Hi I have a DVD which i want to deinterlace correctly as possible and convert the 25FPS to the original FPS. I also like to fix the aspect ratio as DVD is in 4x3 and image is stretched. Also like to to improve on the picture quality.
Can anyone please take a look and help. I've started a script but I need help on it as im still learning the basics in avisynth. There is a duplicate frame every 22nd frame.
here is my script so far:
here is the DVD source:https://www.swisstransfer.com/d/4c7a532c-8476-493e-adb4-aa24b0870549Code:a = LWlibavAudioSource("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v = Mpeg2Source("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) TFM() TDecimate(cycle=22, cycleR=1) ColorMatrix(mode="rec.601->rec.709") Crop(10, 0, -8, -0, align=false) Spline36Resize(720, 282)
+ Reply to Thread
Results 1 to 30 of 41
-
-
i would use something like:
for the resize, one of these input PARs might be correctCode:TFM() TDecimate(mode=7, rate=23.976) Crop(10, 2, -8, -0, align=false) ContinuityFixer(bottom=3, radius=2) Spline36Resize(704, 262)
- 2.00:1 (RKO Superscope / Univisium) => 704x288 (when converting to 1:1 PAR), or
- 2.20:1 (70mm print) => 704x262 (when converting to 1:1 PAR)
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
I opened the VOB with LWLibavVideoSource and LWLibavVideoSource.
There seems to be only three patches of interlacing at approx 5sec, 23sec and 50sec.
I did a straight TFM on it and found only one duplicate, at frame 1194.
TFM gave a frame rate of 25fps, so I just applied AssumeFPS(24, true). "True" allegedly keeps the audio in sync (which appears to be out by 5 frames [audio delayed] in the source VOB).
Re colours, my understanding is that 709 is only for frame heights of 720 or more ie HD.
It looks closest to 2.2:1 to me, or maybe a bit wider; 2.39:1 looks OK too. -
The source is basically progressive PsF which occasionally changes to phase switched video, e.g. from field #1132 to #1154 and #2390 to #2434, from where onwards it reverts to normal PsF again. Correcting this using TFM() returns duplicate frames #565,566 and #1194,1195 respectively.
It seems not to follow a standard Telecine/pulldown pattern.....
Edit:
This seems to work, returning progressive 24fps:
Code:LWLibavVideoSource("VTS_01_1.VOB") TFM().TDecimate(cycle=25)Last edited by Sharc; 14th Mar 2026 at 06:18.
-
In case of dynamic phase shift, telecide works as well (did not try on the sample posted):
source: Exotic Interlacing by scharfis_brainCode:Telecide(order=1, guide=2, post=0)
-
Yep. Good ole' Telecide works perfectly on this source as well.
Edit: named argument 'order' changed to 'back' in version 5.3.0, so
https://www.rationalqm.us/decomb/decombnew.htmlCode:telecide(back=1,guide=2,post=0).Decimate(cycle=25)
Last edited by Sharc; 14th Mar 2026 at 07:35.
-
My speculation about the aspect ratio:
Assuming the original was released as 16:9 PAL SVCD its PAR (PixelAspectRatio) would be 59/27. Converting the cropped 704x576 .vob to square pixels would make it 704x264 => DAR=2.67.
Frames around #1450 show a football in the top right corner which looks pretty circular with this assumption (Cinerama and Cinemascope movies were up to 2.66:1 btw.).
[Attachment 91508 - Click to enlarge]Last edited by Sharc; 14th Mar 2026 at 09:58.
-
Thank you everyone for your help.
@Sharc, So i have changed to 704x264 as suggested. Below is a frame from same DVD of the moon in the sky with 704x264. Would you say it looks okay?
[Attachment 91509 - Click to enlarge] -
^^^^ The moon looks horizontally stretched. What would the DAR become if you resize it to circular shape?
Do you watch the 704x264 in square pixels (using Vdub for example), or does the player stretch it anamorphic acc. DVD PAR 16/15?Last edited by Sharc; 14th Mar 2026 at 10:58.
-
Assuming that moon is round, it's 2.39:1.
2.2:1
[Attachment 91512 - Click to enlarge]
2.39:1
[Attachment 91513 - Click to enlarge]
2.55:1
[Attachment 91514 - Click to enlarge]
2.66:1
[Attachment 91515 - Click to enlarge]
How about the colour space? -
It also needs denoising; a light touch of Temporaldegrain2 and possibly then a bit of sharpening would smarten it up a bit.
-
I've used SMDegrain & LSFmod()
here is updated script:
please let me know if anything needs changing to improve it. many thnanks.Code:a = LWlibavAudioSource("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v = Mpeg2Source("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) telecide(back=1,guide=2,post=0) Decimate(cycle=25) ColorMatrix(mode="rec.601->rec.709") Crop(10, 2, -8, -0, align=false) Spline36Resize(704, 294) SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true) LSFmod() -
Your 2.39:1 (704x294) looks ~ok based on that moon (although a moon near the horizon may look slightly vertically squashed ....) We will not know exactly because we don't know the format (crop, resize) history of that DVD. Some guesswork remains. Anyway you know how to apply the circle test and draw your conclusions.
Why change the colormatrix? You can leave this away, it should stay at 601.
Denoising and sharpening is a matter of personal preference, so it's up to you what looks best to you, on your playback scenario. Your choice is fine I think.Last edited by Sharc; 14th Mar 2026 at 12:24.
-
Thanks Sharc.
I've done a export using my script and there seems to be some frame blending issue ( interlace maybe) not sure what it is.
Here is a screenshot:
[Attachment 91518 - Click to enlarge]
Here is short sample of script export file too:
https://www.swisstransfer.com/d/c2093a4f-fc2c-4ace-abf2-252c98d48f0f
Can this be fixed ? -
Upload the section of the original source so someone may take a look. Your encoded .mp4 file doesn't tell much.
-
Also I noticed another issue with my script, it seems frames are being removed. see video:
https://www.swisstransfer.com/d/914d02d9-6d31-436a-a11b-a646d0a802e8
between frame 140 and 141, don't look smooth. what could be the issue anyone have any idea ?
this is my script:
This is original DVD source for that part of scene if it helps anyone:Code:a = LWlibavAudioSource("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v = Mpeg2Source("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) telecide(back=1,guide=2,post=0) Decimate(cycle=25) Crop(10, 2, -8, -0, align=false) Spline36Resize(704, 294) SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true) LSFmod()
https://www.swisstransfer.com/d/43de94b4-a583-4453-a706-d7ba93370878 -
Try something like
or change the orderCode:LWLibavVideoSource("VTS_01_1.VOB") assumeTFF() bob().srestore(frate=25) #removes the ghosts Telecide(back=1,guide=2,post=0).Decimate(cycle=25)
Code:LWLibavVideoSource("VTS_01_1.VOB") assumeTFF() Telecide(back=1,guide=2,post=0).Decimate(cycle=25) bob().srestore(frate=24) #removes the ghostsLast edited by Sharc; 14th Mar 2026 at 17:58.
-
-
Your "DVD" source has several issues:
- Non-compliant Pixel Aspect Ratios for DVD. Therefore some guesswork is needed to resize and play the movie at its intended aspect ratio.
- The film is encoded PsF but has occasional field drops/inserts which makes it switch between PsF and field-shifted video by toggling the field dominance. Or broken Euro-pulldown, perhaps. Maybe due to a capture or edit issue. Applying TFM or Telecide to regroup the fields may eventually introduce dropped or duplicatied frames.
- Dropped frames/fields would have to be substituted by synthesized fields/frames from adjacent frames/fields. Requires manual work, or maybe try Selur's 'ContinuityFixer' of post#2 (I don't know it).
- The framrate conversion (from film to 25fps video) created blended fields (ghosts) - which can be mostly fixed with sRestore, as suggested
Is your source an original commercial DVD or some processed stuff? I would live with what you have got so far to mitigate the defects. And revisit your former threads where you already got help for similar issues, AFAIK.Last edited by Sharc; 15th Mar 2026 at 07:54.
-
Hi Sharc, yeah my DVD is an original commercial release by a UK Label and its very common in these old kung fu films to be transferred incorrectly as you see here.
I've tried Selur's 'ContinuityFixer' and that was also eating up good frames too. I've tried other methods yesterday from reading up on google but no luck. From what i read it seems you cant use both srestore and Decimate as both remove frames. -
ContinuityFixer does not eat frames,... it's one of the modes of EdgeFixer which I only there to 'fix' the flickering bottom edge,....
users currently on my ignore list: deadrats, Stears555, marcorocchini -
- users currently on my ignore list: deadrats, Stears555, marcorocchini
-
-
update: Everything I tried here was eating up good frames so I went with a different option and kept all frames from the original source and slowed movie to 23.976 fps.
I used this script:
It removes ghosting from some scenes but not all of them.Code:v = Mpeg2Source("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1.d2v", Info=3) # get video a = LWlibavAudioSource("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) AudioDub(v, a) Crop(10, 2, -8, -0, align=false) ContinuityFixer(bottom=3, radius=2) assumeTFF() TFM(order=1) QTGMC(Preset="Slower", InputType=1, TR2=0, EzDenoise=0, SubPel=1, NoiseProcess=2, GrainRestore=0.4) DeHalo_alpha(rx=1.5, ry=1.5, darkstr=1.0, brightstr=1.0) LSFmod(defaults="slow", strength=60, overshoot=1, soft=20) AssumeFPS(24000, 1001, sync_audio=true) Spline36Resize(704, 284) TimeStretch(pitch=100.0 * 25.0 / 23.976)
this script by Sharc using SRestore, fixed ghosting but issue with good frames being removed:
Is there a way I can use Sharc's script using SRestore and have the video slowed down like I have and keep all frames without any good frames being eaten up ?Code:a = LWlibavAudioSource("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") # get audio (decompressed to PCM) v = Mpeg2Source("G:\future projects\Dance of the Drunken Mantis proejct\Demux files\VTS_01_1.d2v", Info=3) # get video AudioDub(v,a) assumeTFF() bob().srestore(frate=25) #removes the ghosts Telecide(back=1,guide=2,post=0).Decimate(cycle=25) Crop(10, 2, -8, -0, align=false) Spline36Resize(704, 294) -
It is basically a progressive video. I would forget trying to deal with it at a field level and instead would simply run this old script of mine:
Automatically fix dups followed (eventually) by drops -
I agree (missed that the source was not interlaced before).
users currently on my ignore list: deadrats, Stears555, marcorocchini
Similar Threads
-
Handling Aspect Ratio when going from DVD sources to NLE?
By GMaq in forum EditingReplies: 16Last Post: 3rd Jan 2025, 15:34 -
How to fix DVD aspect ratio please?
By BrownMan in forum Newbie / General discussionsReplies: 12Last Post: 24th Aug 2024, 13:45 -
Fixing interlacing(?) in Youtube video
By corecore in forum Newbie / General discussionsReplies: 0Last Post: 6th Jul 2024, 22:32 -
Converting DVD: Aspect Ratio Error
By SomeoneNeutral in forum Newbie / General discussionsReplies: 3Last Post: 13th Feb 2023, 00:13 -
Aspect ratio and video picture size issue DVD
By njemje in forum Newbie / General discussionsReplies: 37Last Post: 9th Jan 2023, 04:13


Quote
