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

Hiding the ffmpeg popup that appears momentarily #2097

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Menonro
Copy link

@Menonro Menonro commented Mar 20, 2024

On Windows there is a problem due to which FFMPEG running in the background becomes small for a second during startup.

Context: "Whisper" is used in conjunction with FastAPI and uvicorn. The service is started using pm2.

The problem does not exist if you run it manually from a regular console using "python main.py"

Demonstration of the problem before and after
https://youtu.be/IsEavmzQOv8

On Windows there is a problem due to which FFMPEG running in the background becomes small for a second during startup.

Context: "Whisper" is used in conjunction with FastAPI and uvicorn. The service is started using pm2.

The problem does not exist if you run it manually from a regular console using "python main.py"

Demonstration of the problem before and after
https://youtu.be/IsEavmzQOv8
Copy link

@glangford glangford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CREATE_NO_WINDOW is only valid on Windows platforms. The import fails for other OS's.

https://stackoverflow.com/questions/25122823/hide-console-with-subprocess-popen

@Menonro
Copy link
Author

Menonro commented Mar 20, 2024

CREATE_NO_WINDOW действителен только на платформах Windows. Импорт не удался для других ОС.

https://stackoverflow.com/questions/25122823/hide-console-with-subprocess-popen

I made a commit based on your comment.

@Menonro Menonro requested a review from glangford March 20, 2024 11:54
@glangford
Copy link

glangford commented Mar 20, 2024

This line of the proposed change

from subprocess import CalledProcessError, run, CREATE_NO_WINDOW

will fail with ImportError: cannot import name 'CREATE_NO_WINDOW' from 'subprocess'
on non-Windows platforms.

@Menonro
Copy link
Author

Menonro commented Mar 20, 2024

This line of the proposed change

from subprocess import CalledProcessError, run, CREATE_NO_WINDOW

will fail with ImportError: cannot import name 'CREATE_NO_WINDOW' from 'subprocess' on non-Windows platforms.

Thank you for your patience, I will install myself a virtual machine for testing. I'm testing it on my Windows. Made a correction so that import occurs only on Windows systems.

@Menonro Menonro closed this Mar 20, 2024
@Menonro Menonro deleted the patch-1 branch March 20, 2024 16:39
@Menonro Menonro restored the patch-1 branch March 21, 2024 07:53
@Menonro Menonro reopened this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants