VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Writing this so I can refer back to it whenever I need... some of you may be interested in this as well so I'm posting it here.

    Let me preface this with the fact that I never went to school for any video / audio processing. This is what has resulted from gathering info from various sources around the net and doing my own experimenting.

    This is a guide on how to rip a DVD to 1080p @ 59.94FPS (or 50FPS for Region 2). It's mostly geared towards NTSC DVDs but I've had the same success with interlaced PAL DVDs using this method. Trashy AI upscales (looking at you Topaz) annoyed me so I figured out how to do this instead. This guide is a more faithful-to-the-original-DVD conversion than a true upscale.

    I'm going to be up-scaling (aka resizing) the video to 1080p while keeping frame accuracy during a QTGMC pass, retaining chapters, all audio tracks, and subtitles (if on the DVD).

    This is a rather tedious and lengthy process, so just read through it all first before you attempt it.

    You'll need these tools (all free):

    DVD Decrypter
    DVDVob2Mpg
    DGIndex
    AviSynth+ / VirtualDub2 (with QTGMC + NNEDI3 plugins) -- watch this guide on how to set it up
    Handbrake
    SubtitleEdit
    MKVToolNix
    VLC

    MediaInfo (not required but nice to check what tracks are in your files)

    Step 1: Use DVD Decrypter to export the DVD to an ISO.

    This will remove any region locks on the DVD and an accurate ISO rip. I rip them in DVD9 (dual layer) mode for maximum quality.
    You can do this with DVD5, but the results aren't nearly as good.

    Some newer DVDs may need RipIt4Me to defeat the copyright protection.

    Step 2: Eject your DVD and mount the ISO.

    I do this since it's faster to work with a mounted ISO than it is to continuously read the DVD, so set it up in read mode to ISO, and wait for this to finish.

    Step 3: Open the mounted ISO with DVD Decrypter in IFO mode.

    This will read the headers and stuff in the DVD, and show you the VOBs you can extract.

    Using VLC, open your DVD and start playing what episode or video you want to export, and pay attention to the track lengths for each episode you want to extract.
    Sometimes the copyright protection methods include having multiple of the same video, but with long blank areas or misaligned audio.

    Extract the correct length track that you find in the Input menu.

    Step 4: Use DVDVob2Mpg to convert all the .VOB files extracted into a single MPG file.

    Make sure to select them in order so you don't have any out of order scenes. This is to get rid of any junk data in the VOBs. Do not delete the VOBs yet.

    Step 5: Use MKVToolNix to create the chapters file.

    Select your first VOB that you extracted and add it into MKVToolNix as a new file. Select the rest in order, and drag them in, choosing "Append" to the current project.

    De-select the video track and keep at least one audio track in the file.
    Move to the "Output" tab and under Chapters, find the "Generating chapters" dropdown menu and choose "One chapter for each appended file".
    Click start multiplexing and wait for your track to finish.
    Now open "Chapter editor" on the left menu of MKVToolNix.
    Make any necessary changes (usually deleting the first and last chapter since the video start & end chapters don't matter and re-numbering the rest) to the chapter file and then save it.

    Keep the mka file that was generated. You can now delete the VOB files that were extracted.

    Step 6: Use Handbrake to export the subtitle track(s).

    Open Handbrake and import the MPG you generated earlier. Set format in the 'Summary' tab to MKV.
    Go to the 'Video' tab and chooe H.264, Constant Quality, Constant Framerate, set the RF to 51 and encoder preset to ultrafast. (we're just doing this to extract the subtitles, so the video quality doesn't matter).
    Go to the 'Subtitles' tab and click tracks -> Add all remaining tracks. Delete the 'Foreign Audio Scan' entry.
    Delete any audio tracks so you don't waste any time.
    Start the encode and wait for it to finish, it should generate a MKV.

    Open the generated video in SubtitleEdit, and it should show you the subtitle tracks.
    For each track, choose import and set the new resolution to 1440x1080 (or 1920x1080 for widescreen).
    I export them as both an .ASS track (I change the font a nice letterbox black highlight / white font) and a .SRT track.

    Now you can delete the video file you just generated.

    Step 7: Open your MPG file in DGIndex

    Open DGIndex and select your MPG file.

    Play it for a bit and check the side panel to see if it's top field first or bottom field first. This is important for later.

    Then do 'File' -> 'Save Project' and save it.

    This should export a .D2V file as well as export any audio tracks with their respective delays in the file name, usually this is 0ms since DVDVob2MPG usually zeros / aligns them.

    Step 8: Converting the video with VirtualDub2

    You're going to need to write a small AVS script for VirtualDub2 to know what to do.

    This is my upscaling script. It's pretty basic compared to some of the very fine adjustments other's have done with QTGMC, however it works well enough for me.

    SetFilterMTMode ("QTGMC", 2)
    MPEG2Source("DRIVE:\YOURDIRECTORY\WHATEVER.d2v")
    AssumeTFF()
    QTGMC(preset="Slower", InputType=0, Lossless=2, SourceMatch=3, EdiThreads=4)
    #Crop(0,2,0,0)
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=720, fheight=540, nns=4)
    nnedi3_rpow2(2, cshift="Spline64Resize", fwidth=1440, fheight=1080, nns=4)
    Sharpen(0.016)
    Prefetch(14)
    We set the filter MT mode to 2, I'm not sure why but I read it somewhere.
    Then we use MPEG2Source and import the D2V correctly, and frame accurate. FFVideoSource won't.
    Then we set the field order that we found above in DGIndex. (TFF or BFF)
    QTGMC pass at 'Slower' for better quality / more time per frame, 0 to indicate interlaced, using lossless and sourcematch to adjust some of it's internal filters. EdiThreads is adjusted for my CPU, you may need to change it.
    Some encodes have a small flickering black line on the top or bottom, i crop them out (lose a small amount of detail, unnoticable IMO)
    I do a couple resizes using different algorithms with NNEDI3.
    A small sharpen at the end since we've come up quite a bit in size from the original DVD source.
    A prefetch to utilize my CPU. You may need to remove that line.

    You will need to adjust the widths and heights if you are going to 1080p (I do 960x540 and 1920x1080).

    Ok, now save this as a .AVS file.

    Drag your AVS file into VirtualDub2 and it should pop up the preview. Scroll through and play a bit to make sure there aren't any issues like wrong field first or flickering lines.

    Make your adjustments and once it looks okay, go to 'File' and 'Save Video'. Change file format to MKV. Change the compression to whatever codec you prefer.

    I do FFMPEG/x265 and configure it to 8 bit depth, profile Slow, RF18. This setting takes a while but the video quality is fantastic.

    Now name the video something like VOB_01(RF18S).mkv and let it run. This took a long time to process per episode, about 2hrs per 25 mins. This is because of my settings, you can adjust them / the codec and achieve faster processing times.

    Step 9: Merge everything together with MKVToolNix.

    Import the video file you created with VirtualDub2, then import your audio (usually track 0 is the default while others are commentary / scores / other languages), and your subtitles.
    Import the .mka file you generated with chapters as well, then pay attention to the color and de-select the audio track that was imported with it.

    Re-arrange your audio tracks so the default is first. Then, for any other tracks, select them (multiple if you hold CTRL) and set "Default track" flag to No. I also change all the audio track's language to "en" for english and set the 'Track name' accordingly (ie. Mono / Stereo / Commentary / Surround / 5.1 Surround / etc.)

    De-select any Tags / Global Tags that were generated with the video file. You won't need them.

    So you should now have a video track, audio track(s), subtitle tracks, and a chapter track. Make sure your 'Generating Chapters' dropdown menu is set to 'Don't generate chapters' since we already have them.

    Now, multiplex your file together and you should have your final result, a 1080p/59.94fps fullscreen video with frame accurate deinterlacing and synced audio / subtitle / tracks & chapters.

    You can go ahead and rename your final file, and delete the rest.

    That's it.

    Now it's time to do the whole thing over again for your entire DVD / show. It's a long process, it's best to have them all setup as jobs in VirtualDub2 and run them overnight. I've successfully done Viva La Bam, IASIF, and 6 seasons of TPB like this and it was very time consuming. I will add example pictures eventually.

    This will also work with say old VHS / Hi8 footage if you use a DVD Recorder (S-Video is best) as they record in interlaced NTSC (or PAL).

    Important note: This may not work accurately with animated titles or ones that are hard telecined. (For example, Invader Zim)

    Additional note: I have noticed some very slight audio sync issues in a few of my encodings, but only a handful. I'm not sure if there's something going on with the process, if I just missed a step, or if its a source issue but if anyone has this same issue and knows why it may be happening please let me know.
    Quote Quote  
  2. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Some comments, just to better understand your flow:

    Why QTGMC applied by default? (in PAL not all sources are interlaced, movies rarely are; in NTSC often an inverse telecine is needed)

    Why QTGMC lossless? (is not appropriate for all sources by default)

    Why 2 nnedi3 steps?

    QTGMC denoises with that settings, a better sharpening filter is more appropriate.

    This will also work with say old VHS / Hi8 footage if you use a DVD Recorder (S-Video is best) as they record in interlaced NTSC (or PAL).
    They may encode interlaced the progressive source
    Quote Quote  
  3. Originally Posted by lollo View Post
    Why QTGMC applied by default? (in PAL not all sources are interlaced, movies rarely are; in NTSC often an inverse telecine is needed)
    I do a QTGMC deinterlacing on any MPG that is pressed on DVD as interlaced. This is because it's what you'd normally see on an NTSC TV when watching the DVDs. For PAL sources, as long as DGIndex picks up that it's interlaced then I do those as well. As you said, a lot of movies and shows may be pressed in progressive which DGIndex will pick up on. Anything identified as progressive I don't encode and only work with sources that are interlaced.

    As far as doing a inverse telecine, yes, some shows may benefit from that. I enjoy the higher framerate (59.94/50FPS) after deinterlacing as 23/24fps stuff is jittery, especially during high motion scenes, whereas QTGMC isn't (although there may be a slight quality loss). Yes it's not the best encoding possible, I know, but the results look good enough for me.

    Originally Posted by lollo View Post
    Why QTGMC lossless? (is not appropriate for all sources by default)

    ...

    QTGMC denoises with that settings
    I experimented with some of the default settings for QTGMC after reading this site and this was what gave me the best results. I did do a lot of research on the different settings you can adjust, but I didn't feel like messing around for hours on end for a slightly better output. I'm sure others with more experience using QTGMC can chime in with better settings to use.

    Originally Posted by lollo View Post
    Why 2 nnedi3 steps?
    I tried doing it a couple different ways, one resize step using different algorithms, but using the two combined gave me a better output.

    Originally Posted by lollo View Post
    a better sharpening filter is more appropriate.
    Yeah, I didn't do much research into sharpening filters but I'm sure better ones exist. The default worked well enough and it was such a low sharpening factor that I didn't bother to look into them. Do you have a better recommendation?

    Originally Posted by lollo View Post
    They may encode interlaced the progressive source
    I wasn't aware that some record in progressive, I only have one DVD recorder that records interlaced so I misspoke on the behalf of the rest. As long as the DVD is recorded as interlaced then it should be good.
    Last edited by ArchLio; 1st Oct 2024 at 12:44.
    Quote Quote  
  4. Here's a resizing suggestion to make the edges nice and clean if there's lots of black or fuzzy borders. I'd try to make sure the AviSynth resizers are only downscaling, so I'd make the first resizing something like 864x576 (for an NTSC DVD).

    Source (4:3 NTSC DVD):

    Image
    [Attachment 82771 - Click to enlarge]


    Upscale and then use the CropResize function in my signature to crop and resize. For a 4:3 DVD I'd generally use InDAR=15.0/11.0, as 4:3 DVDs tend to have a 15:11 display aspect ratio, including the black borders, but use InDAR=4.0/3.0 if you prefer.

    If the DAR is less than 16:9 after cropping, just specify the height (1080) and use zero for the width.
    If the DAR is greater than 16:9 after cropping, just specify the width (1920) and use zero for the height.

    Preview the cropping:
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=864, fheight=576, nns=4)
    nnedi3_rpow2(2, cshift="Spline64Resize", nns=4)
    CropResize(0,1080, 24,10,-24,-18, InDAR=15.0/11.0, Resizer="Resize8", RStr=""" kernel="Spline64" """, CPreview=1)

    Image
    [Attachment 82772 - Click to enlarge]


    Resize:
    nnedi3_rpow2(2, cshift="LanczosResize", fwidth=864, fheight=576, nns=4)
    nnedi3_rpow2(2, cshift="Spline64Resize", nns=4)
    CropResize(0,1080, 24,10,-24,-18, InDAR=15.0/11.0, Resizer="Resize8", RStr=""" kernel="Spline64" """)

    Image
    [Attachment 82773 - Click to enlarge]
    Last edited by hello_hello; 11th Oct 2024 at 16:03.
    Quote Quote  
  5. "as long as DGIndex picks up that it's interlaced then I do those as well."
    DGIndex only shows how it's been encoded, not what the content is like. Virtually all PAL DVDs are encoded interlaced, whether the source is progressive or interlaced. One way to tell what the source is like is to look at the untouched frames in VDub2 or some such. Or to separate the fields in your AviSynth script.

    You did mention it doesn't work with hard telecine. For the same reason it doesn't work on progressive PAL sources encoded as interlaced. It "works", sort of, but at the expense of unnecessarily degrading your video. IVTC the former, treat the latter as progressive. In both cases skip the QTGMC step.
    Quote Quote  
  6. Yeah, one way to determine if a PAL DVD is interlaced or progressive is to deinterlace with a de-interlacer that doubles the frame rate. Yadif(mode=1) would probably do, or even just Bob(), then step through the frames one at a time where there's movement. If each frame is unique, it's interlaced. If each frame is repeated, it's progressive.

    ArchLio, I also meant to mention...

    Why rip the DVDs to ISO files when you can rip them directly to a collection of IFO/Vob files?

    Also, there's no need to extract the video from the vob files or to join it, assuming they're sequentially numbered as a set, such as
    VTS_01_1.vob
    VTS_01_2.vob
    etc

    If you open the first vob file in a set with DGIndex it'll append the rest as though they're one large file. It'll also extract the audio from the vob files for you.
    I can't remember if DVD Decrypter has an option to prevent it splitting vob files into 1GB segments as I mostly used DVD Shrink for ripping and re-authoring DVDs. You can tell it not to split them if you prefer.

    If Subtitle Edit can't import subtitles from vob files (although I'm sure it can) you can extract them yourself. If you prefer to do it with a GUI, try MeGUI, as it has a tool for extracting DVD subtitles (under the Tools/VobSubber menu). There's also a Chapter Creator under the Tools menu for opening IFO files and extracting DVD chapters.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!