[FFmpeg-user] repeat a frame

Mark Filipak (ffmpeg) markfilipak at bog.us
Fri Mar 5 02:23:29 EET 2021


On 2021-03-04 09:26, Moritz Barsnick wrote:
> On Thu, Mar 04, 2021 at 03:57:38 -0500, Mark Filipak (ffmpeg) wrote:
>> Well, per rational.h, 'num' & 'den' are both integers.
>>
>> Now, I don't know how '720000' is stored. Is it stored as an int64?
> 
> They are defined as "int", which can be platform dependant. ffmpeg
> assumes/guarantees ints to be at least 32 bits.
> 
>> I don't know, but I do know that it can't be stored as an 8-bit
>> integer or a 16-bit integer or anything else that has 8-bit or 16-bit
>> resolution.
> 
> If you mean the number 720000, that's correct.
> 
>> That includes AVRational. 720000 can't be stored as
>> AVRational. AVRational just doesn't have enough resolution.
> 
> Huh? You didn't even wait for the answer to how it is stored. And you
> even asked whether it was 64 bits. This would work just fine with 64
> bits.
> 
> It's a rational number of two integers with at least 32 bits...

Ah! An 'int' is a signed, 32-bit integer (aka int32_t). Okay. Good to know. Thanks.

>... 1/720000
> is probably stored as { 1, 720000 }, but could also be { 2, 1400000 }
> for example, unless they get reduced automatically (I'm too lazy to
> check).

So, TB is stored as an AVRational: 'num', 'den', each signed, 32-bit integers. Okay. Good to know. 
Thanks.

No problem then. I think that just about clears everything up. You see, I'm not a 'C' programmer and 
it appears that just what an int *is* varies. I guess that's why the 'C' world has standardized on 
calling the datatype "int32_t", eh?

>> I'm sure you know that the running time produced by 'PTS's depends on frame
>> rate *and* time_base. For example, for 23.976fps and TB = 1/(720000 ticks/s)
>> = 1.3[8..] ┬Ás/tick, a PTS of +9223372036854775800 indicates a
>> 307138595965860 maximum frame number.
> 
> Huh? At 720000 ticks/seconds, and PTS being number of ticks, you can
> create timestamps spanning
> (2^63 - 1) / 720000 seconds
> which is
> ~12810238940076 seconds
> which is
> ~400000 years.

Where am I going wrong?

A maximum frame number, N, of 307138595965860 frames at 24/1.001 frames/s yields a running time of 
12810238940076.0775 seconds. So we're in agreement I think.

Oh! I see. I wrote this: "That frame number is reached by a 426581383 second video (= 13 years, 189 
days, 49 minutes, 43 seconds)." I apparently divided maximum running time by deltaPTS (30030). Why 
did I do that? Well, that was at 4AM. I was getting pretty punchy. Sorry.

>> Do you agree with my figures? Do you see the difference between time
>> extents and time resolution?
> 
> I don't agree with your figures.

I swear: That is the last mistake I will ever make (for all time).  :-)

-- 
In U.S. History: The House Un-American Activities Committee was a committee of the House of 
Representatives that engaged in un-American activities.


More information about the ffmpeg-user mailing list