ffmpeg无法转换

时间:2014-03-27 20:20:30

标签: node.js ffmpeg exec

我使用以下命令将我服务器上的mp4转换为webm,作为Node.js脚本的一部分。

var command = execSync('ffmpeg -i '+video+' -vpre libvpx-720p -cpu-used -5 -deadline realtime -b 3900k -an -f webm -y '+saveTo);

在常规终端中运行命令时,它可以正常工作。但是,当使用execSync()节点包运行它时,我得到以下控制台输出。

Error: ffmpeg version 1.0.8 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 27 2014 17:09:06 with gcc 4.7.3 (Gentoo 4.7.3-r1 p1.3, pie-0.5.5)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-
g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O2 -pipe -march=native -fomit-frame-pointer' --extra-cflags='-O2 -pipe -march=native -fomit-frame-pointer' --extra-cxxflags
='-O2 -pipe -march=native -fomit-frame-pointer' --disable-static --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-avresample --disable-stripp
ing --disable-debug --disable-doc --disable-vaapi --disable-vdpau --disable-ffplay --disable-runtime-cpudetect --enable-libmp3lame --enable-libvo-aacenc --enable-libthe
ora --enable-libfdk-aac --enable-nonfree --disable-indev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss -
-disable-outdev=sdl --enable-libvorbis --enable-libvpx --disable-amd3dnow --disable-amd3dnowext --disable-altivec --disable-avx --disable-mmxext --disable-ssse3 --disab
le-vis --disabl  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/path/to/video/input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2013-08-24 21:58:35
    encoder         : HandBrake 0.9.9 2013051800
  Duration: 00:06:31.46, start: 0.000000, bitrate: 5092 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 4919 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      creation_time   : 2013-08-24 21:58:35
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 168 kb/s
    Metadata:
      creation_time   : 2013-08-24 21:58:35
Please use -b:a or -b:v, -b is ambiguous
[libvpx @ 0x7f0c40] v1.3.0
Output #0, webm, to '/path/to/video/output.webm':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    encoder         : Lavf54.29.104
    Stream #0:0(und): Video: vp8, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=11-51, 3900 kb/s, 1k tbn, 25 tbc
    encoder         : Lavf54.29.104                                                                                                                          [4009/9202]
    Stream #0:0(und): Video: vp8, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=11-51, 3900 kb/s, 1k tbn, 25 tbc
    Metadata:
      creation_time   : 2013-08-24 21:58:35
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libvpx)
Press [q] to stop, [?] for help
[h264 @ 0x8f42a0] AVC: nal size 3235393
    Last message repeated 1 times
[h264 @ 0x8f42a0] no frame!
[h264 @ 0x7be7e0] concealing 7123 DC, 7123 AC, 7123 MV errors in P frame
[h264 @ 0x8f46c0] AVC: nal size 2572289
    Last message repeated 1 times
[h264 @ 0x8f46c0] no frame!
[h264 @ 0x8f4ae0] AVC: nal size 11559745
    Last message repeated 1 times
[h264 @ 0x8f4ae0] no frame!
[h264 @ 0x8f4f00] AVC: nal size 781975966
    Last message repeated 1 times
[h264 @ 0x8f4f00] no frame!
[h264 @ 0x7be7e0] AVC: nal size -1537130086
    Last message repeated 1 times
[h264 @ 0x7be7e0] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x8f42a0] AVC: nal size -1303101030
    Last message repeated 1 times
[h264 @ 0x8f42a0] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x8f46c0] AVC: nal size 833290655
    Last message repeated 1 times
[h264 @ 0x8f46c0] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x8f4ae0] AVC: nal size -816365157
    Last message repeated 1 times
[h264 @ 0x8f4ae0] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x8f4f00] AVC: nal size 776798623
    Last message repeated 1 times
[h264 @ 0x8f4f00] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x7be7e0] AVC: nal size -824622693
    Last message repeated 1 times
[h264 @ 0x7be7e0] no frame!
Error while decoding stream #0:0: Operation not permitted
[h264 @ 0x8f42a0] AVC: nal size 1276789151
Error while decoding stream #0:0: Operation not permitted
frame=    4 fps=0.0 q=0.0 Lsize=     107kB time=00:00:00.16 bitrate=5476.5kbits/s    
video:106kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.473334%
Received signal 2: terminating.

' no frame'比特在到达最后一节之前重复几千次。

有人能告诉我什么是错的吗?

感谢您的帮助

0 个答案:

没有答案