[FFmpeg-user] Muxing raw H264 to container format (MP4, MOV)

Bazza lamia at jeack.com.au
Wed Nov 2 01:45:09 CET 2011


On Tue, 1 Nov 2011 07:36:30 -0700 (PDT), oblivion <vlad.ion at gmail.com>
wrote:

>Considering nobody knows why my h264 file is skipped maybe it's a bug and I
>should submit a bug report?
>
>I find the fact that there is no error very strange. If I give an empty (or
>invalid) file as input to ffmpeg then I get an error so it means it does
>read my file but decides to ignore it without any message.


Well I'm most certainly no expert but I tried your little example.
The line that worked for me ...

ffmpeg -threads 3 -i in.h264 -vcodec mpeg4 -r 25 -sameq outfile.mp4

I didn't need to " -f h264 " but I did need to force the codec
which, running the way you expressed it, complained about the
frame rates being incompatible (and quite rightfully ?? so because MP4
is only 25 fps ???)

---------------------------------------------- As reported

C:\Users\Administrator>ffmpeg -threads 3 -i in.h264 -vcodec mpeg4 -r
25 -sameq .mp4

ffmpeg version git-N-29638-g95f163b, Copyright (c) 2000-2011 the
FFmpeg developers
  built on May  6 2011 12:50:01 with gcc 4.5.3
  configuration: --enable-gpl --enable-version3 --enable-memalign-hack
--enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable
nable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libopenjpeg --enable-l
able-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs
--enable-lib
le-zlib --pkg-config=pkg-config
  libavutil    51.  2. 1 / 51.  2. 1
  libavcodec   53.  3. 0 / 53.  3. 0
  libavformat  53.  0. 3 / 53.  0. 3
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  4. 0 /  2.  4. 0
  libswscale    0. 14. 0 /  0. 14. 0
[h264 @ 018AAE60] 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 'e:\molly\in.h264':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h264 (High), yuv420p, 1280x960, 25 fps, 25
tbr, 1200k tbn, 50 tbc
[buffer @ 03E6FD20] w:1280 h:960 pixfmt:yuv420p
Output #0, mp4, to 'e:\molly\outfile.mp4':
  Metadata:
    encoder         : Lavf53.0.3
    Stream #0.0: Video: mpeg4, yuv420p, 1280x960, q=2-31, 200 kb/s, 25
tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=   85 fps= 15 q=0.0 Lsize=    8933kB time=3.40
bitrate=21523.8kbits/s dup=0 drop=172
video:8932kB audio:0kB global headers:0kB muxing overhead 0.016171%
---------------------------------------------- 



More information about the ffmpeg-user mailing list