<div dir="ltr"><font face="monospace, monospace">Hi.</font><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">I am looking into encoding once but writing to multiple files with different formats.</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">For some formats the encoder must be configured with the AV_CODEC_FLAG_GLOBAL_HEADER flag active, like this:</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><div>if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)</div><div>    enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;</div><div><br></div><div><br></div><div>My problem comes when having to encode for two formats, one that needs the flag and one that does not.</div><div><br></div><div>I know that not setting the flags for the formats that need it, is not an option. Since this produced files not playable by most players. </div><div><br></div><div>What happens when the flags is set for formats that does not need it?</div><div><br></div><div>Will forcing the flag to be always true fix my problem?</div><div><br></div><div>Thanks.</div></font></div></div>