diff --git a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegcodeccontext.cpp b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegcodeccontext.cpp
index 625643fb1..41ffe6d3a 100644
--- a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegcodeccontext.cpp
+++ b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegcodeccontext.cpp
@@ -113,6 +113,14 @@ QMaybe<CodecContext> CodecContext::create(AVStream *stream, AVFormatContext *for
     AVDictionaryHolder opts;
     av_dict_set(opts, "refcounted_frames", "1", 0);
     av_dict_set(opts, "threads", "auto", 0);
+    auto parsedValues = parse_QT_FFMPEG_OPTIONS("codec");
+    if (!parsedValues.empty()) {
+      qCInfo(qLcPlaybackEngineCodec) << "Codec Options via QT_FFMPEG_OPTIONS environment variable:";
+      for (auto optIter = parsedValues.begin(); optIter != parsedValues.end(); ++optIter) {
+        qCInfo(qLcPlaybackEngineCodec) << optIter.key() << "=" << optIter.value();
+        av_dict_set(opts, optIter.key().toUtf8().constData(), optIter.value().toUtf8().constData(), 0);
+      }
+    }
     applyExperimentalCodecOptions(*decoder, opts);
 
     ret = avcodec_open2(context.get(), decoder->get(), opts);
diff --git a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegmediadataholder.cpp b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegmediadataholder.cpp
index 99e3432bf..6c9ca14e7 100644
--- a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegmediadataholder.cpp
+++ b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegmediadataholder.cpp
@@ -215,6 +215,14 @@ loadMedia(const QUrl &mediaUrl, QIODevice *stream, const std::shared_ptr<ICancel
     AVDictionaryHolder dict;
     constexpr auto NetworkTimeoutUs = "5000000";
     av_dict_set(dict, "timeout", NetworkTimeoutUs, 0);
+    auto parsedValues = parse_QT_FFMPEG_OPTIONS("input");
+    if (!parsedValues.empty()) {
+      qCInfo(qLcMediaDataHolder) << "Input Options via QT_FFMPEG_OPTIONS environment variable:";
+      for (auto optIter = parsedValues.begin(); optIter != parsedValues.end(); ++optIter) {
+        qCInfo(qLcMediaDataHolder) << optIter.key() << "=" << optIter.value();
+        av_dict_set(dict, optIter.key().toUtf8().constData(), optIter.value().toUtf8().constData(), 0);
+      }
+    }
 
     const QByteArray protocolWhitelist = qgetenv("QT_FFMPEG_PROTOCOL_WHITELIST");
     if (!protocolWhitelist.isNull())
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeg.cpp b/src/plugins/multimedia/ffmpeg/qffmpeg.cpp
index fb4a75e2c..8a7d1db98 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpeg.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpeg.cpp
@@ -393,4 +393,36 @@ QDebug operator<<(QDebug dbg, const AVCodecConfig value)
 }
 #endif
 
+
+
+QMap<QString, QString> parse_QT_FFMPEG_OPTIONS(const QString &category)
+{
+  QMap<QString, QString> options;
+  
+  // Get the environment variable
+  QString envValue = qgetenv("QT_FFMPEG_OPTIONS");
+  
+  if (envValue.isEmpty()) {
+    qCWarning(qLcFFmpegUtils) << "Environment variable QT_FFMPEG_OPTIONS is not set or empty.";
+    return options;
+  }
+  
+  QStringList pairs = envValue.split(",", Qt::SkipEmptyParts);
+  for (const QString &pair : pairs) {
+    QStringList keyValue = pair.split("=");
+    
+    if (keyValue.size() == 2) {
+      QString key = keyValue[0].trimmed();
+      QString value = keyValue[1].trimmed();
+      
+      // Only parse the category specified (e.g. "input" or "codec")
+      if (key.startsWith(category + ":")) {
+        options[key.mid(category.length() + 1)] = value;
+      }
+    }
+  }
+  
+  return options;
+}
+
 QT_END_NAMESPACE
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeg_p.h b/src/plugins/multimedia/ffmpeg/qffmpeg_p.h
index 43538a2dd..5889d80d4 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpeg_p.h
+++ b/src/plugins/multimedia/ffmpeg/qffmpeg_p.h
@@ -20,8 +20,11 @@
 #include <QtMultimedia/qvideoframeformat.h>
 
 #include <qstring.h>
+#include <qmap.h>
 #include <optional>
 
+QMap<QString, QString> parse_QT_FFMPEG_OPTIONS(const QString &category);
+
 inline bool operator==(const AVRational &lhs, const AVRational &rhs)
 {
     return lhs.num == rhs.num && lhs.den == rhs.den;
