[Libav-user] force_key_frames

M Parker diesirae777 at hotmail.com
Thu Apr 2 21:21:47 EEST 2020


>The option force_key_frames is handled in fftools/ffmpeg.c, so your best
approach is to copy its behaviour.

I had gotten that far, but setting it still eluded me. After much digging, some experimentation
and a little luck, I figured out how to code it in:

AVDictionary *dict;
av_dict_set(&dict, "force_key_frames", expression_string, NULL);
avcodec_open2(videoCodecContext, videoCodec, &dict);


Hopefully this helps someone in the future.
________________________________
From: Libav-user <libav-user-bounces at ffmpeg.org> on behalf of Carl Eugen Hoyos <ceffmpeg at gmail.com>
Sent: Wednesday, April 1, 2020 7:02 PM
To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. <libav-user at ffmpeg.org>
Subject: Re: [Libav-user] force_key_frames

Am Mi., 1. Apr. 2020 um 20:23 Uhr schrieb M Parker <diesirae777 at hotmail.com>:
>
> The command line has an option for forcing key frames, aptly named: -force_key_frames
>
> Is it possible to set this via libav, and where would I do it? The closest I've been able
> to find is a forced_key_frames option on an OutputStream, and I can't find
> where to access it.

The option force_key_frames is handled in fftools/ffmpeg.c, so your best
approach is to copy its behaviour.

Carl Eugen
_______________________________________________
Libav-user mailing list
Libav-user at ffmpeg.org
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
libav-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200402/6dacde76/attachment.html>


More information about the Libav-user mailing list