FFmpeg: Use range coder for FFV1 to reduce output size
Vicki Pfau vi@endrift.com
Fri, 03 Jul 2020 03:50:12 -0700
2 files changed,
6 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -41,6 +41,7 @@ - Util: Fix crash if PNG header fails to write
Misc: - Debugger: Keep track of global cycle count - FFmpeg: Add looping option for GIF/APNG + - FFmpeg: Use range coder for FFV1 to reduce output size - Qt: Renderer can be changed while a game is running - Qt: Add hex index to palette view - Qt: Add transformation matrix info to sprite view
M
src/feature/ffmpeg/ffmpeg-encoder.c
→
src/feature/ffmpeg/ffmpeg-encoder.c
@@ -383,6 +383,11 @@ strcasecmp(encoder->containerFormat, "mov"))) {
// QuickTime and a few other things require YUV420 encoder->video->pix_fmt = AV_PIX_FMT_YUV420P; } +#if LIBAVCODEC_VERSION_MAJOR >= 57 + if (encoder->video->codec->id == AV_CODEC_ID_FFV1) { + av_opt_set(encoder->video->priv_data, "coder", "range_tab", 0); + } +#endif if (strcmp(vcodec->name, "libx264") == 0) { // Try to adaptively figure out when you can use a slower encoder