Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd May 2020, 14:26   #1  |  Link
Treaties Of Warp
Registered User
 
Join Date: Apr 2019
Posts: 14
MKVToolNix seems to "auto" decimate soft-telecined DVD source?

I couldn't find any info about this using Google, etc.

I have a source NTSC DVD title that is soft telecined. The frames go P P P I I P P P I I P P P I I etc. (29.97 fps).

If I just use MKVToolNix to mux the ripped DVD title to MKV, regardless what I put for frame rate (leave blank, 29.970, 23.976), the resulting MKV file is "seen" by FFmpeg and FFmpegSource2 as only having the progressive frames. So for example if I run the "slow & accurate" frame count command (ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 input.mkv), it counts only progressive frames. If I copy all frames (ffmpeg -r 1 -i "input.mkv" -r 1 frame%06d.png), only the progressive frames get extracted.

However, the exact same MKV file is "seen" by LivavVideoSource as having the interlaced frames included, just like the source DVD. (FFMpeg and FFmpegSource2 also "see" both the interlaced and progressive frames on the source .VOB files or the a mux of them to mpg.)

So, is this the correct behavior? It's as if some kind of decimating metadata is being written to the MKV file that flags the interlaced frames or something.

I'm mainly wondering how the interlaced frames are getting flagged or detected in terms of accuracy. I get a slightly different total frame count if I decimate the VOB or MPG using TIVTC. It's only off by about a second or two. So I wonder if the MKVToolNix result is better or more accurate than the TIVTC result.
Treaties Of Warp is offline   Reply With Quote
Old 3rd May 2020, 16:10   #2  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
MKVToolNix only repackages the elementary streams, no decimation
The fact that two different source filters see it differently means the issue is in the source filter or command line
Soft Telecine uses no extra fields, just flags
gonca is offline   Reply With Quote
Old 3rd May 2020, 17:00   #3  |  Link
Treaties Of Warp
Registered User
 
Join Date: Apr 2019
Posts: 14
I might be misusing the term "soft telecine". There are definitely a mix of progressive + interlaced frames in the source, as I described. (Checked with DGIndex.)

If I use Hybrid to load the MKV, use FFmpegSource2 on it (which it does by default), use the AviSynth previewer, and advance frame by frame, it looks correct and I see no interlaced (combed) frames at all. It seems like it correctly got rid of the interlaced frames. (Loading the .mpg and using the previewer to advance frame by frame shows combed interlaced frames.) I'm not understanding how MKVToolNix/MakeMKV created a file that works this way with FFmpeg. I do want to get rid of the interlaced frames and go to 23.976 on this, but I'm not sure if I should trust the results from going from source to mkv then to mp4 using FFmpeg without fully understanding what the heck is happening in terms of getting rid of the interlaced frames. In other words, I don't know how accurate this is, given that it might even be some kind of bug or something.

MediaInfo on the VOB's muxed to mpg show a frame count of 160174 (29.97 fps) - 01:29:04.48

MediaInfo on the VOB's muxed to mkv (latest MKVToolNix version) shows 128107 frames... I manually specified 23.976 fps - 01:29:03.13

If I decimate the mpg using TIVTC to 23.976 via AviSynth (using Hybrid), I get 128139 frames - 01:29:04.47

So it seems whatever MKVToolNix is doing is not completely accurate, since it loses 1.35 seconds. Not sure if it's at the beginning, end, or if it's dropping frames that might cause a timing issue that will cause the audio to go slightly out of sync.

Last edited by Treaties Of Warp; 3rd May 2020 at 17:24.
Treaties Of Warp is offline   Reply With Quote
Old 3rd May 2020, 20:45   #4  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Post the Avisynth script please
It might be Hybrid that is telecining the video
gonca is offline   Reply With Quote
Old 4th May 2020, 04:09   #5  |  Link
Treaties Of Warp
Registered User
 
Join Date: Apr 2019
Posts: 14
It's not, as I mentioned, I checked source VOB's with DGIndex.


MPG script (using TIVTC):
Code:
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\LoadDll.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\TIVTC.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\AddGrainC.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\dfttest.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\EEDI2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\eedi3.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\FFT3DFilter.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\masktools2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\mvtools2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\PlanarTools.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\TDeint.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\RgTools.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\nnedi3.dll")
LoadCPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\yadif.dll")
LoadDLL("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\libfftw3f-3.dll")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\QTGMC.avsi")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi")
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
# loading source: E:\USER\DVDMUX\Input.mpg
#  input color sampling YV12
#  input luminance scale tv
MPEG2Source(d2v="\mpg_b21879f411d975407b8c0e6b0fb1fa4f_853323747.d2v")
# current resolution: 720x480
# deinterlacing
A2 = last
A2 = A2.QTGMC(Preset="Very Slow", PrevGlobals="Replace", ediThreads=2, FPSDivisor=2)
TFM(slow=2,mChroma=true,clip2 = A2)
TDecimate(cycleR=1,cycle=5,hybrid=1)
AssumeFrameBased()
# filtering
PreFetch(4)
return last

MKV script (no filters):
Code:
LoadCPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\ffms2.dll")
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
# loading source: E:\USER\DVDMUX\Input.mkv
#  input color sampling YV12
#  input luminance scale tv
FFVideoSource("E:\USER\DVDMUX\Input.mkv",colorspace="YV12")
# current resolution: 720x480
# filtering
PreFetch(4)
return last
Treaties Of Warp is offline   Reply With Quote
Old 4th May 2020, 10:49   #6  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Quote:
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\TIVTC.dll")
This is from the script that Hybrid creates.
This is a telecining plugin
gonca is offline   Reply With Quote
Old 4th May 2020, 13:58   #7  |  Link
Treaties Of Warp
Registered User
 
Join Date: Apr 2019
Posts: 14
???

Of course. I manually specified that. I used it to decimate the mpg with the interlaced frames.

I'm asking what is going on with the mkv.
Treaties Of Warp is offline   Reply With Quote
Old 4th May 2020, 14:06   #8  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Can you post a link to a short MKV that shows the issue?

If it is soft 3:2 as you say, probably FFVideoSource() is not honoring the pulldown flags. IIRC, it doesn't by default and you need to specify an option (IIRC, rffmode=1). Ignoring the flags is a form of deinterlacing.

Also, ignoring flags can hurt AV sync if it is not pure soft 3:2 throughout. That may account for your time discrepancies.

I don't know if it is true, but there are reports rffmode=1 is buggy. Maybe safer to use a source filter that is known to be reliable in its pulldown handling, such as Mpeg2Source() or DGSource().

Last edited by videoh; 4th May 2020 at 17:10.
videoh is offline   Reply With Quote
Old 4th May 2020, 21:32   #9  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
MKVToolNIX only repacks the streams into the mkv container, it does not alter them in any way
If you are seeing telecining or deinterlacing in the preview then it is the source filter or some plugin in the script
gonca is offline   Reply With Quote
Reply

Tags
decimation, dvd, mkv, mkvmerge, soft-telecine

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.