cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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.!!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.