This little fix solves the above problem where libavformat refuses to write the header while complaining about an obscure tag value.
It turns out that libavformat doesn't like the codec_tag that is copied into the output stream codec context from the input stream codec context. Setting this to 0 allows the correct codec_tag for the output container format to be selected when the header is written.
This little fix solves the above problem where libavformat refuses to write the header while complaining about an obscure tag value.
It turns out that libavformat doesn't like the codec_tag that is copied into the output stream codec context from the input stream codec context. Setting this to 0 allows the correct codec_tag for the output container format to be selected when the header is written.