Question

ffmpeg binary not found

Posted January 16, 2021 659 views
NginxPythonFlask

ffmpeg binary not found

python version = 3.6.5
os : ubuntu 20.0.4
nginx + uwsgi

when i try to execute ffmpeg using python code in my python shell it’s work but when i try the same thing with nginx+uwsgi in my api it’s not working.

1 comment
  • ffmpeg is installed and accessible on everywhere in system

    root@ubuntu:~# which ffmpeg 
    /usr/local/bin/ffmpeg
    
    
    root@ubuntu:~# whereis ffmpeg
    ffmpeg: /usr/bin/ffmpeg /usr/local/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
    
    

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there @kotadiyavivek,

What I could suggest is installing ffmpeg via pip as well:

pip install ffmpeg

Let me know how it goes!
Regards,
Bobby

  • @bobbyiliev

    (testvenv) root@ubuntu:/var# pip freeze | grep 'ffmpeg'
    ffmpeg==1.4
    ffmpeg-python==0.2.0
    

    i have already installed ffmpeg dependency in my virtualenv, but still not working.

    • Hi there,

      Have you tried specifying the full path to the ffmpeg binary as per this discussion here.

      Regards,
      Bobby

      • @bobbyiliev

        can you please check this configuration of my droplet and tell me what’s wrong here?

        root@ubuntu:~# whereis ffmpeg
        ffmpeg: /usr/bin/ffmpeg /usr/sbin/ffmpeg /usr/local/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
        root@ubuntu:~# 
        
        
        root@ubuntu:~# which ffmpeg 
        /usr/local/bin/ffmpeg
        
        
        root@ubuntu:~# whereis nginx
        nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
        root@ubuntu-s-1vcpu-1gb-nyc3-01:~# 
        
        
        root@ubuntu:~# which nginx 
        /usr/sbin/nginx
        root@ubuntu:~# 
        
        • Hi there @kotadiyavivek,

          The configuration looks good. Have you tried providing the full path to the ffmpeg binary in your script?

          Regards,
          Bobby

          • thank you @bobbyiliev for your quick response.
            we are using a python library https://github.com/deezer/spleeter/ in which we are getting this error, it’s not my custom script in which i’m getting this issues it’s a third party lib in which we are getting this error.

            please take look at this issues posted by us https://github.com/deezer/spleeter/issues/546

          • Hi there @kotadiyavivek,

            As far as I can see here you might be able to set an environment variable called FFMPEG_PATH with the path to the binary file.

            Let me know how it goes!
            Regards,
            Bobby

          • @bobbyiliev

            root@ubuntu-s-1vcpu-1gb-nyc3-01:~# echo $FFMPEG_PATH 
            /usr/bin/ffmpeg
            root@ubuntu-s-1vcpu-1gb-nyc3-01:~# 
            
            current_dir  /var/www/vocal/app/main/file_upload
            upload_dir_path  /var/www/vocal/app/main/file_upload/upload
            True <<<<<
            temp_file /var/www/vocal/app/main/file_upload/upload/file_example_MP3_700KB_04f44726-4ab9-4406-a111-96df3db692a5.mp3
            2021-02-06 06:05:07.261193: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
            2021-02-06 06:05:07.272130: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2294600000 Hz
            2021-02-06 06:05:07.272444: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55d562e1bce0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
            2021-02-06 06:05:07.272478: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
            Error while processing file with spleeter : ffmpeg binary not found
            [pid: 425576|app: 0|req: 6/14] 42.111.125.254 () {44 vars in 886 bytes} [Sat Feb  6 06:05:07 2021] POST /api/file_upload => generated 83 bytes in 196 msecs (HTTP/1.1 200) 3 headers in 103 bytes (18 switches on core 0)
            ^C
            
            
            
          • Hi there,

            While you are in the virtual environment, it is possible that you have a different path than while you are in your standard shell. Have you checked your PATH while in the testenv?

            Regards,
            Bobby