From 1cf207de076c97f3fd0e039ff30fb6af5ad07c8c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 27 Dec 2025 21:07:04 -0600 Subject: [PATCH] Allow overriding FFmpeg AVOptions via environment variable --- app/streaming/video/ffmpeg.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/streaming/video/ffmpeg.cpp b/app/streaming/video/ffmpeg.cpp index eab0f0f1..66c52b4e 100644 --- a/app/streaming/video/ffmpeg.cpp +++ b/app/streaming/video/ffmpeg.cpp @@ -539,6 +539,16 @@ bool FFmpegVideoDecoder::completeInitialization(const AVCodec* decoder, enum AVP return false; } + QString optionVarName = QString("%1_AVOPTIONS").arg(decoder->name).toUpper(); + QByteArray optionVarValue = qgetenv(optionVarName.toUtf8()); + if (!optionVarValue.isNull()) { + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Applying FFmpeg option overrides for %s: %s", + decoder->name, + optionVarValue.constData()); + av_dict_parse_string(&options, optionVarValue, "=", ":", 0); + } + // Nobody must override our ffGetFormat SDL_assert(m_VideoDecoderCtx->get_format == ffGetFormat);