<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello All,<div>I having some difficulty on getting samples out of a QTCaptureSession into MPEG4VideoStreamDiscreteFramer.</div><div><br></div><div>The DeviceSource::doNextFrame is only being called every 1 to 1.5 seconds, the delay is not in MPEG4VideoStreamDiscreteFramer::doGetNextFrame().</div><div><br></div><div>A binary file of the QTCaptureSession output can be seen at the following link;</div><div><span class="Apple-style-span" style="font-family: Baskerville; font-size: 13px; "><a href="http://www.pathfinertv.net/555/stream-from-qt.bin">http://www.pathfindertv.net/555/stream-from-qt.bin</a></span></div><div><br></div><div>I think there may be something missing in the bit stream from QT that is causing MPEG4VideoStreamDiscreteFramer not to be able to parse the incoming stream.</div><div><br></div><div>modulo_time_base and vop_time_increment are always zero.</div><div><br></div><div>Every call to DeviceSource::deliverFrame the data starts with 000001B6...... the vop start code. There is not any 000001B3xxx000001B6..... (group of vop start code) or 000001B0.... (visual object sequence start code)<span class="Apple-style-span" style="font-size: 10px; "><span class="Apple-style-span" style="font-size: 12px; "> in the QTCaptureSession output.</span></span></div><div><br></div><div>I tried to use MPEG4VideoStreamFramer but it needs the 000001B0.... (visual object sequence start code) in order to accepted the stream.</div><div><br></div><div><div>My input is defined and used as below;</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "> MPEG4VideoStreamDiscreteFramer<span style="color: rgb(0, 0, 0); ">* </span>videoSource<span style="color: rgb(0, 0, 0); ">;</span></div><div><font class="Apple-style-span" face="Monaco" size="2">.</font></div><div><font class="Apple-style-span" face="Monaco" size="2">.</font></div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "> DeviceParameters<span style="color: rgb(0, 0, 0); "> params;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="white-space: pre; "> </span></font>fileSource<span style="color: rgb(0, 0, 0); "> = </span>DeviceSource<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(38, 71, 75); ">createNew</span><span style="color: rgb(0, 0, 0); ">(*</span>env<span style="color: rgb(0, 0, 0); ">, params);</span></div><div><font class="Apple-style-span" face="Monaco" size="2">.</font></div><div><font class="Apple-style-span" face="Monaco" size="2">.</font></div><div><font class="Apple-style-span" face="Monaco" size="2"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><span style="color: rgb(0, 0, 0); "> </span>FramedSource<span style="color: rgb(0, 0, 0); ">* videoES = </span>fileSource<span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><span class="Apple-style-span" style="color: rgb(63, 110, 116); "><span style="color: rgb(0, 0, 0); "> </span>videoSource<span style="color: rgb(0, 0, 0); "> = </span>MPEG4VideoStreamDiscreteFramer<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(38, 71, 75); ">createNew</span><span style="color: rgb(0, 0, 0); ">(*</span>env<span style="color: rgb(0, 0, 0); ">, videoES);</span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: rgb(0, 0, 0); "> </span>// Finally, start playing:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(196, 26, 22); "><span style="color: rgb(0, 0, 0); "> *</span><span style="color: rgb(63, 110, 116); ">env</span><span style="color: rgb(0, 0, 0); "> << </span>"Beginning to read from file...\n"<span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><span style="color: rgb(0, 0, 0); "> </span>videoSink<span style="color: rgb(0, 0, 0); ">-></span><span style="color: rgb(38, 71, 75); ">startPlaying</span><span style="color: rgb(0, 0, 0); ">(*</span>videoSource<span style="color: rgb(0, 0, 0); ">, afterPlaying, </span>videoSink<span style="color: rgb(0, 0, 0); ">);</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000">.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000">.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000"><br></font></div></font></div></div><div>The rest of the code is based in testMPEG4VideoStreamer.cpp</div><div><br></div><div><div>I have modified DeviceSource.cpp deliverFrame to <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">deliverFrame(<span style="color: rgb(170, 13, 145); ">void</span> *data, <span style="color: rgb(170, 13, 145); ">int</span> len) <span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">to pass data into it. And in the deliverFrame function follows;</span></span></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: rgb(0, 0, 0); "> </span><span style="color: rgb(170, 13, 145); ">if</span><span style="color: rgb(0, 0, 0); "> (!isCurrentlyAwaitingData()) </span><span style="color: rgb(170, 13, 145); ">return</span><span style="color: rgb(0, 0, 0); ">; </span>// we're not ready for the data yet</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: rgb(0, 0, 0); "> <span class="Apple-style-span" style="color: rgb(0, 116, 0); "><span style="color: #000000"> </span>// Deliver the data here:</span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #aa0d91">if</span>(fMaxSize < len){</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>fNumTruncatedBytes = len - fMaxSize;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>len = fMaxSize;<span class="Apple-tab-span" style="white-space:pre">                </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(196, 26, 22); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #2e0d6e">printf</span><span style="color: #000000">(</span>"Frame size truncated\n"<span style="color: #000000">);<span class="Apple-tab-span" style="white-space:pre">                </span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>fDurationInMicroseconds = dura;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>fFrameSize = len;<span class="Apple-tab-span" style="white-space:pre">        </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #2e0d6e">memcpy</span>(fTo, data, len);</div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(196, 26, 22); "><font class="Apple-style-span" color="#000000"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: rgb(0, 0, 0); "> </span>// After delivering the data, inform the reader that it is now available:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> FramedSource::afterGetting(<span style="color: rgb(170, 13, 145); ">this</span>);</div><div><br></div></font></div></div></div></div><div>Any help would be great.</div><div><br></div><div>Thanks</div><div>Austin</div></body></html>