我正在向python中的函數發送一個文件,並試圖將結果保存到一個變量中,但我不斷收到該錯誤。Python + ffmpeg TypeError:並非在字符串格式化過程中轉換的所有參數
我看過其他答案,但似乎沒有任何合適的。任何幫助表示讚賞:
def ffmpegLUFS(fileName):
subprocess.Popen("ffmpeg -i %s -filter_complex ebur128 -f null - 2>&1 | grep -n '.*' | grep -A 5 'size' | grep 'I:' | cut -d ':' -f3-" % tuple(map(pipes.quote, sys.argv[1])),stdout=subprocess.PIPE,shell=True).communicate()[0]
return
Traceback (most recent call last):
File "/Volumes/videos/videos/DROP_BIN/CHRIS/POD_Workflow_Files/WebContent_Audio.py", line 30, in <module>
sourceLUFS = ffmpegLUFS(sys.argv[1])
File "/Volumes/videos/videos/DROP_BIN/CHRIS/POD_Workflow_Files/WebContent_Audio.py", line 18, in ffmpegLUFS
subprocess.Popen("ffmpeg -i %s -filter_complex ebur128 -f null - 2>&1 | grep -n '.*' | grep -A 5 'size' | grep 'I:' | cut -d ':' -f3-" % tuple(map(pipes.quote, fileName)),stdout=subprocess.PIPE,shell=True).communicate()[0]
TypeError: not all arguments converted during string formatting
請包括完整的錯誤追溯。 – Mikael