Ffmpeg没有完全运作

时间:2014-08-26 04:06:28

标签: ffmpeg

你好我有问题ffmpeg我使用phpvibe cms已经在他们的论坛上询问但他们不知道答案导致我这可能是我的错所以问题是当我上传:

6秒avi视频,权重817 KB 上传完美播放就像它应该运行一样。

然而,当我尝试上传12mb avi示例时,我发现它在文件夹中不起作用,应该转换的视频显示0kb

这意味着它没有开始转换一些我认为这是ffmpeg问题我也发现我的ffmpeg放在 / usr / local / bin / 和phpvibe cms系统那里是ffmpeg的不同位置,它看起来像这样:Img link

为什么当我上传小型avi视频时,它转换得很好,当我尝试更长时间它失败时可能会在上传过程中进行转换但是为什么它会在放置转换视频的文件夹中显示0b?

P.s我尝试了几个重量超过10 MB的avi视频同样的东西,我的ffmpeg对话代码是:

$output ="{ffmpeg-cmd} -i {input} -vcodec libx264 -s {ffmpeg-vsize} -threads 4 -movflags faststart {output}.mp4";

也尝试过:

output ="{ffmpeg-cmd} -i {input} -vcodec libx264 -s {ffmpeg-vsize} -threads 4 {output}.mp4 2>&1";

同样的事情+即时通讯使用Debian 7 Wheezy。谢谢!

编辑:

我已经制作了一个测试脚本,它给出了这个输出:

array(21) {
  [0]=>
  string(83) "ffmpeg version git-2014-08-25-bb29896 Copyright (c) 2000-2014 the FFmpeg developers"
  [1]=>
  string(61) "  built on Aug 25 2014 19:52:12 with gcc 4.7 (Debian 4.7.2-5)"
  [2]=>
  string(62) "  configuration: --enable-shared --enable-libx264 --enable-gpl"
  [3]=>
  string(40) "  libavutil      54.  7.100 / 54.  7.100"
  [4]=>
  string(40) "  libavcodec     56.  0.101 / 56.  0.101"
  [5]=>
  string(40) "  libavformat    56.  3.100 / 56.  3.100"
  [6]=>
  string(40) "  libavdevice    56.  0.100 / 56.  0.100"
  [7]=>
  string(40) "  libavfilter     5.  0.103 /  5.  0.103"
  [8]=>
  string(40) "  libswscale      3.  0.100 /  3.  0.100"
  [9]=>
  string(40) "  libswresample   1.  1.100 /  1.  1.100"
  [10]=>
  string(40) "  libpostproc    53.  0.100 / 53.  0.100"
  [11]=>
  string(31) "Input #0, avi, from 'test.avi':"
  [12]=>
  string(11) "  Metadata:"
  [13]=>
  string(36) "    encoder         : Nandub v1.0rc2"
  [14]=>
  string(60) "  Duration: 00:01:09.78, start: 0.000000, bitrate: 1517 kb/s"
  [15]=>
  string(126) "    Stream #0:0: Video: msmpeg4v3 (DIV3 / 0x33564944), yuv420p, 640x352, 1279 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc"
  [16]=>
  string(83) "    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 222 kb/s"
  [17]=>
  string(87) "[libx264 @ 0x6c31e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX"
  [18]=>
  string(44) "[libx264 @ 0x6c31e0] profile High, level 3.0"
  [19]=>
  string(649) "[libx264 @ 0x6c31e0] 264 - core 124 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - 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=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=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00"
  [20]=>
  string(131) "[aac @ 0x6c3c20] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it."
}
int(1)

我得到这个输出:

$output ="{ffmpeg-cmd} -y -i {input} {output}.mp4 2<&1"";

简单的ffmpeg命令也尝试过:

$output ="{ffmpeg-cmd} -i {input} -vcodec libx264 -s {ffmpeg-vsize} -threads 4 {output}.mp4 2>&1";

使用此命令可以输出:

array(21) {
  [0]=>
  string(83) "ffmpeg version git-2014-08-25-bb29896 Copyright (c) 2000-2014 the FFmpeg developers"
  [1]=>
  string(61) "  built on Aug 25 2014 19:52:12 with gcc 4.7 (Debian 4.7.2-5)"
  [2]=>
  string(62) "  configuration: --enable-shared --enable-libx264 --enable-gpl"
  [3]=>
  string(40) "  libavutil      54.  7.100 / 54.  7.100"
  [4]=>
  string(40) "  libavcodec     56.  0.101 / 56.  0.101"
  [5]=>
  string(40) "  libavformat    56.  3.100 / 56.  3.100"
  [6]=>
  string(40) "  libavdevice    56.  0.100 / 56.  0.100"
  [7]=>
  string(40) "  libavfilter     5.  0.103 /  5.  0.103"
  [8]=>
  string(40) "  libswscale      3.  0.100 /  3.  0.100"
  [9]=>
  string(40) "  libswresample   1.  1.100 /  1.  1.100"
  [10]=>
  string(40) "  libpostproc    53.  0.100 / 53.  0.100"
  [11]=>
  string(31) "Input #0, avi, from 'test.avi':"
  [12]=>
  string(11) "  Metadata:"
  [13]=>
  string(36) "    encoder         : Nandub v1.0rc2"
  [14]=>
  string(60) "  Duration: 00:01:09.78, start: 0.000000, bitrate: 1517 kb/s"
  [15]=>
  string(126) "    Stream #0:0: Video: msmpeg4v3 (DIV3 / 0x33564944), yuv420p, 640x352, 1279 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc"
  [16]=>
  string(83) "    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 222 kb/s"
  [17]=>
  string(88) "[libx264 @ 0x13046c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX"
  [18]=>
  string(45) "[libx264 @ 0x13046c0] profile High, level 3.0"
  [19]=>
  string(650) "[libx264 @ 0x13046c0] 264 - core 124 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - 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=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=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00"
  [20]=>
  string(132) "[aac @ 0x13055a0] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it."
}
int(1)

还尝试了这个命令:

$output ="{ffmpeg-cmd} -i {input} -vcodec libx264 -s {ffmpeg-vsize} -threads 4 -movflags faststart {output}.mp4";

这样就可以了:

    array(0) {
}
int(1)

在所有情况下,文件中的12 mb doest都没有将其转换为ftp中的0kb

0 个答案:

没有答案