[FFmpeg-user] force frame rate when reformating raw h264 stream

Jan Pohanka xhpohanka at gmail.com
Mon Oct 1 11:24:38 CEST 2012


Hello,

I have a file with raw h264 stream (a.h264) and I want to mux it into  
matroska. The file was encoded with 5 fps and have 75 frames so its length  
is 15s.

When I try to play this raw stream with ffplay, its speed is correct and  
also the video ends after 15s even if the log says something about 25 fps.

# ffplay a.h264
avplay version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2003-2012 the  
Libav developers
   built on Jun 12 2012 16:52:09 with gcc 4.6.3
[h264 @ 0x7f65e40008c0] Estimating duration from bitrate, this may be  
inaccurate
Input #0, h264, from 'a.h264':
   Duration: N/A, bitrate: N/A
     Stream #0.0: Video: h264 (High), yuvj420p, 800x608, 25 fps, 25 tbr,  
1200k tbn, 5 tbc
[avsink @ 0x7f65dc001020] auto-inserting filter 'auto-inserted scaler 0'  
between the filter 'src' and the filter 'out'
[scale @ 0x7f65dc001700] w:800 h:608 fmt:yuvj420p -> w:800 h:608  
fmt:yuv420p flags:0x4
   16.21 A-V:  0.000 s:0.0 aq=    0KB vq=    0KB sq=    0B f=0/0   0/0

However when I try to mux this file into a container (even with forcing  
the frame rate) its fps is lowered to half -> 2.5 fps and it looks like it  
has 30s.

# ffmpeg -r 5 -i a.h264 -vcodec copy -f matroska -r 5 -y btest.mkv
ffmpeg version 0.8.12, Copyright (c) 2000-2011 the FFmpeg developers
   built on Oct  1 2012 08:25:20 with gcc 4.6.3
   configuration: --enable-libx264 --enable-gpl
   libavutil    51.  9. 1 / 51.  9. 1
   libavcodec   53.  8. 0 / 53.  8. 0
   libavformat  53.  5. 0 / 53.  5. 0
   libavdevice  53.  1. 1 / 53.  1. 1
   libavfilter   2. 23. 0 /  2. 23. 0
   libswscale    2.  0. 0 /  2.  0. 0
   libpostproc  51.  2. 0 / 51.  2. 0
[h264 @ 0x2ead400] max_analyze_duration 5000000 reached at 5200000
[h264 @ 0x2ead400] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 5.00  
(5/1) -> 2.50 (5/2)
Input #0, h264, from 'a.h264':
   Duration: N/A, bitrate: N/A
     Stream #0.0: Video: h264 (High), yuvj420p, 800x608, 2.50 fps, 2.50  
tbr, 1200k tbn, 5 tbc
Output #0, matroska, to 'btest.mkv':
   Metadata:
     encoder         : Lavf53.5.0
     Stream #0.0: Video: libx264, yuvj420p, 800x608, q=2-31, 1k tbn, 2.50  
tbc
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
frame=   76 fps=  0 q=-1.0 Lsize=     789kB time=00:00:30.40 bitrate=  
212.5kbits/s
video:787kB audio:0kB global headers:0kB muxing overhead 0.168676%

It seems to me that ffmpeg thinks that it is recoding interlaced stream to  
progressive, but the input file is progressive also. I have tried the same  
with latest git master, but the situation is the same.

Is it a bug or I'm missing something?

regards
Jan

-- 
Tato zpráva byla vytvořena převratným poštovním klientem Opery:  
http://www.opera.com/mail/


More information about the ffmpeg-user mailing list