Commit ddae6794 authored by Stefano Sabatini's avatar Stefano Sabatini

examples/encode_video: slightly improve error reporting

parent 002dbc5a
...@@ -89,7 +89,7 @@ int main(int argc, char **argv) ...@@ -89,7 +89,7 @@ int main(int argc, char **argv)
/* find the mpeg1video encoder */ /* find the mpeg1video encoder */
codec = avcodec_find_encoder_by_name(codec_name); codec = avcodec_find_encoder_by_name(codec_name);
if (!codec) { if (!codec) {
fprintf(stderr, "Codec not found\n"); fprintf(stderr, "Codec '%s' not found\n", codec_name);
exit(1); exit(1);
} }
...@@ -126,8 +126,9 @@ int main(int argc, char **argv) ...@@ -126,8 +126,9 @@ int main(int argc, char **argv)
av_opt_set(c->priv_data, "preset", "slow", 0); av_opt_set(c->priv_data, "preset", "slow", 0);
/* open it */ /* open it */
if (avcodec_open2(c, codec, NULL) < 0) { ret = avcodec_open2(c, codec, NULL);
fprintf(stderr, "Could not open codec\n"); if (ret < 0) {
fprintf(stderr, "Could not open codec: %s\n", av_err2str(ret));
exit(1); exit(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment