Add Player > External Monitor > Preview Window (HDR)#1831
Merged
Conversation
It already defaults to Metal on macOS, and Vulkan is required for HDR on Linux. But FYI, Vulkan still needs to be explicitly requested with env var QSG_RHI_BACKEND.
and remove the Softare option (doesn't work)
- It was inconveniently deep in that menu. - Added keyboard shortcut to open/raise it to Ctrl+`. - Rename it "Preview Window (HDR)" to clarify it is not only for HDR but can provide HDR.
… and tone mapping
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the custom GPU-backed preview rendering path with Qt Multimedia VideoOutput/QVideoSink, adds an HDR-capable external preview window, and extends video mode/export settings for HDR transfer metadata.
Changes:
- Adds HDR preview window UI, frame delivery through
QVideoFrame, HDR gain handling, and platform/build support for Qt Multimedia. - Adds dynamic range selection/display for custom video modes and timeline properties.
- Adds HDR export metadata UI/injection and updates packaging/build scripts for newer Qt and multimedia/QML dependencies.
Reviewed changes
Copilot reviewed 45 out of 46 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
src/widgets/timelinepropertieswidget.ui |
Adds dynamic range display row. |
src/widgets/timelinepropertieswidget.cpp |
Populates dynamic range from MLT transfer characteristics. |
src/widgets/openglvideowidget.h |
Removes OpenGL preview widget declaration. |
src/widgets/openglvideowidget.cpp |
Removes OpenGL shader preview implementation. |
src/widgets/metalvideowidget.h |
Removes Metal preview widget declaration. |
src/widgets/metalvideowidget.mm |
Removes Metal preview implementation. |
src/widgets/d3dvideowidget.h |
Removes D3D preview widget declaration. |
src/widgets/d3dvideowidget.cpp |
Removes D3D preview implementation. |
src/videowidget.h |
Adds Qt Multimedia sink/frame APIs and HDR transfer signal. |
src/videowidget.cpp |
Implements frame-to-QVideoFrame conversion, HDR color metadata, and sink delivery. |
src/util.h |
Declares AVX2 CPU feature helper. |
src/util.cpp |
Implements AVX2 detection. |
src/settings.h |
Adds HDR preview/settings accessors. |
src/settings.cpp |
Persists HDR preview geometry and HDR display/tone mapping settings. |
src/qml/views/HdrPreview.qml |
Adds HDR preview window UI and controls. |
src/qml/views/hdr_gain.frag |
Adds shader for HDR gain adjustment. |
src/qml/modules/Shotcut/Controls/VuiBase.qml |
Adds main preview VideoOutput sink. |
src/mltcontroller.h |
Adds transfer-characteristic state accessors. |
src/mltcontroller.cpp |
Loads/detects HDR transfer characteristics from profiles/producers. |
src/mainwindow.ui |
Moves External Monitor menu and adds Vulkan drawing action. |
src/mainwindow.h |
Adds HDR preview window ownership and slot. |
src/mainwindow.cpp |
Adds HDR preview action/window wiring and drawing-method changes. |
src/main.cpp |
Updates Qt media/backend and graphics initialization. |
src/macos.mm |
Adds macOS EDR headroom helpers. |
src/macos.h |
Declares macOS EDR helper APIs. |
src/hdrpreviewwindow.h |
Adds HDR preview window class API. |
src/hdrpreviewwindow.cpp |
Implements HDR preview window playback, HDR gain, and platform handling. |
src/docks/encodedock.ui |
Adds HDR metadata button. |
src/docks/encodedock.h |
Adds HDR metadata state and handlers. |
src/docks/encodedock.cpp |
Injects HDR transfer/mastering metadata into supported encoders. |
src/dialogs/customprofiledialog.ui |
Adds dynamic range selector. |
src/dialogs/customprofiledialog.h |
Adds color-space change slot. |
src/dialogs/customprofiledialog.cpp |
Saves/loads HDR transfer characteristics for custom profiles. |
src/CMakeLists.txt |
Adds HDR preview sources, shader build step, and Qt private dependency. |
scripts/build-shotcut.sh |
Updates Linux/macOS packaging for Qt Multimedia and minimal backend. |
scripts/build-shotcut-msys2.sh |
Updates Windows Qt version and deployed Qt Multimedia/Shapes modules. |
MinimalMediaBackend/minimalmediaplugin.json |
Adds minimal media backend plugin metadata. |
MinimalMediaBackend/minimalmediaplugin.cpp |
Implements minimal Qt Multimedia backend. |
MinimalMediaBackend/CMakeLists.txt |
Adds build target for minimal media backend plugin. |
CMakePresets.json |
Updates Qt version and enables minimal media backend in preset. |
CMakeLists.txt |
Adds minimal backend option/subdirectory and Qt private lookup. |
.github/workflows/build-windows.yml |
Updates Windows CI Qt package version. |
.github/workflows/build-sdk-windows.yml |
Updates SDK Windows CI Qt package version. |
.github/workflows/build-linux.yml |
Restricts package jobs to master branch. |
.github/copilot-instructions.md |
Updates documented Qt version. |
Comments suppressed due to low confidence (2)
src/docks/encodedock.cpp:931
- Using the MaxCLL/MaxFALL values as the gate also suppresses
mastering-displaymetadata when both content-light fields are intentionally left as “Not set”. The dialog still collects mastering primaries and min/max luminance, so SVT-AV1 exports can silently omit mastering-display metadata even though the user configured it.
if ((m_hdrMaxCll > 0 || m_hdrMaxFall > 0)
&& MLT.colorTrc() == QLatin1String("smpte2084")) {
src/docks/encodedock.cpp:999
- Using the MaxCLL/MaxFALL values as the gate also suppresses
master_displaymetadata when both content-light fields are intentionally left as “Not set”. The dialog still collects mastering primaries and min/max luminance, so exports can silently omit mastering-display metadata even though the user configured it.
// Inject HDR10 mastering metadata for hevc_nvenc when the source is PQ.
if (vcodec == "hevc_nvenc" && (m_hdrMaxCll > 0 || m_hdrMaxFall > 0)
&& MLT.colorTrc() == QLatin1String("smpte2084")) {
...to the MLT consumer thread and use a buffer pool.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Its gamma now follows the video mode's dynamic range (transfer).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VideoOutputwith a customQVideoSinkbased on MLT.QQuickView(window) separate from the widgets-basedMainWindow, Quick can support HDR.#gpuor#10bit.libx265andlibsvtav1codecs. A post-processing step to inject metadata for hardware encoders is pending, e.g.MinimalMediaBackendlibrary build target. You can opt into it with cmake configure option-DBUILD_MINIMAL_MEDIA_BACKEND=ON. Shotcut needs Qt Multimedia on Linux/BSD now (previously it did not) because it must be able to make a custom, MLT-basedQVideoSinkto feed the QML Quick Multimedia-based video component. After building, you need to manually install it like:cp -p build/MinimalMediaBackend/libminimalmediaplugin.so ~/Qt/6.10.3/gcc_64/plugins/multimedia/