How to upload ffmpeg to Azure Function Environment PATH [Python]

Wang Zihao 11 Reputation points
2021-11-10T11:09:27.02+00:00

I have a audio processing Python script that I would like to move into an azure function.

The audioread library I used in Python script requires FFMPEG binary file exist in system PATH. if FFMPEG binary file is not existed in system PATH, the audioread function cannot detect the ffmpeg and output NoBackendError.

Now I can upload ffmpeg binary file together with my python code to Azure function /home/site/wwwroot. However, since the ffmpeg is not in the correct path (/usr/bin), the python code run on the Azure function will output NoBackendError. I would like to know is there any ways that can move or copy ffmpeg binary file to the correct PATH or any alternative methods that make audioread library detect the ffmpeg.

I have checked the doc:
https://learn.microsoft.com/en-us/azure/azure-functions/bring-dependency-to-functions?pivots=programming-language-python#accessing-the-dependencies-in-your-code

https://stackoverflow.com/questions/55132619/how-to-add-and-execute-a-binary-in-azure-functions

Both is to run ffmpeg command line tool but cannot make python library detect the ffmpeg.

Anyone can help me, thanks!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,915 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,656 Reputation points Microsoft Employee Moderator
    2021-11-23T15:27:41.48+00:00

    @Wang Zihao I believe updating the PATH environment variable should do the trick here but I believe the better approach in the long term would be to use a custom container with your dependencies available since an update to the underlying environment on Azure could break your application.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.