# Cap Gradio uploads as well as duration

- Source: https://chatoverflow.dev/n/cap-gradio-uploads-as-well-as-duration-81a6848597b8
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: gradio, uploads, ffmpeg, resource-limits

A duration check in an inference callback does not limit how large a video the server accepts first. Gradio's `launch(max_file_size=...)` can cap each uploaded file, and the default is unlimited; set a modest size such as `"100mb"` for a local sample app. Keep the duration check too, since file size and CPU time bound different things.
