Vinlic / WebVideoCreator

🌈 A framework for rendering web animations into videos. It's implemented based on Node.js + Puppeteer + Chrome + FFmpeg, utilizing the latest browser APIs.
Apache License 2.0
94 stars 26 forks source link

参数没加引号导致部分参数被shell解析成命令 #25

Open NyPhile opened 4 months ago

NyPhile commented 4 months ago

生成带音频的视频时,debug显示有一步的命令ffmpeg -i {path}/tmp/synthesizer/video_404m4w1tedlt2d3h15.mp4 -i {path}/tmp/preprocessor/x/public/voice/swr4evwebn8.mp3 -y -filter_complex [1]atrim=start=0:end=13.062,adelay=0|0,volume=1[a0];[a0]amix=inputs=1:normalize=0 -acodec aac -vcodec copy -t 13 -movflags +faststart -f mp4 {path_output}/video-1708917063155.mp4 执行的时候报错: Error: ffmpeg exited with code 1: Error initializing complex filters. Option not found

单独执行的话,会报错:bash: 0,volume=1[a0]: command not found

尝试把命令修改成:ffmpeg -i {path}/tmp/synthesizer/video_404m4w1tedlt2d3h15.mp4 -i {path}/tmp/preprocessor/x/public/voice/swr4evwebn8.mp3 -y -filter_complex "[1]atrim=start=0:end=13.062,adelay=0|0,volume=1[a0];[a0]amix=inputs=1:normalize=0" -acodec aac -vcodec copy -t 13 -movflags +faststart -f mp4 {path_output}/video-1708917063155.mp4就成功了。 是否考虑在参数部分添加引号?

ffmpeg版本: ffmpeg version 3.4.1

另外,又测试了一下,使用ffmpeg 6.1版本时,audio部分不加引号也能正常,但video部分的参数缺失Error: ffmpeg exited with code 218: frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A,是否在Readme指明能跑通的ffmpeg版本?