Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installation of FFMPEG for Python in WIndows

I'm trying to use this python video converter and I couldn't even run the test. I read in the manual that I had to install FFMPEG separately so I did (I created the folder in C:\, the enviroment variable "path" and tested it and worked) but still doesn't work.

When I run the command:

python setup.py test

I get this:

Traceback (most recent call last):
  File "setup.py", line 51, in <module>
    packages=['converter'],
  File "C:\Python27\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 20, in run
    raise Exception('tests failed')
Exception: tests failed

When I run this example code:

from converter import Converter
c = Converter()

info = c.probe('test1.ogg')

conv = c.convert('test1.ogg', '/tmp/output.mkv', {
    'format': 'mkv',
    'audio': {
        'codec': 'mp3',
        'samplerate': 11025,
        'channels': 2
    },
    'video': {
        'codec': 'h264',
        'width': 720,
        'height': 400,
        'fps': 15
    }})

for timecode in conv:
    print "Converting (%f) ...\r" % timecode

I get this:

Traceback (most recent call last):
  File "C:\Users\USER\worspace_pyth\cosa\prueba1.py", line 3, in <module>
    c=Converter()
  File "C:\Python27\converter\__init__.py", line 27, in __init__
    ffprobe_path=ffprobe_path)
  File "C:\Python27\converter\ffmpeg.py", line 345, in __init__
    raise FFMpegError("ffmpeg binary not found: " + self.ffmpeg_path)
converter.ffmpeg.FFMpegError: ffmpeg binary not found: ffmpeg

I can't understand what else I need to do for this to work. Thanks for your help.

like image 914
user3587175 Avatar asked Jul 24 '26 22:07

user3587175


1 Answers

in windows 10 and above use :

winget install ffmpeg

or see: https://www.gyan.dev/ffmpeg/builds/

like image 106
Dev zero Avatar answered Jul 27 '26 12:07

Dev zero



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!