Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-01 20:17:16 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-10-08 01:58:59 +0400
commitb6b9c150f06adc5a2feada116e9d8f3c3fba8b71 (patch)
tree14485ef7dd94b9b6d89df397398ffdc38448e7eb
parent728bb910ec04ef7138a4089ca72398270210e11f (diff)
ffmpeg: add max_error_rate to allow tuning the point decoding errors are considered a failure of the whole transcoding.
Suggested-by: Daemon404 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--ffmpeg.c2
-rw-r--r--ffmpeg.h1
-rw-r--r--ffmpeg_opt.c3
3 files changed, 5 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 38a3bd0d02..d7bcb78cc0 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3420,7 +3420,7 @@ int main(int argc, char **argv)
}
av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" frames successfully decoded, %"PRIu64" decoding errors\n",
decode_error_stat[0], decode_error_stat[1]);
- if (2*decode_error_stat[0] < decode_error_stat[1])
+ if ((decode_error_stat[0] + decode_error_stat[1]) * max_error_rate < decode_error_stat[1])
exit_program(69);
exit_program(received_nb_signals ? 255 : 0);
diff --git a/ffmpeg.h b/ffmpeg.h
index 09b29a9673..054e71814d 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -420,6 +420,7 @@ extern int qp_hist;
extern int stdin_interaction;
extern int frame_bits_per_raw_sample;
extern AVIOContext *progress_avio;
+extern float max_error_rate;
extern const AVIOInterruptCB int_cb;
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 59470f5588..738d61269a 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;
@@ -2717,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 },