Reputation: 187
I want to do the equivalent of the following command line from a C program.
ffmpeg ..... -movflags frag_keyframe
I have narrowed it down to setting some fields in priv_class in AVOutputFormat somehow. But I don't understand how AVOptions work, I could not find a good example that explains how AVOptions are set and used. I did come across av_opt_set but if I set the name field to "movflags" what is the val and do I set a separate option for frag_keyframe or is it embedded in the flags set for "movflags"? Thanks in advance for your time.
Upvotes: 2
Views: 944
Reputation: 493
Try this
AVFormatContext * _format_context = ...
AVDictionary * params = NULL;
av_dict_set(¶ms, "movflags", "frag_keyframe", 0);
avformat_write_header(_format_context, ¶ms);
Upvotes: 1