DVD-Titel auslesen mit VLC und Durchsatzmessung

vlcvob:

  1. #!/bin/sh
  2.  
  3. # Check prerequirements (assume that 'rm', 'mkfifo' etc are available)
  4. echo "Checking prerequirements..."
  5. if ! (which mktemp && which pv && which cvlc); then
  6. echo "Missing required programs. See output for info." >&2
  7. exit 1
  8. fi
  9.  
  10. source="$1"
  11. destination="$2"
  12. fifo="$(mktemp)"
  13.  
  14. if [ "x$source" = "x" ] || [ "x$destination" = "x" ]; then
  15. echo "Read vob file from DVD using VLC." >&2
  16. echo "Usage: $0 " >&2
  17. echo "Example:" >&2
  18. echo " Store first title from device '/dev/dvd' to 'filename.vob':">&2
  19. echo " $0 dvdsimple:///dev/dvd@1 filename.vob" >&2
  20. exit 1
  21. fi
  22.  
  23. if [ -e "$destination" ]; then
  24. echo "File '$destination' already exists. Please remove first." >&2
  25. exit
  26. fi
  27.  
  28. # Command from http://www.gentoo-wiki.info/HOWTO_Backup_a_DVD.
  29. # Other commands that should work (untested):
  30. # CMD="mplayer dvd://$TITLE -dvd-device $DEVICE -dumpstream -dumpfile '$fifo'"
  31. # CMD="mplayer dvdnav://$TITLE -nocache -dvd-device $DEVICE -dumpstream -dumpfile '$fifo'"
  32. CMD="cvlc '$source' --sout '#standard{access=file,mux=ps,dst=$fifo}' vlc://quit"
  33.  
  34. echo "Creating FIFO file '$fifo'..."
  35. rm "$fifo" && mkfifo "$fifo" || exit 1
  36.  
  37. echo "Starting VLC: $CMD"
  38. eval $CMD &
  39. vlcpid="$!"
  40.  
  41. # Wait a second or so to let VLC do it's work
  42. sleep 5
  43.  
  44. pv -petrb "$fifo" > "$destination" &
  45. pvpid="$!"
  46.  
  47. wait "$vlcpid"
  48. kill "$pvpid"
  49. rm "$fifo"

Disclaimer:
Selbstverständlich sind dabei die Urheberrechte zu beachten! Für selbsterstellte DVDs ist das unproblematisch. Ein Kopierschutz darf jedoch zumindest in Deutschland nicht umgangen werden.

Add new comment