[FFmpeg-user] repeat a frame
Mark Filipak (ffmpeg)
markfilipak at bog.us
Thu Mar 4 00:57:30 EET 2021
On 2021-03-03 11:30, Mark Filipak (ffmpeg) wrote:
> On 2021-03-03 05:58, Moritz Barsnick wrote:
>> On Tue, Mar 02, 2021 at 17:32:42 -0500, Mark Filipak (ffmpeg) wrote:
>>> Thank you, Jim. To the best of my knowledge, rational is not a 'C' datatype.
>>
>> No, but it is an ffmpeg data type, AVRational, as defined in
>> libavutil/rational.h, along with functions to operate on this type.
>>
>>> I need to know the dimension (or 'C' datatype) of TB as it is used in PTC
>>> calculations.
>>
>> Do you really need to know?
>
> Do you really need to ask?
I've tried transcoding a 2:21:19 movie via this script:
SET prep23=settb=expr=1/720000,setpts=N*30030
SET cfr23=setpts=N*1001/24000/TB,fps=24000/1001
SET codecs=-codec:v libx265 -x265-params crf=16:qcomp=1.00 -codec:a copy -codec:s copy -dn
ffmpeg -i i:\BDMV\STREAM\00303.m2ts -vf %prep23%,%cfr23% %codecs% test.mkv
pause
exit
I succeeded. So, the working filter pipeline time_base -- whatever it is -- must have higher
resolution than 32 bits. Why?
With TB = 1/(720000 ticks/s), for a 24.976fps output,
deltaPTS = (1001/24000 frames/s)/(1/(720000 ticks/s)) = 30030 ticks/frame
If working time_base (from the AVRational) has an effective resolution of int32 (i.e. +/-2147483647
ticks), then frames past 0:49:42 will be dropped.
If working time_base has an effective resolution of uint32 (i.e. 4294967295 ticks), then frames past
1:39:26 will be dropped.
I think that the successful transcode of a 2:21:19 video confirms that the working time_base is
sufficient. I suspect it's a float but of course I don't know that and I don't know its resolution.
Why 720000? TB = 1/(720000 ticks/s) guarantees that 'PTS's will be exact integers for a wide variety
of source and intermediate frame rates.
Of course the MKV output resolution is 1 milliseconds, but I'm essentially setting the pipeline's
resolution to 1.3[8..] microseconds.
You know, I've transcoded a great number of movies and many wind up VFR. I think that's bogus,
resulting from loss of pipeline resolution.
Has anyone actually encountered a professionally mastered source video that is VFR. I haven't.
More information about the ffmpeg-user
mailing list