We use cookies on this website to distinguish you from other users.
We use this data to improve our content experience and for targeted advertising.
By continuing to use this website you consent to our use of cookies.
For more information, please see our
Cookie Policy.
Posts tagged Ffmpeg
How to pipe an FFmpeg output and pass it to a Python variable?
- 19 März 2020
- 08 April 2022
- Munich
- English
- Signal processing
When writing code, the key optimization points are speed and efficiency. I often face this dilemma when using FFmpeg with Python. For example: when I need to convert an mp3 to a wave file and then do some processing to it in Python. The simple way to do this, is by using FFmpeg to convert the mp3 input to a wave, then read the wave in Python and do process it. Although this works, but clearly it is neither optimal nor the fastest solution. In this blog post, I will present an improved solution to this inconvenience by piping the output of FFmpeg to Python and directly pass it to a numpy variable.