使用Golang拼接ffmpeg命令之后filter错误

使用Golang拼接ffmpeg命令之后执行错误,直接在powershell中能执行成功

相关代码

cmd := exec.Command("cmd", "/C", `ffmpeg -i test.mp4  -filter_complex "[0:v]scale=-2:480[scale];movie=youku.png[watermark];[scale][watermark]overlay=10:10" test1.mp4`)

错误信息

[AVFilterGraph @ 0000022435423c00] No such filter: '"'
Error initializing complex filters.

共 1 个回复


zichen

这样即可,把参数名用单引号引起来(双引号未测试)

cmd := exec.Command("cmd", "/C", `ffmpeg -i test.mp4 -filter_complex [0:v]'scale'=-2:480[scale];'movie'=youku.png[watermark];[scale][watermark]'overlay'=10:10 test1.mp4`)
# 0