Skip to content

Instantly share code, notes, and snippets.

@discarn8
Created April 12, 2022 00:39
Show Gist options
  • Save discarn8/c6fe0b855d49db04d8df21b3000d9ad8 to your computer and use it in GitHub Desktop.
Save discarn8/c6fe0b855d49db04d8df21b3000d9ad8 to your computer and use it in GitHub Desktop.
webm_convert_to_mp3
#!/bin/bash
# Convert your directory of webm files to mp3 automatically
D="/your_folder_here"
echo $D
while IFS= read -r -d '' file; do
echo "Processing $file" >> "$D/converted.txt"
sleep 1
ffmpeg -nostdin -i "$file" -vn -ab 320k -ar 48000 -y "${file%.*}.mp3"
rm "$file"
done < <(find $D -maxdepth 5 -type f -name "*.webm" -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment