<div dir="ltr"><div>Hi,<br><br><br>After weeks of time spent, now my module finally can muxing H264 and AAC RTP streams into a MPEG-TS. Here write down the "big picture" for someone new at this onto the track quickly.<br>
<br><br></div><div>Objective: Create a relay program which works as a RTSP client, consumes the video and audio RTP sessions, muxing them into a MPEG-TS and then push to somewhere network you need.<br><br></div><div>To-do:<br>
</div><div>1. The implementation can start on the testRTSPCclient<br><br></div><div>2. For incoming H264 RTP session, firstly, you will need to implement a filter class to insert H264 Start code in the beginning of each frame. The work will simply insert 4 bytes (0x00, 0x00, 0x00, 0x01) in the beginning of each frame.<br>
<br>3. For incoming AAC RTP session, firstly, you will need to implement a filter class to insert ADTS header in front of each AAC packet. ADTS header just several bytes and the format can be find on internet easily, mostly bit-wise operations according to your environment.<br>
<br></div><div>4. In the continueAfterSETUP(), feed the video session's FrameSource (this will be a H264VideoRTPSource) into your H264 StartCode filter, and then feed the H264 StartCode filter into a MPEG2TransportStreamFromESSource by it's addNewVideoSource, use 5 as the mpegVersion.<br>
<br>5. In the continueAfterSETUP(), feed the audio session's FrameSource (this will be a MPEG4GeneticRTPSource) into
your ADTS header filter, and then feed the ADTS header filter into the same MPEG2TransportStreamFromESSource by it's addNewAudioSource, use 4 as
the mpegVersion.<br><br></div><div>6. After the 2 session setup completed, call startPlaying of a SimpleRTPSink with the MPEG2TransportStreamFromESSource.<br><br><br></div><div>Hope this helps.<br></div>James.<br></div>