This pcap file in cloudshark was captured during a voip mobile app (audio) conversation. https://www.cloudshark.org/captures/8fef0eaa85f4 As we can see, Opus is used as codec. In wireshark, I analyzed the RTP stream, saved as raw file. Then I downloaded opus encode/decoder tool from : http://www.opus-codec.org/downloads/ I encoded the raw file as : "encode.exe --bitrate 16 --raw myrawfile.raw output.opus" Then Tried to play opus file in audacity. What I can get is only the noise. I tried by decoding the opus file into wav and play again. Still no luck. Could you please suggest me where have I gone wrong ? |
You want to go the other way, decode from opus to wav. @Jaap, wireshark doesnt allow saving .opus, does it ? To decode it we need to have .opus file at first. That is the problem, we dont have ,opus file, we have only raw file. Thanks
(17 May '15, 19:32)
Shas
Raw != WAV. Raw is the binary data in the RTP packets. The binary data in the RTP packets is Opus encoded sound. Therefore you need to decode the opus encoded data in WAV encoded data.
(17 May '15, 23:04)
Jaap ♦
@Jaap, Thanks for the comment. I couldnt be quiet clear. Yes, I have raw file (already opus encoded), need to make it wav file. but opus decoder takes only .opus file as input to decode and create wav file. Here is the problem, how do we feed raw (opus encoded) but not recognized by opus decoder as opus file in the decoder. Appreciated
(03 Jun '15, 09:06)
Shas
The problem with extracting the raw Opus stream is that it is a variable bit rate (VBR) codec. The extracted data needs to be written with some sort of framing such as Ogg or Matroska so the player knows where one frame ends and the next begins.
(27 Nov '15, 16:36)
kjotte
Indeed. And so opening a whole new can-o-worms.
(27 Nov '15, 20:41)
Jaap ♦
look here. In short, by extracting the RTP payload from the RTP packets into a continuous stream of bytes, you strip information which the opus decoder needs. As @kjotte wrote, the decoder needs to know where the individual Opus packets (which are not the same as IP packets) begin and end, as they do not contain such information inside themselves and as their size is variable. The opusdec from the Opus tools can only extract the Opus packets from an ogg file structure which provides, if we limit ourselves to aspects important for Opus, the same service like RTP: encapsulation of the Opus packets into a transport layer which indicates where they begin and end and also includes means to obtain this information also if part of the data gets lost in transport. So you have three possibilities:
(28 Nov '15, 11:18)
sindy
Hm, as there are many possible "link type" encapsulations, you'd need half of Wireshark code to properly parse a pcap(ng) file to reach the packet fields you need. So better to use
(29 Nov '15, 13:02)
sindy
showing 5 of 7
show 2 more comments
|