ffmpeg-python
ffmpeg-python copied to clipboard
Avoid console windows for ffprobe.exe and ffmpeg.exe
Hi, thank you for your fantastic library! I'm starting my application using pythonw to avoid a console window. When I call ffmpeg to play an mp3-stream a console window for ffprobe.exe is opened as well as a window for ffmpeg.exe. Is there a way to avoid these two console windows?
This is my code:
process = ffmpeg.input(source).filter('volume', self._volume).output('pipe:', format='f32le', acodec='pcm_f32le', ac=channels, ar=samplerate, loglevel='quiet').run_async(pipe_stdout=True)
I expected to be loglevel='quiet' to be the solution, but it isn't :-)
Thanks for your help
Found out in run.py we can enhance the run_async method by:
startupinfo = None
if os.name == 'nt':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(command, startupinfo=startupinfo)
Source: https://stackoverflow.com/questions/1016384/cross-platform-subprocess-with-hidden-window
Also a big fan of this library! Having the same issue where the popups are annoying users. Hoping you can add some parameter to do this, as I'm currently just using the edit to _run.py padmalcolm proposed above, which adds a nasty bit of jank to my new release compilation workflow, which I'd be grateful to be rid of!