问题
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
回答1:
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:
- Figure out what payload format is being used (eg octet-aligned or bandwidth-efficient). This is usually found in the SIP/SDP negotiation
- Write a script to convert the payloads into an .amr file using RFC 4867 as your guide
- 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
回答2:
Okay lets write this again: I have a PCAP file which contains RTP packets. There are SIP and AMR messages within it (Wideband or Narrowband) I want to get the corresponding AMR sound file which can be played by every player.
Alex Cohn's approach seems to be easy. By just adding and removing some bits from what can be exported from PCAP. As it seems the raw payload can be exported.
So does that mean that the python script needs this *.raw data as input and converts the file to a playable AMR format and I just need to distinguish AMR-NB or AMR-WB?
What about SID messages. Will there be NO_DATA frames inserted automatically?
So what to do step by step starting at a PCAP?
来源:https://stackoverflow.com/questions/9225661/amr-raw-output-from-wireshark-not-playing-in-players