当前位置:网站首页>When Python calls ffmpeg, 'ffmpeg' is not an internal or external command, nor a runnable program

When Python calls ffmpeg, 'ffmpeg' is not an internal or external command, nor a runnable program

2020-11-09 08:25:49 osc_ucqb2u3q

solve python call ffmpeg when ‘ffmpeg’ Not an internal or external command , It's not a runnable program

stay windows Under the system , We use windows Next , Use ffmpeg Library call FFmpeg Tools to extract video images / Read video information

import ffmpeg

We may encounter the following problems

'ffmpeg'  Not an internal or external command , It's not a runnable program 

What's the reason for this ?

python Of ffmpeg It's using subprocess.Popen() Function to call the command line , And then get the returned data . Equivalent to python In your system cmd In the input ffmpeg xxx xxx xxx xxx

Then the system reports you an error ‘ffmpeg’ Not an internal or external command , It's not a runnable program

So there are two reasons :

But the quickest way is , When you download well ffmpeg
Then decompress , Write down the bin The path of

E://anaconda//ffmpeg-4.3.1//bin//

 Insert picture description here
And then modify ffmpeg The code of

  • 《 Yours python Package path 》/site-packages/ffmpeg/_probe.py
    Add directly ffmpeg The path of
     Insert picture description here

  • 《 Yours python Package path 》/site-packages/ffmpeg/_run.py
    Add directly ffmpeg The path of
     Insert picture description here

版权声明
本文为[osc_ucqb2u3q]所创,转载请带上原文链接,感谢