Skolavennu commited on
Commit
cc1a3da
·
verified ·
1 Parent(s): 8d409d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -11,7 +11,12 @@ def extend_video(video_path, seconds):
11
  if not video_path:
12
  return None
13
 
14
- output_path = "extended_output.mp4"
 
 
 
 
 
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)