Jeffgold commited on
Commit
88c7481
·
1 Parent(s): 85ba746

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 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()