In my ffmpeg book, I have mentioned that it is pointless to use ffmpeg to backup DVDs as the VOB files are huge and movie companies go to great lengths to foil ripping attempts.
Yesterday, I wrote a post on ripping VCD images in CUE/BIN formats. I wondered if something similar could be done with DVD ISOs found on Archive.org. These ISOs would not be encrypted.
I have heard a lot about Handbrake but never used until today because their site offers only flatpack images. I hate flatpacks and similar universal binary images. Today, I was looking to install dvdbackup from the Software Manager app and I found that Ubuntus or Mints have a native DEB installer for Handbrake.
I mounted my DVD ISOs that I downloaded from Archive.org but Handbrake did not detect them as virtual DVD drives. I loaded the source files from the _VIDEOTS directory and I was able to extract the video tracks. It however messed up the audio tracks. The DVD publishers chop the tracks in awkward places and reorder their streams to foil DVD-ripping attempts. I had to rely on dvdbackup and ffmpeg to make a single-file backup.
How to
First, mount the ISO in your file manager. (In my Mate desktop, I have a couple of option when I right-click the file. If you use Gnome 3, I do not think you are allowed to right-click anything as that is too complicated (according to the developers). I cannot help ya.)
Assuming that the DVD is mounted at /media/ya_username/DVD_VOL, use dvdbackup to list the tracks in the disc.
dvdbackup -i /media/ya_username/DVD_VOL -I
dvdbackup refers to the main movie as the main feature. Other tracks such as extras are called title sets.
You can back up the main movie like this:
dvdbackup -i /media/ya_username/DVD_VOL -n "Idiocracy" -F
If you want to backup some other track, say, the sixth one:
dvdbackup -i /media/ya_username/DVD_VOL -n "Idiocracy" -T 6
These tracks will be saved in the current directory at Idiocracy/VIDEO_TS. You can then use ffmpeg to concatenate them into a single file. When you concatenate files using ffmpeg, use the concat filter. This filter is more robust than concat demuxer or concat protocol. However, you need to ensure that the video tracks all have the same dimensions. The concat filter is further plagued by timestamp errors so ensure that the streams in each track is passed through setpts=PTS-STARTPTS and asetpts=PTS-STARTPTS before the concat filter. If you get Sample Aspect Ratio (SAR) errors, then pass the timestamp-corrected streams through setdar=dar=16/9 or setdar=dar=4/3 filters.
Do note that DVD tracks may have additional audio streams (languages, director's track, etc.). You may have to use ffprobe to correctly identify them and extract them. Concatenate them as you did with video and then slipstream the final audio into the final video.
ffprobe Idiocracy/VIDEO_TS/VTS_01_1.VOB
You can then test-play an audio stream, say the third stream in the file, like this:
ffplay -f lavfi "amovie=Idiocracy/VIDEO_TS/VTS_01_1.VOB:s=2"
As I had mentioned earlier, it is not easy. And, there is another thing you need to take care of when dealing with DVDs. If you have 5.1 audio and need to downmix to stereo, you need to boost vocal channel.
Become an FFmpeg PRO by reading my book Quick Start Guide to FFmpeg.
- MORE INFO — http://www.vsubhash.in/ffmpeg-book.html
- BUY — https://books2read.com/ffmpeg (common link for all stores)
