Log in

View Full Version : Noise filters on interlaced material


Jonaldinho
15th July 2011, 21:57
Hi, I'm encoding my dv footage to dvd with CCE 2.67. I know how to encode and the basic settings to create an avs script but i'm not sure how to use noise filters on interlaced content. I have 2 videos i'm joining together, I had issues with the audio so I created grf files and loaded them instead. I'm experimenting with convolution3dyv12, here's my script:

LoadPlugin("O:\MeGUI\tools\avisynth_plugin\Convolution3DYV12.dll")
vid=DirectShowSource("M:\Video 1 Video.GRF", audio=false)+DirectShowSource("M:\Video 2 Video.GRF", audio=false).AssumeBFF()
aud=DirectShowSource("M:\Video 1 Audio.GRF", video=false)+DirectShowSource("M:\Video 2 Audio.GRF", video=false)
AudioDub(vid, aud)
ConvertToYV12()
separatefields()
vid_e=selecteven()
vid_o=selectodd()
vid_e=convolution3d(vid_e,0,4,4,4,4,2.8,0)
vid_o=convolution3d(vid_o,0,4,4,4,4,2.8,0)
interleave(vid_e,vid_o)
weave()
ConvertToYUY2()
__film = last
__t0 = __film.trim(5, 7505)
__t1 = __film.trim(7569, 8563)
__t2 = __film.trim(8609, 10072)
__t3 = __film.trim(10691, 58249)
__t4 = __film.trim(58350, 79793)
__t0 ++ __t1 ++ __t2 ++ __t3 ++ __t4

Does this look right? I'm unsure about the colour space conversion parts and I've seen some scipts with DoubleWeave.SelectOdd() after Weave(). Do i need .AssumeBFF() after each loaded video? I assumed because it was on the same line it wouldn't matter. Thanks.

Gavino
15th July 2011, 23:18
Do i need .AssumeBFF() after each loaded video? I assumed because it was on the same line it wouldn't matter.
As you've written it, AssumeBFF only applies to Video2 - in effect, the '.' binds more tightly than the '+'.
You could have written
vid=(DirectShowSource(...1...)+DirectShowSource(...2...)).AssumeBFF()
or
vid=DirectShowSource(...1...).AssumeBFF()+DirectShowSource(...2...).AssumeBFF()
but since BFF is the default, you don't really need it anyway.

Jonaldinho
16th July 2011, 11:22
You could have written
vid=(DirectShowSource(...1...)+DirectShowSource(...2...)).AssumeBFF()
or
vid=DirectShowSource(...1...).AssumeBFF()+DirectShowSource(...2...).AssumeBFF()
but since BFF is the default, you don't really need it anyway.

Thanks for your reply. I encoded it with out .AssumeBFF() and the motion was jerky. I started this thread at the start of encoding this script, with .AssumeBFF() just at the end of the line and it appears to be playing smoothly during both videos. Now I'm just wondering if i've applied the right settings to apply the noise filter to interlaced material correctly.

Gavino
16th July 2011, 18:44
Thanks for your reply. I encoded it with out .AssumeBFF() and the motion was jerky. I started this thread at the start of encoding this script, with .AssumeBFF() just at the end of the line and it appears to be playing smoothly during both videos.
That's puzzling since, as I said, Avisynth defaults to BFF, so it shouldn't matter if you put it in for either video or not at all.

And in fact, there is nothing in your script that requires the correct field order to be known, since you process the odd and even fields independently and put them back in the same order afterwards.

Note however that when encoding, you will also have to tell your encoder that the clip is BFF, since most (if not all) encoders will not get that information from Avisynth.

One thing I have just spotted is that your ConvertToYV12() and ConvertToYUY2() calls should specify interlaced=true, but that should only affect chroma, not cause jerky movement.

Jonaldinho
18th July 2011, 11:51
Note however that when encoding, you will also have to tell your encoder that the clip is BFF, since most (if not all) encoders will not get that information from Avisynth.

I added .AssumeBFF() after each line of video just to be safe. I don't know how to tell the encoder it's BFF. I've encoded it and it plays smoothly so hopefully it's OK.

One thing I have just spotted is that your ConvertToYV12() and ConvertToYUY2() calls should specify interlaced=true, but that should only affect chroma, not cause jerky movement.

I have now added interlaced=true to each colour conversion command now, thank you. I couldn't see any difference in the noise with the settings I was using so I tried the noise filter on a higher setting (0,6,10,6,8,2.8,0) and now i can see a subtle reduction in noise. I don't want to reduce noise to much in trade of for picture detail because I'm encoding at 9mbps and there doesn't appear to be any obvious artifacts.