Videodun / app.py
Feroj700's picture
Create app.py
92e711c verified
Raw
History Blame Contribute Delete
633 Bytes
import gradio as gr
from moviepy.editor import VideoFileClip
def process_video(video):
try:
clip = VideoFileClip(video)
duration = clip.duration
clip.close()
return f"Video duration: {duration:.2f} seconds"
except Exception as e:
return f"Error: {str(e)}"
with gr.Blocks() as demo:
gr.Markdown("## 🎬 Simple Video Processor (MoviePy + Gradio)")
with gr.Row():
video_input = gr.Video(label="Upload your video")
output_text = gr.Textbox(label="Result")
video_input.change(fn=process_video, inputs=video_input, outputs=output_text)
demo.launch()