Im trying to encode some DVD's of mine and I notice the color coming out of the black outlines. I believe this is called color bleeding.
It looks like the color is a little too far to the right. here are a couple screenshots of what im talking about. Their clothing and skin colors bleed over the black outlines to the right.
I saw someone trying to encode something long ago that had a similar issue as you can see in the picture below only it was bleeding to the left instead.
Someone suggested to use an avisynth filter called chroma shift I believe.
I dont know much about chroma shift and I havent used it before, could anyone assist me in getting the colors in their proper place so they are not bleeding to the right?
Id like to fix this with avisynth. I think I just need to shift it to the left a couple pixels but Im not sure how to add it into my script.
+ Reply to Thread
Results 1 to 30 of 46
If it's just one direction you can use chromashiftsp , you can try to sharpen and align the chroma with something like Mergechroma(awarpsharp2(depth=20))
Adjust the depth setting to your tastes
No you don't , but most people will like the results of sharpening the color borders as well. You can use ChromaShiftSP() alone to move the chroma in subpixels (SP=subpixel) without sharpening
Try it out, you'll see shifting in 1 direction will often make other sections worse. In animation with 4:2:0 chroma, the color edges will often be blurred in all directions . If you shift it one direction, it makes the other edges worse
If you get overlap on opposite borders with the mergechroma technique, you can temporarily add borders then crop them
Last edited by jagabo; 2nd Oct 2012 at 12:24.
Heres the result I got thanks to
TOP = Before
BOTTOM = After
you might consider using awarpsharp2 instead of awarpsharp - Look at the left and right frame edges in jagabo's 2nd picture, to the girl's right, there is a "wraparound" splotch from the other side of the frame where her left hair was? Likewise there is a blue patch on the opposite side of the frame where it shouldn't be. Whenever there are objects on the border edges, you might get artifacts otherwise
I mentioned the addborders, crop method - that was if you use awarpsharp . Awarpsharp2 doesn't need addborders ,crop method
Is there any real difference between
is awarpsharp2 any better to use?
(Sorry poisondeathray, I didnt see your post before I posted this)
Last edited by darkdream787; 2nd Oct 2012 at 15:02. Reason: Update
Last edited by jagabo; 2nd Oct 2012 at 15:09.
You can use awarpsharp2 for everything . awarpsharp can cause artifacts, even when not used with mergechroma . It's the reason why awarpsharp2 was written
The only reason I keep the original function around is some older functions and plugins still use it as a pre-requisite
I have one last question at the moment.
What would I use to shift chroma up and down incase it would ever need to to go up or down a couple pixels.
Chromashift(c=-2) goes left 2 and Chromashift(c=2) goes right 2
Whats up and down? a different letter than "c" I take it?
Another way to do it, and without needing a plugin, is like this:
A positive value to 'X' shifts the chroma to the right (by 10 pixels in this example). A positive value to 'Y' moves the color down (by 10 pixels in this example). To shift in the opposite direction (left and/or up) use negative values for the numbers. Play with the 'X' and 'Y' numbers. Usually they're 2 to 4, and usually negative.
For the original chromashift, L=+ is down , L=- is up
I need a small bit of advice here.
If you were to chroma shift this DVD source I have fixed up, how many pixels going left, right, up, and down would you go?
I tried shifting it 2 to the left and it seems to fix most of it, but then it bleeds to far to the left a bit and makes it look like I should go down 2 as well. When I tell it to go down 2 as well, it just looks completely off. So I cant figure out what I should go with.
Heres the shots when shifted 2 pixels to the left.
The blue sky started covering the right black outline of Tiens head around the ear area after the shift.
The blue sky started covering the black outline and bleeding into Trunks hair after the shift.
The sky started bleeding over the black outline on the entire right side of Krillins body and maked his eyebrow look blue.
You probably need different filters for different scenes. They are not shifted the same, between your screenshots either in magnitude or direction (sometimes it' s just low resolution or chroma blurring so it's shifted in all directions)
If you want more precision for 1 direction, use ChromaShiftSP (SP = subpixel), you can use decimal values e.g. X=-0.25
You probably need a combination of mergechroma(awarpsharp2(some settings)) , with some type of shift but adjusted for each scene
Keep in mind that YV12 video has chroma channels that are half the resolution of the luma channel. So a 640x480 YV12 video has 320x240 color. The colors will always be blurrier than the luma and you will never get them to align exactly.
You can enlarge the frame size, shift, then shrink the frame to get smaller shifts with ChromaShift(). For example, to shift colors left by one pixel:
shifted = BicubicResize(width*2, height).ChromaShift(c=-2).BicubicResize(width, height) MergeChroma(last,shifted)
Last edited by jagabo; 5th Oct 2012 at 07:52.
You can use trim() to apply different filters or settings to different frame ranges, then join them with aligned splice ; or use remapframes(), or applyrange()
Is there any specific reason why when I use ChromashiftSP and MergeChroma the audio and video are a bit out of sync?
I encoded this both with and without ChromaShiftSP and MergeChroma(aWarpSharp2()) added in the script.
For some reason when I encode it without those 2 things the audio and video are perfectly in sync and when the mouths are done moving the audio is done talking.
When I encode it with those 2 things in the script the video plays a bit faster than the audio and the audio keeps talking after the mouths have stopped for about half a second to one whole second.
Is there any specific reason that these 2 things are causing this?
the only difference in the script is I added these 2 things in at the bottom.
I've never used ChromaShiftSP() but I've never seen A/V sync problems with Chromashift(), MergeChroma(), or aWarpSharp2().
Mediainfo shows the same exact info except their titles since their titled different but when I play them they play differently. The framerates and length are all the same but it looks like the video during actual playback is half a second to one second faster than the audio when their used. Almost as if the video started playing half a second to one second quicker than the audio.
Like I said the mouths stop moving before the audio stops talking and it doesnt do that when I remove the 2 from the script. I tried reencoding them both twice just to see if it was an error but its the same result in the end.
I added chapters to both in the same exact timeframes and when I check them both one is starting at the beginning of a word while the other is half through the same word when the chapter is loaded. Yes the chapters are at the exact same times in the MKV file.
I just find it weird because im using the same audio and video source for them both.
That is weird and shouldnt happen. None of those filters you listed affect framecount or fps. They dont' affect audio either
Check the framecount. e.g. use info() , and preview a few frames. If the frames are the same, then it should be in sync . They are essentially the same video then (just with chroma shifted a bit on each frame)
If it's a constant sync issue (e.g. 0.2 sec all the way through), there is a delay that you might have not have taken in to account when muxing . Muxing has nothing to do with the avs script , unless you are doing something else ? (are you re-encoding the audio ?) . Constant sync issue is easy to fix
Why don't you post the full script and exact procedure you are doing