#๐Ÿ”’ How do i hide the ffmpeg console?

42 messages ยท Page 1 of 1 (latest)

dreamy canyon
#

this is the part of my code that uses ffmpeg to convert video to audio, and i just want to know if theres a way i could modify it so that it doesnt actually show the ffmpeg console pop up

ionic shoreBOT
#

@dreamy canyon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

pure moon
#

Use CREATE_NO_WINDOW flag

#

Eg

subprocess.run(command, check=True, creationflags=subprocess.CREATE_NO_WINDOW)

Should do the job

dreamy canyon
#

lemme see

pure moon
#

You know there's a ffmpeg wrapper lib for python btw, yes?

dreamy canyon
#

what

pure moon
#

It'll make your life a tab easier

dreamy canyon
#

wdym

pure moon
#

Its a pythonic wrapper for ffmpeg

#

I thought you might have a use for that

dreamy canyon
#

idk i dont even know what that means

pure moon
#

A better way to use ffmpeg instead of subprocess.run

#

Although at core I guess they are doing the same thing, but for you as a user it gives you a mroe pythonic interface

dreamy canyon
#

doesnt matter

pure moon
#

K

dreamy canyon
#

i guess

#

idk

#

all i know is that it surely works this way

#

since this has gui and stuff

#

and i made an installer for it

#

i just want the final product to work without the ffmpeg console

#

it seems to work now

marble narwhal
#

Possibly just doing STDOUT=DEVNULL,STDERR=DEVNULL would work

pure moon
#

If you compile it with pyinstaller or nuitka you can disable console

marble narwhal
#

it's actually weird to me that a console can ever pop up... must be a windows thing.

dreamy canyon
#

but those use like idk how to say it

pure moon
#

Bundle with pyinstaller or compile with nuitka*

dreamy canyon
#

the thing is

#

i include ffmpeg with the installer

#

cause the other modules just wont work

pure moon
#

You can do it with nuitka and pyinstaller as well, bundle whatever you like

dreamy canyon
#

they can never find ffmpeg

pure moon
#

Make distribution easier, and also kind of make getting the source code harder

#

(or much harder if you go nuitka way)

dreamy canyon
#

idk this is too complicated for me ๐Ÿ˜…

pure moon
#

Okay. Nvm sorry for confusing you ๐Ÿ˜Š

#

Glad it works!

dreamy canyon
#

anyways thanks it seems to work like that

ionic shoreBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.