code_junkie

How do I programmatically convert mp3 to an itunes-playable aac/m4a file?

Nov 10th, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. ffmpeg -i source.mp3 -acodec libfaac -ab 128k dest.aac
  2.  
  3. #!/bin/sh
  4.  
  5. TARGET=$1
  6.  
  7. BASE=`basename "${TARGET}"`
  8. echo TARGET: "${TARGET}"
  9. echo BASE: "${BASE}" .m4a
  10.  
  11. # Warning! Race condition vulnerability here! Should use a mktemp
  12. # variant or something...
  13. mkfifo encode
  14. mplayer -quiet -ao pcm -aofile encode "${TARGET}" &
  15. lame --silent encode "${BASE}".mp3
  16. rm encode
Add Comment
Please, Sign In to add comment