Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,11 +6,12 @@ import gradio as gr
|
|
| 6 |
|
| 7 |
|
| 8 |
def get_video_info(v):
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
| 14 |
return "\n".join([
|
| 15 |
"fps: " + fps,
|
| 16 |
"frame count: " + frames,
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def get_video_info(v):
|
| 9 |
+
vc = cv.VideoCapture(v)
|
| 10 |
+
fps = vc.get(cv.CAP_PROP_FPS)
|
| 11 |
+
frames = vc.get(cv.CAP_PROP_FRAME_COUNT)
|
| 12 |
+
width = vc.get(cv.CAP_PROP_FRAME_WIDTH)
|
| 13 |
+
height = vc.get(cv.CAP_PROP_FRAME_HEIGHT)
|
| 14 |
+
vc.release()
|
| 15 |
return "\n".join([
|
| 16 |
"fps: " + fps,
|
| 17 |
"frame count: " + frames,
|