Media Backup
By Tom Ratcliff
Backup Media From DVD to Filesystem
- Get sector size and count of the DVD
sudo isosize -x /dev/sr0
- Write the contents of the DVD to an ISO
sudo dd if=/dev/sr0 of=dvd.iso bs=2048 count=2131422 status=progress
- Mount the ISO and inspect the contents
sudo mount -o loop dvd.iso /mnt/iso
ls /mnt/iso/VIDEO_TS/
- Use FFmpeg to convert VOB to preferred format
For lossless
ffmpeg -i VTS_01_1.VOB -c:a copy -c:v libx265 -preset ultrafast -x265-params lossless=1 ~/mycoolvid.mkv
For compressed choose a suitable crf (higher the more compressed, lower closer to lossless)
ffmpeg -i VTS_01_1.VOB -c:a copy -c:v libx265 -preset ultrafast -crf 21 ~/mycoolvid.mkv
If there’s multiple .VOBs, you can concat them with a shell script and then use ffmpeg (ie: shows to movie)
ls -1 *VOB | tr '\n' '|'
ffmpeg -i concat:"VTS_01_1.VOB|VTS_02_1.VOB|VTS_03_1.VOB|VTS_04_1.VOB|VTS_05_1.VOB|VTS_06_1.VOB|VTS_07_1.VOB|VTS_08_1.VOB|VTS_09_1.VOB|VTS_10_1.VOB|VTS_11_1.VOB|VTS_12_1.VOB|VTS_13_1.VOB|VTS_14_1.VOB|VTS_15_1.VOB|VTS_16_1.VOB|VTS_17_1.VOB" -c:a copy -c:v libx265 -preset ultrafast -crf 21 ~/mycoolvid.mkv
Script to bulk process
⚠️ this will remove the original content (copy of mkv)
#!/bin/bash
IFS=$'\n'
for i in $(find . -iname '*mkv'); do
ffmpeg -i $i -target ntsc-dvd movie.mp4
dvdauthor --title --video=ntsc -o dvd -f movie.mp4
dvdauthor -o dvd -T
mkisofs -dvd-video -o "${i%.mkv}.iso" dvd/
rm -r dvd
rm $i
rm movie.mp4
done
Backup Media from Filesytem to DVD
- Convert file (if needed)
ffmpeg -i my_movie.avi -target ntsc-dvd movie.mpg
- Create DVD folder for AUDIO_TS & VIDEO_TS
dvdauthor --title --video=ntsc -o dvd -f movie.mpg
- Create Titles
dvdauthor -o dvd -T
- Make an ISO of the directory
mkisofs -dvd-video -o dvd.iso dvd/
- Burn image to DVD
wodim -v dev=/dev/sr0 -eject dvd.iso