diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2017-05-23 13:22:09 +0300 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2017-05-31 16:46:19 +0300 |
commit | ddae6794585405ad59cf1baa855ec3e2f55bb7a1 (patch) | |
tree | 7eda934be084f9fda4b532cf336928c91ab9da24 /doc/examples/encode_video.c | |
parent | 002dbc5a1f2a6008acd29bd7cfa6733a745224bf (diff) |
examples/encode_video: slightly improve error reporting
Diffstat (limited to 'doc/examples/encode_video.c')
-rw-r--r-- | doc/examples/encode_video.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/examples/encode_video.c b/doc/examples/encode_video.c index 107bea2992..8cd13219bb 100644 --- a/doc/examples/encode_video.c +++ b/doc/examples/encode_video.c @@ -89,7 +89,7 @@ int main(int argc, char **argv) /* find the mpeg1video encoder */ codec = avcodec_find_encoder_by_name(codec_name); if (!codec) { - fprintf(stderr, "Codec not found\n"); + fprintf(stderr, "Codec '%s' not found\n", codec_name); exit(1); } @@ -126,8 +126,9 @@ int main(int argc, char **argv) av_opt_set(c->priv_data, "preset", "slow", 0); /* open it */ - if (avcodec_open2(c, codec, NULL) < 0) { - fprintf(stderr, "Could not open codec\n"); + ret = avcodec_open2(c, codec, NULL); + if (ret < 0) { + fprintf(stderr, "Could not open codec: %s\n", av_err2str(ret)); exit(1); } |