Ich versuche, eine Gui für FFMPEG
zu schreiben. Ich benutze Pythons Subprozess, um einen ffmpeg-Prozess für jede gewünschte Konvertierung zu erstellen. Dies funktioniert gut, aber ich möchte auch einen Weg, um den Fortschritt der Umwandlung zu bekommen, ob es versäumt oder nicht usw. Ich dachte, ich könnte dies tun durch den Zugriff auf die Standardausgabe der Prozess ist wie so:FFMPEG und Pythons Subprozess
subprocess.Popen()
Aufruf
# Convert - Calls FFMPEG with current settings. (in a seperate
# thread.)
def convert(self):
# Check if options are valid
if self.input == "" or self.output == "":
return False
# Make the command string
ffmpegString = self.makeString()
# Try to open with these settings
try:
self.ffmpeg = subprocess.Popen(ffmpegString, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
except OSError:
self.error.append("OSError: ")
except ValueError:
self.error.append("ValueError: Couldn't call FFMPEG with these parameters")
# Convert process should be running now.
Und stdout
Lesen:
convert = Convert()
convert.input = "test.ogv"
convert.output = "test.mp4"
convert.output_size = (0, 0)
convert.convert()
while 1:
print convert.ffmpeg.stdout.readline()
Dies aber, den Status des ffmpeg funktioniert nicht zeigen. Ich gehe davon aus, dass es etwas damit zu tun hat, wie ffmpeg es auffrischt. Gibt es eine Möglichkeit, darauf zuzugreifen?
Beide Ihre Links sind tot, bitte beheben Sie sie. – slhck