[FFmpeg-devel] [WIP] movie video source
Stefano Sabatini
stefano.sabatini-lala
Sun Oct 31 22:23:51 CET 2010
On date Sunday 2010-10-31 14:13:47 -0700, Baptiste Coudurier encoded:
> On 10/31/10 12:56 PM, Stefano Sabatini wrote:
> > On date Sunday 2010-10-31 18:40:39 +0100, Stefano Sabatini encoded:
> >> Hi,
> >>
> >> not really yet for committment, anyway comments are welcome.
> >>
> >> Also I'd like to know from Baptiste which currently are the main
> >> problems with this source.
> >
> > [...]
> >
> > +
> > + while (av_read_frame(movie->format_ctx, &packet) >= 0) {
> > + // Is this a packet from the video stream?
> > + if (packet.stream_index == movie->video_stream) {
> > + // Decode video frame
> > + avcodec_decode_video2(movie->codec_ctx, movie->frame, &frame_finished, &packet);
> > +
> > + // Did we get a video frame?
> > + if (frame_finished) {
> > + av_image_copy(movie->picref->data, movie->picref->linesize,
> > + movie->frame ->data, movie->frame ->linesize,
> > + movie->picref->format, outlink->w, outlink->h);
> > +
> > + movie->picref->pts = packet.pts;
>
> Do we store the timebase of the stream somewhere yet ?
Yes, check output_props, timebase is stored in the output link.
> Otherwise pts must be rescaled to AV_TIME_BASE.
--
FFmpeg = Faithless & Foolish Mind-dumbing Peaceful Elitist Gangster
More information about the ffmpeg-devel
mailing list