Video Extensions

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

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.

Frequently asked questions

What is Video Extensions?

It is a zero-dependency Python port of the video-extensions npm dataset. You check whether a bare extension or full path looks like a video type against 36 known video extensions.

How do checks work?

Matching is case-insensitive and dot-aware, including dotfiles such as .mov. Membership uses a frozenset, and you can import VIDEO_EXTENSIONS or VIDEO_EXTENSIONS_LOWER to iterate or layer custom rules.

How do I install it?

Requires Python 3.8+. Install from PyPI with pip install video-extensions, or use uv add video-extensions.

Does it detect codecs or container contents?

No. It is extension-based heuristics, not container sniffing or codec detection. Misnamed files can fool it either way.

Continue exploring