5

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.

user3587175
  • 141
  • 3
  • 3
  • 8
  • It may help to just try another ffmpeg distribution and see if that works – zelusp Apr 20 '17 at 06:30
  • Yeah, at least ffmpeg responded when I type ffmpeg -version in my anaconda cmd command. [enter image description here](https://i.stack.imgur.com/U8jHA.png) – Oscar Gener Oct 27 '20 at 00:22

3 Answers3

2

I was able to get the instructions found here to work. At least to the point that typing ffmpeg -version into my command prompt returned a result.

http://adaptivesamples.com/how-to-install-ffmpeg-on-windows/

Austin Downey
  • 943
  • 2
  • 11
  • 28
1

It doesn't look like it's 100% Windows compatible yet anyways: https://github.com/senko/python-video-converter/issues/1

Personally I'd suggest using Cygwin: https://www.cygwin.com/

Just install ffmpeg and python in Cygwin and go from there. Then you have a nice POSIX-y environment to run this and other such pieces of software in.

keithzg
  • 351
  • 2
  • 8
-3

Installing FFmpeg on Windows:

Follow the below steps to install FFmpeg on Windows:

Step 1: Click here to download the zip file of the latest version. (As of September 2021, version 4.4 is the latest)

Step 2: Unzip this file using any file archiver such as Winrar or 7z.

Step 3: Rename the extracted folder to ffmpeg and move it into the root of C: drive.

Step 4: Now, run cmd as an administrator and set the environment path variable for ffmpeg by running the following command:

setx /m PATH "C:\ffmpeg\bin;%PATH%"

Step 5: Restart your computer and verify the installation by running the following:

ffmpeg -version
Shubham Verma
  • 8,783
  • 6
  • 58
  • 79
  • 2
    Why is September 2021 relevant here? Maybe this answer was generated by ChatGPT? Please note that [ChatGPT is banned](https://meta.stackoverflow.com/q/421831/5470544). – JSON Derulo Aug 19 '23 at 17:50
  • __ATTENTION:__ If somebody really uses `setx /m PATH "C:\ffmpeg\bin;%PATH%"` in a Windows Command Prompt window or PowerShell console or Windows Terminal opened as administrator, then I offer my condolences for having successfully __CORRUPTED__ the most important __system__ environment variable `Path`. It is an absolute __NO GO - NEVER EVER__ using `%SystemRoot%\System32\setx.exe` to modify the __system__ environment variable `Path` using the __local__ environment variable `PATH` for several reasons (expansion, duplication, truncation, folder path order). – Mofi Sep 02 '23 at 18:14
  • IF a user wants to modify __system__ or __user__ environment variable `Path` for __appending at the end__ (bottom of the folder paths list) the path of the folder containing `ffmpeg.exe`, then please click once on Windows __Start__ button, type on keyboard __environment__, click on suggested __Edit environment variables for your account__ or __Edit the system environment variables__, click on button __Environment Variables__ if the __System Properties__ window is displayed to open the __Environment Variables__ window, select `Path` in upper (user) or lower (system) list and __Edit__ it. – Mofi Sep 02 '23 at 18:19
  • A new Windows Command Prompt window, PowerShell console or Windows Terminal must be opened from Windows shell (__Start__ button) for getting the __system__ or __user__ `Path` modification applied without a sign out and sign in (__user__ `Path` modification) or restart of Windows (__system__ `Path` modification) for at least the processes started new from Windows shell. Please take a look on [What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?](https://stackoverflow.com/a/41461002/3074564) – Mofi Sep 02 '23 at 18:22