[FFmpeg-devel] Fix ffmpeg -re behaviour
Sun Nov 23 17:40:20 CET 2008
Michael Niedermayer wrote:
>> * fixrate-emu-pts.patch
>> Use ist->next_pts rather than use frame_nb * codec_time_base as the
>> timestamp for the next frame to print.
>> This assumption is not always true and only works for video codecs anyway.
> I dont think next_pts is the correct variable to use, but then what exactly
> where the use cases of rate_emu anyway?
rate_emu should read a stream and transcode it at a rate given by the
input timestamps. I find it useful when streaming, or when doing
real-time video conversion without consuming too much CPU time.
In theroy, I think that the input dts should be used, but it can often
be AV_NOPTS_VALUE... I see that ffmpeg.c sets next_pts according to the
input dts, and then updates it (with the guessed value) so that it will
have a reasonable value even if the next dts is AV_NOPTS_VALUE.
So, I had the impression that next_pts can be used in this case (the
exact value is not really important; the important thing is to maintain
an acceptable average rate).
Would ist->pts be a better solution?
More information about the ffmpeg-devel