Omnibus commited on
Commit
e4fa945
·
1 Parent(s): f504e7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -9,7 +9,7 @@ def load_video_yt(vid):
9
  vid = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename=f"{uid}-tmp.mp4")
10
  vid_aud = yt.streams.filter(only_audio=True)[0].download(filename=f"{uid}-tmp_aud.mp4")
11
  print (f'Video Length: {yt.length}')
12
- return vid, vid_aud, f"{uid}-tmp_aud.mp4"
13
 
14
  def trim_vid():
15
  ffmpeg_extract_subclip("video1.mp4", start_time, end_time, targetname="test.mp4")
@@ -36,7 +36,13 @@ def make_model(vid_path):
36
  sfm.structure_from_motion()
37
 
38
  with gr.Blocks() as app:
39
- inp=gr.Textbox(label="URL")
40
- btn=gr.Button()
 
 
 
 
41
  out=gr.Files()
 
 
42
  app.launch()
 
9
  vid = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename=f"{uid}-tmp.mp4")
10
  vid_aud = yt.streams.filter(only_audio=True)[0].download(filename=f"{uid}-tmp_aud.mp4")
11
  print (f'Video Length: {yt.length}')
12
+ return f"{uid}-tmp_aud.mp4"
13
 
14
  def trim_vid():
15
  ffmpeg_extract_subclip("video1.mp4", start_time, end_time, targetname="test.mp4")
 
36
  sfm.structure_from_motion()
37
 
38
  with gr.Blocks() as app:
39
+ with gr.Row():
40
+ inp_url=gr.Textbox(label="URL")
41
+ load_yt_btn=gr.Button()
42
+ with gr.Row():
43
+ pre_vid = gr.Video()
44
+ clip_vid=gr.Video()
45
  out=gr.Files()
46
+ load_yt_btn.click(load_video_yt, inp_url, [pre_vid])
47
+
48
  app.launch()