FFMPEG
에 대한 GUI를 작성하려고합니다. 내가 원하는 모든 변환에 대해 ffmpeg 프로세스를 생성하기 위해 pythons 하위 프로세스를 사용하고 있습니다. 이것은 잘 작동하지만 나는 또한 내가과 같이 프로세스의 표준 출력에 액세스하여이 작업을 수행 할 수있는 생각 등 실패 여부, 변환의 진행을 얻을 수있는 방법을 싶습니다FFMPEG 및 Python 보조 프로세스
이 subprocess.Popen()
# 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.
그리고 stdout
읽기 :이 있지만 작동
convert = Convert()
convert.input = "test.ogv"
convert.output = "test.mp4"
convert.output_size = (0, 0)
convert.convert()
while 1:
print convert.ffmpeg.stdout.readline()
,는 FFmpeg의 상태는 표시되지 않습니다. 나는 그것이 ffmpeg가 그것을 새롭게하는 방법과 관련이 있다고 가정하고있다. 액세스 할 수있는 방법이 있습니까?
두 링크가 모두 죽었으니 수정하십시오 – slhck