diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-04-14 15:09:27 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-04-14 15:25:34 +0300 |
commit | b9207fb43d6fb55b83ee25263a3963c8c736f876 (patch) | |
tree | 11bd3206cc374fb9c41246222da525cd97b32a17 /source/blender | |
parent | 9ca55b10b8cc78271a6266c4af473aa5fde493c6 (diff) |
FFmpeg: Adjust default proxy settings
GOP size and quality are adjusted for h264 codec.
These new values are based on result of benchmark on 9 random files:
https://docs.google.com/spreadsheets/d/1nOyUGjoVWUyhQ2y2lAd8VtFfyaY1wQNGj1krCCNbk7Y/edit?usp=sharing
Reducing quality to 50 reduces proxy filesize by about 2x on average
and has no significant impact on decoding performance.
Increasing GOP size from 2 to 10 also reduces proxy filesize 2x-3x
while scrubbing is only about 8% slower. It is still around 100FPS
with 1920x1080 media.
This is unfortunately about 50% slower than MJPEG, but this can be
improved with `fastdecode` tune applied to libx264 encoder
Quite surprisingly h264 codec presets had little influence on proxy
building performance as well as proxy filesize. So far it looks that
FFmpeg does initialize encoder in different way then Blender.
This applies mot only for presets but for tune and profile libx264
setting.
Once this issue is resolved, performance of proxies may be optimized
further.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D10897
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_movieclip_defaults.h | 2 | ||||
-rw-r--r-- | source/blender/sequencer/intern/proxy.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 6496f2d05a4..ef9f6d861a3 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -500,7 +500,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( rv->c->codec_id = AV_CODEC_ID_H264; rv->c->width = width; rv->c->height = height; - rv->c->gop_size = 2; + rv->c->gop_size = 10; rv->c->max_b_frames = 0; /* Correct wrong default ffmpeg param which crash x264. */ rv->c->qmin = 10; diff --git a/source/blender/makesdna/DNA_movieclip_defaults.h b/source/blender/makesdna/DNA_movieclip_defaults.h index 4aa1bd779c2..753147eb072 100644 --- a/source/blender/makesdna/DNA_movieclip_defaults.h +++ b/source/blender/makesdna/DNA_movieclip_defaults.h @@ -32,7 +32,7 @@ .build_size_flag = IMB_PROXY_25, \ .build_tc_flag = IMB_TC_RECORD_RUN | IMB_TC_FREE_RUN | \ IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN | IMB_TC_RECORD_RUN_NO_GAPS, \ - .quality = 90, \ + .quality = 50, \ } diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c index 4dff3d03335..bd7ea5b958c 100644 --- a/source/blender/sequencer/intern/proxy.c +++ b/source/blender/sequencer/intern/proxy.c @@ -587,7 +587,7 @@ void SEQ_proxy_set(struct Sequence *seq, bool value) seq->flag |= SEQ_USE_PROXY; if (seq->strip->proxy == NULL) { seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy"); - seq->strip->proxy->quality = 90; + seq->strip->proxy->quality = 50; seq->strip->proxy->build_tc_flags = SEQ_PROXY_TC_ALL; seq->strip->proxy->build_size_flags = SEQ_PROXY_IMAGE_SIZE_25; } |