Log in

View Full Version : Artefacts when converting HD to SD.


spyros78
15th August 2008, 15:07
Hi all,

I am trying to convert some M2T (MPEG2, Resolution 1440x1080, 16:9 @ 25.00fps) files to SD. I am then planning to copy the converted SD content on DigiBeta tape. The original video is interlaced and I want to retain interlacing.

I am currently using the below script:

LoadPlugin("C:\Program Files\DGIndex\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\yadifmod\YadifMod.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MPASource\MPASource.dll")

Video=MPEG2Source("D:\M2T\Video1.d2v")
Audio=MPASource("D:\M2T\Video1 DELAY -264ms.mp2")
Audio = Normalize(audio, 0.95)
AudioDub(video,audio)
converttoyuy2(interlaced=true)

Bicubicresize(720, Last.Height)
# Modified version of Yadif. Using edge-directed interpolation, checking previous, current and next frames to
# recreate missed field. Mode = 1: double framerate (bob), temporal and spatial interlacing check.
YadifMod(Mode = 1, EDeint = Bob(0, 1))
BicubicResize(Last.Width, 576)
SeparateFields()
SelectEvery(4, 0, 3)
Weave()

I noticed a strange artefact when panning which can mainly be seen on red objects. It looks something between interlacing, color-bleed and ghosting.

I also checked this thread as well: http://forum.doom9.org/showthread.php?t=139102 but my case is slightly different and I am not that advanced with AviSynth. I am suspecting the problem might be at converttoyuy2?

Could you please help me out? Please check a Screengrab though it does look a bit different with motion and in an interlaced monitor.

Thanks in advance.

Adub
15th August 2008, 16:33
The problem is you are resizing before you are deinterlacing. It is never good to resize interlaced content.

Also, why the Separatefields() after yadif? If you want progressive material, just use yadif, and then resize.

thetoof
15th August 2008, 16:46
A small RAW video sample would help us help you...

and about the resize, he's doing the horizontal before deinterlacing and vertical after, which is... acceptable (I prefer doing all the resize in one step, but heh)

florinandrei
15th August 2008, 17:38
Read this thread:

http://forum.doom9.org/showthread.php?t=139102

Gavino
15th August 2008, 17:59
@spyros78:
Are you sure the field order is correct - your script assumes TFF. Try changing the SelectEvery to (4,1,2).
Also, I don't know why you say the other thread is not applicable - it seems to be exactly what you want.

@Merlin7777:
He doesn't want progressive output, he wants interlaced SD, so needs to re-interlace after resize.

scharfis_brain
15th August 2008, 18:28
@thetoof:
and about the resize, he's doing the horizontal before deinterlacing and vertical after, which is... acceptable (I prefer doing all the resize in one step, but heh)
Some time ago I suggested this two step resize.
It doesn't show a visual difference to a single step resize after deinterlacing, but it offers a immense speedup of the operation, cause the pixel count is reduced by 2.5 times.

Adub
15th August 2008, 19:28
Wait, then can some one explain to me why he is even deinterlacing in the first place? Is it to resize?

thetoof
15th August 2008, 19:39
Well... seems like it! He wants to convert HD to SD :p

scharfis_brain
15th August 2008, 19:47
if you want to do a proper vertical resize of interlaced video your need to bob-deinterlace it with a good deinterlacer before you do the (vertical) resize.
afterwards you'll re-interlace the video back.

Alex_ander
15th August 2008, 19:54
He resizes on interlaced horizontally, but I'm not 100% sure a bi-directional resizer doesn't have any bi-directional control over image contours integrity (using pixel positions in adjacent lines). Is it absolutely safe with bicubic?

scharfis_brain
15th August 2008, 19:57
it is absolutely safe with any resizer in AVISynth, because every resizer in avisynth internally has two separate resizers for vertical and horizontal proportions.
if if one of the dimensions is not altered, avisynth internally will disable the corresponding resizer.
so by only resizing horizontally you'll gain speed and also don't touch the line structure.

halsboss
15th August 2008, 23:24
@thetoof:

Some time ago I suggested this two step resize.
It doesn't show a visual difference to a single step resize after deinterlacing, but it offers a immense speedup of the operation, cause the pixel count is reduced by 2.5 times.

I have tested this and it produces a significant speedup. Some sort-of related deinterlacing method timings (including this method) : http://forum.doom9.org/showthread.php?p=1170623#post1170623

spyros78
18th August 2008, 10:19
A small RAW video sample would help us help you...

The artifact can only be seen on an interlaced monitor! I cannot see any problem on a computer monitor unfortunatelly. It looks like diagonall moving lines. It can be seen on red, vertical objects while panning. I initially thought the problem was some sort of upsampling like suggested here: http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html - My artifact looks exactly like this - but I now suspect that the artifact might be there on the original. Unfortunately there is no way for me to check. I was given the captured content.

@scharfis_brain
Could you please direct me to your two-step resize explanation? I want to understand more about it.

@Gavino
I have re-read it and did find it usefull so sorry for the 'double-post'

@Merlin7777
Indeed I deinterlace for the resize.

Many thanks for your time all!
sp.