An issue with pydub

Hello my dear friends.
I’m having some issues with pydub wich is a python library.
the problem seems to be related to ffprobe not being installed at all/properly. here is the error output:

Traceback (most recent call last): File "/app/.heroku/python/lib/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/app/.heroku/python/lib/python3.11/threading.py", line 975, in run self._target(*self._args, **self._kwargs) File "/workspace/telebot.py", line 1086, in prun_check audio = AudioSegment.from_file(audio_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.heroku/python/lib/python3.11/site-packages/pydub/audio_segment.py", line 728, in from_file info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.heroku/python/lib/python3.11/site-packages/pydub/utils.py", line 274, in mediainfo_json res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.heroku/python/lib/python3.11/subprocess.py", line 1024, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/app/.heroku/python/lib/python3.11/subprocess.py", line 1917, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'

Thanks in advance.

Hi there,

Thank you for your message. ffmpeg is a system package and it is not possible to install it during deployment. You will soon be able to build the project from Dockerfile. For now, you can create your own Docker image and then deploy it on Koyeb.

Thanks,
Sebastian

1 Like

You will soon be able to build the project from Dockerfile.

You mean using a prebuilt ffmpeg dockerfile?

Hello,

When deploying your application on Koyeb, there are a few different options available. Here are two methods you can use:

  1. Docker Image: You can deploy a Docker image hosted on Docker Hub or any other container registry. By specifying the Docker image, Koyeb will pull it and deploy your application.

  2. GitHub Application: Another option is to create a GitHub application. With this approach, whenever you push changes to your repository, Koyeb will automatically build and deploy your application based on the updated code.

On the service page in Koyeb, you can configure the build process using two modes:

a. Buildpack: Koyeb will attempt to automatically build your application using a buildpack. This method should work for most cases.

b. Dockerfile: If you choose this mode, you need to have a Dockerfile in the root folder of your repository. Koyeb will build your application based on the instructions in the Dockerfile. This gives you the flexibility to define your dependencies and any other relevant configurations required to run your application.

Regarding your question about installing the Python dependency pydub, which relies on the system package ffmpeg to build successfully, it’s worth noting that you don’t necessarily need to have ffmpeg installed. You can find the pydub package on PyPI (Python Package Index) at https://pypi.org/project/pydub/#files. Pydub provides a pre-compiled .whl file, which means you don’t have to worry about installing ffmpeg separately.

To install pydub on Koyeb, you can simply add it to the requirements.txt file, and Koyeb will utilize the .whl file during the installation process. This approach should work smoothly without requiring ffmpeg specifically.

1 Like