Starting with an H.264 YUV mp4 file, how would I confine the luma and RGB values to the range of 5 to 246 using ffmpeg?
I'm using lutyuv successfully on the luma, but am having a hard time with the RGB levels. They tend to be too hot.
https://tech.ebu.ch/docs/r/r103.pdf
Preferred Min. / Max.Video Signal Tolerance
In practice it is difficult to avoid generating signals slightly out of range, and it is considered
reasonable to allow a small tolerance, therefore,
the EBU recommends that the RGB components and the corresponding Luminance (Y) signal should not normally
exceed the “Preferred Minimum/Maximum” range of digital sample levels in the table
below.
Any signals outside the “Preferred Minimum/Maximum” range are described as having a gamut error
(or as, being out of gamut). Signals shall not exceed the “Total Video Signal Range”, overshoots
that attempt to “exceed” these values may clip.
8 bit
5 - 246
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 4 of 4
Thread
-
-
Here is some ffmpeg code I use to make the output of my camcorder r103 compliant, i.e. the luma and RGB levels are confined to digital 5 - 246.
It controls gain, pedestal (brightness), gamma, saturation and adds a little sharpness.
Code:ffmpeg -y -i "input.mp4" -crf 0 -c:v libx264 -pix_fmt yuv420p -s 1280x720 -r 59.94 -vf unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=0.25,eq=brightness=-.03:saturation=0.65:gamma=1.15, lutyuv=y='clip(val*1.06,16,235)' -c:a copy clipped.mp4
-
Here is some ffmpeg code that does the same thing as above, but creates a lossless ffv1 .mkv file.
Code:ffmpeg -y -i input.MP4 -vcodec ffv1 -level 3 -threads 8 -coder 1 -context 1 -g 1 -slices 24 -slicecrc 1 -pix_fmt bgr0 -s 1280x720 -r 59.94 -vf unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=0.25,eq=brightness=-0.03:gamma=1.15:saturation=0.65 -c:a copy clipped.mkv
-
Here is some ffmpeg code that does the same things as above, but creates a lossless ffv1 .mkv file.
Code:ffmpeg -y -i input.MP4 -vcodec ffv1 -level 3 -threads 8 -coder 1 -context 1 -g 1 -slices 24 -slicecrc 1 -pix_fmt bgr0 -s 1280x720 -r 59.94 -vf unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=0.25,eq=brightness=-0.03:gamma=1.15:saturation=0.65 -c:a copy clipped.mkv
Similar Threads
-
how can i join two videos a1.mp4 + a2.mp4 = a12.mp4
By sommers in forum Newbie / General discussionsReplies: 14Last Post: 8th Jun 2017, 19:01 -
Homemade mp4 files quality vs. ripped movies in mp4 format
By MrMX in forum Newbie / General discussionsReplies: 11Last Post: 26th Nov 2015, 23:12 -
How to open .MP4 files in virtualdub? (i want to sharpen mp4
By fuc847 in forum Video ConversionReplies: 27Last Post: 22nd Apr 2015, 09:06 -
Mux AVI with MP4 / Quicktime stuff into MP4
By TheRandomOne in forum EditingReplies: 2Last Post: 13th Sep 2014, 21:29 -
Plain English Guide to MP4Box and Repacking MKV-MP4, MP4-MP4 (M4V).
By raregrit in forum Video ConversionReplies: 3Last Post: 8th Jul 2013, 13:52