X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg_opt.c;h=9604a6a5d52e8c45d2f8e0caa28c7952d96f2627;hb=0160fe454c38a507eaf53ec9012e07244597f672;hp=2adefc5ca5a37db2bc92435bc2f93d19bec51bd2;hpb=293124cae80e7ea8ad4d95539ff605fb12aa9516;p=ffmpeg diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 2adefc5ca5a..9604a6a5d52 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -872,6 +872,7 @@ static int open_input_file(OptionsContext *o, const char *filename) print_error(filename, err); exit_program(1); } + remove_avoptions(&o->g->format_opts, o->g->codec_opts); assert_avoptions(o->g->format_opts); /* apply forced codec ids */ @@ -1828,7 +1829,7 @@ static int open_output_file(OptionsContext *o, const char *filename) /* pick the "best" stream of each type */ /* video: highest resolution */ - if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) { + if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) { int area = 0, idx = -1; int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0); for (i = 0; i < nb_input_streams; i++) { @@ -1850,7 +1851,7 @@ static int open_output_file(OptionsContext *o, const char *filename) } /* audio: most channels */ - if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) { + if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) { int channels = 0, idx = -1; for (i = 0; i < nb_input_streams; i++) { ist = input_streams[i];