Merge pull request #3376 from pmuetschard/encoder_opts

Respect the encoder options for the header write.
This commit is contained in:
Isaac Connor 2021-10-19 12:37:59 -04:00 committed by GitHub
commit bfcc6ed13e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -224,6 +224,8 @@ bool VideoStore::open() {
); );
video_out_codec = nullptr; video_out_codec = nullptr;
} }
av_dict_free(&opts);
av_dict_parse_string(&opts, Options.c_str(), "=", ",#\n", 0);
} // end if video_out_codec } // end if video_out_codec
ret = avcodec_parameters_from_context(video_out_stream->codecpar, video_out_ctx); ret = avcodec_parameters_from_context(video_out_stream->codecpar, video_out_ctx);
@ -231,7 +233,6 @@ bool VideoStore::open() {
Error("Could not initialize stream parameteres"); Error("Could not initialize stream parameteres");
} }
} // end if extradata_entry } // end if extradata_entry
av_dict_free(&opts);
} else if (monitor->GetOptVideoWriter() == Monitor::ENCODE) { } else if (monitor->GetOptVideoWriter() == Monitor::ENCODE) {
int wanted_codec = monitor->OutputCodec(); int wanted_codec = monitor->OutputCodec();
if (!wanted_codec) { if (!wanted_codec) {