Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [WinError 2] The system cannot find the file specified #845

Open
RagingRift opened this issue Jul 1, 2024 · 4 comments

Comments

@RagingRift
Copy link

RagingRift commented Jul 1, 2024

I've imported ffmpeg-python and had the error but i tried installing ffmpeg as well but the issue still persists. I have the input file in the same directory as the python file so it should be able to find it? I even pasted in the whole directory but it still didn't work.

I've looked at posts on here with the same issue but the solutions they gave were either not descriptive enough, confusing, or didn't work. I am extremely new to python, programming and computers in general so maybe i don't understand things people say on here

Here is my code currently:

import ffmpeg

source = "input.webm"
output = "output.ts"

stream = ffmpeg.input(source)
stream = ffmpeg.output(stream, output)
ffmpeg.run(stream)
@joe-saronic
Copy link

joe-saronic commented Jul 2, 2024

Try ffmpeg.input(source).output(output). The stream argument is self on the second config line.

@pgoskiFLT
Copy link

If I try this:

source = r'C:\Users\Freelancer-xxx-05\Desktop\HRO_FD_reduced_v004_[00000-03999]_Difference_4.mp4'
output = r'C:\Users\Freelancer-xxx-05\Desktop\mpegger_test\mac.mp4'
ffmpeg.input(source).output(output)
ffmpeg.run()

I get:

Traceback (most recent call last):
File "C:\Users\Freelancer-xxx-05\PycharmProjects\pythonProject.venv\ffmpegtest.py", line 6, in
ffmpeg.run()
TypeError: run() missing 1 required positional argument: 'stream_spec'

Process finished with exit code 1

I was running into the same thing as OP...really not sure what is going on as it all seems to be good until this point.

@pgoskiFLT
Copy link

Ok, so I found the issue and it is user error.
When setting the ENV variable it must be set in the "Path" variable
select this, then click edit...it will open a new window.
Click add, then add the path to the ffmpeg.exe (DO NOT include executable, only add the path)
Once this has been done restart command line or powershell, and try again.
This worked for me.

@Abinesh78
Copy link

Take the ffmpeg.exe file and put it in the python environment which has python.exe it will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants