Log in

View Full Version : Fix colour streaks


ariga
6th December 2005, 12:52
It looks like an interlaced frame, but it is not. Only some parts have red colour sticking out as sharp lines.
http://img207.imageshack.us/img207/5541/colourstreak1ap.png (http://imageshack.us)
Performing a deinterlace doesn't help. Is there any filter to fix it ?

The avi clip is here (http://rapidshare.de/files/8706745/sample1.avi.html)

Chainmax
6th December 2005, 13:26
Looks like a color sampling issue, try using ConvertToYV12() or ConvertToYV12(interlaced=true) at the beginning of your script.

Didée
6th December 2005, 13:29
"MergeChroma( blur(0,1) )" will help for sure ...

Chainmax
6th December 2005, 13:36
What is it with you second guessing my latest posts? ;) :p

ariga
6th December 2005, 14:16
Looks like a color sampling issue, try using ConvertToYV12() or ConvertToYV12(interlaced=true) at the beginning of your script.
It's DV decoded as YV12 already. Captured via analog input of camcorder.
Will try MergeChroma.

Wilbert
6th December 2005, 14:57
Before you do that. I don't know how you created the screenshot (and which codec you used for decoding), but try to open it with Cedocida DV Codec first (as YV12),

AviSource(...)
ConvertToRGB32(interlaced=true) # or false if it is progressive

and post some screenshots.

I will look at the avi when i'm home.

ariga
6th December 2005, 16:40
Before you do that. I don't know how you created the screenshot (and which codec you used for decoding)
The frame was decoded using Cedocida in Vdub. Still frame copied to clipboard, pasted into The Gimp, added yellow border, cropped, saved as png.

But it looks the same with Avisynth serving YV12 to Vdub. I was applying some filters to clean up the source and thought the colour streaks were because of some filter wrongly applied. Then I opened the avi in Vdub directly and took a screenshot. Will try with the ConvertToRGB and post another screenshot if it looks any different.

Wilbert
6th December 2005, 17:15
But it looks the same with Avisynth serving YV12 to Vdub.
This the problem. VDub upsamples progressively when displaying, so it's only a display problem (your source is interlaced, you can check this in AviSynth using AviSource(...).SeparateFields). Use ConvertToRGB32(interlaced=true) for proper display, or just encode straight away. It will not be visible in your encoding.

ariga
7th December 2005, 08:24
@Wilbert: ConvertToRGB32(interlaced=true) did make it a little better but didn't fix it (don't have a screenshot). But i'm not convinced about the source being interlaced. If the source is processed with TDeint(), the preview in Vdub shows the streaks as broken dashes. I have another partial capture of the same broadcast from a different channel which is interlaced for sure - almost every scene has combing.

But take a look at these. Frame 38 of the clip with different sampling options in Cedocida.

Vdub direct
http://img235.imageshack.us/img235/8447/vdubdv5fv.png (http://imageshack.us)

Frameserved/AviSource (YV12, sampling=DV)
http://img235.imageshack.us/img235/6597/avisrcdv3qh.png (http://imageshack.us)

Frameserved/AviSource (YV12, sampling=MPEG2 non-int)
http://img235.imageshack.us/img235/3929/avisrcmpgni6zc.png (http://imageshack.us)

Frameserved/AviSource (YV12, sampling=MPEG2 int)
http://img235.imageshack.us/img235/1233/avisrcmpgi9zp.png (http://imageshack.us)

Framedserved/DirectShowSource (YUY2)
http://img235.imageshack.us/img235/9605/dsourcedv7om.png (http://imageshack.us)


Changing the sampling option didn't effect the preview in Vdub when opened directly, but it did effect when frameserving via Avisynth !! Info() says it's YV12 all the time.

Sampling option set to MPEG non-interlaced shows the "correct" preview. Does this imply the source is non-interlaced ? Or does Cedocida modify the chroma info in the YV12, so that when Vdub upsamples progressively the preview is correct ?

BTW, the effect is amplified if using video overlay in Vdub. Instead of colour streaks, the entire frame appears blocky. (Unfortunately I cannot take a screenshot of it). With MPEG2 non-interlaced sampling the playback is correct.

Wilbert
8th December 2005, 00:14
Ok, i looked at it. In my opinion the source is progressive (as you suggest). It seems to me this is also encoded as progressive, but i don't understand how this would be possible. What dv codec did you use for this?

Indeed setting Cedocida to MPEG-2 non-interlaced for decoding gives "correct" output. Thus, the artefacts you saw is the cause of a progressive source being decoded as interlaced.

scharfis_brain
8th December 2005, 06:15
Thus, the artefacts you saw is the cause of a progressive source being decoded as interlaced.

These artefakts will also show up, if an interlaced source is sampled up interlaced.

to avoid that, use my motion adaptiv chroma upsampling routines with Tdeint.
http://forum.doom9.org/showthread.php?t=90794&highlight=squeeze+detail

DV also supports Progressive encoding.
I've seen interlaced cameras, that encode low and nomotion blocks progressive, wjich obviously destroys the chroma for that block, but effectively reduces ringing in allover the image.

ariga
9th December 2005, 10:56
What dv codec did you use for this?A/V out (TV) => A/V in TRV-355E (http://www.amazon.co.uk/exec/obidos/tg/stores/detail/-/electronics/B00008AQCO/system-requirements/ref=ed_tec_dp_2_1/203-0504084-1467956) camcorder => DV out.
These artefakts will also show up, if an interlaced source is sampled up interlaced. Thanks, I'll remember that !
yv12toyuy2_laced (Is this similar to autoyuy2 ?) followed by a TDeint() didn't fix it. Besides, I do not need an upsampling since I'm encodig to DivX.
... or just encode straight away. It will not be visible in your encoding.Forgot to mention earlier. AviSource() with Cedocida -> Vdub and encoded to DivX with these settings.
(a) YV12 sampling=DV / DivX interlace=Progressive Source
(b) YV12 sampling=MPEG2 non int / DivX interlace=Progressive Source
(c) YV12 sampling=DV / DivX interlace=Preserve interlace
(d) YV12 sampling=MPEG2 non int / DivX interlace=Preserve interlace
When played in PowerDVD with deinterlacing turned off, (a) was messed up whereas (b), (c) and (d) played back fine.
Playback in Vdub however still showed slightly jagged edges in some places.

MPEG2 non-interlaced sampling fixes the problem. Finally the author clears it up (http://forum.doom9.org/showthread.php?p=748783#post748783) !