Posted By

Affix on 01/08/11


Tagged

ffmpeg


Versions (?)

AVI Converter


 / Published in: Bash
 

URL: http://affix.me

convert a directory of AVI files into mpegs

  1. #!/bin/bash
  2. #
  3. # run FFMPeg to convert a directory of AVI into mpeg
  4. #
  5.  
  6.  
  7. if [ -d ${args[0]} ]; then
  8. echo "Directory to be Converted : ${args[0]}"
  9. else
  10. echo "Directory ${args[0]} does not exist"
  11. exit;
  12. fi
  13.  
  14. if [ -d ${args[0]}/out ]; then
  15. echo "Output Directory : ${args[0]}/out"
  16. else
  17. echo "Creating output directory!"
  18. mkdir ${args[0]}/out
  19. echo "Output Directory : ${args[0]}/out"
  20. fi
  21.  
  22. for f in ${args[0]}/*
  23. do
  24.  
  25. if [ -d $f ]; then
  26. echo "Will not recurse into directory"
  27. else
  28. if [ "$f" == "*.avi" ]; then
  29. echo "Processing $f file..."
  30. ffmpeg -i $f -target pal-dvd -ps 2000000000 -aspect 16:9 ${args[0]}/out/$f.mpeg > /dev/null 2>&1
  31. else
  32. echo "$f is of invalid type!"
  33. fi
  34. fi
  35.  
  36. done

Report this snippet  

You need to login to post a comment.