ffmpeg 在 Linux 上创建视频时出现问题

ffmpeg 在 Linux 上创建视频时出现问题

我有以下 ffmepg 命令,它在运行 Windows 的本地服务器上完美运行,但当我在 Linux 服务器上尝试时出现以下问题:

video.mp4 正在创建但它在 48 字节处停止,而不是本地的 1,854,59 字节。

命令:

ffmpeg -framerate 1/5 -i /var/lib/tomcat7/webapps/ROOT/images/processing/test/%02d.jpg -i /var/lib/tomcat7/webapps/ROOT/images/processing/test/music.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -r 30 -movflags +faststart -shortest /var/lib/tomcat7/webapps/ROOT/images/processing/test/video.mp4

错误日志:

     ffmpeg version 2.5.4-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2015 the FFmpeg developers
  built on Feb 17 2015 03:40:54 with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --cc=gcc-4.9
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from '/var/lib/tomcat7/webapps/ROOT/images/processing/test/%02d.jpg':
  Duration: 00:00:30.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x910 [SAR 1:1 DAR 192:91], 0.20 fps, 0.20 tbr, 0.20 tbn, 0.20 tbc
[mp3 @ 0x3180ea0] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from '/var/lib/tomcat7/webapps/ROOT/images/processing/test/music.mp3':
  Duration: 00:03:52.18, start: 0.000000, bitrate: 111 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 112 kb/s
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x31e2d60] using SAR=1/1
[libx264 @ 0x31e2d60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x31e2d60] profile High, level 4.0
[libx264 @ 0x31e2d60] 264 - core 144 r96 40bb568 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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=1 lookahead_threads=1 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=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/var/lib/tomcat7/webapps/ROOT/images/processing/test/video.mp4':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 1920x910 [SAR 1:1 DAR 192:91], q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.13.100 libx264
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc56.13.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (mp3 (native) -> aac (native))
Press [q] to stop, [?] for help

文件:

在此处输入图片描述

相关内容