File size: 674 Bytes
cc29966
3d78fdd
cc29966
3d78fdd
 
 
 
cc29966
3d78fdd
 
cc29966
3d78fdd
 
cc29966
3d78fdd
 
 
 
 
 
 
cc29966
3d78fdd
 
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
import gradio as gr
from moviepy.editor import VideoFileClip

# Function to process and return the video
def display_video(video_file):
    # Load the video using MoviePy (optional for processing)
    clip = VideoFileClip(video_file)
    
    # Optionally, you can print video details or process it
    print(f"Duration: {clip.duration} seconds")
    
    # Return the video file to be displayed in Gradio
    return video_file

# Create the Gradio interface
interface = gr.Interface(
    fn=display_video,
    inputs=gr.Video(label="Upload your video"),
    outputs=gr.Video(label="Uploaded Video"),
    title="Video Uploader",
)

# Launch the interface
interface.launch()