[Bug 788777] rtpjitterbuffer/h264parse timestamp issue (regression)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sun Jul 8 14:43:39 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=788777

Pedro Corte-Real <pedro at pedrocr.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pedro at pedrocr.net

--- Comment #14 from Pedro Corte-Real <pedro at pedrocr.net> ---
I've hit what I think is this bug trying to do rtsp streaming from an IP
camera. For example:

$ gst-launch-1.0 --gst-debug-level=2 uridecodebin uri="rtsp://xxx"
caps="video/x-h264" ! h264parse ! mp4mux ! filesink location=test.mp4
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to
rtspu://10.23.67.76/user=admin&password=&channel=1&stream=0.sdp?real_stream
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
0:00:02.155699947 19264 0x7f1fe4003630 WARN                   qtmux
gstqtmux.c:4553:gst_qt_mux_add_buffer:<mp4mux0> error: Buffer has no PTS.
ERROR: from element /GstPipeline:pipeline0/GstMP4Mux:mp4mux0: Could not
multiplex stream.
Additional debug info:
gstqtmux.c(4553): gst_qt_mux_add_buffer ():
/GstPipeline:pipeline0/GstMP4Mux:mp4mux0:
Buffer has no PTS.
Execution ended after 0:00:02.061331145
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
0:00:02.156376777 19264 0x55a03c547370 WARN                 rtspsrc
gstrtspsrc.c:5915:gst_rtsp_src_receive_response:<source> receive interrupted
0:00:02.156393147 19264 0x55a03c547370 WARN                 rtspsrc
gstrtspsrc.c:8242:gst_rtspsrc_pause:<source> PAUSE interrupted
Setting pipeline to NULL ...
Freeing pipeline ...

Using matroskamux instead of mp4mux appears to work but only because instead of
failing it creates a file without any I-frames:

$ gst-launch-1.0 --gst-debug-level=2 uridecodebin uri="rtsp://xxx"
caps="video/x-h264" ! h264parse ! matroskamux ! filesink location=test.mp4
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to
rtspu://10.23.67.76/user=admin&password=&channel=1&stream=0.sdp?real_stream
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
0:00:02.176154384 19308 0x7fad98003f70 WARN             matroskamux
matroska-mux.c:3685:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid
buffer timestamp; dropping buffer
0:00:02.181343483 19308 0x7fad98003f70 WARN             matroskamux
matroska-mux.c:3685:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid
buffer timestamp; dropping buffer
0:00:04.182640326 19308 0x7fad98003f70 WARN             matroskamux
matroska-mux.c:3685:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid
buffer timestamp; dropping buffer
0:00:06.180916572 19308 0x7fad98003f70 WARN             matroskamux
matroska-mux.c:3685:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid
buffer timestamp; dropping buffer
0:00:08.181572733 19308 0x7fad98003f70 WARN             matroskamux
matroska-mux.c:3685:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid
buffer timestamp; dropping buffer
0:00:10.181878193 19308 0x7fad98003f70 WARN             matroskamux
matroska-mux.c:3685:gst_matroska_mux_write_data:<matroskamux0:video_0> Invalid
buffer timestamp; dropping buffer
(...)

I added a probe to the h264parser src and it seems that all the I-frames end up
with broken pts values (each line is a buffer):

flags: DISCONT | HEADER | DELTA_UNIT pts 00:00:00.130488980 dts
00:00:00.132701175
flags: (empty) pts 99:99:99.999999999 dts 00:00:00.144599571
flags: DELTA_UNIT pts 00:00:00.170488896 dts 00:00:00.172938726
flags: DELTA_UNIT pts 00:00:00.210488559 dts 00:00:00.212886204
flags: DELTA_UNIT pts 00:00:00.250487801 dts 00:00:00.252749559
flags: DELTA_UNIT pts 00:00:00.290486458 dts 00:00:00.292753600
flags: DELTA_UNIT pts 00:00:00.330484373 dts 00:00:00.332698810
flags: DELTA_UNIT pts 00:00:00.370481400 dts 00:00:00.373815622
flags: DELTA_UNIT pts 00:00:00.410477411 dts 00:00:00.412160732
flags: DELTA_UNIT pts 00:00:00.450472303 dts 00:00:00.452277058
flags: DELTA_UNIT pts 00:00:00.490466004 dts 00:00:00.492262089
flags: DELTA_UNIT pts 00:00:00.530458479 dts 00:00:00.532317524
flags: DELTA_UNIT pts 00:00:00.570449738 dts 00:00:00.572483015
flags: DELTA_UNIT pts 00:00:00.610439839 dts 00:00:00.612719141
flags: DELTA_UNIT pts 00:00:00.650428891 dts 00:00:00.652659546
flags: DELTA_UNIT pts 00:00:00.690417052 dts 00:00:00.692286976
flags: DELTA_UNIT pts 00:00:00.730404526 dts 00:00:00.732778163
flags: DELTA_UNIT pts 00:00:00.770391557 dts 00:00:00.772393936
flags: DELTA_UNIT pts 00:00:00.810378416 dts 00:00:00.812636200
flags: DELTA_UNIT pts 00:00:00.850365386 dts 00:00:00.852443918
flags: DELTA_UNIT pts 00:00:00.890352749 dts 00:00:00.893038377
flags: DELTA_UNIT pts 00:00:00.930340769 dts 00:00:00.932568091
flags: DELTA_UNIT pts 00:00:00.970315534 dts 00:00:00.972372486
flags: DELTA_UNIT pts 00:00:01.010292724 dts 00:00:01.012433147
flags: DELTA_UNIT pts 00:00:01.050272620 dts 00:00:01.052350431
flags: DELTA_UNIT pts 00:00:01.090255361 dts 00:00:01.092344823
flags: DELTA_UNIT pts 00:00:01.130240949 dts 00:00:01.132636784
flags: DELTA_UNIT pts 00:00:01.170229258 dts 00:00:01.172454366
flags: DELTA_UNIT pts 00:00:01.210220059 dts 00:00:01.213108059
flags: DELTA_UNIT pts 00:00:01.250213051 dts 00:00:01.253091072
flags: DELTA_UNIT pts 00:00:01.290207891 dts 00:00:01.292905405
flags: DELTA_UNIT pts 00:00:01.330204227 dts 00:00:01.333063222
flags: DELTA_UNIT pts 00:00:01.370201723 dts 00:00:01.372836432
flags: DELTA_UNIT pts 00:00:01.410200080 dts 00:00:01.412488087
flags: DELTA_UNIT pts 00:00:01.450199049 dts 00:00:01.452409799
flags: DELTA_UNIT pts 00:00:01.490198431 dts 00:00:01.492800029
flags: DELTA_UNIT pts 00:00:01.530198079 dts 00:00:01.532800996
flags: DELTA_UNIT pts 00:00:01.570197889 dts 00:00:01.573130835
flags: DELTA_UNIT pts 00:00:01.610197792 dts 00:00:01.612535500
flags: DELTA_UNIT pts 00:00:01.650197746 dts 00:00:01.655823246
flags: DELTA_UNIT pts 00:00:01.690197725 dts 00:00:01.692281451
flags: DELTA_UNIT pts 00:00:01.730197717 dts 00:00:01.732738014
flags: DELTA_UNIT pts 00:00:01.770197713 dts 00:00:01.772335278
flags: DELTA_UNIT pts 00:00:01.810197712 dts 00:00:01.812399785
flags: DELTA_UNIT pts 00:00:01.850197712 dts 00:00:01.852435838
flags: DELTA_UNIT pts 00:00:01.890197712 dts 00:00:01.893547681
flags: DELTA_UNIT pts 00:00:01.930197712 dts 00:00:01.932689090
flags: DELTA_UNIT pts 00:00:01.970197712 dts 00:00:01.972465099
flags: DELTA_UNIT pts 00:00:02.010197712 dts 00:00:02.012648985
flags: DELTA_UNIT pts 00:00:02.050197712 dts 00:00:02.053152003
flags: DELTA_UNIT pts 00:00:02.090197712 dts 00:00:02.093963961
flags: HEADER | DELTA_UNIT pts 00:00:02.130197711 dts 00:00:02.130642509
flags: (empty) pts 99:99:99.999999999 dts 00:00:02.144220304
flags: DELTA_UNIT pts 00:00:02.170197711 dts 00:00:02.172837551
(...)

I found a workaround (that I haven't yet figured out how to enable in the rust
bindings) which is to do set_pts_interpolation(h264parser, true). That seems to
fix the issue.

I haven't bee able to grab a raw rtp or h264 stream to a file that I can then
reproduce this at will from. Let me know what kind of extra information would
help. If any one the gstreamer developers wants one of these cameras to test I
can also have it shipped to you. There seems to be a recent wave of cheap 2-4MP
cameras with h264 (and supposedly h265 as well). They're probably all using the
same encoder chips so this is likely to be a common issue.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list