diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-10 13:53:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-10 13:53:44 +0100 |
| commit | b7ded219e1c21ca19eb9396b7590ae861d8bfb88 (patch) | |
| tree | c899683d075ede198a0c9a3f29e6ddc2bdb979a0 /src/lib/ffmpeg_encoder.cc | |
| parent | fc4956d144ed0869fe2fa1737adc21104bb47836 (diff) | |
Fix options for libx264.
Diffstat (limited to 'src/lib/ffmpeg_encoder.cc')
| -rw-r--r-- | src/lib/ffmpeg_encoder.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc index 734c9810d..7d1597e36 100644 --- a/src/lib/ffmpeg_encoder.cc +++ b/src/lib/ffmpeg_encoder.cc @@ -45,6 +45,7 @@ force_pixel_format (AVPixelFormat, AVPixelFormat out) FFmpegEncoder::FFmpegEncoder (shared_ptr<const Film> film, weak_ptr<Job> job, boost::filesystem::path output, Format format) : Encoder (film, job) + , _options (0) , _history (1000) , _output (output) { @@ -52,6 +53,8 @@ FFmpegEncoder::FFmpegEncoder (shared_ptr<const Film> film, weak_ptr<Job> job, bo case FORMAT_PRORES: _pixel_format = AV_PIX_FMT_YUV422P10; _codec_name = "prores_ks"; + av_dict_set (&_options, "profile", "3", 0); + av_dict_set (&_options, "threads", "auto", 0); break; case FORMAT_H264: _pixel_format = AV_PIX_FMT_YUV420P; @@ -97,11 +100,7 @@ FFmpegEncoder::go () _video_stream->id = 0; _video_stream->codec = _codec_context; - AVDictionary* options = 0; - av_dict_set (&options, "profile", "3", 0); - av_dict_set (&options, "threads", "auto", 0); - - if (avcodec_open2 (_codec_context, codec, &options) < 0) { + if (avcodec_open2 (_codec_context, codec, &_options) < 0) { throw runtime_error ("could not open FFmpeg codec"); } @@ -109,7 +108,7 @@ FFmpegEncoder::go () throw runtime_error ("could not open FFmpeg output file"); } - if (avformat_write_header (_format_context, &options) < 0) { + if (avformat_write_header (_format_context, &_options) < 0) { throw runtime_error ("could not write header to FFmpeg output file"); } |
