Log in

View Full Version : Having difficulties with QTGMC \ MakeMKV


iz-Moff
20th February 2024, 01:37
Hi.

I want to encode a tv series from DVD source, using QTGMC for de-interlacing, but there seems to be an issue with it not maintaining the field order. The source is BFF, if i do

FFMPEGSource2("D:\recomp\S01D1\VIDEO_TS\mkv\A1_t00.mkv", atrack=1)
AssumeBFF()
SeparateFields()

everything looks fine, playback is smooth. But then if i use QTGMC

FFMPEGSource2("D:\recomp\S01D1\VIDEO_TS\mkv\A1_t00.mkv", atrack=1)
AssumeBFF()
QTGMC(preset="Very Slow", FPSDivisor=2, TR2=3, Sharpness=0.0

i get "jumpy" video, and the thing is, it happens regardless of which field order i choose.

Now, i'm using MakeMKV to mux DVD into mkv container. The reason i'm doing it is cause it's very convenient, it automatically splits the DVD stream into individual episodes, convers chapter time codes, subtitles, audio streams etc. So all i have to do then is run a script to generate .avs and encoder .bat scripts, making the entire process almost automatic.

But there seems to be something about the mkv files that throws QTGMC off. Cause i tried to use DGIndex to demux the problematic episode, DGDecode_mpeg2source as the source filter, and then, using the same script above, QTGMC works fine.

Which is all well and good, but i'm really not looking forward to manually demuxing every individual episode with DGIndex. Does anyone know if anything can be done to make QTGMC work smoothly with mkv files? I tried to google it, but haven't found much besides a few comments suggesting that it could be an issue with FFmpegSource, which i use to load mkvs.

Or maybe someone knows of a program that can do something similar to what MakeMKV does, except producing .d2v files and extracting streams instead?

StainlessS
20th February 2024, 11:18
Maybe its NTSC telecine source, with (non-separated frames) 3 good frames, 2 combed frames, where DgIndex would remove repeated fields and provide
output of 'smooth' non combed 23.976FPS instead of the 3 good, 2 combed frames of 29.97FPS that you are probably getting.
[DGindex in such case probably using, Menu/Video/Field-Operation/Ignore Pulldown Flags ticked (or is it Honour Pulldown Flags, I dont often have such source, and hate it)]

To separate ripped VIDEO_TS/VOBs into episodes, I usually use DvdShrink/ReAuthor mode, (WITHOUT shrinking, ie Compession Settings @ "No Compression"),
In DvdShrink Preferences, set Target DVD size to DVD-9, where no re-compression will ever be necessary [ie no shrinking, no quality loss].
[EDIT: You can also choose which episode language audio/subs you require]

Then, I use DGindex on each of the new DvdShrink extracted [episode] VIDEO_TS/VOB sets.
EDIT: Best results will be using DGIndex to de-telecine, better than MakeMkv/DgIndexNV where extra processing would be required to identify and remove the extra telecine repeat fields.

EDIT: I aint no expert on such 'stuff', perhaps others have better suggestions.

EDIT: Below a DGIndex Template file, set location of it in DGIndex settings. [I usually copy it to DGINDEX/TEMPLATES Folder]
DgIndex_Test_Template.avs [Totally untested, Requires the audio source + TFM filters]

# DGIndex Template, below "__???__" filled in by DgIndex
DGI_VideoFileName ="__vid__"
DGI_AudioFileName ="__aud__"
DGI_AudioDelay =Value("__del__")

Video = Mpeg2Source(DGI_VideoFileName)
#Video = Video.TFM(d2v=DGI_VideoFileName) # Remove repeat fields from NTSC telecine stuff, ie 29.97 > 23.976 FPS, use if DGIndex "Honour Pulldown Flags"

AudioExt = GetFileExtension(DGI_AudioFileName)

Audio= (AudioExt==".ac3") ? NICAC3Source(DGI_AudioFileName,channels=2,DRC=0)
\ : (AudioExt==".mpa"||AudioExt=="mp1"||AudioExt==".mp2"||AudioExt==".mp3") ? NicMPG123Source(DGI_AudioFileName,Normalize=False)
\ : (AudioExt==".wav") ? RaWavSource(DGI_AudioFileName)
\ : (AudioExt==".dts") ? NicDTSSource(DGI_AudioFileName)
\ : (AudioExt==".w64") ? RaWavSource(DGI_AudioFileName,samplerate=6)
\ : 0

Assert(!isInt(Audio),"NO AUDIO")

AudioDubEx(Video,Audio) # Last is now Video + Audio
DelayAudio(DGI_AudioDelay)
Trim(0,0) # Chop/Pad audio to same length as video

# Dont think these are necessary, think DGIndex sets field order by default
#AssumeTFF
#AssumeBFF

########################################
### YOUR EXTRA PROCESSING STUFF HERE ###


### END OF YOUR EXTRA PROCESSING ###
########################################

Prefetch(4) # Or whatever number
Return Last

#
Function GetFileExtension(string fn) { rfn=fn.RevStr i=rfn.FindStr(".") Return (i==0) ? "" : rfn.LeftStr(i).RevStr }

takla
20th February 2024, 12:55
Or try LWLibavVideoSource("C:\Users\Admin\Documents\INPUT.mkv")
https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works/releases

DTL
20th February 2024, 14:55
"SeparateFields()"

After separate fields you got x2 fps and smooth enough motion. And with FPSDivisor=2, you got 1x fps at output (?). So if you need same smooth motion as field-based you need to run QTGMC in 2x fps processing mode and output 2x fps.

From documentation - http://avisynth.nl/index.php/QTGMC
By default QTGMC outputs video at "double-rate", twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source ("single-rate")

poisondeathray
20th February 2024, 15:40
But there seems to be something about the mkv files that throws QTGMC off. Cause i tried to use DGIndex to demux the problematic episode, DGDecode_mpeg2source as the source filter, and then, using the same script above, QTGMC works fine.


The only explanation is bad source filter, such as old ffms2 version


Which is all well and good, but i'm really not looking forward to manually demuxing every individual episode with DGIndex. Does anyone know if anything can be done to make QTGMC work smoothly with mkv files? I tried to google it, but haven't found much besides a few comments suggesting that it could be an issue with FFmpegSource, which i use to load mkvs.

Or maybe someone knows of a program that can do something similar to what MakeMKV does, except producing .d2v files and extracting streams instead?

If you have a compatible Nvidia card, DGSource (DGDecNV) works on MKV

Or lsmash suggested above , or update ffms2