View Full Version : Possible to Apply Chroma Interpolation afterwards?
De-M-oN
20th September 2015, 23:41
hello,
my capture card has no chroma interpolation.
If I record in YUY2 - every 2nd pixel is without color, because of no interpolation.
Is there a way to have an interpolation applied afterwards? Even if the quality is worse than having the interpolation from a RGB source it would be better than nothing.
I can record in RGB, but at RGB the card can only do 2560x1600 @ 51fps, while YUY2 would work with 60fps.
thank you :)
feisty2
21st September 2015, 01:42
Converttorgb24()
vivan
21st September 2015, 03:02
If I record in YUY2 - every 2nd pixel is without color, because of no interpolation.This is not how subsampling (https://en.wikipedia.org/wiki/Chroma_subsampling) works. Chroma (color) is shared between 2/4 pixels (4:2:2/4:2:0).
Is there a way to have an interpolation applied afterwards? Even if the quality is worse than having the interpolation from a RGB source it would be better than nothing.There's no nothing. Interpolation will always happen at playback, you can't convert video to rgb to display it without doing it.
raffriff42
21st September 2015, 03:11
You could do something like
MergeChroma(YToUV(UtoY.Blur(1,0), VtoY.Blur(1,0)))
but this is very crude. We would need a video sample to give a more precise answer.
De-M-oN
24th September 2015, 00:56
Converttorgb24()
In which way this would help?
You could do something like
MergeChroma(YToUV(UtoY.Blur(1,0), VtoY.Blur(1,0)))
but this is very crude. We would need a video sample to give a more precise answer.
RGB:
http://killerinstinct.ath.cx:2000/files/Card-RGB.avi
YUY2 by Capture Card (missing chroma interpolation - every 2nd pixel colorless:
http://killerinstinct.ath.cx:2000/files/Card-YUY2.avi
YUY2 recorded with MSI Afterburner & UTVideo 4:2:2 Interpolation is now in effect:
http://killerinstinct.ath.cx:2000/files/YUY2-interp.avi
The videos are each only 4 frames short to save filesizes. This means you may need to pause the video and seek to one of the four frames to see something more than just a stopped video.
Look at the winamp playlist. The non-interpolated chroma YUY2 has lost lots of color within the winamp playlist font (and so the whole video).
The codec MagicYUV had the same problem of missing interpolation, so I had requested it:
http://forum.doom9.org/showpost.php?p=1727986&postcount=352
And he added it now : http://forum.doom9.org/showpost.php?p=1735749&postcount=401
And since my capture card sends only non-interpolated YUY2 (and so the UTVideo Codec can only use what it gets of course) my question is if its maybe possible to add this interpolation afterwards?
Desbreko
24th September 2015, 01:57
It looks like the problem is that your capture card is using nearest neighbor scaling for subsampling the chroma when it captures in YUY2. Using ConvertToYV16(chromaresample="Point") on the RGB sample produces the same effect.
raffriff42
24th September 2015, 06:38
This is not a simple loss of every other sample. There is a beat pattern (https://en.wikipedia.org/wiki/Beat_%28acoustics%29) (aka rainbow) between the chroma and luma samples for some reason. I have no idea what to do with this.
vivan
24th September 2015, 10:05
I agree that chroma was pointresized.
FFVideoSource("Card-RGB.avi").ConvertToYV16().UToY() (http://i.imgur.com/ezcvrRK.png) (how it should be)
FFVideoSource("Card-RGB.avi").ConvertToYV16(chromaresample="Point").UToY() (http://i.imgur.com/m22yGte.png) (pointresized chroma)
FFVideoSource("Card-YUY2.avi").UToY() (http://i.imgur.com/6lQRjIx.png) (how it is)
What you want is to turn 2 into 1, but I don't think anything close is possible.
And the reason for rainbows on text is ClearType.
Ignus2
24th September 2015, 19:25
Your card indeed seems to do point-resize, and so color is lost, you cannot recover that.
Blurring what raffriff42 mentioned might help a little, but there really is nothing you can do, apart from looking around in your capture card settings to change YUY2 conversion mode (if there is any).
Greets,
I.
De-M-oN
16th November 2015, 22:45
http://abload.de/img/unbenannt2993ou06.png
Can someone explain me this answer by the support? o.O
De-M-oN
18th January 2016, 01:33
Wouldnt it be possible with this method?:
Use the average color of the 2 neighbor pixel around the colorless one and place that color on the colorless one? If upsampling it to 4:4:4 / RGB could even get more out of it I dont mind. I just want to give the colorless pixel color.
So: Would that be possible? Sounds at least realistic to me. So would this work? And if so: Is there a plugin for this?
geometer
20th January 2016, 18:38
I suppose there should be a masking function available on px level?
idea:
copy the video to another variable, do a chroma shift on that, so a grey and a colored px would later overlay.
get the chroma values of both (e.g. plane wise to Y if no other trick), overlay them, and use always the pixel with the non-zero value, or the higher value.
then, upsample (resize) to double or triple resolution. do a px shift there, it's value needs to be iterated, by checking final result.
do some brickwall filtering (band limiting at top frequency of original resolution, but maybe also sharpening at that frequency).
get the original luma, and upsample to the same.
merge luma and px-shifted/filtered chroma to produce YV16 or something.
downsample (optionally with dithering) to original resolution, check color quality, for erraneous shifts. bad shift => iterate
fast guess..
vivan
20th January 2016, 20:03
Wouldnt it be possible with this method?:
Use the average color of the 2 neighbor pixel around the colorless one and place that color on the colorless one?That's basically how bilinear upsampling works.
De-M-oN
20th January 2016, 23:38
So this is possible? What can I do? Is there a plugin for this?
It would be so awesome if there is a solution.
geometer
21st January 2016, 02:43
you can construct a script that materializes my step by step suggestions, and see what comes about.
there is probably no one-button solution.
De-M-oN
14th April 2016, 02:03
Sagaras helped me to do your suggestion, because it overwhelmed me.
Here an example without rainbow, just the fact that every 2nd vertical row has no color like I told you:
http://killerinstinct.ath.cx:2000/files/YUY2-Doom.avi (MagicYUV instead UTVideo this time. Forgot to change codec to UTVideo. I hope you dont mind. Otherwise I will convert)
The 1 pixel thin red lines of the map should be red, but as you can see every 2nd pixel is without color (like we know already)
We got this script now:
http://pastebin.com/XFYnge3g
You can load it into avspMod, then you have the sliders for shifting chroma.
This way I can indeed move all the chroma.
But we dont find a way to work with it. We just move it around, but what to do to colorize the colorless pixels?
My imagination still is it should be doable by calculating the average of the neighbor pixels and apply that color on the colorless one.
But we have still no clue how we could do that.
Please help.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.