0

I want to have an HDR YouTube video published, my source file is either an Apple ProRes or DNxHR using a chroma subsamplig 4:4:4 or full RGB, both 10bit, so the original source file has all what is needed in order to be encoded into a 10bit 4:2:0 H.265/HEVC (HDR).

I have followed some answers listed here, reviewed lots of different approaches, tried out many different commands without success, colors aren't right when using only FFmpeg, to much red, when using only Adobe to encode into H.264 with the recommended settings on their support page, the results is darker, here are the commands I've using:

I have tried this:

ffmpeg \
-i input.mov \
-c:v libx265 \
-tag:v hvc1 \
-crf 21 \
-preset fast \
-pix_fmt yuv420p10le \
-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" \
-c:a libfdk_aac \
-b:a 128k \
-ac 2 \
-ar 44100 \
-movflags +faststart \
output.mp4

And this:

ffmpeg \
-y \
-hide_banner \
-i input.mov \
-pix_fmt yuv420p10le \
-vf "scale=out_color_matrix=bt2020:out_h_chr_pos=0:out_v_chr_pos=0,format=yuv420p10" \
-c:v libx265 \
-tag:v hvc1 \
-crf 21 \
-preset fast \
-x265-params 'crf=12:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)":max-cll="1000,400"' \
-c:a libfdk_aac \
-b:a 128k \
-ac 2 \
-ar 44100 \
-movflags +faststart \
output.mp4

I have also tried using MKVToolNix in order to insert the metadata into the encoded HEVC/H.265 file with the following command:

/Applications/MKVToolNix-9.7.1.app/Contents/MacOS/mkvmerge \
-o output.mkv \
--colour-matrix 0:9 \
--colour-range 0:1 \
--colour-transfer-characteristics 0:16 \
--colour-primaries 0:9 \
--max-content-light 0:1000 \
--max-frame-light 0:300 \
--max-luminance 0:1000 \
--min-luminance 0:0.01 \
--chromaticity-coordinates 0:0.68,0.32,0.265,0.690,0.15,0.06 \
--white-colour-coordinates 0:0.3127,0.3290 \
input.mp4

But the result is the same and YouTube don't recognize the file as an HDR file, it does only with the first FFmpeg command and with the file encoded with Adobe Premiere, but the colors don't look well, so, maybe I'm getting some concept wrong, thanks for your help.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Rodrigo Polo
  • 4,314
  • 2
  • 26
  • 32
  • What are the colorspace properties of the source? And how did you generate it? – Gyan Jan 31 '18 at 05:23
  • It is video from a DNG sequence from a Canon 6D using Magic Lantern, in other words, RAW source color corrected and graded in AfterFX, using Rec.2020 as the color space of the whole project. – Rodrigo Polo Jan 31 '18 at 07:56
  • In your first cmd, remove `-pix_fmt yuv420p10le` and add `-vf colorspace=all=bt2020:range=tv:format=yuv420p10`. If your input file doesn't have all metadata, you may need to specify it - see options beginning with `i` at https://ffmpeg.org/ffmpeg-filters.html#colorspace – Gyan Jan 31 '18 at 10:26
  • Some ideas also [here](https://mavicpilots.com/threads/uploading-hdr-video-to-youtube-what-you-need-to-know.48268/). – mirh Mar 16 '19 at 16:00

0 Answers0