This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] Vapoursynth: Image Stream Luma TV Range not working correctly (??)
#13
Except, the output video file is at "PC" range instead of "TV" range. Shoudn't the x264 output range change to "TV" if "Range Conversion" -> "full to limited (pc -> tv)" is specified on the "Color" tab for Vapoursynth?

[Image: PNIOy86.png]

# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading E:\USER\fin\Joga\Bjork - Joga_%1d.00x_1312x960_Gaia-HQ_png\000000.png using vsImageReader
clip = core.imwri.Read("E:/USER/fin/Joga/Bjork - Joga_%1d.00x_1312x960_Gaia-HQ_png/000000.png", firstnum=2)
clip = core.std.Trim(clip=clip, length=100)
# Input color space is assumed to be RGB24.
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
clip = core.resize.Point(clip, range_in_s="full", range_s="limited")
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# adjusting output color from: RGB24 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709", range_s="limited")
# Output
clip.set_output()

The Vapoursynth preview stays looking correct when toggling "Range Conversion" -> "full to limited (pc -> tv)" on and off.

So shouldn't this produce a "TV" range mp4 file?


[Image: t4MV2uR.png]

I guess I'm not understanding why it works differently in AviSynth.

The only way to get a "TV" range mp4 file (as in AviSynth), is to import at TV range and enable the "Levels" filter in Vapoursynth:

# Color Adjustment
clip = core.std.Levels(clip=clip, min_in=0, max_in=255, min_out=16, max_out=235)

Anyways, at least we know it's not a bug! Blush

By the way, what program did you use to take the "levels" screenshots? Smile
Reply


Messages In This Thread
RE: Vapoursynth: Image Stream Luma TV Range not working correctly (??) - by The_Tinkerer - 24.07.2020, 03:45

Forum Jump:


Users browsing this thread: 1 Guest(s)