Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions example/api2-samples/api2-hw-encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*
* Thanks to https://github.com/mojie126, for more-less complete sample.
*
* Known issues: error on the Matroska header writing.
*
*/


Expand Down Expand Up @@ -155,6 +153,11 @@ int main(int argc, char **argv) {
encoder.setTimeBase(Rational{1, 1000});
encoder.setBitRate(vdec.bitRate());

// MKV format wants global header, so
// this fixes the issue with MKV container
if (ofrmt.flags() & AVFMT_GLOBALHEADER)
encoder.addFlags(AV_CODEC_FLAG_GLOBAL_HEADER);

encoder.open(Codec(), ec);
if (ec) {
cerr << "Can't opent encodec\n";
Expand Down
Loading