<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> You need to show the source of your data. How do you get the frames from a</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> webcam, does it come in packets? RGB data? that's the code you should show.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> The problem that I'm seeing is that you're using an avio context when you</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> don't actually intend to write data with it to a file. Just take the webcam</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> frame data call avcodec_encode_video and that function writes it to a</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> buffer. I'm not sure why you're making the all these avio calls. I suggest</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> you also look at the headers for avcodec_encode_video.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Well, now I am sending my function. I have made a small step forward.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I remember that this function produces h264, theora and vp8 videos correctly.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The small step forward is about the use of "<span style=" font-weight:600;">avio_open_dyn_buf, avio_close_dyn_buf</span>" functions. Now I can read the buffer at the end of the encoding correctly. I can put the buffer in a file and the file is played correctly. The problem is that I can read the buffer only at the end of the encoding!</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">The question is: how can I read the buffer (and empy it) during the encoding?</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" color:#808000;">void</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QThCamera</span><span style=" color:#000000;">::</span><span style=" font-style:italic; color:#000000;">run</span><span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"QThCamera::run()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">start"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier'; color:#800080;">QString</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">MPGFileName=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"a.mp4"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier'; color:#800080;">CvCapture</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*Capture=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier'; color:#000000;">Capture=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">cvCreateCameraCapture</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">Index</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Width</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Height</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(!Capture)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"cvCreateCameraCapture</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800000;">ExternalFrame</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">cvNamedWindow</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#008000;">"Frame"</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800080;">CV_WINDOW_AUTOSIZE</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#800080;">IplImage</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*frame=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#800080;">CvFont</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">font;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier';">cvInitFont</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&font,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">CV_FONT_HERSHEY_SIMPLEX</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0.5f</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0.5f</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVOutputFormat</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pOutputFormat=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">av_guess_format</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#008000;">"mp4"</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">//</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">CODEC_ID_H264</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">-></span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">mp4,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">rawvideo;</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">CODEC_ID_THEORA</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">-></span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">ogg;</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">CODEC_ID_MPEG4</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">-></span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">mpegts,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">rawvideo;</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">CODEC_ID_VP8</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">-></span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">webm</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(!pOutputFormat)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"Could</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">not</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">set</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">output</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">format,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">using</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">MPEG."</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier'; color:#000000;">pOutputFormat=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">av_guess_format</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#008000;">"mpeg"</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(!pOutputFormat)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"av_guess_format</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVFormatContext</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pFormatCtx;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">avformat_alloc_output_context2</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&pFormatCtx,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pOutputFormat,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">)<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"avformat_alloc_output_context2</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVStream</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pVideoStream=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">av_new_stream</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(!pVideoStream)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"av_new_stream</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVCodecContext</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pCodecCtx=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pVideoStream-></span><span style=" font-family:'Courier New,courier'; color:#800000;">codec</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">codec_id</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800080;">CODEC_ID_H264</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">codec_type</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVMEDIA_TYPE_VIDEO</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">bit_rate</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">40000</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">width</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Width</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">height</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Height</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">time_base</span><span style=" font-family:'Courier New,courier'; color:#000000;">.</span><span style=" font-family:'Courier New,courier'; color:#800000;">den</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">25</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">time_base</span><span style=" font-family:'Courier New,courier'; color:#000000;">.</span><span style=" font-family:'Courier New,courier'; color:#800000;">num</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">1</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">gop_size</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">10</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">pix_fmt</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800080;">PIX_FMT_YUV420P</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">oformat</span><span style=" font-family:'Courier New,courier'; color:#000000;">-></span><span style=" font-family:'Courier New,courier'; color:#800000;">flags</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">&</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">AVFMT_GLOBALHEADER</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">flags</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">|=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">CODEC_FLAG_GLOBAL_HEADER</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier';">av_dump_format</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">1</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVCodec</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pCodec=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">avcodec_find_encoder</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">codec_id</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(!pCodec)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"avcodec_find_encoder</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">avcodec_open</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pCodecCtx,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodec)<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"avcodec_open</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                            </span><span style=" font-family:'Courier New,courier'; color:#800080;">QFile</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">QFMPGFileOut;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                            </span><span style=" font-family:'Courier New,courier'; color:#000000;">QFMPGFileOut.</span><span style=" font-family:'Courier New,courier';">setFileName</span><span style=" font-family:'Courier New,courier'; color:#000000;">(MPGFileName);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                            </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(QFMPGFileOut.</span><span style=" font-family:'Courier New,courier'; font-style:italic; color:#000000;">open</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800080;">QIODevice</span><span style=" font-family:'Courier New,courier'; color:#000000;">::</span><span style=" font-family:'Courier New,courier'; color:#800080;">WriteOnly</span><span style=" font-family:'Courier New,courier'; color:#000000;">))</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">avio_open_dyn_buf</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&pFormatCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">pb</span><span style=" font-family:'Courier New,courier'; color:#000000;">)<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"avio_open</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">avformat_write_header</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">NULL</span><span style=" font-family:'Courier New,courier'; color:#000000;">)!=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"av_write_header</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">int</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">BYTEPIC=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Width</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Height</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">3</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#800080;">uint8_t</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pOutBuffer=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800080;">uint8_t</span><span style=" font-family:'Courier New,courier'; color:#000000;">*)</span><span style=" font-family:'Courier New,courier';">malloc</span><span style=" font-family:'Courier New,courier'; color:#000000;">(BYTEPIC);</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">int</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">Frames=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier'; color:#800080;">QDateTime</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">QDTStart=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800080;">QDateTime</span><span style=" font-family:'Courier New,courier'; color:#000000;">::</span><span style=" font-family:'Courier New,courier';">currentDateTime</span><span style=" font-family:'Courier New,courier'; color:#000000;">();</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">while</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800000;">DoStart</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                            </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(!</span><span style=" font-family:'Courier New,courier';">cvSetChannel</span><span style=" font-family:'Courier New,courier'; color:#000000;">(Capture,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Channel</span><span style=" font-family:'Courier New,courier'; color:#000000;">))</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"cvSetChannel</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                            </span><span style=" font-family:'Courier New,courier'; color:#000000;">frame=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">cvQueryFrame</span><span style=" font-family:'Courier New,courier'; color:#000000;">(Capture);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                            </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(frame)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVFrame</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pAVFrame=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">avcodec_alloc_frame</span><span style=" font-family:'Courier New,courier'; color:#000000;">();</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                </span><span style=" font-family:'Courier New,courier'; color:#800080;">uint8_t</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pBuffer=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800080;">uint8_t</span><span style=" font-family:'Courier New,courier'; color:#000000;">*)</span><span style=" font-family:'Courier New,courier';">malloc</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">avpicture_get_size</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800080;">PIX_FMT_YUV420P</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Width</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Height</span><span style=" font-family:'Courier New,courier'; color:#000000;">));</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier';">avpicture_fill</span><span style=" font-family:'Courier New,courier'; color:#000000;">((</span><span style=" font-family:'Courier New,courier'; color:#800080;">AVPicture</span><span style=" font-family:'Courier New,courier'; color:#000000;">*)pAVFrame,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pBuffer,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800080;">PIX_FMT_YUV420P</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Width</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Height</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier';">IplImageToAVFrame</span><span style=" font-family:'Courier New,courier'; color:#000000;">(frame,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pAVFrame,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Width</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800000;">Height</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#800080;">PIX_FMT_YUV420P</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">pAVFrame-></span><span style=" font-family:'Courier New,courier'; color:#800000;">pts</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">Frames;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">int</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">OutSize=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">avcodec_encode_video</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pCodecCtx,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pOutBuffer,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">BYTEPIC,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pAVFrame);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(OutSize></span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#800080;">AVPacket</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">Packet;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier';">av_init_packet</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&Packet);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#008000;">//Packet.pts=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Frames;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">coded_frame</span><span style=" font-family:'Courier New,courier'; color:#000000;">-></span><span style=" font-family:'Courier New,courier'; color:#800000;">pts</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">!=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">AV_NOPTS_VALUE</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                            </span><span style=" font-family:'Courier New,courier'; color:#000000;">Packet.</span><span style=" font-family:'Courier New,courier'; color:#800000;">pts</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">av_rescale_q</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">coded_frame</span><span style=" font-family:'Courier New,courier'; color:#000000;">-></span><span style=" font-family:'Courier New,courier'; color:#800000;">pts</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">time_base</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pVideoStream-></span><span style=" font-family:'Courier New,courier'; color:#800000;">time_base</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">coded_frame</span><span style=" font-family:'Courier New,courier'; color:#000000;">-></span><span style=" font-family:'Courier New,courier'; color:#800000;">key_frame</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">Packet.</span><span style=" font-family:'Courier New,courier'; color:#800000;">flags</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">|=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">AV_PKT_FLAG_KEY</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#000000;">Packet.</span><span style=" font-family:'Courier New,courier'; color:#800000;">stream_index</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pVideoStream-></span><span style=" font-family:'Courier New,courier'; color:#800000;">index</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#000000;">Packet.</span><span style=" font-family:'Courier New,courier'; color:#800000;">data</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pOutBuffer;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#000000;">Packet.</span><span style=" font-family:'Courier New,courier'; color:#800000;">size</span><span style=" font-family:'Courier New,courier'; color:#000000;">=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">OutSize;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">av_interleaved_write_frame</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">&Packet)!=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"av_interleaved_write_frame</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">Frames++;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(Frames></span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">time_base</span><span style=" font-family:'Courier New,courier'; color:#000000;">.</span><span style=" font-family:'Courier New,courier'; color:#800000;">den</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">/</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pCodecCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">time_base</span><span style=" font-family:'Courier New,courier'; color:#000000;">.</span><span style=" font-family:'Courier New,courier'; color:#800000;">num</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">10</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#808000;">break</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                </span><span style=" font-family:'Courier New,courier'; color:#000000;">}{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier';">av_free</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pAVFrame);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                    </span><span style=" font-family:'Courier New,courier';">free</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pBuffer);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                                </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; font-family:'Courier New,courier';"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                            </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"QThCamera::run()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">frame=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">false"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">Frames</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">/</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">QDTStart.</span><span style=" font-family:'Courier New,courier';">secsTo</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800080;">QDateTime</span><span style=" font-family:'Courier New,courier'; color:#000000;">::</span><span style=" font-family:'Courier New,courier';">currentDateTime</span><span style=" font-family:'Courier New,courier'; color:#000000;">());</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier';">free</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pOutBuffer);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier';">av_write_trailer</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx)!=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"av_write_trailer</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">//</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Crash</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">with</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">H264!!!</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#800080;">uint8_t</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">*pDynBuffer;</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier'; color:#808000;">int</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pDynBufferLen=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">avio_close_dyn_buf</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">pb</span><span style=" font-family:'Courier New,courier'; color:#000000;">,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">&pDynBuffer);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier'; color:#800080;">QByteArray</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">QBAByteIn((</span><span style=" font-family:'Courier New,courier'; color:#808000;">const</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#808000;">char</span><span style=" font-family:'Courier New,courier'; color:#000000;">*)pDynBuffer,</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pDynBufferLen);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier'; color:#000000;">QFMPGFileOut.</span><span style=" font-family:'Courier New,courier';">write</span><span style=" font-family:'Courier New,courier'; color:#000000;">(QBAByteIn);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                        </span><span style=" font-family:'Courier New,courier';">av_free</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pDynBuffer);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                                </span><span style=" font-family:'Courier New,courier'; color:#000000;">QFMPGFileOut.</span><span style=" font-family:'Courier New,courier'; font-style:italic; color:#000000;">close</span><span style=" font-family:'Courier New,courier'; color:#000000;">();</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                            </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#808000;">else</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"QFMPGFileOut.open()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">Error!"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                            </span><span style=" font-family:'Courier New,courier';">avcodec_close</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pVideoStream-></span><span style=" font-family:'Courier New,courier'; color:#800000;">codec</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                        </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#808000;">for</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#808000;">int</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">count=</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000080;">0</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#808000;">unsigned</span><span style=" font-family:'Courier New,courier'; color:#000000;">)count<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">pFormatCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">nb_streams</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">count++)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">{</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                        </span><span style=" font-family:'Courier New,courier';">av_freep</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&pFormatCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">streams</span><span style=" font-family:'Courier New,courier'; color:#000000;">[count]-></span><span style=" font-family:'Courier New,courier'; color:#800000;">codec</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                        </span><span style=" font-family:'Courier New,courier';">av_freep</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&pFormatCtx-></span><span style=" font-family:'Courier New,courier'; color:#800000;">streams</span><span style=" font-family:'Courier New,courier'; color:#000000;">[count]);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">                </span><span style=" font-family:'Courier New,courier';">av_free</span><span style=" font-family:'Courier New,courier'; color:#000000;">(pFormatCtx);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">            </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier';">cvReleaseCapture</span><span style=" font-family:'Courier New,courier'; color:#000000;">(&Capture);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">        </span><span style=" font-family:'Courier New,courier'; color:#808000;">if</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#800000;">ExternalFrame</span><span style=" font-family:'Courier New,courier'; color:#000000;">)</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier';">cvDestroyWindow</span><span style=" font-family:'Courier New,courier'; color:#000000;">(</span><span style=" font-family:'Courier New,courier'; color:#008000;">"Frame"</span><span style=" font-family:'Courier New,courier'; color:#000000;">);</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#c0c0c0;">    </span><span style=" font-family:'Courier New,courier';">qDebug</span><span style=" font-family:'Courier New,courier'; color:#000000;">()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#000000;"><<</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">"QThCamera::run()</span><span style=" font-family:'Courier New,courier'; color:#c0c0c0;"> </span><span style=" font-family:'Courier New,courier'; color:#008000;">stop"</span><span style=" font-family:'Courier New,courier'; color:#000000;">;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; color:#000000;">}</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">-- </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">www.denisgottardello.it</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Skype: mrdebug</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Videosurveillance and home automation! </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php</p></body></html>