0
我試圖使用python通過調用子流程ffmpeg爲視頻添加水印。我的代碼:在ffmpeg中找不到選項
command = "C:\\VidMaker\\source\\ffmpeg.win32.exe -i C:\\VidMaker\\kq"+str(i)+".mp4 -i C:\\VidMaker\\1.png -filter_complex" "[0:v]setsar=sar=1[v];[v][1]blend=all_mode='overlay':all_opacity=0.7" "-vcodec libx264 C:\VidMaker\\Res"+str(i)+".mp4"
subprocess.check_call(command, shell = False)
結果是:
Unrecognized option 'filter_complex[0:v]setsar=sar=1[v];[v][1]blend=all_mode='overlay':all_opacity=0.7-movflags'.
Error splitting the argument list: Option not found
Traceback (most recent call last):
File "C:\VidMaker\add.py", line 10, in <module>
subprocess.check_call(command, shell = False)
File "C:\Python27\lib\subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'C:\VidMaker\source\ffmpeg.win32.exe -n -i C:\VidMaker\kq2.mp4 -i C:\VidMaker\1.png -filter_complex[0:v]setsar=sar=1[v];[v][1]blend=all_mode='overlay':all_opacity=0.7-movflags +faststart C:\VidMaker\Res2.mp4' returned non-zero exit status 1
[Finished in 0.4s with exit code 1]
EDIT1:它沒有選項來運行正常:
command = "C:\\VidMaker\\source\\ffmpeg.win32.exe -i C:\\VidMaker\\kq"+str(i)+".mp4 -i C:\\VidMaker\\1.png -filter_complex overlay=10:10 C:\VidMaker\\Res"+str(i)+".mp4"
用什麼選擇發生,如何解決謝謝!
EDIT2:我需要這樣的呼籲,因爲我的VPS不能像我的計算機上運行,在我的電腦用成功運行:
subprocess.call(['ffmpeg',
'-i', 'funvi 155.mp4',
'-i', '1.png',
'-filter_complex', "[1:v]format=argb,geq=r='r(X,Y)':a='0.15*alpha(X,Y)'[zork]; [0:v][zork]overlay",
'-vcodec', 'libx264',
'myresult6.mp4'])