ChiBenevisamPas's picture
Update app.py
3d78fdd verified
raw
history blame
674 Bytes
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()