cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read image and vedio data in Databricks using OpenCV.

KVK
New Contributor II

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.)

OpenCV version: 4.5.5

Here is the code:

import numpy as np

import cv2

import ffmpeg

# Capture video from file

cap = cv2.VideoCapture('/dbfs:/databricks-datasets/cctvVideos/mp4/test/Browse1.mp4', cv2.FFMPEG)

while True:

success, img = cap.read()

print(success)

if success:

cv2.imshow("video", img)

cv2.waitKey(1)

if 0xFF == ord('q') :

break

else:

break

Does it have have any dependencies on other libraries?

1 REPLY 1

sachinkumar
New Contributor II

Kindly let me know if you find the answer.!!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group