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 761943 - gstrtpbasepayload: set DEFAULT_PERFECT_RTPTIME to FALSE
gstrtpbasepayload: set DEFAULT_PERFECT_RTPTIME to FALSE
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-12 14:15 UTC by Håvard Graff (hgr)
Modified: 2018-11-03 11:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.64 KB, patch)
2016-02-12 14:15 UTC, Håvard Graff (hgr)
none Details | Review
rtpmpeg4pay: Don't produce timestamps based on byte count (1.84 KB, patch)
2016-05-15 10:21 UTC, Olivier Crête
none Details | Review
rtpmp4gpay: Don't produce timestamps based on byte count (1.84 KB, patch)
2016-05-15 10:21 UTC, Olivier Crête
committed Details | Review

Description Håvard Graff (hgr) 2016-02-12 14:15:38 UTC
Created attachment 320983 [details] [review]
patch

A very common pipeline is feeding an encoder inheriting from
GstAudioEncoder into a payloader inheriting from GstRtpBasePayload.

If this is the case, the rtp-timestamp will, if perfect_rtptime is TRUE,
reflect the amount of bytes in each packet, and not (like it should)
reflect the timestamp of the packets in the clock-rate domain.

Example:
20ms AAC packets with clock-rate of 90000, should have the rtp-timestamp
incrementing with 90000 * 20 / 1000 = 1800.

Currently, because perfect_rtptime is default TRUE, the AAC-packets
will be incrementing with the buffer-size of the packets, which is
typically 64000 * 20 / 1000 = 1280.

In the case that bitrate and clock-rate are the same (like with ALAW and
MULAW) it will work by chance, which is probably why it has not been
discovered earlier.
Comment 1 Tim-Philipp Müller 2016-02-22 23:20:50 UTC
Wim, any opinion?

perfect-rtptime=TRUE seems wrong to me as default.
Comment 2 Olivier Crête 2016-05-15 09:49:46 UTC
Increasing by the buffer size is a bug here.. it should increase by the number of samples.. This sounds like a bug in the payloader.
Comment 3 Olivier Crête 2016-05-15 10:21:07 UTC
Created attachment 327926 [details] [review]
rtpmpeg4pay: Don't produce timestamps based on byte count

Perfect RTP time is only used for payloaders that support it, they do that by
giving the sample count in GST_BUFFER_OFFSET, rtpmp4gpay was just putting the byte count in there, explaining the effect your seeing!

The GST_BUFFER_OFFSET of output buffers returned to GstRtpBasePayload
should reflect the number of "samples" in the unit of the RTP clock in this
buffer. If this is not true, then it shouldn't be set.
Comment 4 Olivier Crête 2016-05-15 10:21:50 UTC
Created attachment 327927 [details] [review]
rtpmp4gpay: Don't produce timestamps based on byte count

The GST_BUFFER_OFFSET of output buffers returned to GstRtpBasePayload
should reflect the number of "samples" in the unit of the RTP clock in this
buffer. If this is not true, then it shouldn't be set.
Comment 5 Olivier Crête 2016-05-15 10:29:58 UTC
Fix committed to rtpmp4gpay, I think all of the other payloaders have the right behaviour.

commit e21cf3bc1c85ff7ad235c36a99ee169784040008
Author: Olivier Crête <olivier.crete@collabora.com>
Date:   Sun May 15 12:16:23 2016 +0200

    rtpmp4gpay: Don't produce timestamps based on byte count
    
    The GST_BUFFER_OFFSET of output buffers returned to GstRtpBasePayload
    should reflect the number of "samples" in the unit of the RTP clock in this
    buffer. If this is not true, then it shouldn't be set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761943
Comment 6 Håvard Graff (hgr) 2016-05-15 19:44:35 UTC
The reported issue did not involve rtpmp4gpay in any shape or form, but the fact the "perfect-rtptime" does not consider the clock-rate at all, making it completely useless IMHO. My point in the initial description was that this works "by accident" for any payloadtype that happens to have clock-rate == samplerate, but the whole concept is flawed and should be removed. (IMHO) :)
Comment 7 Olivier Crête 2016-05-16 08:19:06 UTC
For most audio codecs, it is explicitly defined that clock-rate=sample-rate, for those where it isn't, there is sometimes a direct mapping that can be obtained. Do you have any pipeline where it produces the wrong result? In theory, the code should do nothing if the subclass doesn't set GST_BUFFET_OFFSET() on the output buffer and it only does that on fixed bitrate codecs right now (those that use GstRtpBaseAudioPayload).
Comment 8 GStreamer system administrator 2018-11-03 11:44:46 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/252.