incorrect fps value from "sequence header" (ignoring division factor info in "sequence extension" relating to fps ?)
|Reported by:||Owned by:||reimar|
|Reproduced by developer:||no||Analyzed by developer:||no|
I recently posted a request info / bug report (last 4th January, see here after) about incorrect MPEG frame rate interpretation
by MPlayer and, as suggested by Reimar Döffinger, I just tried to upload the first 4 MBytes of my 5 fps frame rate MPEG test file
that is unfortunately displayed at 30 fps by MPlayer if not forcing the '-fps 5' option.
I also tried to upload level 1 log messages generated when invoking MPlayer at command prompt when playing
my MPEG test file with and without forcing the correct frame rate:
Unfortunately, all my tries to upload these 3 files fail systematically, so,
how to make these files available to anybody who could examine this frame rate bug ? As it is my first MPlayer bug-report ever in the related Bugzilla area,
is there another way to join files to a bug-report ?
Especially to Reimar Döffinger :
would you accept direct mail from me with 3 attached files I mentioned here
(that is, 2 x ".log" and 1 x ".mpg" files) ?
2 persons have already posted comments and point of view about my initial post :
- Nico Sabbi said:
"IIRC the MPEG parsing code was never updated to correctly handle the
framerate extension, and (still IIRC) not even ffmpeg handles it"
- Reimar Döffinger said :
"Please provide a sample file and also try playing with -demuxer lavf"
So, my initial questions are still the same:
- How to make MPlayer interpreting the correct frame rate by exploiting "sequence header" (announcing pre-defined "30 fps" frame rate)
in conjunction with (NOT IGNORING) elements from "sequence extension" giving the frame rate division factor to be applied
to the "standard" frame rate value deriving from the standard frame rate index info read from "sequence header" ?
Please note that the interesting MediaInfo project/tool has been recently fixed about this MPEG technical details (see version 0.7.27 release of MediaInfo)
and is now reporting correct "5 fps" frame rate about my MPEG test file (v0.7.26 was previously reporting incorrect "0 fps" frame rate).
- Could anybody indicate/suggest to me what MPlayer and/or ffmpeg source file(s) are concerned in reading/interpreting
MPEG "sequence header" and "sequence extension" from an MPEG file or MPEG stream data ?
Thanks a lot in advance, anymore help very appreciated. Kind regards.
Previous bug-report post (dated from last 4th January) :
I'm looking for method(s)/object(s)/function(s) involved by MPlayer to retrieve informations
from an MPEG file, especially how it will read information fields from "sequence header" (start_code 0x00001B3)
and "sequence extension" (start_code 0x000001B5), because I obtain a 6X speed factor when trying to read
an MPEG video file which was encoded as 5 frames per second as MPlayer is thinking of a 30 fps video stream file...
I think it is because MPlayer (or 3rd-party library functions used by MPlayer ?) don't use properly mixed info between
"sequence header" and "sequence extension" which are well present in the MPEG file and have reliable detailed
information about the video stream according to MPEG standard...
Here below are valid informations in the MPEG file that don't seem to be taken into account properly by MPlayer:
frame_rate_code = 5 (=> "frame_rate_value = 30 fps", if ignoring or miss-interpreting
extension data information in the "sequence extension"...)
frame_rate_extension_n = 0
frame_rate_extension_d = 5
as specified in the MPEG standard, the formula to calculate the effective "frame_rate" shall be
frame_rate = frame_rate_value * (frame_rate_extension_n + 1) / (frame_rate_extension_d + 1)
with "frame_rate_value" being hard-coded and deriving from "frame_rate_code", as specified by the MPEG standard.
With implementing the right standard formula, frame_rate shall be calculated as :
30 * (0 + 1) / (5 + 1) = 30 * 1 / 6 = 5 fps yyyeeeeeesssssssssss !!!
I recompiled MPlayer (on a Linux platform) with "-g" gcc compile flag, hopping to debug/run it step by step with "ddd",
but I didn't find what object/function is effectively reading or not reading the "sequence extension" data
to correct 1st level information data read from the "sequence header".
As more information to you, please notice that the interesting "MediaInfo" tool seems to have (same) problem
in its version 0.7.26 about mixing "sequence header" and "sequence extension" information, not (yet) applying
the right standard MPEG formula, deciding by mistake to take "frame_rate_extension_n / frame_rate_extension_d"
ratio from "sequence extension" as frame rate ( ! ) and ignoring frame_rate_code (frame_rate_value) from "sequence header"
because "frame_rate_extension_n" is zero ! So, MediaInfo displays an invalid "0 fps" frame rate as a result from
"0 / 5" division ! I sent an email about that to the french developper maintaining the MediaInfo tool
(suggesting to him what modification to apply to source code to obtain the right frame rate value,
as I tested/validated this modification by recompiling my own standard copy of MediaInfo source code).
He replied to me, acknowledging for suggested modification.
Hopping anybody can have a look at official source code of MPlayer and post an (approved) update,
many thanks in advance, it may allow me to play "slow" videos which are ok against MPEG stream packet
format, but unfortunately, almost all multimedia players are not ok with such "slow" encoded video streams !?
VLC is hanging with such vids, only Windows Media Player from Microsoft seems to sometimes accept decoding & displaying
of such vids at the right 5 fps frame rate display speed, but surprisingly announcing a 30 fps frame rate (!?) in the info window,
It shall be noticed that other data information fields shall have to be also examined against being defined
partly in "sequence header" and partly in "sequence extension":
a good example (with potential "difficulty") is the "bit rate" which is defined as a 30bit value by the MPEG standard,
with 18 lowest bits named as "bit_rate_value" ( ! ) in the "sequence header" and higher 12 bits "bit_rate_extension"
in the "sequence extension"...
'hope my post can help to build a new version of MPlayer, because for now, I have to add the "-fps 5" option to MPlayer
to properly decode/render our slow 5 fps mpeg stream, but we would have a transparent solution/way to play such streams
without to have to specify the "-fps ?" option because we don't know the right fps before pre-decoding input files...
Kind regards & many thanks in advance.
Change History (13)
by , 12 years ago
by , 12 years ago
by , 12 years ago