View Full Version : Freaky wave effect, how do I treat it?
MasamuneXGP
3rd June 2007, 14:33
[ass-covering]The clip in question is a clip from something that I am encoding for my own personal enjoyment. I have no intention of distributing it.[/ass-covering]
Hello all. I've run across a rather odd artifact in my encoding adventures, and I'm not sure what filter I should use to get rid of it. It's some sort of wavy effect that's especially visible during vertical panning. I've attached a clip that is afflicted by this problem. Note how the shadow seems to shiver as the camera pans. Is there a filter that can treat this problem?
EDIT: Perhaps uploading it elsewhere would be better...
http://download.yousendit.com/EE12044A080668A0
EDIT2: Clips from the original vob:
http://download.yousendit.com/DFB127D12EAA9E82
iantri
4th June 2007, 17:09
what deinterlacing technique did you choose?
I think that you are seeing a deinterlacing artifact.
MasamuneXGP
4th June 2007, 18:24
I didn't deinterlace it; this is right from the DVD with zero processing. It would appear whoever encoded the DVD already did so and did a crappy job.
Is there any way at all I can treat it? It's massively annoying.
Didée
4th June 2007, 20:18
I didn't deinterlace it; this is right from the DVD with zero processing.
... This you tell about a 486x364 Xvid clip? Funny.
Like neuron2 says x-thousand times per year:
Please post a link to an *unprocessed* VOB fragment (or source stream) that shows the issue. ;)
MasamuneXGP
4th June 2007, 23:10
You're right, there was some unrelated processing involved. My apologies. Here are some vob clips, straight out of DVD Decrypter and MPEG2Cut:
ftp://masamune.zapto.org/WaterPump.vob
ftp://masamune.zapto.org/Townspeople.vob
ftp://masamune.zapto.org/Communicator.vob
And here's all three on YouSendIt in case my FTP server starts acting up again:
http://download.yousendit.com/DFB127D12EAA9E82
Seeing something like this is extremely frustrating. If it were interlaced at least I would know what to do with it... The fact that this kind of sloppy encoding is on an official DVD is down right appalling. But whatever. The distortion follows a pretty predictable pattern; surely there's a way to treat it?
davidhorman
5th June 2007, 00:50
It looks to me like it's been point resized down - the jaggies occur every 8 lines or so, suggesting the video was original 540 pixels high.
There might be something clever that could be done with EEDI2 or Yadif - you need to recreate the missing 60 lines by interpolating between those pairs of lines around the jaggies. I'm still thinking about how to do that - it can be done with a whole load of crop()s, but I'd rather come up with an elegant solution ;)
David
davidhorman
5th June 2007, 01:29
Okay, I couldn't wait to come up with a really elegant solution, but rather than post my script right now, I'll wait and see what others come up with - instead, here's the result of my not-so-elegant script, which runs at about 11fps on my 1.0GHz laptop:
http://horman.net/communicator.avi
What you see can improved by using EEDI2 (at the moment it's bilinear interpolation) but that will cost more time and a couple of extra colour space conversions.
David
MasamuneXGP
5th June 2007, 04:22
Wow! That's a massive improvement! Please post the script! Elegance is indeed important but I'd rather have it acceptable now and make it even better later. Also, please explain how I would use EEDI2, as encoding speed is not an issue to me.
Seeing something like this is extremely frustrating. If it were interlaced at least I would know what to do with it... The fact that this kind of sloppy encoding is on an official DVD is down right appalling. But whatever. The distortion follows a pretty predictable pattern; surely there's a way to treat it?
Errr... are those samples off the US DVDs of Haibane Renmei? Can't say that I noticed this when I watched them on my TV...
davidhorman
5th June 2007, 11:58
Hmm, the EEDI2 version of my script seems to be coming off worse - I'm not sure why. Here's the bilinear resize version:
function split2(clip c) {
return stackhorizontal( \
c.crop(0,0,0,c.height/2), \
c.crop(0,c.height/2,0,0) \
)
}
function split3(clip c) {
return stackhorizontal( \
c.crop(0,0,0,c.height/3), \
c.crop(0,c.height/3,0,c.height/3), \
c.crop(0,2*c.height/3,0,0) \
)
}
function split5(clip c) {
return stackhorizontal( \
c.crop(0,0,0,c.height/5), \
c.crop(0,c.height/5,0,c.height/5), \
c.crop(0,2*c.height/5,0,c.height/5), \
c.crop(0,3*c.height/5,0,c.height/5), \
c.crop(0,4*c.height/5,0,0) \
)
}
function join5(clip c) {
return stackvertical( \
c.crop(0,0,c.width/5,0), \
c.crop(c.width/5,0,c.width/5,0), \
c.crop(2*c.width/5,0,c.width/5,0), \
c.crop(3*c.width/5,0,c.width/5,0), \
c.crop(4*c.width/5,0,c.width/5,0) \
)
}
function join3(clip c) {
return stackvertical( \
c.crop(0,0,c.width/3,0), \
c.crop(c.width/3,0,c.width/3,0), \
c.crop(2*c.width/3,0,c.width/3,0) \
)
}
function join2(clip c) {
return stackvertical( \
c.crop(0,0,c.width/2,0), \
c.crop(c.width/2,0,c.width/2,0) \
) \
}
s=mpeg2source("waterpump.d2v").converttorgb24.crop(0,0,0,-1).addborders(0,1,0,0)
q=s.split2.split2.split3.split5
top=q.crop(0,0,0,2)
bottom=q.crop(0,2,0,0)
# i=q.bilinearresize(q.width,q.height*2).crop(0,4,0,1) NOTE: replaced with:
i=q.pointresize(q.width,q.height*2).assumebff.bob(0,1).selecteven.crop(0,4,0,1)
j=stackvertical(top,i,bottom)
k=j.join5.join3.join2.join2
k.lanczos4resize(720,480) # scale back to NTSC (or 720,576 for PAL)
David
MasamuneXGP
5th June 2007, 12:57
Errr... are those samples off the US DVDs of Haibane Renmei? Can't say that I noticed this when I watched them on my TV...
Indeed they are. The problem only appears to be in specific episodes though (the clips are from ep02). Admittedly I don't recall seeing this problem the first time I watched it either, but that was before I had an HDTV ;)
Davidhorman, I'm trying to think of ways to improve the script. Is there a function to interpolate a single line using both the line above and the line below?
Davidhorman, I'm trying to think of ways to improve the script. Is there a function to interpolate a single line using both the line above and the line below?
Hmmm... crop both lines, stack them vertically, do a bilinear/bicubic/whatever vertical resize from 2 to 3 pixels then use the produced middle line?
Creepy, I know... :D
davidhorman
5th June 2007, 14:17
Hmmm... crop both lines, stack them vertically, do a bilinear/bicubic/whatever vertical resize from 2 to 3 pixels then use the produced middle line?
I'm not sure I'd trust a vertical resizer that way - in fact, that probably explains why there's still some residual shimmering from my script. Back to the drawing board!
Replace:
i=q.bilinearresize(q.width,q.height*2).crop(0,4,0,1)
with:
i=q.pointresize(q.width,q.height*2).assumebff.bob(0,1).selecteven.crop(0,4,0,1)
David
MasamuneXGP
5th June 2007, 16:25
David, with that latest addition, your function (which I have dubbed "PointDesize" :p) almost perfectly fixes this thing. I'm testing it on the full VOB, and I in most scenes I can't see the shimmer at all. Some scenes still have a very slight shimmer, but it's well within acceptable ranges and postprocessing will probably reduce it even further. However, to my utter horror, I discovered that the last few minutes of the ep have an entirely *new* shimmer pattern, one which your function just makes even worse. Here's the vob clip:
ftp://masamune.zapto.org/Rakka.vob
It looks sort of like shimmer pattern in the rest of the ep, but more subtle somehow. It's almost subtle enough that I'm tempted to just leave it, but my perfectionist tendencies are screaming bloody murder at the very thought. URGH! I swear I'm ready to choke whoever encoded these DVDs...
davidhorman
5th June 2007, 17:03
It's the same pattern, but it looks like the image has been shifted down by two pixels, so my script misses it. The easiest thing to do is to shift that section of the video back up with
crop(0,2,0,0).addborders(0,0,0,2)
You'll have to trim the section out to apply the above, or use applyrange.
If it occurs anywhere else, you'll have to shift up or down in the same way to align the jaggies for my script - at most it will be +/-4 pixels.
David
MasamuneXGP
5th June 2007, 17:35
Ah, I thought it might have been shifted, but I only tried +/- 1. Shifting it by two does indeed fix it right up. Massive thanks David! If anyone else has a more elegant solution feel free to post it =)
cestfait
10th July 2007, 01:02
Hi, sorry to be a total newb here, but I thought that maybe someone would be kind enough to save me some time:
I'm working in Avisynth through Yatta and I am having trouble getting this script to load. Would someone please tell me how to load it?
Any help would be greatly appreciated! :thanks:
neuron2
10th July 2007, 02:29
this script What script? What problem are you having?
If this is a different problem from the one covered here, you should start your own thread.
cestfait
16th July 2007, 00:52
The script that davidhorman posted above... I cannot seem to get Yatta to find the file I replaced "waterpump.d2v" with in the script (I called it "HAIBANE_2.d2v"). Same episode of the same show, though.
Any ideas? Thanks!
Leak
16th July 2007, 02:15
The script that davidhorman posted above... I cannot seem to get Yatta to find the file I replaced "waterpump.d2v" with in the script (I called it "HAIBANE_2.d2v"). Same episode of the same show, though.
Have you considered entering the full path to the d2v file?
You know, as in
MPEG2Source("E:\DVD\HAIBANE1\VIDEO_TS\VTS_01_1 - 0xE0 - Video - MPEG-2 - 720x480 (NTSC) - 16~9 - Letterboxed.d2v")
?
np: The Orb - Star 6 & 7 8 9 (Live 93 (Disc 1))
cestfait
16th July 2007, 04:46
OK, it's loaded. Now Yatta is saying it only accepts YUY2 or YV12 input, which means the crop is invalid (not a multiple of 2).
Any more ideas? (>.<)
Thanks!
Edit: Heh. Forgot that YUY2 could do that. SUCCESS!!! Thanks everyone for your input! (^_^)
cestfait
18th July 2007, 05:59
Sorry to double-post, but I'm not sure if just an edit is enough to let people know that this topic still wants attention.
I got the script working, but when I try applying a "manaodenoise," Yatta spits out an error that reads something like "MPEG2Source: the file is not a D2V project file" --
Could this be a problem with using more than one script in one chain? But that doesn't make sense.... Other scripts and filters like LSF and FRFun work...
Can anyone tell me why my D2V is no longer a D2V? What script do I have to modify, and where?
My basic chain up to the error was an "Import" of the davidhorman function above, ConvertToYV12, and then ManaoDenoise, which I have as an autoloading plugin.
:thanks:
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.