Spaces:
Sleeping
Sleeping
rosyvs
commited on
Commit
·
109738c
1
Parent(s):
500e98d
Update gradio version
Browse filesfrom 3.47.1 to 4.43
handle FFMPEG errors with user feedback
- app.py +1 -1
- requirements.txt +1 -1
- utils.py +1 -0
app.py
CHANGED
|
@@ -199,7 +199,7 @@ interface = gr.Interface(fn=trim_video, inputs=[input_file, output_format, start
|
|
| 199 |
|
| 200 |
# gr components for video converter
|
| 201 |
input_file_c = gr.File(label="Select video file")
|
| 202 |
-
output_format_c = gr.Dropdown(choices=["mkv", "MOV", "mp4", "wav"], label="Select output format", value="
|
| 203 |
output_file_c = gr.File(label="Download converted file")
|
| 204 |
|
| 205 |
interface_c = gr.Interface(fn=convert_video, inputs=[input_file_c, output_format_c], outputs=output_file_c, title="Video Converter", allow_flagging="never",
|
|
|
|
| 199 |
|
| 200 |
# gr components for video converter
|
| 201 |
input_file_c = gr.File(label="Select video file")
|
| 202 |
+
output_format_c = gr.Dropdown(choices=["mkv", "MOV", "mp4", "wav"], label="Select output format", value="mp4",)
|
| 203 |
output_file_c = gr.File(label="Download converted file")
|
| 204 |
|
| 205 |
interface_c = gr.Interface(fn=convert_video, inputs=[input_file_c, output_format_c], outputs=output_file_c, title="Video Converter", allow_flagging="never",
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio==
|
| 2 |
moviepy==1.0.3
|
| 3 |
pandas==1.1.3
|
| 4 |
xlrd==1.2.0
|
|
|
|
| 1 |
+
gradio==4.43.0
|
| 2 |
moviepy==1.0.3
|
| 3 |
pandas==1.1.3
|
| 4 |
xlrd==1.2.0
|
utils.py
CHANGED
|
@@ -257,6 +257,7 @@ def convert_and_trim_video(media_in, media_out, start=None, end=None):
|
|
| 257 |
process = subprocess.run(command, capture_output=True, text=True)
|
| 258 |
if process.returncode != 0:
|
| 259 |
logging.info(f"FFMPEG error: {process.stderr}")
|
|
|
|
| 260 |
else:
|
| 261 |
logging.info(process.stdout)
|
| 262 |
return media_out
|
|
|
|
| 257 |
process = subprocess.run(command, capture_output=True, text=True)
|
| 258 |
if process.returncode != 0:
|
| 259 |
logging.info(f"FFMPEG error: {process.stderr}")
|
| 260 |
+
gr.Error(f"FFMPEG error: {process.stderr}")
|
| 261 |
else:
|
| 262 |
logging.info(process.stdout)
|
| 263 |
return media_out
|