[FFmpeg-devel] [WIP] movie video source
Stefano Sabatini
stefano.sabatini-lala
Sun Nov 21 00:07:57 CET 2010
On date Sunday 2010-10-31 22:23:51 +0100, Stefano Sabatini encoded:
> 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.
What about to commit this one in the current form? I'm trying to
address the memcpy issue, but that changeset is currently in bikeshed
hell, and having a suboptimal movie source in the main repo is better
than having a broken suboptimal movie source in the soc repo.
--
FFmpeg = Fanciful and Fierce Magical Perennial Encoding/decoding Game
More information about the ffmpeg-devel
mailing list