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

Running without console window? #686

Open
amamic1803 opened this issue Jul 19, 2022 · 1 comment · May be fixed by #790
Open

Running without console window? #686

amamic1803 opened this issue Jul 19, 2022 · 1 comment · May be fixed by #790

Comments

@amamic1803
Copy link

I'm making a python script to convert video or image to ASCII art and I need ffmpeg for the last part. The thing is that when I build EXE file using PyInstaller (and select -noconsole option), when code execution comes to the point when ffmpeg is needed, console window still opens for each ffmpeg process opened. I open two processes, code for which is provided here:

process_in = ffmpeg.input(open_path, r=fps)[v_stream_indx].output('pipe:', format='rawvideo', pix_fmt='rgb24', r=fps).run_async(pipe_stdout=True, cmd=ffmpeg_path)

process_out = ffmpeg.input('pipe:', format='rawvideo', pix_fmt='rgb24', s=f'{width}x{height}', r=fps).output(ffmpeg.input(open_path, r=fps, vn=None), save_path, pix_fmt=pixel_format, r=fps, vcodec=og_codec, codec="copy").overwrite_output().run_async(pipe_stdin=True, cmd=ffmpeg_path)

Of course I don't want those console windows as my app has GUI. Strangely, there is no output in any of those 2 windows (I would expect it to be because there are many logs printed out when run from pycharm where main script output is printed out, BTW is there a way to disable that?).

@amamic1803
Copy link
Author

Solved. (https://stackoverflow.com/a/71741286/9927277)
@kkroening could you review linked answer? I don't understand what he did and why it works, but if it is a good fix it would be nice to include it in official pip release.

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

Successfully merging a pull request may close this issue.

1 participant