View Single Post
Old 22nd January 2021, 20:29   #5  |  Link
BlueSky00
Registered User
 
Join Date: Feb 2020
Posts: 5
Quote:
Originally Posted by benwaggoner View Post
This is how I had to make some of our HDR demo clips for CES 2015. If you've exported your YUV frames as proper SMPTE 2100 (PQ with 2020 primaries), it's pretty trivial to use that as source. I'd probably convert from the frames to a .y4m file in ffmpeg first, just to confirm I've got a single file with the correct metadata. You could also pipe straight to x265. One trick here is using -pix_fmt yuv420p10le -strict -1 in your ffmpeg command line so it'll make a real 10-bit YUV. There's also ffmpeg's turgid image sequence file reading syntax, which you've probably already figured out.

x265 can directly read a .y4m file and will read the height/width/fps/color depth/subsampling from the metadata so you don't have to specify all that.

Here's a sample command line for encoding from .y4m to HDR.

Code:
ffmpeg.exe -i foo.y4m -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - | x265.exe - --y4m --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --hdr --hdr-opt --max-cll "2000,300" -o foo.hevc
Thanks for your reply. I will try your approach. I also posted my commands in my previous reply. Can you please let me know what you think about that?
And btw, I am using Mac and probably need to make some changes in your command (.exe). I am new to ffmpeg and sorry for my novice questions.
BlueSky00 is offline   Reply With Quote