Page 1 of 1

seeking advice with pulldown and deinterlace

Posted: Fri May 07, 2021 8:43 am
by hydra3333
Hello.

I'm in PAL world, and never see Pulldown.
Unfortunately for once, I am.

I need to deinterlace/transcode a DVD purchased as present, to Progressive mpeg4 for display by non-DVD devices.
Unfortunately I had to resort to VLC to get the intermediate .mpg files and mediainfo thinks they're progressive (they look like interlaced TFF so I'm going to try with that as the progressive conversions have what I think is probably "combing").
DIndexNV says Film 99% for one mpg and Film 100% for the rest.

When using a .vpy script along these lines, to try to create a 29.976 progressive video so the audio stays in sync,

Code: Select all

import vapoursynth as vs		# this allows use of constants eg vs.YUV420P8
from vapoursynth import core	# actual vapoursynth core
#import functool
#import mvsfunc as mvs			# this relies on the .py residing at the VS folder root level - see run_vsrepo.bat
#import havsfunc as haf		# this relies on the .py residing at the VS folder root level - see run_vsrepo.bat
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth-x64\DGIndex\DGDecodeNV.dll') # do it like gonca https://forum.doom9.org/showthread.php?p=1877765#post1877765
core.avs.LoadPlugin(r'C:\SOFTWARE\Vapoursynth-x64\DGIndex\DGDecodeNV.dll') # do it like gonca https://forum.doom9.org/showthread.php?p=1877765#post1877765
# NOTE: deinterlace=1, use_top_field=True for "Interlaced"/"TFF"
video = core.dgdecodenv.DGSource(r'D:\VRDTVSP-SCRATCH\file.dgi', deinterlace=1, use_top_field=True, use_pf=False)
# DGDecNV changes -
# 2020.10.21 Added new parameters cstrength and cblend to independently control the chroma denoising.
# 2020.11.07 Revised DGDenoise parameters. The 'chroma' option is removed.
#            Now, if 'strength' is set to 0.0 then luma denoising is disabled,
#            and if cstrength is set to 0.0 then chroma denoising is disabled.
#            'cstrength' is now defaulted to 0.0, and 'searchw' is defaulted to 9.
# example: video = core.avs.DGDenoise(video, strength=0.06, cstrength=0.06) # replaced chroma=True
video = core.avs.DGDenoise(video, strength=0.06, cstrength=0.06) # replaced chroma=True
# example: video = core.avs.DGSharpen(video, strength=0.3)
video = core.avs.DGSharpen(video, strength=0.3)
#video = vs.core.text.ClipInfo(video)
video.set_output()
I receive an error message

Code: Select all

[vapoursynth @ 0000028fd7891680] Failed to parse script: Python exception: DGSource: No deinterlacing with pulldown.
So I look in Virtualdub and every 5th frame "pauses" which I guess means the .mpg pulled down.

The DGSource manual says:
Also note that setting deinterlace to 1 or 2 forces the field operation to be "Ignore Pulldown", regardless of the project setting.
So, any advice please, on how to use DGSource to deinterlace and also honour the "pulldown" ?

edit: I process audio separately and need to keep that and the video in sync when I combine them ;)

seeking advice with pulldown and deinterlace

Posted: Fri May 07, 2021 9:25 am
by hydra3333
Oh. I seem to have lucked out with at least one file by using the below..

Code: Select all

video = core.dgdecodenv.DGSource(r'D:\VRDTVSP-SCRATCH\file.dgi', fieldop=1) # force film
video = core.avs.PVBob(video,order=1,mode=0) # single framerate deinterlacing) # after force film
The audio seems to stay in sync, even.
I'll try the rest.

seeking advice with pulldown and deinterlace

Posted: Fri May 07, 2021 11:00 am
by Rocky
Theoretically you should get progressive video out of force film mode. There may be a few residual combed frames but PVBob is overkill for it (that deinterlaces all frames, not just the residual combed frames). Consider DGTelecide/DGDecimate with postprocessing enabled (mode 1), and use honor pulldown instead of force film for DGSource().

If you are looking for a vapoursynth flow, use avs compatibility mode for DGTelecide/DGDecimate.

You should shoot for 23.976 fps, not 29.97. After DGTelecide you will have 29.97 but with a duplicate frame every 5 frames. DGDecimate removes the duplicates.

Can you post a representative source sample? Without that, it's guesswork on my part and I don't like playing guessing games.

seeking advice with pulldown and deinterlace

Posted: Sat May 08, 2021 4:27 pm
by hydra3333
Thank you ! That helps a lot.
It ended up being "close enough", so I'll give your suggestions a whirl on the next one I come across.

seeking advice with pulldown and deinterlace

Posted: Sat May 08, 2021 4:49 pm
by Guest
@hydra3333
If you wish I can post my template (vpy) for DVD