FFMPEG Python - Convert Audio Files to MP3 SUPER FAST !
How to convert thousands of flac, wav, wma, aac, m4a, aiff, webm, ogg, opus or raw audio files to mp3 super fast using ffmpeg and Python.
In this video we start off by simulating a bash for loop and converting the flac test files sequentially using ffmpeg to demonstrate that only one CPU core is used to transcode the group of flac files to mp3 files using this method. Leaving all of the other CPU cores essentially idling.
We then modify the python script with one simple change to use all of the available CPU cores to convert our flac files to mp3 files and this gives us a massive speed boost, we cut down the transcode time significantly.
Finally we increase our transcode speed even more by using variable bit rate (VBR) mp3 files instead of creating constant bit rate (CBR) mp3 files.
This allowed use to increase our transcode speed to over 725% ( yes you read that right, Seven hundred and twenty five percent speed increase ) faster than our bash for loop method.
We could probably get this speed increase go a little higher if we were to use asycio instead of a thread pool as this would eliminate the thread creation overhead and thread banging wouldn't occur. I may test this in the future but I think over 725% speed increase is pretty good for a 20 minutes rough python script.
Would be interesting to see how fast this would be on a 64 core AMD Threadripper.
OS: Ubuntu 19.04
FFmpeg version: 7:4.1.3-0ubuntu1
Github:
Subscribe:
Blog:
Twitter:
Facebook:
Watch video FFMPEG Python - Convert Audio Files to MP3 SUPER FAST ! 🔥 online without registration, duration 09 minute 04 second in high hd quality. This video was added by user Linux Leech 14 June 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 17 thousand once and liked it 200 people.