How to get MP3 file from a WebM video
Read it in: CatalàCastellano
Another title for this post could be: "Getting audio from video clips". Because you could do it with MP4 (Mpeg4), WebM, Mov, FLV, etc. We are going to use ffmpeg to that:
ffmpeg -i input_file.webm -ab 128k -ar 44100 out_file.mp3
The meaning of the parameters:
-
ab: the audio bitrate in bps
-
ar: the audio sample rate in hz
And if you have a directory with a lot of files to convert you could use:
find . -name "*.webm" -print0 |while read -d
Pay attention to "find" and "while read" commands combinations because we want to support files with spaces.
I hope this is as useful for you as for me.
\0' file; do ffmpeg -i "$file" -ab 128k -ar 44100 -y "${file%.webm}.mp3";done
Pay attention to "find" and "while read" commands combinations because we want to support files with spaces.
I hope this is as useful for you as for me.
6 comments
Comments from the old blog, as they were written. Comments are closed.
Bagus Aji Santoso
Nice tutorial
mauriciolazo
Wow, incredibly simple, yet so powerful. Thank you very much! This is amazing.
Christian
When I copy and paste a command-line sample, a trailer is added: "- See more at: http://oriolrius.cat/blog/2013/09/20/converting-webm-files-to-mp3/". That's very inconvenient, can you turn that off somehow?
Oriol Rius
Solved, try now.
Isla
Incredible, man. Thanks a lot.
Boris
May you need a YouTube to MP3 converter, as like AnyMusic.