我对它疯狂,不认为解决方案。
我使用此代码转换视频,但转换未终止。我试了好几次,然后停在不同的地方。
echo "Starting ffmpeg...\n\n".'</br>';
echo shell_exec('/usr/src/ffmpeg/ffmpeg/ffmpeg -y -i movie.mp4 -i logo.png -filter_complex "overlay=10:10" -b:v 1500k -vcodec libx264 movie2.mp4 2> out.txt').'</br>';
echo "Done.\n";
ffmpeg
的输出:
ffmpeg version git-2014-01-31-dce9321 Copyright (c) 2000-2014 the FFmpeg developers
built on Jan 31 2014 20:37:02 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)
configuration: --prefix=/usr/local/ffmpeg --extra-cflags=-I/usr/local/ffmpeg/include --extra-ldflags=-L/usr/local/ffmpeg/lib --bindir=/usr/local/ffmpeg/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfaac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libfreetype --enable-libtheora
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 49.101 / 55. 49.101
libavformat 55. 28.101 / 55. 28.101
libavdevice 55. 7.100 / 55. 7.100
libavfilter 4. 1.101 / 4. 1.101
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'movie.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2016-06-09 07:48:54
Duration: 00:21:20.00, start: 0.000000, bitrate: 293 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 164 kb/s, -7.31 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2016-06-09 07:48:54
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2016-06-09 07:27:52
handler_name : SoundHandler
Input #1, image2, from 'logo.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #1:0: Video: png, rgba, 350x32 [SAR 3779:3779 DAR 175:16], 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0x3b1fe00] using SAR=1/1
[libx264 @ 0x3b1fe00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x3b1fe00] profile High, level 3.1
[libx264 @ 0x3b1fe00] 264 - core 142 r2 956c8d8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'movie2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.28.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 1500 kb/s, 30k tbn, 29.97 tbc (default)
Stream #0:1(und): Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s (default)
Metadata:
creation_time : 2016-06-09 07:27:52
handler_name : SoundHandler
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #1:0 (png) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac -> libfaac)
Press [q] to stop, [?] for help
frame= 14 fps=0.0 q=0.0 size= 15226kB time=00:00:00.00 bitrate=N/A
[libfaac @ 0x3b20800] Queue input is backward in time
[mp4 @ 0x3b1ef80] Non-monotonous DTS in output stream 0:1; previous: 3003, current: 1024; changing to 3004. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3b1ef80] Non-monotonous DTS in output stream 0:1; previous: 3004, current: 2048; changing to 3005. This may result in incorrect timestamps in the output file.
frame= 25 fps=6.9 q=0.0 size= 15382kB time=00:00:00.23 bitrate=542687.8kbits/s
frame= 46 fps= 10 q=0.0 size= 15408kB time=00:00:00.95 bitrate=132582.7kbits/s
frame= 69 fps= 13 q=32.0 size= 15433kB time=00:00:01.71 bitrate=73576.8kbits/s
[...]
frame=11100 fps= 38 q=0.0 size= 24980kB time=00:06:09.77 bitrate= 553.4kbits/s
frame=11106 fps= 38 q=0.0 size= 25093kB time=00:06:09.98 bitrate= 555.6kbits/s
frame=11131 fps= 38 q=0.0 size= 25109kB time=00:06:10.82 bitrate= 554.7kbits/s
随着小视频的工作,但伟大的视频并没有结束。我不认为这是php.ini
配置,因为没有错误。只是不要结束