Spaces:
Paused
Paused
File size: 445 Bytes
c8942d9 72c532f c8942d9 008783c 96957b4 256b925 72c532f 05649bb 6c005dd 256b925 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import gradio as gr
import ffmpeg
import subprocess
from gradio import outputs
quality = gr.inputs.Dropdown(label="Quality")
def convert_video(quality):
output_path = "output.m3u8"
ffmpeg_command = f"ffmpeg -i input.mp4 -c:v libx264 -crf {quality} -f hls {output_path}"
subprocess.run(ffmpeg_command, shell=True)
return gr.outputs.Video(output_path)
gr.Interface(convert_video, inputs=[quality], outputs=[outputs.Video()]).launch()
|