<div><span class="gmail_quote">Hi Brian,</span></div>
<div><span class="gmail_quote"></span>&nbsp;</div>
<div><span class="gmail_quote">welcome to the field, I was a newbie myslef 3 months ago.</span></div>
<div><span class="gmail_quote">first thing - the code I wrote is client-side code. so it is less relevant to you.</span></div>
<div><span class="gmail_quote"></span>&nbsp;</div>
<div><span class="gmail_quote">what you need to do is the following</span></div>
<ul>
<li><span class="gmail_quote">read the file, one NAL at a time. use the aforementioned H264bitstream to do this</span></li>
<li><span class="gmail_quote">skim through <a href="http://www.rfc-archive.org/getrfc.php?rfc=3984">RFC 3984 RTP Payload Format for H.264 Video</a></span></li>
<ul>
<li><span class="gmail_quote">Aggregation packets (STAP) are packets designed to hold together many small NALs, to increase network efficiency</span></li>
<li><span class="gmail_quote">fragmentation packets (FU) are packets designed to break huge NALs (like IDR/key frames) into network size packets</span></li>
<li><span class="gmail_quote">you should write a framer class, that aggregates small nals into a an STAP packet, and breaks big&nbsp; NALs into several FUs. I don&#39;t think this functionality is available in live555.&nbsp;when you implement it, I suggest you submit it to the forum.
</span></li></ul>
<li><span class="gmail_quote">an H264 encoder has some preferences or options, which it must convey to the decoder, otherwise the decoder can&#39;t work.</span></li>
<ul>
<li><span class="gmail_quote">this information can be signalled&nbsp;in NALs called SPS (sequence parameter set) and PPS (picture parameter set)</span></li>
<li><span class="gmail_quote">a good way to give the decoder this information is by putting the SPS/PPS NALs before every IDR frame, this is especially true for streaming, when a client can start decoding in the middle of the stream
</span></li>
<li><span class="gmail_quote">in RTSP settings, this information is often sent in the SDP from the server side to the client, in the fmtp field (again see rfc 3984) and the NALs are presented as BASE64 text</span></li></ul>
</ul>
<div><span class="gmail_quote">I hope this helps</span></div>
<div><span class="gmail_quote">Aviad</span></div>
<div><span class="gmail_quote"></span>&nbsp;</div>
<div><span class="gmail_quote">On 8/16/07, <b class="gmail_sendername">Brian D&#39;Souza</b> &lt;<a href="mailto:brian.vdsouza@gmail.com">brian.vdsouza@gmail.com</a>&gt; wrote:</span></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi Aviad,</div>
<div>&nbsp;</div>
<div>Well I havent really executed any of the test programs; but I traced the flow for testMPEG4ESVideoToDarwin.cpp: This involved understanding the MultiFramedSink, the Framer, parser classes for MPEG4 video. etc. So I can say I have managed a reasonable if not extensive understanding of the same. 
</div>
<div>&nbsp;</div>
<div>Let me outline in more detail what I am looking to do. </div>
<div>&nbsp;</div>
<div>I have Motorola set top box which has an audio and video encoder and streams live content( mp4 : codec used for video: h264 and for audio: aac). I have to design a module which streams this content in RTP . </div>
<div>&nbsp;</div>
<div>For aac, i think live media has some code to do the streaming using ADTS. Not sure if that will work though.</div>
<div>&nbsp;</div>
<div>For h264; i have been scanning through some posts, but stumbled upon your and thought it was relevant:</div>
<div>&nbsp;</div>
<div>What i need:?</div>
<div>&nbsp;</div>
<div>Ideally take input from encoder/(video(h264) file for now: which contains output of an encoder(video) ..: containing NAL units). Then I need a framer class or something which reads frame by frame from the source, generates RTP packets just like how MultiFrameRTPSInk class( I have come to conclusion; this is the class used by all media to create RTP packets; etc and send them on using packet buffers etc.) 
</div>
<div>&nbsp;</div>
<div>These RTP packets are then fed into Darwin streaming server using DarwinInjector.cpp(of live media) and then my client a mobile phone(connects using RTSP) to the DSS. My client has support for decoding mp4 and support for RTP/RTSP 
</div>
<div>&nbsp;</div>
<div>Darwin has capabilities on waiting for relay; and Live555 has the functionality of basically injecting packets from RTPSink onto the server( it does this by creating an SDP description and using RTSP announce protocol. 
</div>
<div><br>I havent looked at the H264BitStream project , but on first look at the code you sent me; it looks like streaming from a file. Does it actually create RTP Packets and send them.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>I know I am a bit vague; but the thing is I am new to this domain and a summer intern. So have just picked up bits and peices and trying to design module which packetizes elementary streams(h264,aac) and does the relaying. 
</div>
<div>&nbsp;</div>
<div>Sorry for the inconvenience, but would really appreciate your advice.</div>
<div>&nbsp;</div>
<div>Brian</div>
<div>&nbsp;</div>
<div>p.s: You can post my queries to the group, if you thing they might be useful to others.</div>
<div><span class="q" id="q_1146feddc9de15fa_1">
<div><br>&nbsp;</div>
<div><span class="gmail_quote">On 8/16/07, <b class="gmail_sendername">aviad rozenhek</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:aviadr1@gmail.com" target="_blank">aviadr1@gmail.com</a>
&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi Brian,</div>
<div>&nbsp;</div>
<div>I have not understood from your mail whether you are familiar with live555 or not.</div>
<div>also I assume the mobile clients want to have audio in addition to video, so in order to understand your problem better I would need the complete scenario</div>
<div>(live source VS file audio video etc).</div>
<div>&nbsp;</div>
<div>basically, if you are only doing server side then your biggest challenge is to understand live555 good enough to integrate it into your server.</div>
<div>&nbsp;</div>
<div>Let me rephrase my post on live555:</div>
<ul>
<li>&nbsp;the SDP information that is received in the initial RTSP handshake has some crucial information without which it is impossible to decode h264 
<li>&nbsp;this information can be used in two ways: 
<ul>
<li>initialize the decoder with the information in some decoder-proprietary manner 
<li>put this information in the stream itself (increases size of stream slightly) - this is what I did and what my post describes.</li></li></ul></li></li></ul>
<div>you might need to do this (add the information directly to the stream) if the eventual decoder (either darwin if it does transcoding, otherwise the mobile client) doesn&#39;t know the information beforehand.</div>
<div>&nbsp;</div>
<div>I will send you the modified source in a seperate email.</div>
<div>&nbsp;</div>
<div>in the interest of clarity, since you are the 2nd person to ask me on that post outside of the forum, I would be happy if you would allow me to post this conversation back to the mailing list for future reference.</div>

<div>&nbsp;</div>
<div>Cheers</div><span>
<div>Aviad Rozenhek</div></span>
<div><span>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span class="gmail_quote">On 8/16/07, <b class="gmail_sendername">Brian D&#39;Souza</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:brian.vdsouza@gmail.com" target="_blank">brian.vdsouza@gmail.com 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi Aviad,</div>
<div>&nbsp;</div>
<div>I had read one of your posts from the Live555 discussion forums. I am looking to design/re-use a module which takes input from file/encoder, reading h264 content( NAL units i think) and generating RTP packets which is then relayed to the Darwin server and then streamed by the Darwin Server to be viewed by clients on the mobile. 
</div>
<div>&nbsp;</div>
<div>As per a post of yours, I understood that you did something on the similar lines. Did you modify the live555 code to establish the same. </div>
<div>I would really appreciate your guidance/advice and if you have done something on the similar lines I would be grateful if you send me the modified source </div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Thanks in advance</div>
<div><br>Regards </div><span>
<div>Brian</div></span></blockquote></div><br></span></div></blockquote></div><br></span></div></blockquote><br>