[FFmpeg-devel] [WIP] movie video source
Baptiste Coudurier
baptiste.coudurier
Sun Oct 31 22:13:47 CET 2010
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 ?
Otherwise pts must be rescaled to AV_TIME_BASE.
[...]
--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
More information about the ffmpeg-devel
mailing list