Installation configuration and Python call of ffmpeg under win10 system

Installation configuration and Python call of ffmpeg under win10 system

insert image description here

foreword

ffmpeg is an open source program for converting digital audio/video. It supports many types of files, and can be operated independently through the GUI interface, or invoked through the command line.

In deep learning, ffmpeg is often used to open/read audio files as samples.

At present, the information on the Internet is generally the installation and configuration of multimedia practitioners on the premise of operating ffmpeg alone, but how to call it in python is relatively vague.

So, record my construction process. For reference.

System : Win10_64 bit

Python version: 3.7

1. Download

Download URL: http://ffmpeg.org/download.html

After entering the page, select the operating system and the files to be downloaded successively, as shown in the figure:

insert image description here

Find the specific downloaded compressed package in the redirected page, as shown in the figure:

insert image description here

Click download, there is no requirement to save the path.

2. Local path configuration

After downloading and decompressing, there are the following contents:

insert image description here

Add the 'bin' path in the copy to the environment variable of the win10 system (note: it must be an absolute path)

Open "Edit System Environment Variables" –> "Advanced" –> "Environment Variables"

If only the current user uses ffmpeg, 用户变量add it in , if all users use it, 系统变量add it in , the operation method is the same.

Find " " in the variable name on the left side of Fission path, click on it and click "Edit", and add the 'bin' path just copied in the pop-up window

insert image description here

At this point, the path configuration is over

3. Verify that the configuration is successful

win+ROpen cmda command line window, and enter ffmpeg -versionto verify whether the configuration is successful.

If successful, the system returns the corresponding version information, as follows:

insert image description here

4. Install the Python API of ffmpeg

After completing the first three steps, if you run " import ffmpeg", an error will still be reported, and the displayed information will probably be "The ffmpeg module cannot be found". This is because we have not installed the corresponding Python interface. At this time, in the compilation environment, you can't jump to the method of ffmpeg through "Shift + left mouse button".

pip install ffmpeg-pythonEnter the installation API interface on the command line

Then it's 'OK'.

Guess you like

Origin blog.csdn.net/kakangel/article/details/128160587