Skip to content

Ripping

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}/ --decrypt

    or:

      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 en
  • Rip 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.264
  • Encode the video 11:

      ffmpeg -i ${NAME}.{m2ts,vob} -an -sn -c:v libx264 -x264opts ${PARAMETERS} -filter:v crop=${WIDTH}:${HEIGHT}:${X}:${Y} output.264
  • Parameters 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
  • Encoding the video 14,15:

      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.mkv
  • Encoding the video 18:

      HandBrakeCLI -i ${NAME}.{m2ts,vob} -a none -Z ${PRESET} -e x264 -x ${PARAMETERS} -w ${WIDTH} -l ${HEIGHT} -o output.mkv
  • Parameters 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.mkv
  • Merge 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.ecm
  • Convert from APE to BIN:

      ffmpeg -i ${NAME}.ape ${NAME}.wav
      genisoimage -R -o ${NAME}.bin ${NAME}.wav

  1. Ripping DVD to Matroska and H.264 > Rip VOB to Hard Drive - Gentoo Linux Wiki↩︎

  2. The Ultimate Automated Ripping Machine - Pat Hartl↩︎

  3. DumpHD - a HD-DVD / Blu-Ray Decrypter - Doom9’s Forum↩︎

  4. Ripping DVD to Matroska and H.264 > Chapters and Subtitle Information - Gentoo Linux Wiki↩︎

  5. FFmpeg DVD > Extract The Subtitles From a VOB File - Indie IT Wiki↩︎

  6. Ripping DVD to Matroska and H.264 > Subtitles - Gentoo Linux Wiki↩︎

  7. How to convert VOB files to mkv with FFmpeg - Internal Pointers↩︎

  8. Ripping DVD to Matroska and H.264 > Audio - Gentoo Linux Wiki↩︎

  9. Ripping DVD to Matroska and H.264 > Cropping - Gentoo Linux Wiki↩︎

  10. FFmpeg > x264: constant rate factor - ArchWiki↩︎

  11. FFmpeg > x264: constant rate factor - ArchWiki↩︎

  12. FFmpeg Filters Documentation > hqdn3d↩︎

  13. X264 encoding in Linux/BSD > Making small source samples for script testing - SDWiki↩︎

  14. MEncoder > Ripping and encoding the video - ArchWiki↩︎

  15. Ripping DVD to Matroska and H.264 > Transcode to H.264 - Gentoo Linux Wiki↩︎

  16. Mencoder howto > x264 codec - QuakeWorld Wiki↩︎

  17. CLIGuide HandBrake↩︎

  18. CLIGuide HandBrake↩︎

  19. NLMeans denoise filter - Handbrake↩︎

  20. Ripping DVD to Matroska and H.264 > Merge Multimedia Streams - Gentoo Linux Wiki↩︎

  21. Improving playback compatibility with players · mbunkus/mkvtoolnix Wiki↩︎

  22. X264 encoding in Linux/BSD > Making comparison screenshots - SDWiki↩︎

  23. Redump↩︎