• AnyStream is having some DRM issues currently, Netflix is not available in HD for the time being.
    Situations like this will always happen with AnyStream: streaming providers are continuously improving their countermeasures while we try to catch up, it's an ongoing cat-and-mouse game. Please be patient and don't flood our support or forum with requests, we are working on it 24/7 to get it resolved. Thank you.

QTGMC - Staxrip/Hybrid (Out Of Sync Audio In Output File)

zanetti

Well-Known Member
Thread Starter
Joined
Apr 6, 2021
Messages
677
Likes
323
so, long story short. i usually source decrypted DVDs that come in folder structure, aka vob and ifo files in video_ts folder. i then use makemkv to turn vobs into mkvs. then i open staxrip, fiddle with settings to my liking, load batch of mkvs and encode. i usually have to apply deinterlace. thus far ive been using whatever is fast and gives a decent result, aka fieldeinterlace or whatever its called. but recently ive discovered qtgmc which gives magnificent results albeit being slow af. but (a big one)... it doubles the framerate and deals nicely with different interlaced material. ive managed to get great results from both pal and ntsc makemkv'd dvds, aka 50 and 60fps outputs. no problems.

but recently ive stumbled upon a few dvds that, albeit playing nicely in mpv within staxrip's preview, result in out of sync output files. ive tried everything. ffvideo, ffms2, dss2, automatic for source. changing from x264 to x265. going to muxer profiles and trying ffmpeg x264/265, mkvmerge, mp4box. i tried turning 'extract timestamps' on and off, i tried both just remuxing audio and encoding to other codecs besides (default for dvd) ac3. i tried qtgmc regular and qtgmc with repair. but to no avail. i tried hybrid but i dont get double the framerate there with its vapoursynth qtgmc.

whats funny, some mkvs from makmkv'd dvds do not exhibit such audio sync problems. ive done quite a few and they do just fine, ive done entire series with 50fps outputs as results, but some decrypted dvds just wont budge. upon researching i found one comment on doom9 (or was it videohelpforum, cant remember) that said dvds were f'd up when decrypting, and should have used dvdectypter but since im not sourcing from direct iso files but rather already decrypted dvds theres nothing i can do about that. i even tried tfm audio tool, from one of the suggestions, but there i can only change 'framerate' of audio from 23.975 to 25 and up to 29.97, but not to 50 or 60fps (it says out of range).

as an example, ive sourced 'the fugitive', original 1960s series. ive wasted 250gbs on all four seasons and now i cant do f all with them, apart from not using qtgmc! but i want to, lol, since results are just fabulous looking. so, first ive checked vob files. they report 23.976fps. makemkv'd mkvs from those vobs report some f'd up sheeeit, like 24.498fps and when i encode them using staxrip i get out of sync file with 48.997fps reported. afaik, since qtgmc is doubling the framerate audio is out of sync in output. can the audio be somehow streched separately, so i can use mkvtoolnix to just mash (high fps) video and (streched) audio together? or even better, is there something to adjust in staxrip so it can take care of everything?

ive looked over at doom9 and videohelpforum but f me, none of the examples match my search terms and frankly its just a bunch of mumbo jumbo to me since im no pro at encoding and stuff, and i really have tried a few settings from threads that described slightlly similar problems to mine (e.g. turning on extract timestamps etc), but to no avail.

i wanted to give handbrake a go, but bro doesnt use avisynth, hence no qtgmc. seeking help. need help. anyone remuxing dvds and is like kung fu black belt at it and is willing to help a noob out? i just cant get over how great qtgmc results are. and yes, i also dislike high framerate video, but theres something about old tv shows that didnt get the remaster treatment but still look good and then on top are playing at 60fps. ive found i dont mind the high framerate (aka soap opera effect) when dealing with older tv shows.

thank you!

UPDATE: as mentioned before, i did one episode with hybrid and its vaporsynth qtgmc, but i didnt get double the framerate. what i got was a 29.97fps file which is funny since vobs were 23.976 (as per mediainfo). that file is all in sync, no troubles at all. so that got me thinking. what if i ran that file through qtgmc in staxrip and see if i a) get double the framerate and more importantly b) a file with synced audio.

well, well, well... thats exactly what i got. but... lol... now i do have a 60fps output with insync audio but jesus christ its like soap opera effect on steroids, it looks almost cartoonish especially since one can clearly see some frames doing godknowswhat when there is movement of the camera. but when its still and actors face is in full... omg... i... i cant explain it. its high fps but like exaggerated, totally weird. so, i did manage something but thats not a solution since now im doubling the time to encode each episode (with prefetch in staxrip set to 12 and hybrid chugging 100% of cpu all by itself) to roughly 30-32min per episode and also the end result, albeit on track with what im looking for, looks really comical, almost as if ai upscaled it and whatnot. regular qtgmc in staxrip, with doubled framerate looks waay better. still high fps, but more natural looking. so if anyone has any ideas, suggestions, at least a point in the right direction do feel free as im still looking for the perfect solution. cheers!
 
Last edited:
so, long story short. i usually source decrypted DVDs that come in folder structure, aka vob and ifo files in video_ts folder. i then use makemkv to turn vobs into mkvs. then i open staxrip, fiddle with settings to my liking, load batch of mkvs and encode. i usually have to apply deinterlace. thus far ive been using whatever is fast and gives a decent result, aka fieldeinterlace or whatever its called. but recently ive discovered qtgmc which gives magnificent results albeit being slow af. but (a big one)... it doubles the framerate and deals nicely with different interlaced material. ive managed to get great results from both pal and ntsc makemkv'd dvds, aka 50 and 60fps outputs. no problems.
Speaking from experience, I wouldn't use MakeMKV to create MKV out of DVDs. It introduces problems.
There are a few options:
1. Use an older StaxRip version that could still open and extract DVD material from DVD sources, honour 3:2 pulldown, and other things.

2. Use DVDShrink, yes, DVDShrink. Under Edit - Preferences, remove the tick SPlit VOB files...
Select the episodes you want under reauthor. And click backup. Select a folder for output. It should create one VOB for each episode. Leaving all important info intact.

but recently ive stumbled upon a few dvds that, albeit playing nicely in mpv within staxrip's preview, result in out of sync output files. ive tried everything. ffvideo, ffms2, dss2, automatic for source. changing from x264 to x265. going to muxer profiles and trying ffmpeg x264/265, mkvmerge, mp4box. i tried turning 'extract timestamps' on and off, i tried both just remuxing audio and encoding to other codecs besides (default for dvd) ac3. i tried qtgmc regular and qtgmc with repair. but to no avail. i tried hybrid but i dont get double the framerate there with its vapoursynth qtgmc.
Speaking of QGMC, are you aware that it doubles the framerate to remove the interlacing?
There should be an option to force the framerate back, like QTGMC().SRestore(23.976)

However, I use dgmpegdec to analyse, extract the files and create a *.d2v file, which can be used in AviSynth.
This leaves a 3:2 pulldown effective. It will also show you what kind of Interlacing the DVD uses, which makes it easier to select a proper deinterlacing method.


FYI - I do not use staxrip, but you should be able to use the info provided and try it.
 
Speaking from experience, I wouldn't use MakeMKV to create MKV out of DVDs. It introduces problems.
There are a few options:
1. Use an older StaxRip version that could still open and extract DVD material from DVD sources, honour 3:2 pulldown, and other things.

2. Use DVDShrink, yes, DVDShrink. Under Edit - Preferences, remove the tick SPlit VOB files...
Select the episodes you want under reauthor. And click backup. Select a folder for output. It should create one VOB for each episode. Leaving all important info intact.


Speaking of QGMC, are you aware that it doubles the framerate to remove the interlacing?
There should be an option to force the framerate back, like QTGMC().SRate(23.976)

However, I use dgmpegdec to analyse, extract the files and create a *.d2v file, which can be used in AviSynth.
This leaves a 3:2 pulldown effective. It will also show you what kind of Interlacing the DVD uses, which makes it easier to select a proper deinterlacing method.


FYI - I do not use staxrip, but you should be able to use the info provided and try it.
Question for you:

Why in your opinion do you don't use MakeMKV to create an MKV out of a DVD? I have MakeMKV, DVDShrink, some VSO products, and I'm now starting to use StaxRip.
 
I'm curious about that, too... What kind of problems are introduced with DVD - MakeMKV?
I did that once or twice, but I didn't notice any issues.
 
Question for you:

Why in your opinion do you don't use MakeMKV to create an MKV out of a DVD? I have MakeMKV, DVDShrink, some VSO products, and I'm now starting to use StaxRip.
I'm curious about that, too... What kind of problems are introduced with DVD - MakeMKV?
I did that once or twice, but I didn't notice any issues.
I noticed that when using the mkv created by makemkv to "restore/enhance" the material, you might get a video file that might suffer from judder or artefacts.
When simply playing the file, it might not be happening. And maybe it is already fixed in the later versions.


As for the usage of dgmpegdec or DGIndex, here is a screenshot as to why I think it is very useful for DVD video.
Download the tool here: https://www.rationalqm.us/dgmpgdec/
1697854866249.png
 
I had forgotten that info. The script in AviSynth would look something like this.

Code:
# Load the necessary plugins
#LoadPlugin("path_to_plugins/DGDecode.dll")
#Import("path_to_plugins/QTGMC.avsi")

# Load video using DGDecode and the d2v project file
video = MPEG2Source("H:\TEST\VTS_01_1.d2v")

# Load audio from the AC3 file
audio = NicAC3Source("H:\TEST\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3")

# Deinterlace the video using QTGMC
video = video.QTGMC(Preset="Slow")

# Resize to 4:3
video = video.Spline36Resize(640, 480)

# Combine video and audio
finalclip = AudioDub(video, audio)

return finalclip

NicAudio plugin can be found here:
Code:
https://github.com/animeavi/NicAudio
 
I noticed that when using the mkv created by makemkv to "restore/enhance" the material, you might get a video file that might suffer from judder or artefacts.
When simply playing the file, it might not be happening. And maybe it is already fixed in the later versions.


As for the usage of dgmpegdec or DGIndex, here is a screenshot as to why I think it is very useful for DVD video.
Download the tool here: https://www.rationalqm.us/dgmpgdec/
View attachment 74903
Thank you for the clarification. Question #2, I downloaded dgmpgdec2008 dot zip.

Is that the file I need to download/install?

I'm stepping away from my laptop for a sec, since I just found out that you're online.
 
Thank you for the clarification. Question #2, I downloaded dgmpgdec2008 dot zip.

Is that the file I need to download/install?

I'm stepping away from my laptop for a sec, since I just found out that you're online.
Correct.
You extract that into a separate folder. For example, my folder is called dgmpegdec. You can name it how you like.
Once extracted, you will find the DGIndex.exe, the tool, and a DGDecode.dll needed for AviSynth. The x64 folder contains DGDecode.dll as a 64-bit version.
Start DGIndex.exe and open the VOB that you created with DVDShrink.
When you click save project and demux video, it will output the mpeg2 stream, the audio stream(s) and a d2v.
Let me know if you have any questions. :)
 
Correct.
You extract that into a separate folder. For example, my folder is called dgmpegdec. You can name it how you like.
Once extracted, you will find the DGIndex.exe, the tool, and a DGDecode.dll needed for AviSynth. The x64 folder contains DGDecode.dll as a 64-bit version.
Start DGIndex.exe and open the VOB that you created with DVDShrink.
When you click save project and demux video, it will output the mpeg2 stream and a d2v.
Let me know if you have any questions :)
Thanks for your help. I'll start to work on it tomorrow, right before I have to work on the weekend.

I'll probably be online Sunday during the NFL games here in the US, but I'll post you the results and any additional questions that I'll have.

:thankyou:
 
If the info screen looks like below, see video type and frame type, the script would change.

1697879350501.png



Why the script changes:
  1. Deinterlacing: Since the video is primarily film content and it's progressive, there's usually no need for deinterlacing with QTGMC. You can remove the QTGMC line.
  2. Frame Rate & IVTC: Since 96.66% of the content is film-based, you might benefit from an Inverse Telecine (IVTC) function to restore the video to its original 23.976fps film framerate. TFM() can help with this, followed by TDecimate() to adjust the framerate.
The main changes are removing the deinterlacing step and adding the IVTC process using TFM() and TDecimate(). This should result in a cleaner, more film-like playback.


The script starting point:
Code:
# Load video and audio
video = MPEG2Source("H:\TEST\VTS_01_1.d2v")
audio = NicAC3Source("H:\TEST\VTS_01_1 T80 2_0ch 192Kbps DELAY -81ms.ac3")


# Apply IVTC to restore the original film framerate
video = video.TFM().TDecimate()

# Resize to 16:9 with square pixels
video = video.Spline36Resize(854, 480)

# Combine video and audio
finalclip = AudioDub(video, audio)


return finalclip

Please always test before encoding whole videos.
Sample from ffmpeg cmd output via AVSPmod:
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 854x480 [SAR 1:1 DAR 427:240], q=2-31, 23.98 fps, 24k tbn
The output video will have the desired aspect ratio if the DAR is approximately 16:9 (or 1.78:1) and the SAR is 1:1.
  • 854x480 is the resolution of the video.
  • [SAR 1:1] means the Sample Aspect Ratio is 1:1. This is the width-to-height ratio of each pixel. A SAR of 1:1 means each pixel is square.
  • DAR 427:240 is the Display Aspect Ratio. DAR is calculated as Resolution Width x SAR / Resolution Height.

    In this case, it's 854/480 = 1.779, approximately 16:9.
The output video will have the desired aspect ratio as long as the DAR is approximately 16:9 (or 1.78:1) and the SAR is 1:1.
 
https://www.rationalqm.us/faq.html
Good read by author of DGDecode on the nature of video (progressive/interlaced/telecined)
 
Speaking from experience, I wouldn't use MakeMKV to create MKV out of DVDs. It introduces problems.
There are a few options:
1. Use an older StaxRip version that could still open and extract DVD material from DVD sources, honour 3:2 pulldown, and other things.

hm, i saw someone somewhere saying 'just drop vobs into staxrip, bro' but i am now getting no audio when i do vobs in staxrip. i dunno why, audio track is there, but when staxrip first analyzes the file it does not extract audio, albeit that option being checked iin options. weird. and im using older version 2.13.

2. Use DVDShrink, yes, DVDShrink. Under Edit - Preferences, remove the tick SPlit VOB files...
Select the episodes you want under reauthor. And click backup. Select a folder for output. It should create one VOB for each episode. Leaving all important info intact.

haha, i knew i was on the right track. i did try dvdshrink, thinking... i dont know what i was thinking because all i managed was to duplicate vob and the entire decrypted folder structure, basically doing a copy/paste, now im trying per your sugestion. thanks.

Speaking of QGMC, are you aware that it doubles the framerate to remove the interlacing?
There should be an option to force the framerate back, like QTGMC().SRestore(23.976)

yes, i mentioned it and thats probably 50% of the reason why im in love with QTGMC now. second half is sheer quality of the deinterlace, and with just a hint of denoise, as i said before, dvds that looked good for dvds but still didnt get a remaster really, i mean really turn out great. and id go for the time and effort and cost (it does take time converting 100 episodes from vobs to QTGMC'd mkvs, especially for us plebs with itti-bitty processors, lol) over anything any provider, including (H)MAX, has to offer in 460/576p range (provided it has not been remastered, but even then i bet one could get far superior results on his/hers own than what these megamultibillionaire corpos churn out, call it content and then charge you for it, before raising prices again... lol).

However, I use dgmpegdec to analyse, extract the files and create a *.d2v file, which can be used in AviSynth.
This leaves a 3:2 pulldown effective. It will also show you what kind of Interlacing the DVD uses, which makes it easier to select a proper deinterlacing method.

cool, will check it out. btw, what do you mean by 'extract files'? you mean, extract info from files into a d2v file or? anyways, muchos gracias. cheers!
 
Last edited:
https://www.rationalqm.us/faq.html
Good read by author of DGDecode on the nature of video (progressive/interlaced/telecined)
Yes, indeed. You can also compare the extracted m2v in Media info and try the reported info there, which makes life easier.
Example output:

Code:
Video
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                     : Variable
Format settings, picture structure       : Frame
Bit rate mode                            : Variable
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 29.970 (30000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy

hm, i saw someone somewhere saying 'just drop vobs into staxrip, bro' but i am now getting no audio when i do vobs in staxrip. i dunno why, audio track is there, but when staxrip first analyzes the file it does not extract audio, albeit that option being checked iin options. weird. and im using older version 2.13.
It was an older version before they dropped DVD support. I do not recall which version it is, but it is way back.


yes, i mentioned it and thats probably 50% of the reason why im in love with QTGMC now. second half is sheer quality of the deinterlace, and with just a hint of denoise, as i said before, dvds that looked good for dvds but still didnt get a remaster really, i mean really turn out great. and id go for the time and effort and cost (it does take time converting 100 episodes from vobs to QTGMC'd mkvs, especially for us plebs with itti-bitty processors, lol) over anything any provider, including (H)MAX, has to offer in 460/576p range (provided it has not been remastered, but even then i bet one could get far superior results on his/hers own than what these megamultibillionaire corpos churn out, call it content and then charge you for it, before raising prices again... lol).
When I read your text, I thought you had wondered why it is that way.

cool, will check it out. btw, what do you mean by 'extract files'? you mean, extract info from files into a d2v file or? anyways, muchos gracias. cheers!
Please also check the info I mentioned above. With MediaInfo and the m2v that DGIndex extracted.
To help with the short tutorial on the rationalqm website where @goncal provided the link.
 
The problem with Media Info is that it sometimes reports interlaced, because of flags, but it is a fake interlaced flag.
 
The problem with Media Info is that it sometimes reports interlaced, because of flags, but it is a fake interlaced flag.
Yes, indeed. I mentioned MediaInfo as it will give you a hint on which you can test first the TFF or BFF.
It can save you a bit of time when you go through Donald Graft's info on how to check for Interlaced, progressive and TFF/BFF, that you provided earlier.
As it will give you a certain point to start with. This doesn't mean that MediaInfo will provide correct info regarding the flags.
 
The dgi file contains the TFF/BFF info for use with avisynth or vaporsynth, no need to set it explicitly.
Those flags are not critical in determining if video is interlaced/telecine/progressive.
 
The dgi file contains the TFF/BFF info for use with avisynth or vaporsynth, no need to set it explicitly.
Those flags are not critical in determining if video is interlaced/telecine/progressive.
While I respect your expertise, I want to clarify a few things.
Up until now, our discussion has primarily centred on dgmpegdec and d2v. You've introduced the dgi file, bringing a new aspect to our conversation.

It's essential to note that while the dgi file may contain TFF/BFF info for use with avisynth or vaporsynth, it's not the only metric or tool available for determining the nature of the video. Relying solely on those flags might not be sufficient for all scenarios.

Earlier, when discussing MediaInfo, it was meant to be a tool to provide a starting point.
Of course, as you've pointed out, there are instances where MediaInfo can misinterpret flags, leading to potential misinformation.
But it's still a valuable tool for users who want to understand their video files quickly.
In combination with Donald Graft's guidance, it can be pretty helpful.

To sum up, while I acknowledge the utility of the dgi file and its information for specific applications, it's crucial to approach video analysis with a comprehensive toolkit and understanding.
 
I agree with what you said, just brought up the dgi file because it is created by dgmpegdec
 
I agree with what you said, just brought up the dgi file because it is created by dgmpegdec

Thank you for your response.

I understand the point you were trying to make. However, it's essential to differentiate between the tools and their associated file types.

dgmpegdec or DGIndex creates .d2v files and primarily utilizes the CPU.
On the other hand, dgdecnv or DGIndexNV generates .dgi files and is designed to harness the capabilities of Nvidia GPUs exclusively.

It's a subtle distinction but an important one.
 
Back
Top