1

I would like to run the specific commandline application:

ffmpeg -i video.mp4 audio.mp3

I'm running the command through a GUI, and when the console window doesn't exist, the ffmpeg process is running in a new cmd window.

Testers find the "black window that appears" scary and not userfriendly.

How can I run the application without any visible window coming up? os.system(), subprocess.Popen() and subprocess.call() all do launch the cmd window.

If it matters, I'm using pyqt4 and py2exe. I'm targeting Windows OS users.

iTayb
  • 12,373
  • 24
  • 81
  • 135
  • 1
    This may help: http://stackoverflow.com/questions/3390762/how-do-i-eliminate-windows-consoles-from-spawned-processes-in-python-2-7 – Mattie Apr 25 '12 at 18:19
  • Thank you zigg. Can you please write it as a answer so i can choose it? – iTayb Apr 25 '12 at 18:24

3 Answers3

1

This recipe at ActiveState may solve your problem:

http://code.activestate.com/recipes/409002/

Slight changes are required for Python 2.7. See How do I eliminate Windows consoles from spawned processes in Python (2.7)?

Community
  • 1
  • 1
Mattie
  • 20,280
  • 7
  • 36
  • 54
0

Launch ffmpeg from the START command. If you use the /B switch, no command window will be shown.

eduffy
  • 39,140
  • 13
  • 95
  • 92
0

Use subprocess.Popen (or call) and redirect stdout/stderr somewhere. They're currently hooked to your own process's stdout and stderr, which is why they're coming through.

If you need something that can integrate nicely with your GUI event loop, use Twisted's process-launching stuff.

Mike Graham
  • 73,987
  • 14
  • 101
  • 130