I have a wx python application which takes any video file as input and exports each audio track as separate wav files, whilst giving me realtime output info in the status bar. I have this working perfectly on OSX using pexpect, but can't get this working on Windows, I have unsuccessfully tried wexpect. I am using the below code, as an example on Windows, this currently gives me the output, but then pauses when it gets to the bit I am interested in, file export progress, I then get output again when the export finishes. Anyone have any suggestions please?
command = 'ffmpeg\ffmpeg.exe -i "E:\source.mov" -map 0:1 -acodec pcm_s24le -y "E:\source_01.wav" -map 0:2 -acodec pcm_s24le -y "E:\source_02.wav" -map 0:3 -acodec pcm_s24le -y "E:\source_03.wav" -map 0:4 -acodec pcm_s24le -y "E:\source_04.wav" -map 0:5 -acodec pcm_s24le -y "E:\source_05.wav" -map 0:6 -acodec pcm_s24le -y "E:\source_06.wav" -map 0:7 -acodec pcm_s24le -y "E:\source_07.wav" -map 0:8 -acodec pcm_s24le -y "E:\source_08.wav"'
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
p = Popen(command, startupinfo=startupinfo, shell=False, stdout=PIPE, stderr=PIPE, stdin=PIPE)
while True:
line = p.stderr.readline()
if line == '':
break
print line
self.SetStatusText(line)