Unable to read image and vedio data in Databricks using OpenCV.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 01:04 AM
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?
- Labels:
-
Azure databricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 01:23 AM
Kindly let me know if you find the answer.!!