[FFmpeg-devel] [PATCH] cinepakenc: When rd_frame() doesn't use MC, mark pkt as keyframe and reset curframe

James Almer jamrial at gmail.com
Thu Aug 15 20:20:58 EEST 2019


On 8/15/2019 2:13 PM, Tomas Härdin wrote:
> tor 2019-08-15 klockan 12:54 -0300 skrev James Almer:
>> On 8/15/2019 11:34 AM, Tomas Härdin wrote:
>>> Hi
>>>
>>> Attached patch detects when the cinepak encoder has generated a
>>> keyframe on its own, and pushes the generation of forced keyframes into
>>> the future. This is similar to what msvideo1enc.c does.
>>>
>>> Example:
>>>
>>> $ ./ffmpeg -i fate-suite/zmbv/zmbv_32bit.avi -keyint_min 20 -vcodec
>>> cinepak out-before.avi
>>> $ make
>>> $ ./ffmpeg -i fate-suite/zmbv/zmbv_32bit.avi -keyint_min 20 -vcodec
>>> cinepak out-after.avi
>>>
>>> out-before.avi: 667338
>>>  out-after.avi: 660928
>>>
>>> Aside: what is -keyint_min for exactly? It seems to be used as a max in
>>> msvideo1enc.c, but libx264.c and libxavs.c uses it and gop_size as
>>> minimum and maximum respectively.. Feels like the relevant encoders
>>> need to be brought into line (assuming it doesn't break user scripts)
>>
>> Afaik, keyint_min is minimum interval/distance between keyframes. So
>> yes, if it's being used as max distance then it's wrong, as that's what
>> gop_size is for.
> 
> Make sense. But why is gop_size < keyint_min by default then? 12 vs 25.

I have no idea.

> I think the x264 people have complained multiple times about the
> default gop_size setting even

The libx264 wrapper changes both to -1 in libavcodec, which means x264's
own defaults will be used instead. So if they complained then i guess it
was changed accordingly.

> 
> /Tomas
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list