我在ffmpeg
中使用此命令 ffmpeg -i test.flv -i /var/www/phpvibe/logo.gif -filter_complex "scale=1200:-1,overlay=0:0" -s 1280x720 -vcodec libx264 -s 640x360 -movflags test.mp4 2>&1
但我得到了这个
string(42) "At least one output file must be specified"
更新: -
php代码: -
$output ='{ffmpeg-cmd} -i {input} -i /var/www/phpvibe/logo.gif -filter_complex "scale=1200:-1,overlay=0:0" -s 1280x720 -vcodec libx264 -s {ffmpeg-vsize} -threads 4 -movflags {output}.mp4 2>&1';
完成输出: -
array(33) {
[0]=>
string(83) "ffmpeg version git-2015-05-11-94c20de Copyright (c) 2000-2015 the FFmpeg developers"
[1]=>
string(51) " built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
[2]=>
string(243) " configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3"
[3]=>
string(40) " libavutil 54. 23.101 / 54. 23.101"
[4]=>
string(40) " libavcodec 56. 38.100 / 56. 38.100"
[5]=>
string(40) " libavformat 56. 32.100 / 56. 32.100"
[6]=>
string(40) " libavdevice 56. 4.100 / 56. 4.100"
[7]=>
string(40) " libavfilter 5. 16.101 / 5. 16.101"
[8]=>
string(40) " libswscale 3. 1.101 / 3. 1.101"
[9]=>
string(40) " libswresample 1. 1.100 / 1. 1.100"
[10]=>
string(40) " libpostproc 53. 3.100 / 53. 3.100"
[11]=>
string(47) "Trailing options were found on the commandline."
[12]=>
string(31) "Input #0, flv, from 'test.flv':"
[13]=>
string(11) " Metadata:"
[14]=>
string(28) " audiosize : 150117"
[15]=>
string(26) " canSeekToEnd : true"
[16]=>
string(29) " datasize : 1015662"
[17]=>
string(26) " hasAudio : true"
[18]=>
string(27) " hasCuePoints : false"
[19]=>
string(26) " hasKeyframes : true"
[20]=>
string(26) " hasMetadata : true"
[21]=>
string(26) " hasVideo : true"
[22]=>
string(24) " lasttimestamp : 42"
[23]=>
string(72) " metadatacreator : flvtool++ (Facebook, Motion project, dweatherford)"
[24]=>
string(25) " totalframes : 229"
[25]=>
string(28) " videosize : 856032"
[26]=>
string(59) " Duration: 00:00:42.27, start: 0.066000, bitrate: 192 kb/s"
[27]=>
string(124) " Stream #0:0: Video: h264 (High), yuv420p, 176x144 [SAR 12:11 DAR 4:3], 165 kb/s, 30.30 fps, 29.97 tbr, 1k tbn, 59.94 tbc"
[28]=>
string(64) " Stream #0:1: Audio: aac (LC), 8000 Hz, stereo, fltp, 29 kb/s"
[29]=>
string(48) "Input #1, gif, from '/var/www/phpvibe/logo.gif':"
[30]=>
string(29) " Duration: N/A, bitrate: N/A"
[31]=>
string(67) " Stream #1:0: Video: gif, bgra, 90x55, 100 tbr, 100 tbn, 100 tbc"
[32]=>
string(42) "At least one output file must be specified"
}
int(1)
答案 0 :(得分:2)
您输入-movflags
而未在输出文件前指定值。它认为test.mp4
是标志值,因此是你的问题。