diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-01-27 23:51:41 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-01-27 23:51:41 +0000 |
| commit | 2c956bd16d7f74780ac82a50aa7b9f9238a4a63c (patch) | |
| tree | 84b9442c5796e104f72920b5843d5fa8dd54a59d | |
| parent | ea2e02e0b433f11c76e6a993c32bd963da87b547 (diff) | |
Better error from avformat_alloc_output_context2.
| -rw-r--r-- | src/lib/ffmpeg_encoder.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc index e4f258368..edd1fec87 100644 --- a/src/lib/ffmpeg_encoder.cc +++ b/src/lib/ffmpeg_encoder.cc @@ -155,9 +155,9 @@ FFmpegEncoder::go () setup_video (); setup_audio (); - avformat_alloc_output_context2 (&_format_context, 0, 0, _output.string().c_str()); + int r = avformat_alloc_output_context2 (&_format_context, 0, 0, _output.string().c_str()); if (!_format_context) { - throw runtime_error ("could not allocate FFmpeg format context"); + throw runtime_error (String::compose("could not allocate FFmpeg format context (%1)", r)); } _video_stream = avformat_new_stream (_format_context, _video_codec); @@ -180,7 +180,7 @@ FFmpegEncoder::go () throw runtime_error ("could not open FFmpeg video codec"); } - int r = avcodec_open2 (_audio_codec_context, _audio_codec, 0); + r = avcodec_open2 (_audio_codec_context, _audio_codec, 0); if (r < 0) { char buffer[256]; av_strerror (r, buffer, sizeof(buffer)); |
