After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621018 - rtppcmudepay cause crackling with a stream produced by an IP camera
rtppcmudepay cause crackling with a stream produced by an IP camera
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-08 20:24 UTC by Josep Torra Valles
Modified: 2010-06-09 10:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Small clip to reproduce the issue (322.62 KB, application/octet-stream)
2010-06-08 20:35 UTC, Josep Torra Valles
Details
Log showing the duplicated pts (47.06 KB, text/x-log)
2010-06-08 20:36 UTC, Josep Torra Valles
Details

Description Josep Torra Valles 2010-06-08 20:24:48 UTC
I've an IP camera (Swann IP-3G ConnectCam 1000) capable to produce an rtsp stream with mpeg4 part 2 video and mulaw audio.

When I run gst-launch-0.10 playbin2 uri=rtsp://ip/mpeg4 I'm getting some crackling sound.

I've tried to track it and I've observed that the depayloader is creating pairs of buffers with the same pts. I think that this might be related to the issue.

Crackling is reproducible with mulaw decoder and with the pulsesink decoder.
Comment 1 Josep Torra Valles 2010-06-08 20:34:25 UTC
I've captured a portion of stream into a file with the following pipeline: 

gst-launch-0.10 -v rtsp://192.168.1.10/mpeg4 ! gdppay ! identity ! filesink location=bruna_cam.gdp

The crackling sound is reproducible with the following pipeline.

gst-launch-0.10 filesrc -v location=bruna_cam.gdp ! gdpdepay ! rtppcmudepay ! queue ! pulsesink
Comment 2 Josep Torra Valles 2010-06-08 20:35:58 UTC
Created attachment 163101 [details]
Small clip to reproduce the issue
Comment 3 Josep Torra Valles 2010-06-08 20:36:55 UTC
Created attachment 163102 [details]
Log showing the duplicated pts
Comment 4 Mark Nauwelaerts 2010-06-09 09:16:49 UTC
It does not look like rtppcmudepay is causing anything here.

An excerpt of gdpdepay ! rtppcmudepay ! fakesink is:
----
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < ( 1024 bytes, timestamp: 0:01:57.301932429, duration: 0:00:00.128000000, offset: -1, offset_end: -1, flags: 1) 0x26de820"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  896 bytes, timestamp: 0:01:57.301932429, duration: 0:00:00.112000000, offset: -1, offset_end: -1, flags: 33) 0x26deaa0"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < ( 1024 bytes, timestamp: 0:01:57.560319509, duration: 0:00:00.128000000, offset: -1, offset_end: -1, flags: 1) 0x26dec20"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  896 bytes, timestamp: 0:01:57.560319509, duration: 0:00:00.112000000, offset: -1, offset_end: -1, flags: 33) 0x24f0680"
----
which indeed has duplicate timestamps, but it can not be blamed for that, since the input is as follows (gdpdepay ! fakesink):
----
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < ( 1036 bytes, timestamp: 0:01:57.301932429, duration: none, offset: -1, offset_end: -1, flags: 0) 0x22fd940"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  908 bytes, timestamp: 0:01:57.301932429, duration: none, offset: -1, offset_end: -1, flags: 0) 0x212c600"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < ( 1036 bytes, timestamp: 0:01:57.560319509, duration: none, offset: -1, offset_end: -1, flags: 0) 0x22fd9c0"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  908 bytes, timestamp: 0:01:57.560319509, duration: none, offset: -1, offset_end: -1, flags: 0) 0x22fdc40"
----

So it looks like the IP source produces 1920 (for rate 8000) samples in a packet, which is then split during payloading (but still given identical ts).  While the timestamp progress from one change to the next looks about ok for corresponding samples (within sink drift tolerance).  However, buffers with identical timestamp will likely trigger an implicit DISCONT at the sink, and may as such cause distortion.

But, as illustrated, the root cause is in the incoming packets, and other tricks/hacks might have be used to straighten out the timestamps (e.g. audiorate with a large tolerance).

As such, closing, feel free to re-open with other data where applicable.
Comment 5 Zaheer Abbas Merali 2010-06-09 10:17:40 UTC
This is played correctly in mplayer and other players. So yes, the input timestamps in payloading may be screwed up but we should be able to detect at some point down the line this case where we have the following buffers:

ts a duration x
ts a duration y
ts a+x+y duration z
.
.
.

and adjust to:

ts a duration x
ts a+x duration y
ts a+x+y duration z 

without the application having to worry about adding audiorate with relevant tolerance values.
Comment 6 Mark Nauwelaerts 2010-06-09 10:46:17 UTC
If one would run the sink with a larger drift-tolerance, this should automagically work.

Alternatively, if detecting a 'ts a' twice sequence would have to be added to (e.g.) sinks, then it might start with that case, but where it would end ... ?