diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-01-27 23:50:07 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-01-27 23:50:07 +0000 |
| commit | 3c1528e7406becf62d4d57d2515bca17d9bd1067 (patch) | |
| tree | 162a614f98c8e311c86681205a3d8a05be42b149 | |
| parent | 6366926a713f280012edac63d930ee4fd40b5527 (diff) | |
Better error from avformat_alloc_output_context2.
| -rw-r--r-- | src/lib/ffmpeg_file_encoder.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc index 2c67bb5f9..5eccb8f17 100644 --- a/src/lib/ffmpeg_file_encoder.cc +++ b/src/lib/ffmpeg_file_encoder.cc @@ -79,9 +79,9 @@ FFmpegFileEncoder::FFmpegFileEncoder ( 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); @@ -104,7 +104,7 @@ FFmpegFileEncoder::FFmpegFileEncoder ( 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)); |
