Hey folks, it's been a while.
Since the last time I posted, I started a job teaching film and video classes at a pretty awesome local college. Also, nerve issues with my hands have prevented me from doing a lot of extracurricular computer activity (I'm currently using speech to text to write most of this).
As part of my job, I sometimes need to get clips from various DVDs for educational reference. Since I've done this a number of times, I figured it might be worth updating. I do have a previous post going over this process, but it's now almost 8 years old and a lot has changed, so I decided to rework it based on all of the things I've learned since then. If you notice that I get anything wrong, please let me know in the comments and I'll update the post (And probably give you credit as well).
BIG DISCLAIMER: This process may not work, may crash, or may do other things to your system. Virus scan everything you download. It's not a 100% guarantee that you'll avoid getting a malware infection, but it's a lot better than not checking at all.
In this case, please also follow the copyright laws of your country, and be aware of any anti DRM-circumvention laws.
Also, this tutorial is for Windows 11. It might work for previous versions of Windows, but may require slight modifications. Users of MacOS and other OSes should look elsewhere.
First up, I'm going to assume that you've already set up AVISynth+ and VirtualDub2. If not, check out my previous post.
- Copy over the DVD's files (if DVD is unencrypted) or use a decryption program and point the output to a directory on a local drive.
- Determine what title you want to convert.
- Open up the appropriate .vob files in DGIndex. Save project and demux audio.
- Convert audio to .wav using FFMPEG, Shutter Encoder or Audacity with FFMPEG add-on.
- Create AVISynth script
- Load DGIndex project file
- Load audio
- Mix audio and video
- Perform any additional video processing
- Render out avs script to desired format using your rendering program of choice.
Virus scan all downloaded files.
Create a folder somewhere on one of your drives for the DVD files, named whatever you want. Put a DVD in your drive.
If the DVD isn't encrypted, just copy over the VIDEO_TS folder or the .VOB files contained within to your new folder.
If it is encrypted, you'll need to use a decryption program of some sort. Due to the various legal issues involved with DVD ripping programs, I'm a little reluctant to link to any specific programs, and I would caution you to be careful - in addition to my warnings above, semi-to-fully illegal software is a common target for malware authors to try to inject code or compromise the websites of said software in some way.
Regardless, once you have your unencrypted .VOB files copied over, you'll need to find the title you want to transcode.
Often, this is made up of the largest similarly-named files on the disc, but if you don't know what title contains your desired content, use VLC to play back the .VOB files until you find the correct one.
When you know what title you want, open DGIndex from your DGDecode folder. Go to the Audio menu, select Output Method and then Demux All Tracks. Go to the File menu, then select Open. Browse to the folder with your DVD files. Select all the .VOB files in a particular title. They will usually be named with VTS_(title number)_(part number).VOB. For example:
Notice that I don't select the "_0.VOB" files - they're not needed in this case. Click Open, and then you'll get a "File List" window. Confirm that you have all the files you need, or add any you missed. When finished, click OK.
Drag around the playback bar to make sure the entire title is present. If you'd like to get a sense of what DGIndex thinks your video's framerate/aspect ratio is, hit the F5 key and preview it for a minute or so (you can stop playback with the ESC key). When satisfied, go to the File menu and select Save Project. I generally just save it in the same directory as the DVD files, and will proceed as if you have done so.
One thing to look out for: if you get a box like this:
Generally, I will click "No". However, if the resulting project file gives you an "access violation" error during preview or encoding later in the process, then you might need to go back and re-save the project file, than click Yes. (Thanks to C. Sandor for reminding me about this).
Anyways, Save Project will create a .d2v file and at least one audio track in the same directory.
If you'd like, you can convert the audio file to a Wav file ahead of time using Shutter Encoder, or with a simple FFMPEG command like this:
ffmpeg -i "audio.ac3" -c:a pcm_s16le "audio.wav"
The resulting file should work in editing programs either on its own or muxed with the video file we'll be creating in a moment. If the original file has more than 2 channels, they may not be in the correct order is you just use the command above. If you need to mix down 5.1 surround audio to stereo, a common suggestion that I've used is the -ac 2 option, like so:
ffmpeg -i "audio.ac3" -c:a pcm_s16le -ac 2 "audio.wav"
Alternatively, you can use the NicAudio AVISynth filter to import the AC3(or DTS) file, although I've sometimes run into sync issues when using it.
Create a new text document, then change the extension to .avs. Double-click to open it in Notepad or AvsPmod.
Add the following to the newly-created avs file:
video = MPEG2Source("yourproject.d2v")If you want to upscale to 720p from an anamorphic widescreen DVD, add a command like this:.
audio = WavSource("audio.wav")
AudioDub(video, audio)
Spline64Resize(720, 540)
or
BilinearResize(640,480)
instead to correct for the pixel aspect ratio difference between NTSC video and modern displays. Spline64 uses sharpening, Bilinear does not.
For 23.976/25 fps DVDs (most movies), you'll need to perform an "inverse telecine" to extract out the progressive frames from the interlaced video. In my experience, it's best here to use the .d2v file to inform TFM what field order to use:
video = MPEG2Source("yourproject.d2v")
audio = WavSource("audio.wav")
AudioDub(video, audio)
TFM(order=-1, d2v="yourproject.d2v")
TDecimate(cycle=1)
Spline64Resize(1280, 720)
For originally interlaced content, you'll need to use QTGMC:
video = MPEG2Source("yourproject.d2v")
audio = WavSource("audio.wav")
AudioDub(video, audio)
AssumeBFF()
QTGMC(Preset="Slower", FPSDivisor=1)
Spline64Resize(720, 540)
FPSDivisor as included in the above command does nothing, letting the framerate be doubled to 59.94fps. However, if you change the 1 to 2, it will divide the framerate in half, resulting in a cleanly derived 29.97fps. Match the framerate to the project you're importing the video into, or the deliverables spec for your ultimate destination.
When you're ready, you can load your .avs script into VirtualDub2 and test it out. If you don't get any errors, you can try rendering.
ffmpeg -i "your.avs" -c:v prores -profile:v 3 -c:a pcm_s16le "output.mov"
ffmpeg -i "your.avs" -vf "colormatrix=bt601:bt709" -c:v prores -profile:v 3 -c:a pcm_s16le "output.mov"
If you need more info on colorspace conversions using pix_fmt, check out the ProRes section at the following link:
https://trac.ffmpeg.org/wiki/Encode/VFX
And that's it. Simple, right? ;)


No comments:
Post a Comment