I have a line that I can use it with os.system
like;
os.system("ffmpeg -i file.smh -acodec libmp3lame file.mp3")
Where ffmpeg
is an exe file. But It creates a console window on the screen. Normally I hide the console window by the following:
import win32console,win32gui
win = win32console.GetConsoleWindow()
win32gui.ShowWindow(win,1)
I tried this but it didn't work. os.system
still shows me the console window. So I have two options:
- I need a way to hide the console window if I use
os.system
. - Or I need a
subprocess
equivalent ofos.system
.
I tried to use subprocess.Popen(["ffmpeg.exe -i file.smh -acodec libmp3lame file.mp3"])
, but it can't find ffmpeg.exe.
How can I fix this?