Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,8 @@ video_file = st.file_uploader("Choose a video file", type=["mp4"])
|
|
| 11 |
if video_file is not None:
|
| 12 |
# Read the video file from the file-like object
|
| 13 |
video_path = video_file.name
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
# Get the frames per second (fps) of the video
|
| 17 |
fps = (cap.get(cv2.CAP_PROP_FPS))
|
|
|
|
| 11 |
if video_file is not None:
|
| 12 |
# Read the video file from the file-like object
|
| 13 |
video_path = video_file.name
|
| 14 |
+
video_np = np.frombuffer(video_path,np.uint8)
|
| 15 |
+
cap = cv2.imdecode(video_np, cv2.IMREAD_UNCHANGED)
|
| 16 |
|
| 17 |
# Get the frames per second (fps) of the video
|
| 18 |
fps = (cap.get(cv2.CAP_PROP_FPS))
|