diff options
author | Mal Duffin <mal_cando> | 2018-12-11 22:38:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-11 22:44:10 +0300 |
commit | 4bf2530952c0c772f42595fa79a2c0a9a7559314 (patch) | |
tree | bbe3f229163ed25474d9abe85ff81a1594a3fac6 /source/blender | |
parent | 48a3f97b23501fd33f6e400b7682ea4cb2988a8a (diff) |
FFmpeg: enable multi-threaded encoding of multiple frames, for a ~20% speedup.
This enables ffmpeg to encode each frame in its own thread. However in most
cases Blender does not pass frames to ffmpeg fast enough to actually use the
more than two threads. In some tests the speed was measured to be about 20%.
If other parts of the video sequencer get optimized, this should improve.
Differential Revision: https://developer.blender.org/D4031
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 06f11301acb..27c26a93bf5 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -543,6 +543,9 @@ static AVStream *alloc_video_stream(FFMpegContext *context, RenderData *rd, int /* Set up the codec context */ c = st->codec; + c->thread_count = 0; + c->thread_type = FF_THREAD_FRAME; + c->codec_id = codec_id; c->codec_type = AVMEDIA_TYPE_VIDEO; @@ -703,6 +706,9 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, RenderData *rd, int st->id = 1; c = st->codec; + c->thread_count = 0; + c->thread_type = FF_THREAD_FRAME; + c->codec_id = codec_id; c->codec_type = AVMEDIA_TYPE_AUDIO; |