I had the need to batch convert some music files from a wma format to mp3 and for which the filename was in japanese, but the title metadata tag was correctly setted in english. I wanted to set the filename according to the title metadata.

Searching on internet leads me to this small code snippet.

# sh
mkdir encoded
for f in *.wma; do
  ffmpeg -i "$f" -y -f ffmetadata meta.txt; 
  t=$(awk -F= '/title/ { print $2 }' meta.txt); 
  ffmpeg -i "$f" -acodec libmp3lame encoded/"$t.mp3";
done;

Created on 29-03-2014 by Eric le bihen

comments powered by Disqus