diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-03-30 11:34:21 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-04-13 15:11:56 +0200 |
commit | 798da60e6a1c2f1fd7f243829f5e007e69e914d0 (patch) | |
tree | 42eb5adc195e5a8116a47af0a604d3783799f7d4 /fftools/ffmpeg_mux_init.c | |
parent | 5297250920bc03cc39bff586788564f60fb38af3 (diff) | |
download | ffmpeg-798da60e6a1c2f1fd7f243829f5e007e69e914d0.tar.gz |
fftools/ffmpeg_mux_init: print more meaningful error messages
Diffstat (limited to 'fftools/ffmpeg_mux_init.c')
-rw-r--r-- | fftools/ffmpeg_mux_init.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 3490c99c94..4b6c704046 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -2247,7 +2247,8 @@ int of_open(const OptionsContext *o, const char *filename) err = avformat_alloc_output_context2(&oc, NULL, o->format, filename); if (!oc) { - print_error(filename, err); + av_log(mux, AV_LOG_FATAL, "Error initializing the muxer for %s: %s\n", + filename, av_err2str(err)); exit_program(1); } mux->fc = oc; @@ -2334,11 +2335,12 @@ int of_open(const OptionsContext *o, const char *filename) } /* check filename in case of an image number is expected */ - if (oc->oformat->flags & AVFMT_NEEDNUMBER) { - if (!av_filename_number_test(oc->url)) { - print_error(oc->url, AVERROR(EINVAL)); - exit_program(1); - } + if (oc->oformat->flags & AVFMT_NEEDNUMBER && !av_filename_number_test(oc->url)) { + av_log(mux, AV_LOG_FATAL, + "Output filename '%s' does not contain a numeric pattern like " + "'%%d', which is required by output format '%s'.\n", + oc->url, oc->oformat->name); + exit_program(1); } if (!(oc->oformat->flags & AVFMT_NOFILE)) { @@ -2349,7 +2351,8 @@ int of_open(const OptionsContext *o, const char *filename) if ((err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE, &oc->interrupt_callback, &mux->opts)) < 0) { - print_error(filename, err); + av_log(mux, AV_LOG_FATAL, "Error opening output %s: %s\n", + filename, av_err2str(err)); exit_program(1); } } else if (strcmp(oc->oformat->name, "image2")==0 && !av_filename_number_test(filename)) |