Quantcast Avisynth: MA Script for Interlaced Sources? - Page 2 - digitalFAQ.com Forums [Archives]
  #21  
10-25-2003, 10:37 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Using AviSynth 2.5x.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #22  
10-25-2003, 10:45 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
If you captured your source by using 720x480 it doesn't seem that "ITU=R BT.601-4" should be checked in Moviestacker.
Reply With Quote
  #23  
10-25-2003, 03:25 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
The ITU thingie is something you must check. Some cards do horizontal scaling like my Hauppauge WinTV Theatre does, so it doesn't matter if I use a horizontal resolution of 704, 720 or 768. The result is always scaled and the capture itself doesn't have any overscan borders.

If your capture is already in YV12 (all MPEGs for example), there's naturally no need to do the conversion.

Nick, that AddBorders line looks really odd. You're adding 72 pixels to left and right and 17 pixels to top and bottom? (EDIT: Nevermind..you're doing anamorphic but why? Your source is not anamorphic)
Reply With Quote
  #24  
10-25-2003, 03:33 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
And your script might look like this:

Mpeg2Source("H:\fut16\fut16.d2v")
EDIT:BicubicResize(448,224)
AddBorders(16,16,16,16)

Don't crop an odd number of pixels vertically if the source is interlaced! See the post earlier in this thread for correct cropping parameters.
Reply With Quote
  #25  
10-27-2003, 08:13 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
The decomb500 tutorial gives Telecide() as:

Telecide(order=1,guide=1,post=4,vthresh=24)

MovieStacker gives Telecide() as:

Telecide(guide=0, gthresh=30, post=true, threshold=15, dthreshold=9, blend=true, show=false, agg=false, reverse=false, firstlast=false, chroma=false, nt=0, mm=0)

I now understand how Telecide() works using decomb500. Need to know how to use information in regular Telecide() function.
Reply With Quote
  #26  
10-28-2003, 08:49 AM
ozjeff99 ozjeff99 is offline
Free Member
 
Join Date: May 2002
Location: Sydney, Australia
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Boulder. When docs say:

height mod-4 if video is interlaced

I gather that means a multiple of 4?

Excuse my ignorance.
Regards
ozjeff99
Reply With Quote
  #27  
10-28-2003, 09:00 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ozjeff99
Hi Boulder. When docs say:

height mod-4 if video is interlaced

I gather that means a multiple of 4?

Excuse my ignorance.
Regards
ozjeff99
Yep, that's what it means. I don't know why they've used mod-4 as it would have been clearer to state "height must be a multiple of 4".
Reply With Quote
  #28  
11-13-2003, 04:55 AM
digitall.doc digitall.doc is offline
Free Member
 
Join Date: Jul 2003
Location: Valencia (España)
Posts: 741
Thanks: 0
Thanked 0 Times in 0 Posts
I like to keep my films intelaced for making mpeg2 and SKVCD.
I've been using the "interlaced script" that you proposed in this thread, and I'm happy with the results.
I read in "another" forum that it was more recommended, to spatial and temporal filters, to do it this way:
Code:
BicubicResize(_parameters_)
#ComplementaryFields() #I comment this line cos my videos are bottom field first
Bob(0,0.5)
#Spatial filters
#Temporal filters
SeparateFields()
SelectEvery(4,1,2)
Weave()
The visual result in the PC is similar to our script, but I have to test it in TV. The final size I think that gets bigger (I have to compare them).
What's your opinion about this suggestion?. What are they doing?, I know very little about filtering, but I think that they separate the frames in two fields at total resolution, apply the filters, and then separate fields and select two to weave in a frame. Isn't it?.
Do you think it's a better way to keep source interlaced and apply filters?, or just good for some special situations?.
I'm very interested in your feedback .
Reply With Quote
  #29  
11-13-2003, 06:11 AM
GFR GFR is offline
Free Member
 
Join Date: May 2002
Posts: 438
Thanks: 0
Thanked 0 Times in 0 Posts
The Bob() doubles the frame rate, so you don't need to worry about temporal and spatial-temporal filters.

The
SeparateFields()
SelectEvery(4,1,2)
Weave()

Throws away the extra frames so it's back at the original frame rate and then makes it interlaced again.

This method is good quality (maybe marginally better?), but it will take (much) longer.
Reply With Quote
  #30  
11-13-2003, 06:22 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
This is also a very good way to process interlaced material, keeping it interlaced. You'll need the ViewFields and UnViewFields plugins by Simon Walters. This is the script I used with "The Trouble With Harry".

Code:
MPEG2Source("c:\temp\dvd-rip\the trouble with harry\harry.d2v",idct=5)
Crop(0,16,-4,-12)
ViewFields() 
UnDot()
BicubicResize(672,384)
MergeChroma(Blur(1.5))
Convolution3d(2,6,10,8,8,3,0)
Blockbuster(method="noise",variance=0.3,seed=4888,block_size=3)
DCTFilter(1,1,1,1,1,0.75,0.5,0)
UnViewFields()
AddBorders(16,96,16,96)
ConvertToYUY2(interlaced=true) # CCE wants YUY2
Limiter()
ViewFields puts the top field on the top and the bottom field on the bottom of the frame. This allows proper spatial and temporal filtering. In theory it could blur the edge areas between the top and bottom section (that is, the area in the middle of the frame) but you won't notice anything when the fields are put back to their original position.

The good thing is that no filter needs to be called twice. Some filters just don't like that and may produce strange results. I haven't done any speed tests but I suspect that this is faster than SelectEven+SelectOdd+Interleave. It is definitely a lot faster than using Bob.
Reply With Quote
  #31  
11-13-2003, 08:31 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Boulder
This is also a very good way to process interlaced material, keeping it interlaced. You'll need the ViewFields and UnViewFields plugins by Simon Walters. This is the script I used with "The Trouble With Harry".

Code:
MPEG2Source("c:\temp\dvd-rip\the trouble with harry\harry.d2v",idct=5)
Crop(0,16,-4,-12)
ViewFields() 
UnDot()
BicubicResize(672,384)
MergeChroma(Blur(1.5))
Convolution3d(2,6,10,8,8,3,0)
Blockbuster(method="noise",variance=0.3,seed=4888,block_size=3)
DCTFilter(1,1,1,1,1,0.75,0.5,0)
UnViewFields()
AddBorders(16,96,16,96)
ConvertToYUY2(interlaced=true) # CCE wants YUY2
Limiter()
ViewFields puts the top field on the top and the bottom field on the bottom of the frame. This allows proper spatial and temporal filtering. In theory it could blur the edge areas between the top and bottom section (that is, the area in the middle of the frame) but you won't notice anything when the fields are put back to their original position.

The good thing is that no filter needs to be called twice. Some filters just don't like that and may produce strange results. I haven't done any speed tests but I suspect that this is faster than SelectEven+SelectOdd+Interleave. It is definitely a lot faster than using Bob.
My captures are YV12 and top frame first. How would I use?
Reply With Quote
  #32  
11-13-2003, 08:43 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Nic, ....

as you see above, the script handles a DVD-Rip - .d2v and in this CASE this means YV12!

So he also uses a YV12 source ... like you do when handling your mpeg2 captures ...

Here's the mpeg2dec3 "readme" doc, have a look:
http://home.earthlink.net/~teluial/a...MPEG2Dec3.html
Reply With Quote
  #33  
11-13-2003, 08:50 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by incredible
Nic, ....

as you see above, the script handles a DVD-Rip - .d2v and in this CASE this means YV12!

So he also uses a YV12 source ... like you do when handling your mpeg2 captures ...
ViewFields puts the top field on the top and the bottom field on the bottom of the frame. This allows proper spatial and temporal filtering.

My captures are top field first. Does ViewFields assume field order or is it unimportant?

MPEG2Source("c:\temp\dvd-rip\the trouble with harry\harry.d2v",idct=5)

What is "idct=5"?


Also I assume that since I use TMPGEnc, I don't need the ConverttoYUY2 line.
Reply With Quote
  #34  
11-13-2003, 09:30 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
The field order shouldn't matter. Just try with only MPEG2Source and ViewFields lines in your script and you'll see what ViewFields does.

IDCT=5 means that MPEG2DEC3.dll uses SSE2 instructions to decode the video (I have a P4). I don't know if it's any faster than the default IDCT=2 though

I would definitely do the conversion in Avisynth when dealing with interlaced sources; I don't trust any external codecs doing the job for me. With an YUY2 source conversion by a codec should work if you have HuffYUV doing the job, but since HuffYUV doesn't support YV12, I really don't know which codec would do the conversion YV12->RGB24. Maybe you should try ConvertToRGB24(interlaced=true) instead of that ConvertToYUY2(interlaced=true) line in my script.
Reply With Quote
  #35  
11-13-2003, 09:41 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
ConvertToYUY2(interlaced=true) # CCE wants YUY2

Pardon my confusion, but I capture in YV12 and don't use CCE. Do I still need to convert? I have used ConvertToYUY2(interlaced=true) in the past, when I was capturing with Huffy avi.
Reply With Quote
  #36  
11-13-2003, 10:29 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
As I said in my answer, you can use ConverttoRGB24(interlaced=true) instead of ConverttoYUY2(interlaced=true) if you use TMPGEnc
Reply With Quote
  #37  
03-30-2004, 03:21 PM
cweb cweb is offline
Free Member
 
Join Date: Jan 2003
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Should this interlaced ma script use 'motion estimate search(fast)' in Tmpgenc, like the ma script?
Also, when the avs file is opened in Tmpenc, do you need to choose 'INTERLACED' source (with deinterlaced or progressive sources you have to change this usually to not interlaced or whatever the option is called) ?
Reply With Quote
  #38  
03-30-2004, 03:25 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Do make a sample-encoding on maybe 5 Mins incl much variance in frames treatment etc. and do decide on your own as your eyes won't lie
Reply With Quote
  #39  
03-30-2004, 08:53 PM
Peter1234 Peter1234 is offline
Free Member
 
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
This seems to work for me, it is also 30% faster than encoding without separating fields.

### for interlaced source only

LoadPlugin("C:\Filters25\undot.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\Convolution3DYV12.dll")

AVISource("C:\Documents and Settings\user\Desktop\DVtype2.avi")
ConvertToYV12
Levels(0,0.94,255,0,255)

SeparateFields()
odd=SelectOdd().Kwag_MA1()
even=SelectEven().Kwag_MA2()
Interleave(even,odd)
Weave()

Function Kwag_MA1 (clip input1) {
undot(input1)
Limiter(input1)
STMedianFilter(input1,3, 3, 1, 1 )
MergeChroma(input1,blur(1.5))
MergeLuma(input1,blur(0.1))
ScriptClip(" nf = YDifferenceToNext()" +chr(13)+
\ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2,
\ 100)) ).TemporalSoften( fmin( round(2/nf), 6),
\ round(1/nf) , round(3/nf) , 1, 1) ")
Convolution3D(input1,preset="movieLQ")
Limiter(input1)}

Function Kwag_MA2 (clip input2) {
undot(input2)
Limiter(input2)
STMedianFilter(input2,3, 3, 1, 1 )
MergeChroma(input2,blur(1.5))
MergeLuma(input2,blur(0.1))
ScriptClip(" nf = YDifferenceToNext()" +chr(13)+
\ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2,
\ 100)) ).TemporalSoften( fmin( round(2/nf), 6),
\ round(1/nf) , round(3/nf) , 1, 1) ")
Convolution3D(input2,preset="movieLQ")
Limiter(input2)}

Function fmin( int f1, int f2) {return ( f1<f2 ) ? f1 : f2}
Reply With Quote
  #40  
03-30-2004, 09:02 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
FYI you can use only one function as the content is the same. The actual value of the clip paramater will be instanciated to "even" or "odd" according to whgich line calls the function.

Note: you added a C3D("motionLQ") in the end of the normal MA script ? And you use that on divx ???
Woaow... you really like blurred pictures
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Guide to dealing with interlaced sources Boulder Avisynth Scripting 121 04-07-2008 09:36 AM
Avisynth: Interlaced sources guide? [See pg2] J-Wo Avisynth Scripting 50 04-20-2004 07:41 AM
Avisynth: optimal script for dvd sources? CheronAph Avisynth Scripting 6 12-16-2003 07:54 AM
DVD2SVCD: Script for Interlaced sources azel Video Encoding and Conversion 3 11-02-2003 11:29 AM
Avisynth: Multiple Sources in one script? Bchteam Avisynth Scripting 2 09-19-2003 12:12 AM

Thread Tools



 
All times are GMT -5. The time now is 08:14 PM  —  vBulletin © Jelsoft Enterprises Ltd