File size: 512 Bytes
88c7481
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr
import ffmpeg

@gr.experimental()
def transcode_video(video_file):
  """Transcodes a video file to m3u8 using ffmpeg.

  Args:
    video_file: The path to the video file to transcode.

  Returns:
    The path to the transcoded m3u8 file.
  """

  # Create an output file.
  output_file = "output.m3u8"

  # Transcode the video file.
  ffmpeg.input(video_file).output(output_file).run()

  # Return the path to the transcoded file.
  return output_file

gr.Interface(transcode_video).launch()