import gradio as gr import subprocess import os def videoxsub(vid): getAudio(vid) getSubs() return [vid, "audio.vtt"] def getAudio(vid): if os.path.exists("audio.mp3"): os.remove("audio.mp3") commands_list = [ "ffmpeg", "-i", vid, "audio.mp3" ] subprocess.run(commands_list) def getSubs(): command_list = [ "whisper", "audio.mp3", "-f", "vtt", "--fp16", "False"] subprocess.run(command_list) demo = gr.Interface(fn=videoxsub, inputs="video", outputs="video") demo.launch()