VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab Passkey and copy Blu-ray and DVDs! :)
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. 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

    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.
    Preferred Min. / Max.

    8 bit

    5 - 246
    Quote Quote  
  2. 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
    Quote Quote  
  3. 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
    Quote Quote  
  4. 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
    Quote Quote  



Similar Threads