[FFmpeg-user] Why was patch declined: Modified force_key_frames option to accept frame numbers?

Nick vincent at systemli.org
Sat Feb 16 12:22:02 EET 2019


Thanks for the answer.
But I want to do the same thing like the person from the mailing list.
I want that ffmpeg cuts the video in specific segments for DASH with
variable durations.
I want to extract this information and use it to cut the video again
using different qualities.
I could use the -map command for directly encoding different qualities
but I want to outsource the workload.
I want to be sure that everything is aligned.

The one person from the mailing list said:

> In this particular case, you can easily work around the floating point
> rounding issues, since the rounding behaviour of -force_key_frames is
> specified: "more precisely at the first frames after each specified time".
> You just have to make sure your timestamps are rounded down. For example,
> with 24000/1001 FPS: 4.21 4.25 4.30* 4.34 4.38, you need to write 4.29, not
> 4.30, but you can also write any value between 4.25425 and the actual
> 4.295958333. (4.25+4.30)/2 = 4.275 should always work.
This looks a bit like a workaround to me. Frame numbers look more
precise for me.
I do not understand why frame numbers should not be aligned except the
frame rate is changing.

On 2/16/19 8:52 AM, Gyan wrote:
>
>
> On 16-02-2019 05:03 AM, Nick wrote:
>> Hi,
>> why was the "Modified force_key_frames option to accept frame numbers"
>> (2014) declined?
>>
>>> https://ffmpeg.org/pipermail/ffmpeg-devel/2014-November/165167.html
>> You can even specify frame numbers in the current ffmpeg version using:
>>> -force_key_frames expr:gte(n,n_forced*96)
>> Using a framerate of 24 means a keyframe every 4s.
>> I think it is very useful to have something like
>>
>>> /force_key_frames n:0,25,50,75,100/
>
> For a regular pattern like that one, you can already use
>
>     -force_key_frames expr:not(mod(n,25))
>
> Expressions are be evaluated using the interface documented at
> https://ffmpeg.org/ffmpeg-utils.html#Expression-Evaluation
>
>
> Gyan
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list