View Single Post
Old 23rd January 2021, 03:11   #7  |  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
Hi Ben,

Thanks for your comments. I got that. I think the command you proposed originally can meet my need. Just one more question.

I tried making a y4m but I got stuck.

Here is what I tried to do:

1. Combine all YUV frames into a single yuv file using cat command (cat *.yuv > movie.yuv)

2. Convert YUV file to y4m using the following command:

Code:
ffmpeg -s 1920x1080 -strict -1 -pix_fmt yuv420p10le -strict -1 -i all.yuv output.y4m
And get this error:

'yuv420p10le' is not an official yuv4mpegpipe pixel format. Use '-strict -1' to encode to this pixel format.

Can you help me to understand why? Thank you
BlueSky00 is offline   Reply With Quote