Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Last active November 27, 2024 13:37
Show Gist options
  • Select an option

  • Save ZiTAL/12078f0cb404c0113984b6a3b60fe1ad to your computer and use it in GitHub Desktop.

Select an option

Save ZiTAL/12078f0cb404c0113984b6a3b60fe1ad to your computer and use it in GitHub Desktop.
gnu/linux: dvd to mp4
#!/bin/bash
# apt-get install libdvdcss2 dvdbackup ffmpeg
dvdbackup -i /dev/sr0 -o /tmp/example -M
#!/bin/bash
# VOB to MP4
# example: 02.sh example
DIR=$1
LS=$(ls -1 ${DIR} | grep -E "\.VOB$")
for video in ${LS}; do
echo "Processing file: ${DIR}/${video}"
ffmpeg -i ${DIR}/${video} -vcodec h264_nvenc -b:v 4000k -r 30 -acodec aac -b:a 192k -ar 48000 -ac 2 ${DIR}/${video}.mp4
done
file 'example/VTS_01_1.VOB.mp4'
file 'example/VTS_02_1.VOB.mp4'
file 'example/VTS_03_1.VOB.mp4'
file 'example/VTS_04_1.VOB.mp4'
file 'example/VTS_05_1.VOB.mp4'
file 'example/VTS_06_1.VOB.mp4'
file 'example/VTS_07_1.VOB.mp4'
file 'example/VTS_08_1.VOB.mp4'
file 'example/VTS_09_1.VOB.mp4'
file 'example/VTS_09_2.VOB.mp4'
#!/bin/bash
ffmpeg -f concat -safe 0 -i 03.txt -c:v h264_nvenc -b:v 4000k -crf 0 -c:a aac -b:a 192k -ar 48000 -ac 2 example/output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment