Update Convert for 10-bit and HDR#1858
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Shotcut’s convert/transcode workflow to better support HDR by using the current processing mode to drive HDR/10‑bit decisions (codec choice, color conversion defaults, and HDR warnings).
Changes:
- Added
ShotcutSettings::isHdrCompatibleProcessingMode()and applied it to conversion prompts/defaults across UI and utility code. - Updated
Transcoder::convertProducer()to support 10‑bit output paths (including “lossless” mode using H.264 high10) and refined frame-rate handling. - Reduced FFmpeg log noise by adding
-hide_bannerto FFmpeg job arguments.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/widgets/avformatproducerwidget.cpp | Default BT.709 conversion choice now depends on HDR-capable processing mode. |
| src/util.h | Renamed TRC helper to trcIsSdrCompatible. |
| src/util.cpp | HDR-aware conversion advice/prompting and updated TRC compatibility helper usage. |
| src/transcoder.cpp | HDR/10-bit-aware FFmpeg argument construction, codec/pix_fmt selection, and fps handling. |
| src/settings.h | Declared isHdrCompatibleProcessingMode(). |
| src/settings.cpp | Implemented isHdrCompatibleProcessingMode(). |
| src/jobs/ffmpegjob.cpp | Added -hide_banner to FFmpeg args. |
| src/dialogs/transcodedialog.cpp | UI label for “Lossless” now reflects HDR mode selection (Ut Video vs H.264). |
Comments suppressed due to low confidence (1)
src/util.cpp:819
trcIsSdrCompatible()currently treats HLG (18) as SDR-compatible, but the rest of the app explicitly classifies TRC 18 (ARIB B67) as HDR. With the new HDR-aware prompting (getConversionAdvice()), this suppresses the “Probable HDR” warning for HLG sources in non-HDR processing modes.
bool Util::trcIsSdrCompatible(int trc)
{
// Transfer characteristics > SMPTE240M Probably need conversion except IEC61966-2-4 is OK
return trc <= 7 || trc == 11 || trc == 13 || trc == 14 || trc == 15 || trc == 18;
}
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.
This pull request introduces improved support for HDR (High Dynamic Range) workflows by making the application's transcoding and conversion logic aware of the current processing mode's HDR compatibility. The main changes ensure that lossless transcodes use a 10-bit H.264 codec when HDR-compatible processing is enabled, and that color space conversions and user prompts are more accurate for HDR content. Several utility and dialog functions have been updated to reflect this logic, and some code has been refactored for clarity.
HDR-aware transcoding and conversion:
Added
ShotcutSettings::isHdrCompatibleProcessingMode()to determine if the current processing mode supports HDR, and updated relevant dialogs and conversion logic to use this check. (src/settings.h,src/settings.cpp,src/dialogs/transcodedialog.cpp,src/transcoder.cpp,src/util.cpp,src/widgets/avformatproducerwidget.cpp) [1] [2] [3] [4] [5]Lossless transcode mode now uses 10-bit H.264 when HDR-compatible processing is enabled, instead of Ut Video, and sets appropriate ffmpeg arguments for 10-bit output. (
src/dialogs/transcodedialog.cpp,src/transcoder.cpp) [1] [2] [3] [4]Color space and conversion improvements:
Updated logic for when to offer BT.709 color conversion and when to prompt users about probable HDR content, making it conditional on both the processing mode and color transfer characteristics. (
src/util.cpp,src/widgets/avformatproducerwidget.cpp) [1] [2] [3]Renamed
Util::trcIsCompatibletoUtil::trcIsSdrCompatiblefor clarity and updated all references. (src/util.h,src/util.cpp) [1] [2]Other improvements:
Added
-hide_bannerto ffmpeg job arguments to reduce log clutter. (src/jobs/ffmpegjob.cpp)Updated copyright years in relevant files. (
src/dialogs/transcodedialog.cpp,src/transcoder.cpp) [1] [2]