[FFmpeg-user] Encoded NAL data changes when creating mp4

Richard Hubbard richmh58 at gmail.com
Sat Feb 9 20:45:23 CET 2013


Hello,

  I am trying to use ffmpeg to generate an mp4 from an elementary stream. I
do not want the encoded NAL data to change, but it seems to be getting
changed. I can view the NAL data from gdb/lldb, the application that I have
that parses the elementary stream shows different NAL data then the
application that parses the mp4.


I tried the sameq option but that didn't help.

Prior to adding the profile and level options, I noticed that ffmpeg also
changed the profile to high. I added the "-profile main -level 30" and I am
getting the desired profile and level now.


What option should I provide to place the elementary stream into an mp4
container unchanged?


ffmpeg -i cama1_vtc_c.avc -sameq -vcodec libx264 -profile main -level 30
-an cama1_vtc_c_ffmpegMain30_sameq.mp4

ffmpeg version 0.7.13, Copyright (c) 2000-2011 the FFmpeg developers

  built on Jan 14 2013 07:24:27 with clang 4.0 ((tags/Apple/clang-421.0.60))

  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter
--enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac
--enable-libschroedinger --enable-libopenjpeg --enable-libvpx
--enable-libspeex --disable-libopencore-amrnb --disable-libopencore-amrwb
--mandir=/opt/local/share/man --enable-shared --enable-pthreads
--cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl
--enable-postproc --enable-libx264 --enable-libxvid

  libavutil    50. 43. 0 / 50. 43. 0

  libavcodec   52.123. 0 / 52.123. 0

  libavformat  52.111. 0 / 52.111. 0

  libavdevice  52.  5. 0 / 52.  5. 0

  libavfilter   1. 80. 0 /  1. 80. 0

  libswscale    0. 14. 1 /  0. 14. 1

  libpostproc  51.  2. 0 / 51.  2. 0

[h264 @ 0x7feed981e600] Estimating duration from bitrate, this may be
inaccurate


Seems stream 0 codec frame rate differs from container frame rate: 50.00
(50/1) -> 25.00 (50/2)

Input #0, h264, from 'cama1_vtc_c.avc':

  Duration: N/A, bitrate: N/A

    Stream #0.0: Video: h264 (Main), yuv420p, 720x480, 25 fps, 25 tbr,
1200k tbn, 50 tbc

[buffer @ 0x7feed942c400] w:720 h:480 pixfmt:yuv420p tb:1/1000000 sar:0/1
sws_param:

[libx264 @ 0x7feed9818200] Default settings detected, using medium profile

[libx264 @ 0x7feed9818200] using cpu capabilities: none!

[libx264 @ 0x7feed9818200] profile Main, level 3.0

[libx264 @ 0x7feed9818200] 264 - core 119 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1
ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=-2 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 'cama1_vtc_c_ffmpegMain30_sameq.mp4':

  Metadata:

    encoder         : Lavf52.111.0

    Stream #0.0: Video: libx264, yuv420p, 720x480, q=2-31, 200 kb/s, 50
tbn, 25 tbc

Stream mapping:

  Stream #0.0 -> #0.0

Press [q] to stop, [?] for help

frame=    4 fps=  0 q=28.0 Lsize=      79kB time=00:00:00.08
bitrate=8093.9kbits/s

video:78kB audio:0kB global headers:0kB muxing overhead 1.089088%

frame I:1     Avg QP:27.29  size: 41381

[libx264 @ 0x7feed9818200] frame P:2     Avg QP:29.62  size: 15152

[libx264 @ 0x7feed9818200] frame B:1     Avg QP:30.64  size:  7692

[libx264 @ 0x7feed9818200] consecutive B-frames: 50.0% 50.0%  0.0%  0.0%

[libx264 @ 0x7feed9818200] mb I  I16..4:  8.6%  0.0% 91.4%

[libx264 @ 0x7feed9818200] mb P  I16..4:  1.1%  0.0%  7.7%  P16..4: 22.8%
22.1%  9.7%  0.0%  0.0%    skip:36.5%

[libx264 @ 0x7feed9818200] mb B  I16..4:  0.2%  0.0%  0.2%  B16..8: 31.3%
14.1%  5.3%  direct: 6.1%  skip:42.8%  L0:36.4% L1:32.6% BI:31.0%

[libx264 @ 0x7feed9818200] coded y,uvDC,uvAC intra: 91.6% 72.7% 43.9%
inter: 27.7% 24.8% 8.7%

[libx264 @ 0x7feed9818200] i16 v,h,dc,p: 35% 19%  8% 39%

[libx264 @ 0x7feed9818200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 31% 14%  7%
7%  5%  9%  5%  9%

[libx264 @ 0x7feed9818200] i8c dc,h,v,p: 47% 23% 22%  8%

[libx264 @ 0x7feed9818200] Weighted P-Frames: Y:0.0% UV:0.0%

[libx264 @ 0x7feed9818200] ref P L0: 87.4%  9.5%  3.1%

[libx264 @ 0x7feed9818200] kb/s:3968.85


More information about the ffmpeg-user mailing list