AMR Raw Output from Wireshark not playing in players

NitinG picture NitinG · Feb 10, 2012 · Viewed 10k times · Source

I have an issue related to the AMR codec in RTP.

I have RTP capture in pcap form having the AMR-NB and AMR-WB codecs.

Now, using the RTP stream analysis, i have extracted the raw output but I am not able to play that extracted raw output in any of the player.

Is there any way i can play that raw output or decode it and it save it raw format or re-encode it to some other format?

Regards Nitin

Answer

rupello picture rupello · Feb 14, 2012

Wireshark does not do the conversion necessary to convert the RTP AMR payloads into the storage format used by .amr files (for playing by audio applications)

RFC 4867 describes the various payload and storage formats. I'd recommend that you read this to become familiar with the different formats. Then you will need to do the following steps:

  1. Figure out what payload format is being used (eg octet-aligned or bandwidth-efficient). This is usually found in the SIP/SDP negotiation
  2. Write a script to convert the payloads into an .amr file using RFC 4867 as your guide
  3. Play the .amr file or convert it to another format using a tool like ffmpeg

I have pasted some example Python code that does the payload conversion here