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

Bazza lamia at jeack.com.au
Wed Nov 2 02:14:01 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 ???)

FWIW, I tried your lines and it "sort of" worked. The '-f h264' was
needed. There's sound? The quality was crude and the file size
truncated at about 4 Mb but refused to play in Windows Media beyond 8
secs of the file's max duration. Bar "flipping/tilting" =  1 tilt/sec.
In contrast, my working line rendered a bar sway of about 2 tilts/sec.


Perhaps ffprobe -show_streams your_original_infile.xxx ?


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

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

ffmpeg version git-N-29638-g95f163b, Copyright (c) 2000-2011 the
FFmpeg developers
[ etc stuff skipped ]
  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:\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:\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