Spaces:
Runtime error
Runtime error
eienmojiki
commited on
Commit
•
7576e45
1
Parent(s):
13b8187
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,12 @@ import tempfile
|
|
4 |
import gradio as gr
|
5 |
|
6 |
def get_video_detail(video_path):
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
|
10 |
def convert_video_to_gif(
|
11 |
input: str,
|
@@ -117,13 +121,13 @@ with gr.Blocks(
|
|
117 |
inputs=input,
|
118 |
outputs=save,
|
119 |
queue=False,
|
120 |
-
api_name=
|
121 |
).then(
|
122 |
fn=get_video_detail,
|
123 |
inputs=save,
|
124 |
outputs=[start, end, fps, quality],
|
125 |
queue=False,
|
126 |
-
api_name=
|
127 |
)
|
128 |
|
129 |
run_btn.click(
|
|
|
4 |
import gradio as gr
|
5 |
|
6 |
def get_video_detail(video_path):
|
7 |
+
if not video_path:
|
8 |
+
return 0, 0, 0, 0
|
9 |
+
|
10 |
+
else:
|
11 |
+
info = VideoFileClip(video_path)
|
12 |
+
return 0, info.duration, info.fps, max(info.size)
|
13 |
|
14 |
def convert_video_to_gif(
|
15 |
input: str,
|
|
|
121 |
inputs=input,
|
122 |
outputs=save,
|
123 |
queue=False,
|
124 |
+
api_name="upload"
|
125 |
).then(
|
126 |
fn=get_video_detail,
|
127 |
inputs=save,
|
128 |
outputs=[start, end, fps, quality],
|
129 |
queue=False,
|
130 |
+
api_name="info"
|
131 |
)
|
132 |
|
133 |
run_btn.click(
|