title: Accessing RTP Timestamps from WebRTC
body: <p>I'm currently working on a WebRTC project. We are using Janus Gateway for WebRTC server side recording/transceiving etc.</p>
  
  <p>For a canvas related synchronization, I need to access RTP timestamps of the received video track. I have been searching for a method extensively for a while now.</p>
  
  <p>I've tried getStats function of peer connection, but the timestamps of the stats are the acquisition times. Not packet timestamps.</p>
  
  <p>Also, in W3's standard it says specifically: </p>
  
  <blockquote>
    <p>The timestamp of type DOMHighResTimeStamp [HIGHRES-TIME], indicating
    the most recent time of playout of an RTP packet containing the
    source. The timestamp is defined in [ HIGHRES-TIME] and corresponds to
    a local clock.</p>
  </blockquote>
  
  <p>Which can be accessed via <code>getContributingSources()</code> function from <code>RTCRtpReceiver</code> object. But I've noticed, that function returns an empty array.</p>
  
  <p>To reproduce:</p>
  
  <p><a href="https://webrtc.github.io/samples/src/content/peerconnection/pc1/" rel="nofollow noreferrer">https://webrtc.github.io/samples/src/content/peerconnection/pc1/</a></p>
  
  <p>After you press <strong>Start</strong> and <strong>Call</strong> your camera feed and the peer connection should appear.
  After that open up the console and write:</p>
  
  <pre><code>const receivers = pc2.getReceivers();
  receivers.forEach(receiver =&gt; {
      console.log(receiver.getContributingSources());
  });
  </code></pre>
  
  <p>My question is, how can I access the received RTP packet's timestamp? Or the last received video RTP timestamp?</p>
  
  <p>Thanks in advance.</p>