File size: 854 Bytes
f0ceee4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
import gradio as gr
from main import main as process_video

def run_pipeline(youtube_url):
    # Run the main processing function from your script
    # This function should save the final video in the '/translated/' directory
    process_video(youtube_url)

    # Construct the path to the final video
    # Assuming the video is named 'final_video.mp4' and stored in '/translated/'
    final_video_path = './translated/final_video.mp4'
    
    # Return the path for Gradio to display
    return final_video_path

iface = gr.Interface(
    fn=run_pipeline,
    inputs=gr.Textbox(lines=2, placeholder="Enter YouTube Video URL here..."),
    outputs=gr.Video(),
    title="YouTube Video Processing",
    description="Enter a YouTube URL to process the video through transcription, translation, and more."
)

if __name__ == "__main__":
    iface.launch()