/ Published in: Bash
notes - handling raw audio stream delivered over RTP from Youtube servers gaps in java packages to handle 'messageReceived' over the network and to handle RTP dynamic packet headers (see rfc2198) while parsing for the start of hex data for the audio stream in the packet. In the pcap, there are 4 dynamic headers starting around Ox32 in the packet. Those 4 headers NOT being handled by packetHandler in libStageFright.
Expand |
Embed | Plain Text
docs: http://en.wikipedia.org/wiki/Real-time_Transport_Protocol#Packet_header http://onlinelibrary.wiley.com/doi/10.1002/9780470612279.app1/pdf tools: wireshark hexdump wireshark packets: http://bit.ly/xXhnBX :: pcap file for AMR-NB w/ RFC 2198 dynamic RTP headers http://b2bpo.com/images/wireshrk_RTP_amr-nb_8000_rpt_hdr_ssrc.png http://b2bpo.com/images/wireshrk_RTP_amr-nb_8000_fmt7_frame_typ.png java packages: RTSPClientLib.tar.gz on code.google http://github.com/brunodecarvalho/efflux cpp packages: e555.com/liveMedia/ principal packetHandlers: live.livemedia.MultiFramedRTPSource::networkReadHandler1() com.biasedbit.efflux.packet.DataPacket Class **ISSUE** rfc2198 in libstagefright packet details: packets shown in the wireshark pictures are: RTP raw Audio streams dynamic packet type '99' per RTP RFC AMR/8000/1 at 12.2 k bandwidth ( amr frame format type='7' ) packet length 375 hdr length 54 : when call java getPacketData you get len=321 java len includes the 13 bytes of 4 rfc2198 redundant hdrs first raw audio frame inside packets at disp. 0x0044 in the dump 0x3c is the 1 byte frame header in the raw audio stream issue: 13 bytes at disp 0x36 as shown in wireshark images above does not correspond to the rfc packet-header docs on the header fields 'CSRC' and 'Extension Headers' These 13 bytes are 4 consequtive dynamic headers (rfc2198) that do NOT get handled by the call in java to getPacketBody(). The java handlers do not seem to know what to do with those 13 bytes?? issue: if you are wifi dwnld on the stream, you also have to insert 0x3c frame headers every 32 bytes so that the file can be read back and played with proper AMR decode. The cpp mplayer fileHandler takes care of this, java does not. The cpp fileHandler just starts at 0x40 and then inserts frame header at 32 byte boundaries. java discrepancy: calling packet.getData() or packet.getDataAsArray() return object can not be passed directly to a file sink. Response has extra 16 byte preface before the start of the first audio frame. '0xf0 bc bc bc bc bc bc bc bc bc' at the start of the response are in the raw wireshark packet starting at 0x0036 in the dump.
You need to login to post a comment.
