Ethereal-dev: Re: [Ethereal-dev] Decoding G.729 using Ethereal, rtpdump and VoiceAgedecoder

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Alejandro Vaquero <alejandrovaquero@xxxxxxxxx>
Date: Wed, 26 Jul 2006 08:51:33 -0700
Gabriel,
    As mentioned in that doc, the G729 Codec Sample size it is 10bytes and those 10bytes represent 10ms of voice. Then if you put one, two, three or more of those 10byte samples in one RTP packet it is a different story. The default it is to have two samples per RTP packet (so you have a 20ms packetization period), but you can have three or more in one RTP. The most common packetization periods for G729 are 20ms, 40ms, 60ms or 80ms. Of course when you add more G729 samples in one RTP packet, you save bandwidth because there is less IP/UDP/RTP header involved.

Regards
Alejandro

Gabriel M. wrote:

I came across this article (http://www.cisco.com/warp/public/788/pkt-voice-general/bwidth_consume.html) that states there is a non-default version of g.729 which uses 30ms packetization period, thus the RTP payload is 30bytes (I have just noticed that now, I was under the impression that the payload was 20bytes).

Any idea what to do in this case?

 


From: ethereal-dev-bounces@xxxxxxxxxxxx [mailto:ethereal-dev-bounces@xxxxxxxxxxxx] On Behalf Of Alejandro Vaquero
Sent: Tuesday, July 25, 2006 4:41 AM
To: Ethereal development
Subject: Re: [Ethereal-dev] Decoding G.729 using Ethereal, rtpdump and VoiceAgedecoder

 

Looks you are close because you get some voice patterns. If the RTP packetization period is 20ms, then there are two 10byte samples of G729 encoded data per RTP packet, so make sure when you run the "rtpdump" the samples are in the correct order when generating the bitstream.

Gabriel M. wrote:

Hi,

 

I am trying to decode a VoIP conversation using G.729 encoding. I have read older messages on this list (and others) but I am still not able to dump a listenable .au file.

 

The steps that I made so far:

capture the traffic using Ethereal and dumping the RTP data (Statistics -> RTP -> Show all streams -> SaveAs).

Use rtpdump (http://www.cs.columbia.edu/IRT/software/rtptools/) to dump only the audio payload (“rtpdump -F payload -f in.rtp -o out.rtp”)

Use self-made code (see the code at the end of the e-mail) to convert the rtpdump into the bitstream expected by the decoder

Decode the bitstream using the VoiceAge decoder (decoder out.rtp test2.au)

Play the test2.au using GoldWave, (with all possible combinations between 16bit signed/unsigned 8000Hz)

 

Unfortunately all I can hear is some weird sound ( I can see voice patterns in GoldWave, but the sound is metalic, almost alien-like). Am I doing something wrong ?

 

References:

http://www.ethereal.com/lists/ethereal-dev/200505/msg00399.html

http://www.dsprelated.com/groups/speechcoding/show/666.php

 

//rtp_bitstream.c

 

[code]

#include <stdio.h>

 

int main(int argc, char **argv)

{

            char c;

            FILE *f=fopen("in.rtp", "r");

            FILE *fileout = fopen("out3.rtp","w");

 

            long lSize;

            char * buffer, * out;

            char qbyte, q;

 

            int i, j =0, k;

 

    fseek (f , 0 , SEEK_END);

    lSize = ftell (f);

    rewind (f);

 

            buffer = (char*) malloc (lSize);

            out = (char*) malloc (lSize * 16);

 

            fread (buffer,1,lSize,f);

 

            for (i = 0; i<lSize; i++)

            {

                       

                        qbyte = buffer[i];

                        for (k=0;k<8;k++)

                        {

 

                                    q = qbyte & 1;

                                    out[j] = 0x00;

                                    j++;

 

                                    if (q == 0)

                                                out[j] = 0x71;

                                    else

                                                out[j] = 0x81;

                                    j++;

 

                                    qbyte >>= 1;

                                   

                        }

            }

 

            fwrite (out , 1 , lSize * 16, fileout);

 

 

return 0;

}

[/code]

 

Best regards,

Gabriel.

 



 
_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev
  

_______________________________________________ Ethereal-dev mailing list Ethereal-dev@xxxxxxxxxxxx http://www.ethereal.com/mailman/listinfo/ethereal-dev
_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev