Video Scope Calibration

Version 20.07.11

The Shotcut video scope shows Y = 255 as 100 IRE and Y = 0 as 0 IRE. This is incorrect.

Per BT.709, Y = 235 = 100 IRE and Y = 16 = 0 IRE.

I do not reproduce this. Can you provide a screenshot?

In this screenshot, the white bar in the colorbars has a Y value of 235 (as seen in the video zoom scope) and an IRE of 100 (as seen in the video waveform scope)

Hi Brian -

You just reproduced it! :slight_smile:

The white bar in your screen shot is R=255, G=255, B=255. Use a color picker or “eyedropper” program to see this. The white bar should read 108.5 IRE.

I’m on Windows 10, BTW.

Attached is a window-signal file. The Y values of the patches from left to right are +/- 1: 0, 16, 235, 255.

An external RGB color picker is not reading YUV values; it’s reading RGB values that are converted from YUV values

The RGB preview that you see is using computer range RGB; not studio range RGB - so YCbCr 235,128,128 becomes RGB 255,255,255

The waveform in shotcut is correct - you can verify this with known Y values

The color picker shows R,G,B 255,255,255. Do the math using BT.709 coefficients and you get Y = 255. I was very careful to specify BT.709 in my O.P. which is 16 - 235, so please leave out the “computer range” red herring.

IRE units don’t apply to “computer range” AFAIK, which is what the Shotcut scope is calibrated in. If you believe to the contrary, the onus is on you to prove it.

RGB is not YUV.

It’s using computer range RGB for the RGB conversion for the preview. That’s not the actual underlying YUV stream.

Analyze the YUV stream and you can verify this, instead of using an RGB color picker to infer YUV values (you’re 1 step removed, and it relies on how the YUV=>RGB conversion is performed)

Technically , IRE units do not apply to digital values. They just offer that display for legacy reasons. Technically it should show Y=235 .

This is an unnecessary step and adds extra complication. The Video Zoom scope shows the exact digital values that Shotcut puts in the output. I recommend to use that instead.

You are not using the same colorspace conversion equation that Shotcut uses. When Shotcut uses RGB internally, it uses full range RGB. When Shotcut uses YUV internally, it uses broadcast limited YUV. Shotcut coverts between full RGB and limited YUV. This is clearly illustrated in my screenshot above where the Video Zoom Scope shows a selected white pixel with RGB = 255,255,255 and YUV = 235,128,128.

How to access this video zoom scope?

Here is the conversion equation straight out of BT.709. It’s straightforward. Where do we differ?

3.2 Derivation of luminance signal EY′ EY′ = 0.2126 ER′ + 0.7152 EG′ + 0.0722 EB

View->Scopes->Video Zoom

Shotcut uses libswscale (from FFMpeg) for colorspace conversions.

Here is the code where it selects the transfer coefficients:

For RGB formats (source or destination) it chooses SWS_CS_DEFAULT.

I do not know the equations that swscale uses.

There is a useful conversion function listed on this page:
https://www.vocal.com/video/rgb-and-yuv-color-space-conversion/

If the RGB data has a range of 0-255 (black-white), as is commonly found in PCs, the following equations should be used to maintain the correct black and white levels:

rgb-yuv-conversion-matrix6

(255 x 0.257) + (255 x 0.504) + (255 x 0.098) + 16 = 235

I do not know which standard specifies those coefficients.

It’s ITU BT.709, the de-facto standard for professional and amateur/prosumer video these days. Below is the spec. See section 3.2.

I used the video zoom tool and got exactly the same RGB values with it as I did with my eyedropper program. If you do the math per BT.709 you will see that RGB 255,255,255 gives a Y value of 255. See the window signals I posted above.

Alternatively, you could have two sets of graticules, one for full range and the other for “TV range”. The scope as it is now is useless for TV-range video.

https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-6-201506-I!!PDF-E.pdf

Using non-standard conversion equations and calling them IRE units does not sit well; that’s just me.

This summer marks my 50th year of working in television. I’ve been doing this for a while.

This test clip does not match your description. It is unable to because it is not full range. The lowest Y value is 16, not 0. In order for it to have Y values of 0 and 255, it must be full range. But it loads into Shotcut as Properties > Color Range > Broadcast Limited. If this were actually full range, then the Video Waveform scope will show things below 0 and above 100, but they do not.

Here is a proper clip that shows what you are attempting:

Since this is full range and not signaled as such, it shows values over 100 and below 0 (solid white line at the bottom):

Change the color range to Full and move the play head to get an uncached image, and it shows:

Here is the same clip with full range signaled in the file’s media metadata:

How is it “useless?” for TV range video or any range video? Y=16 displays are IRE 0, Y=235 displays as IRE 100 . The graticules should not change.

A Y’ waveform monitor (as the name suggests) measures Y’, not RGB. The method of converting to RGB does not affect it. The concepts of computer range RGB /studio range RGB are irrelevant for it, because no RGB conversion is being done. It’s directly reading the Y values - that’s the beauty of it, and correct way to do things.

Using a RGB color picker to indirectly measure converted Y values is not correct way to do things. It just adds additional steps and rounding errors, and depends on the method of RGB conversion (and there are far more ways than just studio range and computer range)

I think what you are trying to articulate, is having a the choice of controlling an RGB conversion, should it be necessary. But that has nothing to do with the Y’ waveform monitor part of the scopes. If you’re dealing with RGB input, then one should be using the proper tools that measure RGB, such as RGB histogram, parade; not a Y’ waveform.

A counter argument is 99.999% of shotcut users are using computers, and computer range RGB 0-255 black to white. Not Studio range RGB 16-235 black to white. You can make an argument, maybe include a switch for studio range RGB, vs. computer range RGB - but that would not benefit 99.999% of users . More options are nice, but I think it would cause considerable confusion for many users

Yes, I see that it is limited range per MediaInfo. The .bmp file was exported using Shotcut’s Default → H.264 → High Profile.

Using Shotcut’s own video zoom and loading that .mp4 file into Shotcut, the values are 0,16,235,255 in the preview pane. Same thing if the video is loaded into VLC and checked with my eyedropper, which we have determined matches Shotcut’s video zoom. In addition. How do you explain that? Does Shotcut have a preset which exports in full range? I tried utvideo and it is limited as well.

I am trying to create a full-range file using ffmpeg and MediaInfo reports all of the full-range files I create as “limited” or there is no entry for color range. Do we have a bug in MediaInfo?

MediaInfo says this file is “limited”:

ffmpeg -y  -loop 1 -t 10  -i WindowSignal.bmp  -pix_fmt yuv420p  -c:v libx264  -vf scale=out_range=full    -r 59.94  -an  WindowSignal.mp4

Not a mediainfo bug

For full range in ffmpeg , flagged as full range you would use yuvj420p.

Don’t forget matrix.

-vf scale out_color_matrix=bt709:out_range=pc,format=yuvj420p

ffmpeg -y -r 59.94 -loop 1 -t 10 -i WindowSignal.bmp -vf scale out_color_matrix=bt709:out_range=pc,format=yuvj420p -c:v libx264 -an WindowSignal.mp4

Or you can use -x264opts specifying range=pc and input-range=pc

With window_signal.mp4 from the zoom scope I get Y values: 16, 30, 218, 235.

For the RGB I get your values above. That is because the shaders Shotcut and VLC use to convert YUV to RGB for display use full range RGB.

Does Shotcut have a preset which exports in full range?

No, but you can by adding to Export > Other:

mlt_image_format=rgb24
color_range=full
pix_fmt=yuvj420p

I am trying to create a full-range file using ffmpeg

You can use what I provided above by right-click on the video and save as.

yuvj420p got MediaInfo to report “full range”.

I created a full-range file with yuvj pixels and loaded it into Shotcut. MediaInfo reports it as full range.

The lum levels are being reproduced correctly, i.e. 0,16,235,255.

The scope still says Y=255 is 100 IRE and Y=0 is 0 IRE. This is not useful to someone working in limited range 16 - 235 where Y = 16 = 0 IRE and Y = 235 = 100 IRE.

Now VLC is not reproducing the patches correctly but ffplay does if the range is set to “full”.

I see what you’re saying

A full range YUV video, that is flagged full range , will automatically reflect that in the properties when loaded into shotcut

But if you override with color range set to limited in the properties, this changes what the waveform says.

A waveform should not be affected by what a video is “flagged”, it should be reading just what the Y values actually are, regardless of flags

For example if I had that same video, unflagged, or flagged limited, the Y range and values are exactly the same as the 1st video. That shouldn’t change what a waveform monitor says

This suggests to me that the waveform is not actually reading the video directly, but what the video is conformed to on the timeline

Right. This is why I wrote my own scope program.

I had to revert VLC player to v 2.2.8 to get it to reproduce the window signals correctly. Got rid of PotPlayer.