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 (??)
#1
Bug 
I know you're away but I found some issues with image streams and lossless encoding and if I don't post while this is fresh in my head I'm going to lose it. Tongue

Not sure if this is a bug or expected behavior.

I have an image stream of PNG files that were processed from a source that has a Luma Range of Limited/TV.

I import with the following settings:

[Image: 1YgdI8L.png]

In AviSynth preview, these behave as expected and look the same as the source.

But in Vapoursynth preview, they are different than the source (source is on the left):

[Image: 4vmgQYj.png][Image: wYP16M2.png]

# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading E:\USER\fin\Joga\ImgStrmVStest\%06d.png using vsImageReader
clip = core.imwri.Read("E:/USER/fin/Joga/ImgStrmVStest/%06d.png", firstnum=0)
clip = core.std.Trim(clip=clip, length=51)
# 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 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()

If I add the following VapourSynth filter:

[Image: 5VYrZBp.png]

That seems to fix it and it now looks correct (source is on the left):

[Image: 4vmgQYj.png][Image: fyaPjIS.png]

# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading E:\USER\fin\Joga\ImgStrmVStest\%06d.png using vsImageReader
clip = core.imwri.Read("E:/USER/fin/Joga/ImgStrmVStest/%06d.png", firstnum=0)
clip = core.std.Trim(clip=clip, length=51)
# 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 TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# Color Adjustment
clip = core.std.Levels(clip=clip, min_in=0, max_in=255, min_out=16, max_out=235)
# 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()

Is that expected behavior, or a bug? What's weird, is that even though that filter is changing the levels from 0 to 16, 100% black pixels remain black. Running the Levels filter in AviSynth lightens 100% black pixels.

Here's a zip of the image stream:

https://www67.zippyshare.com/v/a3vg0LOZ/file.html
Reply


Messages In This Thread
Vapoursynth: Image Stream Luma TV Range not working correctly (??) - by The_Tinkerer - 17.07.2020, 23:36

Forum Jump:


Users browsing this thread: 1 Guest(s)