Jeffgold commited on
Commit
9571046
·
1 Parent(s): 650ee8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -2,23 +2,23 @@ import gradio as gr
2
  import ffmpeg
3
 
4
  @gr.experimental()
5
- def transcode_video(video_file):
6
  """Transcodes a video file to m3u8 using ffmpeg.
7
 
8
  Args:
9
  video_file: The path to the video file to transcode.
 
 
 
10
 
11
  Returns:
12
- The path to the transcoded m3u8 file.
13
  """
14
 
15
- # Create an output file.
16
- output_file = "output.m3u8"
17
-
18
  # Transcode the video file.
19
- ffmpeg.input(video_file).output(output_file).run()
20
 
21
  # Return the path to the transcoded file.
22
  return output_file
23
 
24
- gr.Interface(transcode_video).launch()
 
2
  import ffmpeg
3
 
4
  @gr.experimental()
5
+ def transcode_video(video_file, output_file, output_format, output_fps):
6
  """Transcodes a video file to m3u8 using ffmpeg.
7
 
8
  Args:
9
  video_file: The path to the video file to transcode.
10
+ output_file: The path to the transcoded m3u8 file.
11
+ output_format: The output format of the transcoded file.
12
+ output_fps: The output framerate of the transcoded file.
13
 
14
  Returns:
15
+ The path to the transcoded file.
16
  """
17
 
 
 
 
18
  # Transcode the video file.
19
+ ffmpeg.input(video_file).output(output_file, format=output_format, fps=output_fps).run()
20
 
21
  # Return the path to the transcoded file.
22
  return output_file
23
 
24
+ gr.Interface(transcode_video, inputs={"video_file": gr.inputs.File("Select a video file")}, outputs={"output_file": gr.outputs.File("Output file")}).launch()