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: Color shift on PNG export
#1
Bug 
I hesitate (have been hesitating actually) to mention this because I know how welcome a thing it is to troubleshoot color issues. :p

Hopefully this should be reproducible.

Import any video (I mostly work with h264 mp4), then output via Vapoursynth to RAW/PNG. Compare a source frame to the same output PNG frame. You should notice a color shift (which shouldn't happen). What I usually do to compare: load the source mp4 in VirtualDub. Go to the frame you're comparing. Video --> Copy source frame to clipboard. Go into IrfanView, Edit --> Paste. Then start another instance of IfranView, "File" --> "Open" and then navigate into the folder where you output PNG files in Hybrid, and select the PNG for the same frame (add one, since Hybrid starts export at frame number 1 instead of frame number 0). Click between the two IrfanView windows via the start bar to easily compare differences. (I have View --> Display Options --> Fit only big images to window selected in IrfanView.)

Right now, the fix/workaround is to set the ColorMatrix filter in Hybrid on the Vapoursynth --> Color --> Matrix tab in Hybrid: "From" to "Rec.709" and "To" to "Rec.601/470bg/470m". (Clear "Adjust by resolution" tick box and leave "pre and post clipping" enabled.)

clip = core.resize.Spline36(clip=clip, matrix_in_s="709", matrix_s="470bg", range_in=0, range=0)

If you do the same export with the above filter enabled, the exported images will now match when you compare them.
Reply
#2
Quote:Import any video (I mostly work with h264 mp4)
No resolution, color space, bit depth, etc. info.

Quote: then output via Vapoursynth to RAW/PNG
You mean by using: Base->Processing->Video ?
Look at the job queue, is Vapoursynth really used?

Quote:Right now, the fix/workaround is to set the ColorMatrix filter in Hybrid on the Vapoursynth --> Color --> Matrix tab in Hybrid: "From" to "Rec.709" and "To" to "Rec.601/470bg/470m". (Clear "Adjust by resolution" tick box and leave "pre and post clipping" enabled.)
Is your content properly flagged?

Quote:What I usually do to compare: load the source mp4 in VirtualDub. Go to the frame you're comparing. Video --> Copy source frame to clipboard.
Instead use vsViewer (Vapoursynth Preview) in Hybrid, there I can see under the hood.

Wild guess atm. is that it's related to Hybrid feeding ffmpeg with YUV444 data and instead of RGB data. (since y4m piping is only possible with yuv content, I assumed ffmpeg would then to the yuv->rgb conversion properly with the correct values , which is does not seem to do)
-> I'll look into it.

Cu Selur
Reply
#3
Send you a link to a dev version, where I explicitly call the color conversions in ffmpeg.
Let me know whether that helps with your content.

Cu Selur
Reply
#4
Thumbs Up 
Sorry it took so long to report back on this... I had several things going on both on computer and on real life. Sick

Seems to be working fine now, no color shifts, and no extra VS Matrix filters needed to correct anything!

Thank you!! Wink
Reply
#5
Happy to hear that it worked. Smile

Cu Selur
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)