使用FFmpeg将10bit Pro-Res编码为YouTube HEVC/H.265 HDR视频遇色准问题求助
Let's break down your problem and walk through actionable solutions to get your HDR videos looking right on YouTube.
First, Understand the Root Causes
Your issues—red tint with FFmpeg, dim output from Premiere—almost always boil down to incorrect color space mapping or missing/inconsistent HDR metadata between your source, encoder settings, and output container.
Your source files are 10-bit ProRes/DNxHR (4:4:4/RGB) — a perfect starting point for HDR — but converting to 10-bit 4:2:0 HEVC requires precise handling of color profiles at every step.
Step 1: Verify Your Source Metadata
First, confirm your source has valid HDR metadata. Run this command to check:
ffmpeg -i input.mov -hide_banner
Look for lines like color_primaries, transfer_characteristics, and color_space. For HDR, these should be bt2020, smpte2084, and bt2020nc respectively. If they're missing or incorrect, you'll need to manually specify them in your encode command.
Step 2: Fix the FFmpeg Command (Eliminate Red Tint)
Your original FFmpeg commands were close, but missed critical container-level metadata and may have forced incorrect color conversions. Try this revised command:
ffmpeg \ -i input.mov \ # Core encode settings -c:v libx265 \ -tag:v hvc1 \ # Required for YouTube to recognize HEVC in MP4 -crf 21 \ -preset fast \ -pix_fmt yuv420p10le \ # HDR metadata for the encoder -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,10):max-cll=1000,400" \ # Container-level HDR metadata (critical for correct color rendering) -color_primaries bt2020 \ -color_trc smpte2084 \ -colorspace bt2020nc \ # Audio settings (unchanged) -c:a libfdk_aac \ -b:a 128k \ -ac 2 \ -ar 44100 \ # Optimize for streaming -movflags +faststart \ output.mp4
Key Fixes:
- Added
-color_primaries,-color_trc, and-colorspaceto ensure the MP4 container carries the correct HDR metadata (not just the encoder). - Removed the unnecessary
scalefilter from your second command — over-filtering can introduce color shifts when converting RGB to YUV. - Ensured consistency between encoder-level (
x265-params) and container-level metadata.
Step 3: Fix Adobe Premiere's Dim Output
If Premiere is producing dim HDR videos, check these settings:
- Sequence Settings: Make sure your sequence uses an HDR profile (e.g.,
Rec. 2020color space,SMPTE 2084transfer function). - Export Settings:
- When exporting H.264/HEVC, under the
Videotab, setColor SpacetoRec. 2020andColor TransfertoSMPTE 2084. - Enable
Render at Maximum Depthto preserve 10-bit color. - Avoid any color management settings that map HDR to SDR (like limiting brightness to 100 nits).
- When exporting H.264/HEVC, under the
Step 4: Skip MKVToolNix for YouTube
YouTube prefers MP4 for HDR content, so there's no need to convert to MKV and add metadata separately. The revised FFmpeg command above writes all necessary HDR metadata directly to the MP4 container.
Step 5: Validate Your Output
After encoding, use MediaInfo to check the output file's metadata. Ensure:
Color primaries= BT.2020Transfer characteristics= SMPTE ST 2084Color space= BT.2020 non-constant luminanceMaster displayandMax CLLmatch your source's HDR values.
You can also preview the video locally in an HDR-compatible player (like VLC with HDR enabled) to confirm colors look correct before uploading to YouTube.
内容的提问来源于stack exchange,提问作者Rodrigo Polo




