GNOME Bugzilla – Bug 723243
h264parse: Default framerate to 25/1 when no informations found
Last modified: 2014-01-31 12:42:49 UTC
This is actually what we do in gstavviddec, and even if it is not perfect, it allows us to be sure that some framerate informations will be present in the caps. As soon as some information is found in the stream, that will be updated.
Created attachment 267540 [details] [review] h264parse: Default framerate to 25/1 when no informations found
Comment on attachment 267540 [details] [review] h264parse: Default framerate to 25/1 when no informations found Why not use 0/1?
Because it would more likely break other things and create a weird behaviour I would say.
I think making up a "fake" FPS sounds like a pretty bad idea.. If a downstream element absolutely needs a fixed FPS, then it should make a guess or you should add a videorate (possibly with drop-only=true), not put that in the caps.
IMHO, framerate 0/1 is only valid if duration is valid. In the case we don't have valid duration, and no framerate, I think we are pretty much screwed, whatever the fix is won't be ideal. For this reason I'd go fo Sebastien solution but check the duration is valid, if not, we don't do anything.
I think you will rarely have a valid duration if the framerate is 0/1, since by definition duration is then based on the timestamp of the following frame, which we don't know yet (and it would introduce latency to wait for it), no?
The super common case is RTP, where you have no duration and no framerate, all you have is a buffer with a timestamp, nothing more is required for accurate playback.
Created attachment 267632 [details] [review] h264parse: Default framerate to 0/1 when no informations found It is not perfect but it allows us to be sure that the mandatory 'framerate' field is present in the caps. As soon as some information is found in the stream, that will be updated.
Created attachment 267661 [details] [review] h264parse: Default framerate to 0/1 when no informations found It is not perfect but it allows us to be sure that the mandatory 'framerate' field is present in the caps. As soon as some information is found in the stream, that will be updated.
Comment on attachment 267661 [details] [review] h264parse: Default framerate to 0/1 when no informations found Since when is the framerate field in h264 mandatory? :) But looks good, yes. And 25fps or another fake framerate is really not a good idea. Also 0/1 framerate does not depend on a duration at all, just on timestamps.
(In reply to comment #10) > (From update of attachment 267661 [details] [review]) > Since when is the framerate field in h264 mandatory? :) > > But looks good, yes. And 25fps or another fake framerate is really not a good > idea. Also 0/1 framerate does not depend on a duration at all, just on > timestamps. good point.
(In reply to comment #10) > (From update of attachment 267661 [details] [review]) > Since when is the framerate field in h264 mandatory? :) > > But looks good, yes. And 25fps or another fake framerate is really not a good > idea. Also 0/1 framerate does not depend on a duration at all, just on > timestamps. I guess we should change that in gst-libav too then as it defaults to 25/1 there?
(In reply to comment #10) > (From update of attachment 267661 [details] [review]) > Since when is the framerate field in h264 mandatory? :) Just that gst-validate conciders that "framerate" is mandatory for any video caps, that might actually be a bit excessive for encoded formats.
(In reply to comment #13) > Just that gst-validate conciders that "framerate" is mandatory for any video > caps, that might actually be a bit excessive for encoded formats. Currently, demuxing certain TS file result in no framerate and has been so far considered valid. Though your patch would add a framerate, that reflects well the situation, so personally I'm not against doing it this way. I suspect that libav code was there a long time before we introduce 0/1. Note that no-framerate, and 0/1 is pretty much that same.
Attachment 267661 [details] pushed as 5fd9b42 - h264parse: Default framerate to 0/1 when no informations found