<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to read image and vedio data in Databricks using OpenCV. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-read-image-and-vedio-data-in-databricks-using-opencv/m-p/24321#M16904</link>
    <description>&lt;P&gt;I have tried reading image and video data in Azure databricks using OpenCv. When I have checked the type of image, it’s shown as “NonType” and when I tried with vedio file, the file itself was not being opened. (Note: these files are stored on azure blob storage and accesssed in databricks after mounting.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OpenCV version: 4.5.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; numpy &lt;B&gt;as&lt;/B&gt; np&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; cv2&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; ffmpeg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;# Capture video from file&lt;/I&gt;&lt;/P&gt;&lt;P&gt;cap = cv2.VideoCapture('/dbfs:/databricks-datasets/cctvVideos/mp4/test/Browse1.mp4', cv2.FFMPEG)&lt;/P&gt;&lt;P&gt;&lt;B&gt;while&lt;/B&gt; True:&lt;/P&gt;&lt;P&gt;    success, img = cap.read()&lt;/P&gt;&lt;P&gt;    print(success)&lt;/P&gt;&lt;P&gt;    &lt;B&gt;if&lt;/B&gt; success:&lt;/P&gt;&lt;P&gt;        cv2.imshow("video", img)&lt;/P&gt;&lt;P&gt;        cv2.waitKey(1)&lt;/P&gt;&lt;P&gt;        &lt;B&gt;if&lt;/B&gt; 0xFF == ord('q') :&lt;/P&gt;&lt;P&gt;            &lt;B&gt;break&lt;/B&gt;   &lt;/P&gt;&lt;P&gt;    &lt;B&gt;else&lt;/B&gt;:&lt;/P&gt;&lt;P&gt;        &lt;B&gt;break&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it have have any dependencies on other libraries?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2022 08:04:27 GMT</pubDate>
    <dc:creator>KVK</dc:creator>
    <dc:date>2022-03-30T08:04:27Z</dc:date>
    <item>
      <title>Unable to read image and vedio data in Databricks using OpenCV.</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-read-image-and-vedio-data-in-databricks-using-opencv/m-p/24321#M16904</link>
      <description>&lt;P&gt;I have tried reading image and video data in Azure databricks using OpenCv. When I have checked the type of image, it’s shown as “NonType” and when I tried with vedio file, the file itself was not being opened. (Note: these files are stored on azure blob storage and accesssed in databricks after mounting.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OpenCV version: 4.5.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; numpy &lt;B&gt;as&lt;/B&gt; np&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; cv2&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; ffmpeg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;# Capture video from file&lt;/I&gt;&lt;/P&gt;&lt;P&gt;cap = cv2.VideoCapture('/dbfs:/databricks-datasets/cctvVideos/mp4/test/Browse1.mp4', cv2.FFMPEG)&lt;/P&gt;&lt;P&gt;&lt;B&gt;while&lt;/B&gt; True:&lt;/P&gt;&lt;P&gt;    success, img = cap.read()&lt;/P&gt;&lt;P&gt;    print(success)&lt;/P&gt;&lt;P&gt;    &lt;B&gt;if&lt;/B&gt; success:&lt;/P&gt;&lt;P&gt;        cv2.imshow("video", img)&lt;/P&gt;&lt;P&gt;        cv2.waitKey(1)&lt;/P&gt;&lt;P&gt;        &lt;B&gt;if&lt;/B&gt; 0xFF == ord('q') :&lt;/P&gt;&lt;P&gt;            &lt;B&gt;break&lt;/B&gt;   &lt;/P&gt;&lt;P&gt;    &lt;B&gt;else&lt;/B&gt;:&lt;/P&gt;&lt;P&gt;        &lt;B&gt;break&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it have have any dependencies on other libraries?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 08:04:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-read-image-and-vedio-data-in-databricks-using-opencv/m-p/24321#M16904</guid>
      <dc:creator>KVK</dc:creator>
      <dc:date>2022-03-30T08:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read image and vedio data in Databricks using OpenCV.</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-read-image-and-vedio-data-in-databricks-using-opencv/m-p/24322#M16905</link>
      <description>&lt;P&gt;Kindly let me know if you find the answer.!!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 09:23:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-read-image-and-vedio-data-in-databricks-using-opencv/m-p/24322#M16905</guid>
      <dc:creator>sachinkumar</dc:creator>
      <dc:date>2022-12-20T09:23:46Z</dc:date>
    </item>
  </channel>
</rss>

