flvEncoder .flv输出不会使用ffmpeg转换为.mp4

时间:2013-07-30 14:53:51

标签: ffmpeg mp4 flv

我当前的项目涉及使用AIR(使用https://github.com/zeropointnine/leelib/tree/master/src/leelib/util/flvEncoder)创建.flv - 然后必须将其转换为.mp4,我们正在使用ffmpeg。

.mp4输出是正确的尺寸和持续时间,但是空白(没有图像)。音频不是问题,因为原始输出没有音频。

ffmpeg version N-55020-g768e40b Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 28 2013 18:05:44 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --e
nable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable
-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enab
le-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --en
able-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.103 /  3. 81.103
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, flv, from 'testWithAudio.flv':
  Metadata:
    canSeekToEnd    : true
    metadatacreator : FlvEncoder v0.9 Lee Felarca
  Duration: 00:00:44.77, start: 0.000000, bitrate: 56730 kb/s
    Stream #0:0: Video: flashsv, bgr24, 400x400, 30 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 00000000002e1da0] using cpu capabilities: MMX2 SSE2Fast SSEMisalign LZCNT
[libx264 @ 00000000002e1da0] profile High 4:4:4 Predictive, level 2.1, 4:4:4 8-bit
[libx264 @ 00000000002e1da0] 264 - core 135 r2345 f0c1c53 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - 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=4 threads=1 lookahead_threads=1 sl
iced_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 dire
ct=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 'testWithAudio.mp4':
  Metadata:
    canSeekToEnd    : true
    metadatacreator : FlvEncoder v0.9 Lee Felarca
    encoder         : Lavf55.12.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 400x400, q=-1--1, 15360 tbn, 30 tbc
    Stream #0:1: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (flashsv -> libx264)
  Stream #0:1 -> #0:1 (pcm_s16le -> libvo_aacenc)
Press [q] to stop, [?] for help
frame= 1343 fps= 25 q=29.0 Lsize=    2680kB time=00:00:44.70 bitrate= 491.2kbits/s
video:1943kB audio:691kB subtitle:0 global headers:0kB muxing overhead 1.756713%
[libx264 @ 00000000002e1da0] frame I:25    Avg QP:20.44  size: 14523
[libx264 @ 00000000002e1da0] frame P:614   Avg QP:23.20  size:  2319
[libx264 @ 00000000002e1da0] frame B:704   Avg QP:24.59  size:   287
[libx264 @ 00000000002e1da0] consecutive B-frames: 25.6% 11.0%  7.4% 56.0%
[libx264 @ 00000000002e1da0] mb I  I16..4: 17.6% 67.0% 15.3%
[libx264 @ 00000000002e1da0] mb P  I16..4:  7.6%  9.9%  0.8%  P16..4: 28.0%  8.3%  4.0%  0.0%  0.0%    skip:41.4%
[libx264 @ 00000000002e1da0] mb B  I16..4:  0.4%  0.5%  0.0%  B16..8: 16.3%  1.1%  0.1%  direct: 0.2%  skip:81.4%  L0:39.7% L
1:57.4% BI: 2.8%
[libx264 @ 00000000002e1da0] 8x8 transform intra:56.3% inter:85.5%
[libx264 @ 00000000002e1da0] coded y,u,v intra: 35.7% 17.0% 19.1% inter: 7.7% 3.8% 3.4%
[libx264 @ 00000000002e1da0] i16 v,h,dc,p: 26% 28% 17% 30%
[libx264 @ 00000000002e1da0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 21% 33%  4%  4%  5%  4%  4%  4%
[libx264 @ 00000000002e1da0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 16%  5%  6%  9%  6%  6%  6%
[libx264 @ 00000000002e1da0] Weighted P-Frames: Y:6.5% UV:3.3%
[libx264 @ 00000000002e1da0] ref P L0: 56.8% 16.5% 18.2%  8.0%  0.6%
[libx264 @ 00000000002e1da0] ref B L0: 82.3% 14.1%  3.7%
[libx264 @ 00000000002e1da0] ref B L1: 93.7%  6.3%
[libx264 @ 00000000002e1da0] kb/s:355.47

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

参见参考信息:

No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.

所以,添加-pix_fmt yuv420p,你应该没问题。