[FFmpeg-user] clipping samples to broadcast range in an mpeg2video output
dave at dericed.com
Sun Feb 7 21:19:41 CET 2016
>> On Feb 7, 2016, at 1:42 PM, Paul B Mahol <onemda at gmail.com> wrote:
>>> On 2/5/16, Paul B Mahol <onemda at gmail.com> wrote:
>>> On 2/5/16, Dave Rice <dave at dericed.com> wrote:
>>> Hi all,
>>> I am having trouble creating an mpeg2video output that conforms to 16-235
>>> broadcast range. I'd like to find a way to have an input which is yuv420p
>>> but has luma values out of broadcast range but clip to broadcast range
>>> encoding to mpeg2.
>>> To demonstrate the issue, I generate a yuv420p file with samples in the
>>> of broadcast range via:
>>> ffmpeg -f lavfi -i
>>> -c:v ffv1 -t 10 sample.mkv
>>> I can then clip the samples using clipval in the lut filter and see the
>>> clipped values in a waveform with:
>>> ffmpeg -i sample.mkv -vf lut=y=clipval:u=clipval:v=clipval -c:v ffv1 -f
>>> - | ffplay - -vf waveform
>>> The waveform shows the values clipped at 16 and 235.
>>> However I need the output to use mpeg2video. When I change lossless ffv1
>>> mpeg2video with:
>>> ffmpeg -i sample.mkv -vf lut=y=clipval:u=clipval:v=clipval -c:v
>>> -f nut - | ffplay - -vf waveform
>>> The output shows many sample values above 235. The lossy mpeg2video
>>> seems to place values above 235 while the lossless ffv1 doesn't. Is there
>>> way to encode in mpeg2video without having values over 235 in the output?
>> Appears to be mpeg2video bug, can others confirm?
> It appears that having out of range values is OK, its player
> responsibility to clip values that are out of range.
The players involved are broadcast television servers which do not clip the values. The broadcast specification that I'm trying to adhere to requires both mpeg2 encoding and clipping out of range values.
More information about the ffmpeg-user