h264parse: output frames with no pts causes jerky rendering
Submitted by Aurélien Zanelli
Link to original bug (#734124)
Description
Playing a specific ts file using this kind of pipeline:
gst-launch-1.0 filesrc location=1seg.ts ! tsdemux program-number=23992 ! h264parse ! video/x-h264,stream-format=byte-stream,alignment=au ! avdec_h264 ! autovideosink
causes the rendering to be jerky.
The test file can be downloaded here: http://www.darkosphere.fr/tmp/gstreamer/1seg.ts
I think it could be caused by the h264parse element sending frame to decoder without pts.
Here is what I understand about the issue:
I notice that h264parse, in this case, rely on timestamp provided by upstream, ie tsdemux. But buffers pushed by tsdemux element can contain more than one AU, so sone of them will be pushed with a non valid PTS causing decoder to be confused.
Currently, I wrote an ugly ugly ugly hack (and pretty unclear) which slightly improve the rendering. My approach was to try to interpolate PTS using timing info through using gst_h264_parse_get_timestamp() in pre_push_frame().
What do you think about this issue, do you have better ideas ?
P.S: This issue can be a duplicate of bug 659489, but I'm not sure.