bunnytaur

Untitled

Feb 10th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.82 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Simple PSP Video converter script
  4. # Converts some common, and optionally not so common formats to something that should play on a psp.
  5. # Made by Jennifer "bunnytaur" Stears ([email protected])
  6.  
  7. # TODO: Find and fix bugs. Add functonality. Correct spelling.
  8.  
  9. # NOTES: Mplayer's lavf muxer is apparently broken... this should work, if not let me know.
  10. #        You will need mplayer and the required libraries.
  11. #        This should work on ubuntu and debian.
  12. #        sudo aptitude install nasm yasm libfaac libfaac-dev libxvidcore libxvidcore-dev liba52 liba52-dev gtk+2.0-dev build-essential subversion
  13. #        If you do not have aptitude installed, use apt-get instead.
  14. #        The above will(should) get all the libraries you need at minium to get mplayer to install from source.
  15. #        Grab mplayer using svn: svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
  16. #        Go to the newly created mplayer directory: cd mplayer
  17. #        Then type: sh configure
  18. #        If there isn't any problems, now run make -jX where X is the number of cores/cpu(s) in your system. If you have a quad core you would run make -j4
  19. #        After that is finished and there is no errors install it by doing sudo make install.
  20. #        There you have it, an awesome media player and media encoder.
  21. #        If you have problems, look on the ubuntu forums, or use google. You can try to email me, and I will try to help if I can.
  22.  
  23. # USAGE: pspconvert.sh indir outdir threads
  24.  
  25. count=`ls "$1" | wc -l`;
  26. filen=0;
  27. for file in *{.mpg,.mpeg,.mp2,.mp4,.AVI,.xvid,.mkv,.wmv,.rmvb};
  28. do filen=`expr $filen + 1`;
  29. mencoder -ovc lavc -oac lavc -of lavf \
  30. -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:\
  31. vbitrate=1000:threads=$3:acodec=libfaac -af \
  32. lavcresample=24000 -vf scale=480:272,harddup \
  33. -lavfopts format=psp -ofps 30000/1001 \
  34. "$1"$file -o "$2/${file%.*}.mp4";
  35. echo "RAWR!";
  36. done
Add Comment
Please, Sign In to add comment