Log in

View Full Version : Having Trouble Deinterlacing PAL


rhayman
25th October 2003, 00:38
I am trying to put some PAL (25fps) playstation2 FMV's onto dvd.
The files i am trying to encode seem to be heavily interlaced and i have tried the following deinterlace filters:

(I have tried searching the forum and have looked at many posts but none seem to have helped, im not very good at this stuff so ive probably done something stupid :( )

KernalDeint140.dll
#SCRIPT
KernelDeint(Order=0,sharp=true)

#Using the kernalDeint Documentation i added the line
"AssumeTFF().SeparateFields()" and the motion was jumping back and forth, the documentation said if this is the case, the motion is incorrect and my field order is bottom.

PFR.dll
#Script
PFR(Pthresh=50)
#This seemed to work the best but still didnt make much difference)

TomsMoComp
#Script
TomsMoComp(1,5,1)

I have made screenshots of 12 frames, 2 seem to fine and 3 are heavily interlaced and then 2 are fine etc

http://www.rhayman.netfirms.com/index.htm
(Quite a large page, may take time to load)


I would be very gratefull if anyone could help and i am very sorry if this question has been asked before, i did search but nothing seemed to help me (i couldent understand half the posts either :) )

bb
25th October 2003, 09:09
I don't see any interlacing artefacts in your frames. There are a lot of blended frames, though, like you see them often in anime. The blending is in the video - you can do nothing about it.

bb

scharfis_brain
25th October 2003, 11:23
@bb: i assume, that those frames has been resized, thus the interlacing has been replaced with blending....:(

@rayman: please try out
telecide with your clip.


or do a DGbob
and then count how many frames (out of 100) are dupes with dgbob applied.
then you could use decimate to get rid of the dupes.

rhayman
26th October 2003, 03:58
Originally posted by scharfis_brain
@bb: i assume, that those frames has been resized, thus the interlacing has been replaced with blending....:(

@rayman: please try out
telecide with your clip.


or do a DGbob
and then count how many frames (out of 100) are dupes with dgbob applied.
then you could use decimate to get rid of the dupes.

Could you supply more information on how to do this please?

joshyg2
26th October 2003, 14:34
PlayStation 2 FMVs?

Have these FMVs been ripped via a analog capture card?

If so, then interlacing is perfectly normal because the video was ment to be run at 50 fps on your television.

What is your output format going to be? (eg. VCD, SVCD, DivX)

If your output is SVCD, then I would recommend you encode the video as a Interlaced file, this would keep the video smooth and fluid.

If your output is VCD, then just resize the video to 352x288 and then encode. This will keep the video fluid as possible via VCD.

If your output is High Res DivX, then you will need to de-interlace, and since your source is Pure-Interlaced Video (not tecelined video) I would use the following:

LoadPlugin("C:\Program Files\DVD2SVCD\Avisynth2 Plugins\InverseTelecine\decomb.dll")
FieldDeinterlace(full=true,dthreshold=0)

then resize, encode etc.

rhayman
26th October 2003, 17:43
The Source is PAL MPEG2 Files @ 25fps taken from the game dvd.

The source has black borders around it and is very close to widecreen when cropped so i use the following script:

LoadPlugin("mpeg2dec3.dll")
mpeg2source("C:\test.d2v")
crop(32,32,640,416)
LanczosResize(620,576)
AddBorders(50,0,50,0)
ConvertToYUY2()

I am encoding to pal dvd.

Beastie Boy
27th October 2003, 01:42
I'm guessing that the source video is not PAL MPEG2 but is NTSC telecined, left on the disc when the game has been converted from an American original. The Playstation is simply playing the NTSC video and outputting a signal compatible with PAL TV's.

Have you tried what scharfis_brain suggested?

Cheers, Beastie.

rhayman
27th October 2003, 03:47
no but i want to, i dont know how to do it, any help would be appreciated

joshyg2
27th October 2003, 09:27
rhayman you stated in your script:

crop(32,32,640,416)

I dont understand why you used these values, if this line is correct that means your source video resolution is 672 x 448. It also means that your are not croping for wide screen, you are cropping from the left and bottom.

???

if your source was PAL MPEG2 your source should be something like 720 x 576, thus your crop line should be:

crop(0,32,720,512)

and your resize should be:

LanczosResize(720,476)

and your add borders should be:

AddBorders(0,50,0,50)

not . . . . AddBorders(50,0,50,0)

P.S could you please post more information of the source video, it would also help if you make as script like:

LoadPlugin("mpeg2dec3.dll")
mpeg2source("C:\test.d2v")

and load it into Virtual Dub, then click video > copy source frame to clipboard, then paste it into paint or something and save it as a JPEG - WITHOUT RESIZING OR TWEAKING. Then upload it and then post the link, so we can see what the source looks like.

scharfis_brain
27th October 2003, 12:19
rhayman, could you provide a sample clip of your video?

we could help you MUCH better with a sample clip, since there are several methods to get the video deinterlaced.
(fieldmatching, decimating, restore24, bobbing etc.)

scharfis_brain
28th October 2003, 01:31
I think, this script should work for you:
loadplugin("c:\dvdrip'in\mpeg2dec3.dll")
loadplugin("c:\dvdrip'in\dgbob.dll")
mpeg2source("Zanrkand.d2v").converttoyuy2()
crop(0,60,0,-60)
dgbob(order=0,ap=true)
convertfps(50)
lanczosresize(704,576)
separatefields()
selectevery(4,0,3)
weave()

it converts 60 fields/sec to 50 fields/sec.
also it makes a widescreen-output. but IMO a 4:3 (Fullscreen)-conversion would be much better.

scharfis_brain
28th October 2003, 01:40
ah, and I forgot to say:
You have to encode INTERLACED (this is IMPORTANT!)

rhayman
28th October 2003, 01:46
That didnt work :(

I couldent see a difference.

When i go to file information in vdub it still says its 25fps, is it supposed to say that?

One more thing i usually encode to 720x576, your script give me 704x576, is it better to use 704x576?

rhayman
28th October 2003, 01:46
Originally posted by scharfis_brain
ah, and I forgot to say:
You have to encode INTERLACED (this is IMPORTANT!)

Is this something i add to the script or an option im supposed to use in CCE?


EDIT: Thankyou, it plays fine on my tv now, i had to ecnode as progressive and upper field first for it to play properly though.

thanks again :)

joshyg2
28th October 2003, 04:59
yeah, its supposed to say 25 fps.

And you souldnt encode as progressive, if the source is Interlaced. Anyhow the field setting would have mattered if you where encoding as progressive.

Encode as Interlaced, with the field setting set to: Automatic

meaning your CCE settings should be:

linear quantizer scale: off
zigzag scanning order: off
dvd compliant: on
proggressive frames: off

intra dc: 10
close all GOPs: on

color conversion: no color conversion

joshyg2
28th October 2003, 05:06
hang on,

scharfis_brain if the original source is running at 25fps (refer to original thread), then isnt the FMV already running at 50 fields/s. ?

Mug Funky
28th October 2003, 09:36
get the decomb package if you don't have it already, then install it. it contains telecide and decimate, which is all you appear to need.

then do this:

mpeg2source("blah.d2v").converttoyuy2(interlaced=true)

telecide() # this will match telecined fields together into progressive frames

decimate(6) # the value 6 instead of 5 will output 25 frames rather than 24 per second, meaning 1 dup is left behind every second

you'll get one jerk per second, but this wont matter too much so long as your source isn't mixed interlaced and film.

hopefully after this you'll be able to encode in progressive without fear of horrible horrible artefacts.

rhayman
28th October 2003, 15:15
your right, i done some more tests and i do seem to get a lot of artifacts :(

The source material is 25FPS

when i tried
telecide(order=0)
decimate(6)

i got a framerate of 20.3 fps

i need it to be the same as the source :(

can anyone supply more info please

scharfis_brain
28th October 2003, 15:35
oh ****!

I saw 720x480 and assumed 29,97 fps!

who in hell encodes 25fps in NTSC-resolution????????

IMO leave your video interlaced. because deinterlacing reduces quality a LOT (fine horiz. lines) and fieldmatching won't work because it is hybrid content with a lot of different framrates.

the only thing you can do is, to resize it to correct PAL-res.:
mpeg2source("Zanrkand.d2v")
crop(0,60,0,-60)
separatefields()
lanczosresize(704,288)
weave()

joshyg2
28th October 2003, 16:02
i still think you sould encode the video as full 4:3. without cropping.

LoadPlugin("mpeg2dec3.dll")
mpeg2source("C:\test.d2v")
separatefields()
LanczosResize(720,288)
weave()

the video in Virtual Dub, will have interlaced artifacts and combing but thats normal.

just encode as interlaced.

P.S if you have a widescreen television, just use the zoom feature, because if you crop and squash the picture you will be displaying the FMV in the wrong aspect ratio.

scharfis_brain
28th October 2003, 16:19
I've forgot to say: my script is for anamorphic 16:9 interlaced encode.

rhayman
28th October 2003, 19:00
Originally posted by joshyg2
i still think you sould encode the video as full 4:3. without cropping.

LoadPlugin("mpeg2dec3.dll")
mpeg2source("C:\test.d2v")
separatefields()
LanczosResize(720,288)
weave()

the video in Virtual Dub, will have interlaced artifacts and combing but thats normal.

just encode as interlaced.

P.S if you have a widescreen television, just use the zoom feature, because if you crop and squash the picture you will be displaying the FMV in the wrong aspect ratio.

The source video has black borders on it, thats the reason for cropping, and when its cropped it a lot closer to widescreen that 4:3 :)

rhayman
28th October 2003, 19:04
Originally posted by scharfis_brain
oh ****!

I saw 720x480 and assumed 29,97 fps!

who in hell encodes 25fps in NTSC-resolution????????

IMO leave your video interlaced. because deinterlacing reduces quality a LOT (fine horiz. lines) and fieldmatching won't work because it is hybrid content with a lot of different framrates.

the only thing you can do is, to resize it to correct PAL-res.:
mpeg2source("Zanrkand.d2v")
crop(0,60,0,-60)
separatefields()
lanczosresize(704,288)
weave()

So How do i encode this, do i use the scipt below and just encode in cce with no filters checked:
mpeg2source("G:\FFX SEQUNCES\D2V\Zanarkand.d2v").converttoyuy2(Interlaced=true)
crop(0,60,0,-60)
separatefields()
lanczosresize(704,288)
weave()

Or do i remove (Interlaced=true) and check an option in CCE?

joshyg2
29th October 2003, 14:48
remove (Interlaced=true) and uncheck proggressive frames in CCE

rhayman
29th October 2003, 17:16
I tried that and when i open the resulting mpg file in dvd2avi it said the frames are progressive and not interlaced

scharfis_brain
30th October 2003, 02:04
Originally posted by rhayman
I tried that and when i open the resulting mpg file in dvd2avi it said the frames are progressive and not interlaced

I saw this issue, when analzsing your sample! The chroma-information was blurred out on every other field....

but the video content IS INTERLACED, so your reencode has to be INTERLACED.

joshyg2
30th October 2003, 03:58
dont use DVD2AVI to analyse your video.

nothing works better than the human eye, just load the clip into virtual dub, and look for combing artifacts, if there is combing then the video is Interlaced, dosnt matter what other programs say.

rhayman
30th October 2003, 20:07
thankyou for all the help, i finally got it sorted, the playback was jumpy on my tv but i fixed it by checking upper field first in cce.

Thankyou:)

bb
3rd November 2003, 18:27
You could add a "DoubleWeave.SelectOdd()" at the end of your script instead of using CCE's "Upper field first" flag. This avoids the lineshift, and in my opinion it's a better way to correct the field order.

bb