Quantcast Avisynth: MPEG 2 Interlaced Encoding and Scripts? - digitalFAQ.com Forums [Archives]
  #1  
09-15-2003, 12:33 AM
m0rdant m0rdant is offline
Free Member
 
Join Date: May 2002
Posts: 137
Thanks: 0
Thanked 0 Times in 0 Posts
I'm mostly working with mpeg 2 encoding (SKVCD and KDVD) and want to keep the encodes interlaced. I've been reading a little about the fact that the fields should be filtered sepperately because of the way smoothing and denoising filters work. What parts of the optimal script would this effect, and what changes would need to be made.

I'm thinking that the fields have to be sepperated, filtered on their own, and then put back together...or maybe I'm way off.

If someone knows and give some examples that would be appreciated. I think most people here do mpeg1 so it hasn't come up for them.

Thanks for any feedback.
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
  #2  
09-15-2003, 04:43 AM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
try this:

Mpeg2Source("Your_D2V_Source_Here")
SeparateFields()
...
#the sharpen filters...
#the resize line...
#the filters lines...
...
Weave()
AddBorders(x,x,x,x) #or gripborders with MA script!

do a sample for test!
Reply With Quote
  #3  
09-15-2003, 08:41 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
I have found out yesterday a much better way to do this. The problem with Jorel solution is that fields are not aligned, one field is shifted up and the other down, so temporal filtering won't work right. What this funcition below does is put odd fields in the left side and even fields on the right side of each frame, apply filters and interlace fields back. It's a much better approach! A interlaced frame like this:

AAAAAAAAAAAAAA - Frame 1
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 2
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 3
BBBBBBBBBBBBBB

Becomes:

AAAAAAAAAAAAAABBBBBBBBBBBBBB - Frame 1
AAAAAAAAAAAAAABBBBBBBBBBBBBB - Frame 2
AAAAAAAAAAAAAABBBBBBBBBBBBBB - Frame 3

Then you apply the filters and get back to:

AAAAAAAAAAAAAA - Frame 1
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 2
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 3
BBBBBBBBBBBBBB

Check it out:

http://forum.doom9.org/showthread.php?threadid=59029

[]'s
VMesquita
Reply With Quote
  #4  
10-10-2003, 11:10 AM
GFR GFR is offline
Free Member
 
Join Date: May 2002
Posts: 438
Thanks: 0
Thanked 0 Times in 0 Posts
I thougth that this subject deserved a small summary so that people in this forum get the idea.

quoting "stickboy":
Quote:
Well, for purely temporal smoothers, there's nothing special you need to do for interlaced material. Scanline #n always gets smoothed against scanline #n from another frame, so you never smooth scanlines from one field against scanlines from another.

For purely spatial smoothers, you only need to call SeparateFields beforehand and Weave afterward, but that's it.

Spatial-temporal smoothers are the ones that are tricky.
And:
http://forum.doom9.org/showthread.ph...AND+interlaced

stickboy
Quote:
If you don't use SeparateFields, the spatial component to Convolution 3D will smooth scanlines from different fields together.

If you do use SeparateFields, the temporal component will smooth scanlines from different fields together.

Tooting my own horn, I recommend using UnfoldFieldsVertical/FoldFieldsVertical when using spatial-temporal smoothers on interlaced material:

Code:
UnfoldFieldsVertical(true)
Convolution3D(preset="movieHQ")
FoldFieldsVertical(true)
One drawback is that the lower border of the "top" field and the upper border of the "bottom" field will get "blended" by spatial smoothing but that shouldn't be noticeable.

vmesquita:
Quote:
This is what I use to do Convolution3D on interlaced material:

a=AVISource("1.avi")
a=a.Converttoyuy2()

a.SeparateFields()
even=SelectEven(a).Convolution3d(0, 10, 17, 10, 13, 2.8, 0)
odd=SelectOdd(a).Convolution3d(0, 10, 17, 10, 13, 2.8, 0)
a=Interleave(even,odd).weave()
return(a)
This doesn't work with Dust, for example, since you can't have two instances of Dust in the same script.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Smartphone / PDA Encoding scripts Blubear Avisynth Scripting 0 05-17-2006 11:40 AM
Encoding NTSC Interlaced Fullscreen Video? DanoSaurus Video Encoding and Conversion 17 01-15-2004 02:30 PM
Encoding: Choose MPEG-1 or MPEG-2 conversion? Hydeus Video Encoding and Conversion 11 12-27-2003 08:23 AM
TMPGENc: way of finding out if an mpeg or avi is interlaced? ftin Video Encoding and Conversion 1 07-16-2003 10:08 AM
Encoding Interlaced NTSC VOB files, what to do next? syk2c11 Video Encoding and Conversion 7 06-24-2002 08:16 PM

Thread Tools



 
All times are GMT -5. The time now is 05:23 AM  —  vBulletin © Jelsoft Enterprises Ltd