Advertisement
Guest User

Old version

a guest
Jan 8th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # DESCRIPTION:
  4. # Very simple script to read the contents of the working
  5. # directory and encode all .avi files to .m4v for adding
  6. # to iTunes.
  7. #
  8. # USES:
  9. # * HandBrakeCLI to encode the files
  10. # * Rsync to copy encoded files to their final destination
  11. #   so that progress can be tracked.
  12. #
  13. # TODO:
  14. # * Find a way to make HandBrakeCLI run silently
  15. #
  16.  
  17. output_destination="[PATH/TO/SHARE]"
  18.  
  19. for input in *.avi; do
  20.     output=$(echo $input|sed "s/.avi/.m4v/g")
  21.     HandBrakeCLI -i "$input" -o "$output" --preset="AppleTV 2"
  22.     rsync -az --progress "$output" "$output_destination"
  23.     rm "$output"
  24.     rm "$input"
  25. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement