Log in

View Full Version : Deinterlace 25 FPS DVD to 23,976 FPS Progressive


masagrator
19th December 2018, 13:56
It's my first time with 25 FPS Interlaced video. I don't know how to take this.
Video players are deinterlacing it without issue, so it's not that video is screwed.

I tried QTGMC, TFM, yadifmod, DGSource. In every case is 25 FPS Progressive or 50 FPS Progressive, both are smoothing with interlace artifacts. :(

Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings : CustomMatrix / BVOP
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Format settings, picture structure : Frame
Codec ID : V_MPEG2
Codec ID/Info : MPEG 1 or 2 Video
Duration : 1 h 25 min
Bit rate mode : Constant
Bit rate : 7 000 kb/s
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Bottom Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.675
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
GOP, Open/Closed : Closed

StainlessS
19th December 2018, 18:41
I guess you could just (after Deinterlace)

Last=Deint.AssumeFPS(24000,1001,Sync_Audio=true) # play clip a bit slower, whilst keeping audio sync
Last=ReSampleAudio(Deint.AudioRate) # original sample rate
Return Last

But above will result in change in audio pitch, might wanna look up TimeStretch here on forum.
On Wiki:- http://avisynth.nl/index.php/TimeStretch

EDIT: Maybe see here:- https://forum.doom9.org/showthread.php?p=1810135#post1810135

Demo using Colorbars

Function TimeStretchTempo(clip InC,Float OutNum,Float "OutDen") {
# http://forum.doom9.org/showthread.ph...35#post1810135
# Returns Timestretch() Tempo arg, to change playback tempo when changing VideoFramerate, without changing pitch:
Num = InC.FrameRateNumerator
Den = InC.FrameRateDenominator
OutDen = Default(OutDen,1.0).Float
Assert(0.0<OutNum,String(OutNum,"TempoAsPercent: 0.0 < OutNum(%f)"))
Assert(0.0<OutDen,String(OutDen,"TempoAsPercent: 0.0 < OutDen(%f)"))
Return 100.0 * OutNum * Den / (OutDen * Num) # All are Coerced to Float (v2.58 Incl)
}


InC=ColorBars
IFPS=25.0
InC=InC.AssumeFPS(IFPS) # Input simulated FPS : Audio No Change
InC=InC.Trim(0,-(25*60)) # EDIT: Added, make 25 FPS 60 second clip (25*60 frames)

ONUM=24000 # More Accurate than 23.976
ODEN=1001 # Ditto

Tempo=InC.TimeStretchTempo(ONUM,ODEN) # Calc Required Tempo keeping same pitch as InC

OutAudio=InC.TimeStretch(tempo=Tempo).ResampleAudio(InC.AudioRate) # Stretch and back to Original SampleRate
# SSRC() can fail with some ratios,
# ResampleAudio() almost no different to SSRC() for some years.

OutC=InC.AssumeFPS(ONUM,ODEN,Sync_Audio=False) # Output Video rate leaving Audio as was

Last=OutC.AudioDub(Outaudio) # Result Explicit assign to Last (no reason)

#RT_Subtitle("InFPS=%f : OutFPS=%f : Tempo=%f%%",InC.FrameRate,FrameRate,Tempo)
Subtitle(String(InC.FrameRate,"InFPS=%.3f") + String(FrameRate," : OutFPS=%.3f") + String(Tempo," : Tempo=%f%%"))


EDIT: Removed RT_Subtitle requirement.

EDIT: NOTE, both clip and audio will change length (due to lower FPS) showing ~62.56 seconds.

EDIT: An alternative is to miss out a frame every second or so, but that would produce a jerk every second,
or interpolate to lower framerate which will likely look somewhat worse than original.

kuchikirukia
19th December 2018, 20:57
It's my first time with 25 FPS Interlaced video. I don't know how to take this.
Video players are deinterlacing it without issue, so it's not that video is screwed.

I tried QTGMC, TFM, yadifmod, DGSource. In every case is 25 FPS Progressive or 50 FPS Progressive, both are smoothing with interlace artifacts. :(


What do you mean, "interlace artifacts"?

StainlessS
19th December 2018, 21:30
Thanks kuchikirukia, guess I was focused on the 25->23.976 rather than the deinterlace thing.

I note that MediaInfo says Bottom Field First (nearly every PAL DVD I've played with was Top field First).
Perhaps needs Clip=Clip.AssumeBFF() prior to Deinterlace. [or set whatever deinterlacer option is to choose BFF field order]
EDIT: Can never remember what the default field order is.
You can check for field order with

AssumeBFF
#AssumeTFF
SeparateFields

Resize in Vdub2 to about correct size and look for backwards forwards jumping, if so then try the alternate field order.
When true field order ascertained, remove the SeperateFields, and keep the correct field order for deinterlace.

LemMotlow
20th December 2018, 00:51
EDIT: Can never remember what the default field order is.

Default is BFF.

What do you mean, "interlace artifacts"?

Same question. How can you have interlace artifacts after deinterlacing?
And why does the frame rate have to be 23.976? Is this a film-based movie?

I think we need a sample of this video.

manono
20th December 2018, 03:54
I think we need a sample of this video.

No one should have to guess. Nor should we even have to ask for a sample from the source. 10 seconds of steady motion will be plenty.

masagrator
22nd December 2018, 11:39
Ok, sorry for delay.

Here is the sample of file.
https://drive.google.com/file/d/14sMd9j2oCJ-viMilueSTdFblxB4JTSIk/view?usp=sharing

It's an anime which is always in 23.976 (with few old exceptions). That's why it should be 25->23.976.

manono
22nd December 2018, 21:36
10 seconds of steady motion will be plenty.

Flapping lips are not 'steady motion'. And not an MKV. Demux the M2V from the VOB using DGIndex.

Edit: However, there's probably enough there to tell what's going on. It's standard field-blended garbage:

Yadif(Mode=1)## or the better bobber of your choice
SRestore()

Katie Boundary
23rd December 2018, 00:42
It's an anime which is always in 23.976 (with few old exceptions).

Then I can virtually guarantee that something went horribly wrong during the original NTSC -> PAL conversion and your DVD footage itself is fuxx0red.