FFmpeg: Use range coder for FFV1 to reduce output size

This commit is contained in:
Vicki Pfau 2020-07-03 03:50:12 -07:00
parent 8f616f4a25
commit 42a1f95984
2 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,7 @@ Other fixes:
- Qt: Fix Italian RTC translation (fixes mgba.io/i/1798)
- Util: Fix crash if PNG header fails to write
Misc:
- FFmpeg: Use range coder for FFV1 to reduce output size
- Qt: Add per-page scrolling to memory view (fixes mgba.io/i/1795)
- Qt: Add setting to display ROM filename in title (closes mgba.io/i/1784)

View File

@ -378,6 +378,11 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
// 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