We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2de920 commit 6089ac4Copy full SHA for 6089ac4
example/api2-samples/api2-hw-encode.cpp
@@ -3,8 +3,6 @@
3
*
4
* Thanks to https://github.com/mojie126, for more-less complete sample.
5
6
- * Known issues: error on the Matroska header writing.
7
- *
8
*/
9
10
@@ -155,6 +153,11 @@ int main(int argc, char **argv) {
155
153
encoder.setTimeBase(Rational{1, 1000});
156
154
encoder.setBitRate(vdec.bitRate());
157
+ // MKV format wants global header, so
+ // this fixes the issue with MKV container
158
+ if (ofrmt.flags() & AVFMT_GLOBALHEADER)
159
+ encoder.addFlags(AV_CODEC_FLAG_GLOBAL_HEADER);
160
+
161
encoder.open(Codec(), ec);
162
if (ec) {
163
cerr << "Can't opent encodec\n";
0 commit comments