ExternalPlayoutGetData

87 views
Skip to first unread message

emanuele bizzarri

unread,
Sep 30, 2011, 10:45:08 AM9/30/11
to discuss-webrtc
Hi,
I'm using webrtc_voe chain to decode our saved voip calls, in order to
convert them in another format (using ffmpeg).

To do this, I'm using ReceivedRTPPacket and ExternalPlayoutGetData
methods.

I've implemented an external thread that call ExternalPlayoutGetData
every 10ms.
In this situation, if I save decoded (and mixed) data to file, it
seems that some packets are lost.

If I use internal speaker (SetExternalPlayoutStatus(false)) the sound
is perfect.

If I call ExternalPlayoutGetData synchronously after
ReceivedRTPPacket, the audio decoded is shorter than the audio
recorded in the call.

If I put ExternalPlayoutGetData in a "while cycle" after
ReceivedRTPPacket, a deadlock occurs because ExternalPlayoutGetData
always return 0 and lengthSamples is always 160.

There is a way to know if audio is available, after ReceivedRTPPacket
call?

Thank you very much for your great work!

Bye,
Emanuele




emanuele bizzarri

unread,
Oct 3, 2011, 8:49:40 AM10/3/11
to discuss-webrtc
Hi,
I'm trying to go deep in the code.
From what I can understand, the webrtc rx chain is designed for
realtime playback.
In particular, neteq module acts to compensate jitter and bandwith
issues doing some time calculation, audio acceleration or concealment.
For this reason, it seems that using the rx chain to decode and mix
audio data at a speed greater than playback speed is not possible.
If this is true, the only possibility is to implement a one to one
conversion algorithm, where conversion time is equal to the call
duration.
Please, could you give me some advices?

Thankyou very much,
Emanuele
Message has been deleted

manohar

unread,
Jun 22, 2012, 7:43:38 AM6/22/12
to discuss...@googlegroups.com
Hi Emanuele,
  I also had a similar requirement of using ExternalPlayoutGetData (external audio sink). I implemented 
a thread in my application which calls ExternalPlayoutGetData for every ~10ms.
I also do observe loss of audio sometimes. Is this the issue you are also facing ?
I suspect this could be to deal something with ~10ms accuracy. Are there any other ways like 
callbacks or other to get the audio packets to my application asynchronously instead of application 
probing it for every ~10ms ??    

Emanuele Bizzarri

unread,
Jun 22, 2012, 8:59:26 AM6/22/12
to discuss...@googlegroups.com
Hi manohar,
my app plays webrtc recordings and converts them  in other formats, using ffmpeg.
I use webrtc voe ExternalPlayoutGetData with TimeSetEvent on windows, in order to have max precision.
The result is good.
During realtime playback I have no problem.
My problem is in conversion. I'd like to convert the recording at the max speed possible, but I failed to achieve this result.
My application converts the recording in a time that is at least equal to the duration of the recording, because the only way I've found, to play audio data without loss, is to use ExternalPlayoutGetData in "playback mode"

Bye
Emanuele
--


Reply all
Reply to author
Forward
0 new messages