View Single Post
Old 23rd January 2021, 21:04   #8  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by BlueSky00 View Post
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.
You have -strict 1 listed twice in your command line. It works for me if it is following -pix_fmt. Try removing the first one.

As to why, the ineffable inner workings of ffmpeg are not for humankind to understand or question .

Also, there is no metadata in a .yuv frame, so you'll need to specify resolution, fps, chroma subsampling, pixel depth, etcetera in ffmpeg. That's why I do a single-step .yuv frames to .y4m file conversion, so I can examine the .y4m and confirm it works correctly before compression.

Also, not that scaling HDR in ffmpeg isn't optimal, because it presumes gamma, not PQ. You can wind up getting materially different output values in areas of high local contrast scaling in ffmpeg compared to doing a proper linear light scaling based on nit values.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote