Video Extensions

Check if a file or extension is a video type, iterate over 36 known video formats

Gallery image 1

Treat paths as “video-looking” by extension, no extra packages

When it’s useful

Upload validators, media tools, and asset pipelines often need a quick “is this meant to be video?” signal before heavier probes. Maintaining your own extension list drifts out of sync. This library mirrors the widely used video-extensions npm dataset in Python.

What you can do

  • Check a bare extension or a full path with case-insensitive, dot-aware matching (including dotfiles such as .mov).
  • Cover 36 video extensions called out in the project: common containers, streaming-friendly types, professional formats, and legacy extensions.
  • Keep membership checks cheap with a frozenset backing the API.
  • Import VIDEO_EXTENSIONS / VIDEO_EXTENSIONS_LOWER when you need to iterate or layer custom rules.

Limits and fit

This is extension-based heuristics, not container sniffing or codec detection; misnamed files can fool it either way. Python 3.8+; install from PyPI (video-extensions). Usage and tests are in the GitHub repository.

You might also like

Explore All Blogs