Jeffgold's picture
Create app.py
88c7481
raw
history blame
512 Bytes
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()