X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg_opt.c;h=738d61269a512e47c8fcc7f52396e5adf6220d68;hb=f7ed044eeaf39c73333d3cc01d07b07d9bc860c6;hp=8ff5bdfbdaa38bfc2d4836006b7ce86fd616922c;hpb=eeeb3c8fa3a17c6d3363e68d8219cb8c07397f3b;p=ffmpeg diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 8ff5bdfbdaa..738d61269a5 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -84,6 +84,7 @@ int print_stats = -1; int qp_hist = 0; int stdin_interaction = 1; int frame_bits_per_raw_sample = 0; +float max_error_rate = 2.0/3; static int intra_only = 0; @@ -592,7 +593,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) case AVMEDIA_TYPE_VIDEO: if(!ist->dec) ist->dec = avcodec_find_decoder(dec->codec_id); - if (dec->lowres) { + if (av_codec_get_lowres(dec)) { dec->flags |= CODEC_FLAG_EMU_EDGE; } @@ -785,6 +786,14 @@ static int open_input_file(OptionsContext *o, const char *filename) find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0)->id : AV_CODEC_ID_NONE; ic->subtitle_codec_id= subtitle_codec_name ? find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0)->id : AV_CODEC_ID_NONE; + + if (video_codec_name) + av_format_set_video_codec (ic, find_codec_or_die(video_codec_name , AVMEDIA_TYPE_VIDEO , 0)); + if (audio_codec_name) + av_format_set_audio_codec (ic, find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0)); + if (subtitle_codec_name) + av_format_set_subtitle_codec(ic, find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0)); + ic->flags |= AVFMT_FLAG_NONBLOCK; ic->interrupt_callback = int_cb; @@ -2709,6 +2718,8 @@ const OptionDef options[] = { "extract an attachment into a file", "filename" }, { "debug_ts", OPT_BOOL | OPT_EXPERT, { &debug_ts }, "print timestamp debugging info" }, + { "max_error_rate", HAS_ARG | OPT_FLOAT, { &max_error_rate }, + "maximum error rate", "ratio of errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success." }, /* video options */ { "vframes", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_video_frames },