Jump to content
  • 0

How to access audio timestamp?


Lucas Nogueira
 Share

Question

I am trying to perform AV sync, but I cannot access the audio timestamp information from the ant media server stream.

I am using libwebrtc m80, and I am able to access the video frame information by accessing the timestamp() method of webrtc::VideoFrame that I receive from the OnFrame callback.

However, for audio, there is no such property, only property I get from
audio from NeedMorePlayData is the ntp_time_ms, but that's not set since I always just get -1.

Any ideas how I could resolve that?
Link to comment
Share on other sites

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Hi,

Have a good day.

I'm not an expert on WebRTC Stack. But I saw, you can use AudioFrame::data() for audio timestamp usage. Did you check it? Also please check below links:

I hope, I could you.

Best Regards,
Selim

Link to comment
Share on other sites

  • 0

Thanks for your response, Selim.

 

I have seen the AudioFrame before, but the issue is that the NeedMorePlayData function does yield an AudioFrame, it only yields the audio data itself, sample rate, ntp_timestamp_ms (which is always -1), and some other metadata that isn't related to timestamp.

 

Do you know how I could receive the audio data via the AudioFrame? That would probably be ideal since that's how I receive video, via VideoFrame.

Do you have a reference of any sample code that makes use of this class?

Thanks,

Lucas

 

Link to comment
Share on other sites

  • 0

Hi,

I asked this issue to one of our WebRTC Stack experts. Here are the details:
Audio timestamp doesn't provide directly from libwebrtc API. In the audio section, timestamp is not sending directly. If there is audio data in the upper layer buffer, it polls and pulls it. If data/packet has not been received, it returns empty. 

If you want to learn deeply, audio timestamp data sending to Audio Decoder. But it's in WebRTC Internal. 

I hope, I could help you.

Best Regards,
Selim
Link to comment
Share on other sites

 Share

×
×
  • Create New...