Ticket #2211 (closed defect: fixed)
Not possible to override bogus FPS in raw h264 streams
| Reported by: | jaanusk | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | git-master | Keywords: | h264 |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | yes | |
| Analyzed by developer: | no |
Description
It's not possible to override fps on raw h264 streams.
For example, I have a stream produced by Raspberry PI HW encoder which plays fine when fps
is forced. The actual fps is 15, but recent ffmpeg versions default somehow to 25fps.
How to reproduce:
% ffmpeg -r 15 -i stream_00 -vcodec copy stream.mp4
ffmpeg version N-49440-gebe368d Copyright (c) 2000-2013 the FFmpeg developers
built on Jan 29 2013 16:08:08 with gcc 4.7 (Debian 4.7.2-5)
configuration:
libavutil 52. 17.100 / 52. 17.100
libavcodec 54. 91.100 / 54. 91.100
libavformat 54. 61.104 / 54. 61.104
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 34.101 / 3. 34.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
[h264 @ 0x1bcf000] max_analyze_duration 5000000 reached at 5000000 microseconds
[h264 @ 0x1bcf000] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from 'stream_00':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p, 960x720, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Output #0, mp4, to 'stream.mp4':
Metadata:
encoder : Lavf54.61.104
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 960x720, q=2-31, 25 fps, 1200k tbn, 1200k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=224753 fps=173017 q=-1.0 Lsize= 103295kB time=02:29:50.08 bitrate= 94.1kbits/s
video:102400kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.873958%
Output file plays faster then normal because the actual source is 15fps and ffmpeg does not allow to override this.
Last version that works as expected is 0.11.2.
Attachments
Change History
comment:1 in reply to: ↑ description Changed 5 months ago by cehoyos
- Keywords h264 added
comment:2 Changed 5 months ago by jaanusk
Working example:
$ ffmpeg -r 15 -i sample.h264 -vcodec copy out.mp4
ffmpeg version 0.11.2 Copyright (c) 2000-2012 the FFmpeg developers
built on Jan 23 2013 11:04:28 with gcc 4.4.5
configuration:
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
[h264 @ 0x1e459160] max_analyze_duration 5000000 reached at 5000000
[h264 @ 0x1e459160] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from 'sample.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p, 960x720, 15 fps, 15 tbr, 1200k tbn, 30 tbc
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf54.6.100
Stream #0:0: Video: h264 (![0][0][0] / 0x0021), yuv420p, 960x720, q=2-31, 15 fps, 1200k tbn, 1200k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 140 fps=0.0 q=-1.0 Lsize= 202kB time=00:00:09.26 bitrate= 178.8kbits/s
video:200kB audio:0kB global headers:0kB muxing overhead 1.108398%
Changed 5 months ago by jaanusk
-
attachment
sample.h264
added
Raw h264 file from Raspberry Pi encoder, 15fps
Note: See
TracTickets for help on using
tickets.



Replying to jaanusk:
This is unexpected: Please provide command line including complete, uncut console output for a working revision and provide an input sample.