我正在创建一个脚本,该脚本将使用 ffmpeg 从 mp3 创建视频 avectorscope 视频。运行以下代码时,我的日志文件中不断出现以下错误:
PHP
shell_exec('ffmpeg -i ../a5ca0b5894324f8bb54bb9fffad29d1e/tagged/d13c24d9be.mp3 -filter_complex \
"[0:a]avectorscope=s=1280x720,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4');
日志文件错误:
Input #0, mp3, from '../a5ca0b5894324f8bb54bb9fffad29d1e/tagged/d13c24d9be.mp3':
Metadata:
encoder : Lavf57.41.100
Duration: 00:03:30.21, start: 0.025057, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Metadata:
encoder : Lavc57.48
[AVFilterGraph @ 0x286d960] No such filter: ''
Error initializing complex filters.
Invalid argument
sh: 2: [0:a]avectorscope=s=1280x720,format=yuv420p[v]: not found
sh: 3: -map: not found
答案1
感谢@LongNeckbeard 的帮助!如果您遇到此错误,只需删除断线即可:
shell_exec('ffmpeg -i ../a5ca0b5894324f8bb54bb9fffad29d1e/tagged/d13c24d9be.mp3 -filter_complex \ "[0:a]avectorscope=s=1280x720,format=yuv420p[v]" \-map "[v]" -map 0:a output.mp4');