How can I simulate ffmpeg's empty_moov option

2019-07-07 04:15发布

问题:

Command-line ffmpeg has the ability to use an empty moov_atom at the beginning of a file.

More info: http://www.ffmpeg.org/ffmpeg-formats.html#Options-3

I would like to do the same thing, except within code. Anyone know how?

回答1:

This is an AVOption for the mov muxer.

Things in avcodec, avformat, etc. can take AVOptions when setting them up. You can use av_opt_set to set these options. It would be something like:

// Prefixing it with '+' sets the flag
// Prefixing it with '-' unsets the flag
av_opt_set(formatContext, "movflags", "+empty_moov", 0);


标签: c++ ffmpeg