Movies
Disc dump
DVD
Dump DVD contents to hard drive 1:
mplayer dvd://${TITLE} -dvd-device /dev/sr0 -dumpstream -dumpfile ${NAME}.vob
Blu-ray
Dump Blu-ray contents to hard drive 2,3:
makemkvcon backup disc:0 ${NAME}/ --decryptor:
dumphd /media/cdrom ${NAME}/
Chapters
DVD
Get chapters and subtitle Information 4:
dvdxchap -t ${TITLE} /dev/sr0 > chapters.txt cp /media/cdrom/VIDEO_TS/VTS_01_0.IFO .
Subtitles
DVD
Rip subtitle tracks to disk 5:
mencoder ${NAME}.vob -nosound -ovc copy -o /dev/null -vobsubout output-sub -sid 0 -vobsuboutindex 0 -vobsuboutid enRip subtitle tracks (e.g. 0x20 for sid 0) to disk 6:
tccat -i ${NAME}.vob | tcextract -x ps1 -t vob -a ${HEXSID} > sid-${SID} subtitle2vobsub -o output-${SID}.sub -i VTS_01_0.IFO -a ${SID} < sid-${SID}
Audio
FFmpeg
Dump audio tracks to hard drive 7:
ffmpeg -i ${NAME}.{m2ts,vob} -map 0:2 -metadata:s:a:0 language=eng -metadata:s:a:0 title="English audio" -codec:a copy output-eng.ac3 ffmpeg -i ${NAME}.{m2ts,vob} -map 0:3 -metadata:s:a:0 language=spa -metadata:s:a:0 title="Spanish audio" -codec:a copy output-spa.ac3 ffmpeg -i ${NAME}.{m2ts,vob} -map 0:4 -metadata:s:a:0 language=eng -metadata:s:a:0 title="English commentary" -codec:a copy output-1.ac3
MPlayer
Dump audio tracks to hard drive 8:
mplayer ${NAME}.{m2ts,vob} -aid 0 -dumpaudio -dumpfile output-eng.ac3 mplayer ${NAME}.{m2ts,vob} -aid 1 -dumpaudio -dumpfile output-spa.ac3 mplayer ${NAME}.{m2ts,vob} -aid 2 -dumpaudio -dumpfile output-1.ac3
Video
Get cropping information 9:
mplayer ${NAME}.{m2ts,vob} -vf cropdetect -sb 50000000
FFmpeg
Create a 2min. sample encoding 10:
ffmpeg -i ${NAME}.{m2ts,vob} -ss 00:10:00 -t 00:02:00 -an -sn -c:v libx264 -x264opts ${PARAMETERS} -filter:v crop=${WIDTH}:${HEIGHT}:${X}:${Y} sample.264Encode the video 11:
ffmpeg -i ${NAME}.{m2ts,vob} -an -sn -c:v libx264 -x264opts ${PARAMETERS} -filter:v crop=${WIDTH}:${HEIGHT}:${X}:${Y} output.264Parameters for noise reduction 12:
ffmpeg -i ${NAME}.{m2ts,vob} -filter:v hqdn3d output-denoised.264
MEncoder
Create a 2min. sample encoding 13:
mencoder ${NAME}.{m2ts,vob} -ss 00:10:00 -endpos 00:02:00 -nosub -nosound -profile ${PRESET} -ovc x264 -x264encopts ${PARAMETERS} -vf crop=${WIDTH}:${HEIGHT}:${X}:${Y} -of rawvideo -o sample.264-
mencoder ${NAME}.{m2ts,vob} -nosub -nosound -profile ${PRESET} -ovc x264 -x264encopts ${PARAMETERS} -vf crop=${WIDTH}:${HEIGHT}:${X}:${Y} -of rawvideo -o output.264 Parameters for noise reduction 16:
mencoder ${NAME}.{m2ts,vob} -vf denoise3d -o output-denoised.264
HandBrake
Create a 2min. sample encoding 17:
HandBrakeCLI -i ${NAME}.{m2ts,vob} --start-at duration:10 --stop-at duration:130 -a none -Z ${PRESET} -e x264 -x ${PARAMETERS} -w ${WIDTH} -l ${HEIGHT} -o sample.mkvEncoding the video 18:
HandBrakeCLI -i ${NAME}.{m2ts,vob} -a none -Z ${PRESET} -e x264 -x ${PARAMETERS} -w ${WIDTH} -l ${HEIGHT} -o output.mkvParameters for noise reduction 19:
HandBrakeCLI -i ${NAME}.{m2ts,vob} --nlmeans -o output-denoised.mkv
Multiplexing
Merge all multimedia streams in a Matroska container 20,21:
mkvmerge --title "${MOVIE_TITLE}" --chapters chapters.txt --default-duration 0:${VIDEO_FPS}fps --default-language eng --clusters-in-meta-seek --disable-lacing -A output.264 output-eng.ac3 --language 0:spa output-spa.ac3 --track-name 0:"Commentary" output-1.ac3 output-${SID}.idx -o video.mkvMerge directly from an MPLS file into a Matroska container:
mkvmerge --title "${MOVIE_TITLE}" --default-duration 0:${VIDEO_FPS}fps --default-language eng --clusters-in-meta-seek --disable-lacing --video-tracks 0 --audio-tracks 1,2,3 --language 2:spa --track-name 3:"Commentary" --subtitle-tracks 7 ${PLAYLIST}.mpls -o video.mkv
Screenshots
Get screenshot of source and encode files 22:
mplayer -noautosub -nosub -nosound -vo png:z=0 -frames 1 -ss 00:20:00 -loop 1 -vf crop=${WIDTH}:${HEIGHT}:${X}:${Y},scale=${WIDTH}:${HEIGHT} ${NAME}.{m2ts,vob} mplayer -noautosub -nosub -nosound -vo png:z=0 -frames 1 -ss 00:20:00 -loop 1 -vf scale=${WIDTH}:${HEIGHT} video.mkv
Video Games
Convert from ECM to BIN and CUE 23:
ecm-uncompress ${NAME}.bin.ecmConvert from APE to BIN:
ffmpeg -i ${NAME}.ape ${NAME}.wav genisoimage -R -o ${NAME}.bin ${NAME}.wav
Ripping DVD to Matroska and H.264 > Rip VOB to Hard Drive - Gentoo Linux Wiki↩︎
Ripping DVD to Matroska and H.264 > Chapters and Subtitle Information - Gentoo Linux Wiki↩︎
FFmpeg DVD > Extract The Subtitles From a VOB File - Indie IT Wiki↩︎
Ripping DVD to Matroska and H.264 > Subtitles - Gentoo Linux Wiki↩︎
How to convert VOB files to mkv with FFmpeg - Internal Pointers↩︎
Ripping DVD to Matroska and H.264 > Audio - Gentoo Linux Wiki↩︎
Ripping DVD to Matroska and H.264 > Cropping - Gentoo Linux Wiki↩︎
X264 encoding in Linux/BSD > Making small source samples for script testing - SDWiki↩︎
Ripping DVD to Matroska and H.264 > Transcode to H.264 - Gentoo Linux Wiki↩︎
Ripping DVD to Matroska and H.264 > Merge Multimedia Streams - Gentoo Linux Wiki↩︎
Improving playback compatibility with players · mbunkus/mkvtoolnix Wiki↩︎
X264 encoding in Linux/BSD > Making comparison screenshots - SDWiki↩︎