Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,12 @@ def extend_video(video_path, seconds):
|
|
| 11 |
if not video_path:
|
| 12 |
return None
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
if os.path.exists(output_path):
|
| 16 |
os.remove(output_path)
|
| 17 |
|
|
@@ -48,4 +53,4 @@ with gr.Blocks(title="Video Last-Frame Extender") as demo:
|
|
| 48 |
)
|
| 49 |
|
| 50 |
if __name__ == "__main__":
|
| 51 |
-
demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False)
|
|
|
|
| 11 |
if not video_path:
|
| 12 |
return None
|
| 13 |
|
| 14 |
+
# Extract base name without extension and create '<name>-extend.mp4'
|
| 15 |
+
input_file = Path(video_path)
|
| 16 |
+
base_stem = input_file.stem
|
| 17 |
+
output_dir = input_file.parent
|
| 18 |
+
output_path = str(output_dir / f"{base_stem}-extend.mp4")
|
| 19 |
+
|
| 20 |
if os.path.exists(output_path):
|
| 21 |
os.remove(output_path)
|
| 22 |
|
|
|
|
| 53 |
)
|
| 54 |
|
| 55 |
if __name__ == "__main__":
|
| 56 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False, share=True)
|