Jeffgold commited on
Commit
4671d6f
·
1 Parent(s): 45a6dfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -27,15 +27,12 @@ def transcode_video(input_video_file, output_file, output_format, output_fps):
27
  # Return the path to the transcoded file.
28
  return output_file
29
 
30
- def name_file(file_name):
31
- return file_name + ".m3u8"
32
 
33
- def get_file_name(file):
34
- return file.name
35
 
36
- input_video_file = File(accept=".mp4, .mov, .avi, .flv, .wmv, .mpeg, .mpg, .ogg, .webm", name=get_file_name(input_video_file))
37
-
38
- outputs={"output_file": File(name_file(get_file_name(input_video_file)), accept=".m3u8", name="Output File")}
39
 
40
  gr.Interface(
41
  transcode_video,
 
27
  # Return the path to the transcoded file.
28
  return output_file
29
 
30
+ def name_file(file_path):
31
+ return os.path.basename(file_path)
32
 
33
+ input_video_file = File(accept=".mp4, .mov, .avi, .flv, .wmv, .mpeg, .mpg, .ogg, .webm")
 
34
 
35
+ outputs={"output_file": File(name_file(input_video_file), accept=".m3u8")}
 
 
36
 
37
  gr.Interface(
38
  transcode_video,