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

Is there a way to add ffmpeg into a pyinstaller program #856

Open
Souneyy opened this issue Oct 13, 2024 · 5 comments
Open

Is there a way to add ffmpeg into a pyinstaller program #856

Souneyy opened this issue Oct 13, 2024 · 5 comments

Comments

@Souneyy
Copy link

Souneyy commented Oct 13, 2024

So i recently made a youtube video and audio downloader with a working gui and i made it into an .exe file using pyinstaller, i also tried adding the ffmpeg folder into the .exe file using --app-data but it didnt seem to work on my brothers pc because it downloads the video and audio separately and they stay that way since i combine the two using ffmpeg.

@yx-wong
Copy link

yx-wong commented Oct 15, 2024

It worked for me with --onefile param instead of --app-data

@Souneyy
Copy link
Author

Souneyy commented Oct 15, 2024

i fixed my problem, thanks anyways

@eatcows
Copy link

eatcows commented Nov 14, 2024

Apparently the --onefile option did not work for me. @Souneyy how did you fix it?

@Souneyy
Copy link
Author

Souneyy commented Nov 14, 2024

My problem was that I was referring to my folder where my exe file is located at so when I packaged everything into the exe file it was still looking for the ffmpeg file where the exe file got made instead of looking for it in the exe file itself. Can you be more specific with your problem?

@eatcows
Copy link

eatcows commented Dec 3, 2024

OK in the youtube download app I made, the video and audio files are downloaded ok and then they get joined using moviepy. The join operation works ok when you launch the app in the ide (I use VSC) so the program is not at fault. But if I try to make an exe file using pyinstaller, the resulting app never get to join the audio and video file. If you have the same problem this is the solution I found on stack overflow by a guy named Alexander:
"The reason that it doesn't work in window/noconsole mode is because moviepy writes a lot of output to stdout, and when an executable is compiled in windowed mode, pyinstaller explicitly sets sys.stdout to None."
And he suggest to add at the top of your script something like:

import sys

output = open("output.txt", "wt")
sys.stdout = output
sys.stderr = output

This solution worked for me.

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

3 participants