<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Qlabel in video not showing - Raspberry pi 4 Opencv 4.1.0]]></title><description><![CDATA[<p dir="auto">I installed Opencv 4.1.0 and Qt Creator on Rpi 4. I created a gui with a button and a label. When the button is clicked, I want the video to play in the label. The codes I use for this are:<br />
VideoCapture cap(“/home/users/video.mp4”);<br />
  if(!cap.isOpened()){<br />
                      cout &lt;&lt; "Error opening video stream or file" &lt;&lt; endl;<br />
                       return -1;<br />
  }</p>
<pre><code>while(1)
{
	Mat frame;
	cap &gt;&gt; frame;
	if (frame.empty())
</code></pre>
<p dir="auto">break;</p>
<pre><code>	Qimage img = Qimage((uchar*) frame.data, frame.cols, frame.rows, frame.step, Qimage::Format_RGB888);
	ui→label→setPixmap(QPixmap::fromImage(img));
	char c = (char) waitKey(25);
	if(c==27)
		break;
}
cap.release();
destroyAllWindows();
</code></pre>
<p dir="auto">No video is shown in Label. But  imshow (“Frame”, frame);  When I add the command line, the video is displayed in the label.<br />
How can I show the video in qlabel ?</p>
]]></description><link>https://forum.qt.io/topic/109120/qlabel-in-video-not-showing-raspberry-pi-4-opencv-4-1-0</link><generator>RSS for Node</generator><lastBuildDate>Fri, 07 Aug 2026 15:16:05 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/109120.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Nov 2019 10:50:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qlabel in video not showing - Raspberry pi 4 Opencv 4.1.0 on Sat, 08 Feb 2020 16:28:39 GMT]]></title><description><![CDATA[<p dir="auto">ui-&gt;label-&gt;repaint()</p>
]]></description><link>https://forum.qt.io/post/576678</link><guid isPermaLink="true">https://forum.qt.io/post/576678</guid><dc:creator><![CDATA[bknhatice]]></dc:creator><pubDate>Sat, 08 Feb 2020 16:28:39 GMT</pubDate></item><item><title><![CDATA[Reply to Qlabel in video not showing - Raspberry pi 4 Opencv 4.1.0 on Fri, 22 Nov 2019 22:14:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">You are blocking the event loop with your tight loop as well as your wait key.</p>
<p dir="auto">Use a Timer that will read your file at regular interval since you anyway wait for 25ms.</p>
]]></description><link>https://forum.qt.io/post/563664</link><guid isPermaLink="true">https://forum.qt.io/post/563664</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 22 Nov 2019 22:14:35 GMT</pubDate></item></channel></rss>