convert_mp4_to_mp3.sh 319 B

12345678910111213141516
  1. #!/bin/shj
  2. # script to convert all mp4 files to mp3 using ffmpeg
  3. for f in `ls *.mp4`
  4. do
  5. filename=$(basename -- "$f")
  6. echo "Converting $filename"
  7. basename=$(basename $f '.mp4')
  8. ffmpeg -i $filename "$basename.mp3"
  9. done
  10. #alternate way to find basename, if you don't know ext
  11. #filename="${filename%.*}"