[FFmpeg-user] libx264 mp4 encoded video won't play back in chrome/quicktime

Damon Edwards dzedward at gmail.com
Wed Apr 25 01:24:29 CEST 2012


The video won't load in the <video> tag, and played through quicktime I can
only get the audio with a gray video.

The input is an mp4, it gets spit into an image sequence, filters applied
to the images, then recompiled into an mp4: $ffmpeg . ' -i ' . $image_dir .
'/audio.mp3 -f image2 -r ' . $framerate . ' -i ' . $image_dir . '/%11d-' .
$filter . '.jpg -vcodec libx264 -b ' . $bitrate . ' ' . $video_dir .
$filename . '-' . $unique . '-' . $filter . '.mp4'

 output:

[root at localhost html]# php filmstrip.php
ffmpeg version N-40099-g2b336df Copyright (c) 2000-2012 the FFmpeg
developers
  built on Apr 24 2012 14:15:49 with gcc 4.4.6 20110731 (Red Hat 4.4.6-3)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora
--enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3
  libavutil      51. 47.100 / 51. 47.100
  libavcodec     54. 15.100 / 54. 15.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.100 /  2. 72.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/video/switches.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2007-08-26 06:33:35
  Duration: 00:00:30.43, start: 0.000000, bitrate: 625 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
s16, 125 kb/s
    Metadata:
      creation_time   : 2007-08-26 06:33:35
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
    Stream #0:1(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p,
480x360 [SAR 1:1 DAR 4:3], 498 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc
    Metadata:
      creation_time   : 2007-08-26 06:33:35
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
The bitrate parameter is set too low. It takes bits/s as argument, not
kbits/s
Output #0, mp3, to
'/var/www/html/video/images/switches-sepia-test/audio.mp3':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    TDEN            : 2007-08-26 06:33:35
    TSSE            : Lavf54.3.100
    Stream #0:0(und): Audio: mp3, 44100 Hz, stereo, s16, 0 kb/s
    Metadata:
      creation_time   : 2007-08-26 06:33:35
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
Stream mapping:
  Stream #0:0 -> #0:0 (aac -> libmp3lame)
Press [q] to stop, [?] for help
size=     475kB time=00:00:30.37 bitrate= 128.2kbits/s
video:0kB audio:475kB global headers:0kB muxing overhead 0.065364%
ffmpeg version N-40099-g2b336df Copyright (c) 2000-2012 the FFmpeg
developers
  built on Apr 24 2012 14:15:49 with gcc 4.4.6 20110731 (Red Hat 4.4.6-3)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora
--enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3
  libavutil      51. 47.100 / 51. 47.100
  libavcodec     54. 15.100 / 54. 15.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.100 /  2. 72.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/video/switches.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2007-08-26 06:33:35
  Duration: 00:00:30.43, start: 0.000000, bitrate: 625 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
s16, 125 kb/s
    Metadata:
      creation_time   : 2007-08-26 06:33:35
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
    Stream #0:1(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p,
480x360 [SAR 1:1 DAR 4:3], 498 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc
    Metadata:
      creation_time   : 2007-08-26 06:33:35
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
[buffer @ 0x367a8c0] w:480 h:360 pixfmt:yuv420p tb:1/1000000 sar:1/1
sws_param:flags=2
[buffersink @ 0x367ade0] auto-inserting filter 'auto-inserted scale 0'
between the filter 'src' and the filter 'out'
[scale @ 0x36ab220] w:480 h:360 fmt:yuv420p sar:1/1 -> w:480 h:360
fmt:yuvj420p sar:1/1 flags:0x4
Output #0, image2, to
'/var/www/html/video/images/switches-sepia-test/%11d.jpg':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2007-08-26 06:33:35
    encoder         : Lavf54.3.100
    Stream #0:0(und): Video: mjpeg, yuvj420p, 480x360 [SAR 1:1 DAR 4:3],
q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
    Metadata:
      creation_time   : 2007-08-26 06:33:35
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
Stream mapping:
  Stream #0:1 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=  208 fps=0.0 q=0.0 size=       0kB time=00:00:06.94 bitrate=
0.0kbits/sframe=  412 fps=411 q=0.0 size=       0kB time=00:00:13.74
bitrate=   0.0kbits/sframe=  602 fps=400 q=0.0 size=       0kB
time=00:00:20.08 bitrate=   0.0kbits/sframe=  803 fps=401 q=0.0 size=
0kB time=00:00:26.79 bitrate=   0.0kbits/sframe=  912 fps=398 q=0.0
Lsize=       0kB time=00:00:30.43 bitrate=   0.0kbits/s
video:32442kB audio:0kB global headers:0kB muxing overhead -100.000000%
ffmpeg version N-40099-g2b336df Copyright (c) 2000-2012 the FFmpeg
developers
  built on Apr 24 2012 14:15:49 with gcc 4.4.6 20110731 (Red Hat 4.4.6-3)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora
--enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3
  libavutil      51. 47.100 / 51. 47.100
  libavcodec     54. 15.100 / 54. 15.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.100 /  2. 72.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
[mp3 @ 0x2dd5040] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from
'/var/www/html/video/images/switches-sepia-test/audio.mp3':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2007-08-26 06:33:35
    encoder         : Lavf54.3.100
  Duration: 00:00:30.40, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
[image2 @ 0x2dd6aa0] max_analyze_duration 5000000 reached at 5005005
Input #1, image2, from
'/var/www/html/video/images/switches-sepia-test/%11d-sepia.jpg':
  Duration: 00:00:30.43, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: mjpeg, yuvj420p, 480x360 [SAR 1:1 DAR 4:3], 29.97
fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
Please use -b:a or -b:v, -b is ambiguous
[buffer @ 0x2dd5da0] w:480 h:360 pixfmt:yuvj420p tb:1/1000000 sar:1/1
sws_param:flags=2
[libx264 @ 0x313d2a0] using SAR=1/1
[libx264 @ 0x313d2a0] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2 AVX
[libx264 @ 0x313d2a0] profile High, level 3.0
[libx264 @ 0x313d2a0] 264 - core 122 r2184 5c85e0a - 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=3 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=cbr mbtree=1
bitrate=0 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
Output #0, mp4, to '/var/www/html/video/switches-test-sepia.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2007-08-26 06:33:35
    encoder         : Lavf54.3.100
    Stream #0:0: Video: h264 (![0][0][0] / 0x0021), yuvj420p, 480x360 [SAR
1:1 DAR 4:3], q=-1--1, 2997 tbn, 29.97 tbc
    Stream #0:1: Audio: aac (@[0][0][0] / 0x0040), 44100 Hz, stereo, s16,
128 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (mjpeg -> libx264)
  Stream #0:0 -> #0:1 (mp3 -> libvo_aacenc)
Press [q] to stop, [?] for help
frame=  158 fps=0.0 q=69.0 size=      60kB time=00:00:03.63 bitrate=
135.7kbits/frame=  309 fps=308 q=69.0 size=     142kB time=00:00:08.67
bitrate= 134.2kbits/frame=  466 fps=309 q=69.0 size=     232kB
time=00:00:13.91 bitrate= 136.4kbits/frame=  624 fps=310 q=69.0 size=
322kB time=00:00:19.18 bitrate= 137.5kbits/frame=  782 fps=311 q=69.0
size=     411kB time=00:00:24.45 bitrate= 137.8kbits/frame=  912 fps=306
q=-1.0 Lsize=     546kB time=00:00:30.36 bitrate= 147.2kbits/s
video:36kB audio:476kB global headers:0kB muxing overhead 6.526406%
[libx264 @ 0x313d2a0] frame I:4     Avg QP:51.00  size:   187
[libx264 @ 0x313d2a0] frame P:448   Avg QP:51.00  size:    64
[libx264 @ 0x313d2a0] frame B:460   Avg QP:51.00  size:    16
[libx264 @ 0x313d2a0] consecutive B-frames:  2.2% 88.6%  9.2%  0.0%
[libx264 @ 0x313d2a0] mb I  I16..4: 72.7% 27.3%  0.0%
[libx264 @ 0x313d2a0] mb P  I16..4:  1.4%  0.9%  0.0%  P16..4:  1.5%  0.1%
1.3%  0.0%  0.0%    skip:94.8%
[libx264 @ 0x313d2a0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%
0.0%  direct: 0.0%  skip:100.0%  L0:33.3% L1:66.7% BI: 0.0%
[libx264 @ 0x313d2a0] final ratefactor: inf
[libx264 @ 0x313d2a0] 8x8 transform intra:35.7%
[libx264 @ 0x313d2a0] coded y,uvDC,uvAC intra: 0.0% 0.8% 0.0% inter: 0.0%
0.0% 0.0%
[libx264 @ 0x313d2a0] i16 v,h,dc,p: 83% 15%  1%  0%
[libx264 @ 0x313d2a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  0%  0% 100%  0%  0%
0%  0%  0%  0%
[libx264 @ 0x313d2a0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 0x313d2a0] Weighted P-Frames: Y:8.3% UV:1.3%
[libx264 @ 0x313d2a0] ref P L0: 93.6%  0.3%  4.9%  1.1%  0.2%
[libx264 @ 0x313d2a0] ref B L0: 50.0% 50.0%
[libx264 @ 0x313d2a0] kb/s:9.64
[root at localhost html]#

-- 
Damon Edwards
gplus.to/damonedwards


More information about the ffmpeg-user mailing list