Cannot find installation of real FFmpeg (which comes with ffprobe)

Question:

I was trying to fit a generator into a model and I got this error:
AssertionError: Cannot find installation of real FFmpeg (which comes with ffprobe).

I have looked over many of the solutions on GitHub and other questions on Stack Overflow but none of them worked for me.

Here is one of the commands I ran:

sudo add-apt-repository ppa:mc3man/trusty-media  
sudo apt-get update  
sudo apt-get install ffmpeg  
sudo apt-get install frei0r-plugins  

pip list also indicates the presence of ffmpeg-1.4

In addition, I tried force reinstalling and updating ffmpeg just in case any dependencies were not installed properly.

I also set the skvideo’s path for ffmpeg manually:

skvideo.setFFmpegPath('/usr/local/lib/python3.6/dist-packages/ffmpeg/')

This returns: /usr/local/lib/python3.6/dist-packages/skvideo/__init__.py:306: UserWarning: ffmpeg/ffprobe not found in path: /usr/local/lib/python3.6/dist-packages/ffmpeg/
warnings.warn("ffmpeg/ffprobe not found in path: " + str(path), UserWarning)

By the way, when I try installing, it also returns this error, I don’t know what to do about this:

Get:127 http://archive.ubuntu.com/ubuntu bionic/main amd64 vdpau-driver-all amd64 1.1.1-3ubuntu1 [4,674 B]
Fetched 60.4 MB in 7s (8,769 kB/s)
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/w/wavpack/libwavpack1_5.1.0-2ubuntu1.1_amd64.deb  404  Not Found [IP: 91.189.88.149 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I ran apt-get update --fix-missing and that didn’t make anything better.

Is there a solution to this?

Asked By: Asm Goni

||

Answers:

FYI it is best to share a minimal notebook that reproduces the entire issue you see to clarify what exactly you’re trying to do and how it’s going wrong. In this case you might be looking for the following:

!apt-get install --no-install-recommends ffmpeg && pip install ffmpeg scikit-video

import skvideo.io
import skvideo.datasets
bbb = skvideo.datasets.bigbuckbunny()
print('bigbuckbunny is in: {}'.format(bbb))
v = skvideo.io.vread(filename)
print('shape is: {}'.format(v.shape))

(if you’ve already apt/pip-installed a lot of things, esp. if you’ve “forced” installation of various packages, you might want to “Reset all runtimes” in colab to get a clean VM to run the above in)

Answered By: Ami F

Add this at the top of your script:

import skvideo
skvideo.setFFmpegPath('/usr/local/lib/python3.6/dist-packages/ffmpeg/')

You must set the FFmpeg path before you import skvideo.io, otherwise it will be ignored.

Answered By: Todd

For windows10 users

import skvideo
skvideo.setFFmpegPath('C:ProgramDataAnaconda3Libsite-packagesskvideoio')
Answered By: Ezra

For windows, you must specify the ffmpeg path. Download ffmpeg for windows from here: https://ffmpeg.zeranoe.com/builds/

Make sure to download the shared version

(if this link dies when you see this, just search “ffmpeg windows” and you will find a download)

Extract it anywhere (eg. C:\ffmpeg) and then point to it to skvideo like so:

import skvideo
skvideo.setFFmpegPath("C:\ffmpeg") # you need this before the import
import skvideo.io

vid_data = skvideo.io.vread("data/mp4/train.mp4") # example path
print(vid_data.shape)
Answered By: Asad-ullah Khan

For windows:

1.download ffmpeg-…-shared

https://ffmpeg.zeranoe.com/builds/

2.set path to /bin

import skvideo
skvideo.setFFmpegPath('D:\ProgramData\ffmpeg\ffmpeg-20190814-8fcc5d9-win64-shared\bin')
Answered By: Guobao Wang

Shortcut Way

ffmpeg link and unzip
You can do this in your code.
Make sure you put up to bin path of unzipped file

 import skvideo
 skvideo.setFFmpegPath("D:/ffmpeg-20170125-2080bc3-win64-static/ffmpeg- 
 20170125-2080bc3-win64-static/bin")

Permanent Way

One of the reasons might be that ffmpeg is not configured correctly,(its not always the case).

Step1:

Check ffmpeg is accessible from cmd, type ffmpeg in command line and see if it recognizes the command, if not download link and unzip and add it to the environment variable path Eg:

D:ffmpeg-20170125-2080bc3-win64-staticffmpeg-20170125-2080bc3-win64-staticbin

Step 2:

Use where ffmpeg in command line sometimes it could be pointing to wrong file, in my case imageMagick was installed, and system was referring to that

C:Program FilesImageMagick-7.0.8-Q16ffmpeg.exe,

either delete imageMagick path or put it after

D:ffmpeg-20170125-2080bc3-win64-staticffmpeg-20170125-2080bc3-win64-staticbin in path environment variable

Step 3.

Close the terminal and reopen and check where ffmpeg, dont worry if it shows two path, but the first path should be of our installation

ffmpeg-20170125-2080bc3-win64-staticffmpeg-20170125-2080bc3-win64-staticbin

if its okay, you are good to go

Answered By: Ajay Tom George

For windows user this command works

conda install ffmpeg -c mrinaljain17

Answered By: Lakshman ram

Do as follows:

  1. import skvideo

  2. skvideo.setFFmpegPath(‘your_environment/bin/’)

  3. import skvideo.io

  4. videodata = skvideo.io.vread(‘your_video‘)

It is important to follow the sequence without mixing the steps.

Answered By: Georgios Athanasiou