Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I simulate ffmpeg's empty_moov option within code?

Tags:

c++

ffmpeg

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?

like image 938
mczarnek Avatar asked Mar 12 '26 08:03

mczarnek


1 Answers

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);
like image 159
Cornstalks Avatar answered Mar 13 '26 23:03

Cornstalks