<div class="gmail_quote">On Tue, Jun 29, 2010 at 7:28 AM, Ross Finlayson <span dir="ltr"><<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The problem is that when I come to decode the stream in VLC the image is far blockier than the original. Why is this? What am I doing wrong?<br>
</blockquote>
<br></div>
I don't know, in part because you're missing some details about your implementation. In particular, you didn't say anything about your implementation of the following pure virtual functions defined for "JPEGVideoSource":<br>
virtual u_int8_t type() = 0;<br>
virtual u_int8_t qFactor() = 0;<br>
virtual u_int8_t width() = 0; // # pixels/8 (or 0 for 2048 pixels)<br>
virtual u_int8_t height() = 0; // # pixels/8 (or 0 for 2048 pixels)<br>
<br>
In any case, though, I suggest that - if possible - you test your system first by receiving data into a file (by connecting a "JPEGVideoRTPSource" to a "FileSink"), and looking at the resulting data using a JPEG image viewer (rather than a media player like VLC). If your server implements RTSP, then this is easy: Just run "openRTSP" with the "-m" option.<br>
</blockquote><div><br></div><div>Hi Ross,</div><div><br></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span style="color: #558187">TestJPEGVideoSource</span>* <span style="color: #558187">TestJPEGVideoSource</span>::createNew(UsageEnvironment& <span style="color: #558187">env</span>, <span style="color: #b519a1">const</span> <span style="color: #b519a1">char</span> * fileName, <span style="color: #b519a1">unsigned</span> <span style="color: #b519a1">int</span> timePerFrame)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>FILE * fid = fopen( fileName, <span style="color: #c92722">"r"</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">if</span> ( fid == <span style="color: #b519a1">NULL</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #c92722"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #558187">env</span><span style="color: #000000">.setResultErrMsg( </span>"Failed to open input device file"<span style="color: #000000"> );</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #b519a1"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span>return<span style="color: #000000"> </span>NULL<span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">return</span> <span style="color: #b519a1">new</span> <span style="color: #558187">TestJPEGVideoSource</span>( <span style="color: #558187">env</span>, fid, timePerFrame );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span style="color: #558187">TestJPEGVideoSource</span>::<span style="color: #558187">TestJPEGVideoSource</span>(UsageEnvironment& <span style="color: #558187">env</span>, FILE* fid, <span style="color: #b519a1">unsigned</span> <span style="color: #b519a1">int</span> timePerFrame) </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>: JPEGVideoSource(<span style="color: #558187">env</span>), fFid(fid), fTimePerFrame(timePerFrame), fNeedAFrame(False)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #b519a1"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>this<span style="color: #000000">-></span><span style="color: #558187">buffer</span><span style="color: #000000"> = </span>NULL<span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>fseek( fid, <span style="color: #380dd6">0L</span>, SEEK_END );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>size_t sz = ftell( fFid );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>fseek( fid, <span style="color: #380dd6">0L</span>, SEEK_SET );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>buffer = <span style="color: #b519a1">new</span> <span style="color: #b519a1">unsigned</span> <span style="color: #b519a1">char</span>[ sz ];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>fread( buffer, <span style="color: #380dd6">1</span>, sz, fid );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">bool</span> sof0 = <span style="color: #b519a1">false</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">bool</span> sos = <span style="color: #b519a1">false</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #558187"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #b519a1">this</span><span style="color: #000000">-></span>sosIndex<span style="color: #000000"> = </span><span style="color: #380dd6">0</span><span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">this</span>-><span style="color: #558187">sosSize</span> = <span style="color: #380dd6">0</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">for</span> ( <span style="color: #b519a1">int</span> i = <span style="color: #380dd6">0</span>; i < (<span style="color: #b519a1">int</span>)(sz - <span style="color: #380dd6">8</span>); ++i )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #b519a1">if</span> ( buffer[i] == <span style="color: #380dd6">0xFF</span> && buffer[i+<span style="color: #380dd6">1</span>] == <span style="color: #380dd6">0xC0</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                        </span>fLastHeight = (buffer[i+<span style="color: #380dd6">5</span>]<<<span style="color: #380dd6">5</span>)|(buffer[i+<span style="color: #380dd6">6</span>]>><span style="color: #380dd6">3</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                        </span>fLastWidth = (buffer[i+<span style="color: #380dd6">7</span>]<<<span style="color: #380dd6">5</span>)|(buffer[i+<span style="color: #380dd6">8</span>]>><span style="color: #380dd6">3</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                        </span><span style="color: #b519a1">if</span> ( sos && sof0 ) <span style="color: #b519a1">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #b519a1">else</span> <span style="color: #b519a1">if</span> ( buffer[i] == <span style="color: #380dd6">0xFF</span> && buffer[i+<span style="color: #380dd6">1</span>] == <span style="color: #380dd6">0xDA</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                        </span>sosIndex = i + <span style="color: #380dd6">2</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                        </span><span style="color: #b519a1">if</span> ( sos && sof0 ) <span style="color: #b519a1">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">if</span> ( <span style="color: #b519a1">this</span>-><span style="color: #558187">sosIndex</span> > <span style="color: #380dd6">0</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #b519a1">this</span>-><span style="color: #558187">sosSize</span> = sz - <span style="color: #b519a1">this</span>-><span style="color: #558187">sosIndex</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #c92722"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>printf( </span>"Streaming image w=%d h=%d total_size=%d sos_size=%d\n"<span style="color: #000000">, fLastWidth * </span><span style="color: #380dd6">8</span><span style="color: #000000">, fLastHeight * </span><span style="color: #380dd6">8</span><span style="color: #000000">, (</span><span style="color: #b519a1">int</span><span style="color: #000000">)sz, </span><span style="color: #b519a1">this</span><span style="color: #000000">-></span><span style="color: #558187">sosSize</span><span style="color: #000000"> );</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>fclose(fFid);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span style="color: #558187">TestJPEGVideoSource</span>::~TestJPEGVideoSource()</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{<span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">if</span> ( <span style="color: #b519a1">this</span>-><span style="color: #558187">buffer</span> ) <span style="color: #b519a1">delete</span> [] buffer;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span style="color: #b519a1">void</span> <span style="color: #558187">TestJPEGVideoSource</span>::doGetNextFrame()</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>fFrameSize = <span style="color: #b519a1">this</span>-><span style="color: #558187">sosSize</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">if</span> ( fFrameSize > fMaxSize )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #c92722"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span>printf( </span>"Truncating frame!!\n"<span style="color: #000000"> );</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>fNumTruncatedBytes = fFrameSize - fMaxSize;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>fFrameSize = fMaxSize;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>memcpy( fTo, <span style="color: #b519a1">this</span>-><span style="color: #558187">buffer</span> + <span style="color: #b519a1">this</span>-><span style="color: #558187">sosIndex</span>, fFrameSize );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">if</span> ( fPresentationTime.tv_sec == <span style="color: #380dd6">0</span> && fPresentationTime.tv_usec == <span style="color: #380dd6">0</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>gettimeofday( &fPresentationTime, <span style="color: #b519a1">NULL</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>} </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #b519a1"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>else</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #b519a1">unsigned</span> uSeconds = fPresentationTime.tv_usec + ( fTimePerFrame * <span style="color: #380dd6">1000</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>fPresentationTime.tv_sec += uSeconds / <span style="color: #380dd6">1000000</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>fPresentationTime.tv_usec = uSeconds % <span style="color: #380dd6">1000000</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>fDurationInMicroseconds = fTimePerFrame * <span style="color: #380dd6">1000</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>nextTask() = envir().taskScheduler().scheduleDelayedTask( <span style="color: #380dd6">0</span>, (TaskFunc*)FramedSource::afterGetting, <span style="color: #b519a1">this</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #558187"><span style="color: #000000">u_int8_t </span>TestJPEGVideoSource<span style="color: #000000">::type()</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{<span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #b519a1"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>return<span style="color: #000000"> </span><span style="color: #380dd6">1</span><span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">u_int8_t <span style="color: #558187">TestJPEGVideoSource</span>::qFactor()</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #b519a1"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>return<span style="color: #000000"> </span><span style="color: #380dd6">65</span><span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #558187"><span style="color: #000000">u_int8_t </span>TestJPEGVideoSource<span style="color: #000000">::width()</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">return</span> fLastWidth;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">u_int8_t <span style="color: #558187">TestJPEGVideoSource</span>::height()</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #b519a1">return</span> fLastHeight;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo">}</p><div><br></div><div>That's pretty much it. I have downloaded an image from an RTSP source using openRTSP saving each frame as a JPG file. I am the using one these JPG files to be used as a source for the above code. I have then connected using openRTSP to my server streaming back the above source. I have attached the 'input' image and the 'output' image of the process.</div>
<div><br></div><div>Thanks, Andy.</div></div>