How do I extract the metadata from a video file?
Read a video file's technical metadata on this page: duration, frame size, frame rate, codecs, bitrate, and the audio track's sample rate and channels. The file is read in your browser and never uploaded. The page also covers what no header holds, such as the objects and speech in the video, and how to extract both across a library through an API.
The short answer
A video file carries two kinds of metadata. The first is technical, read straight from the container and codec headers: resolution, frame rate, bitrate, duration, codec, and the audio track's sample rate and channel count. The reader on this page shows those for an MP4, MOV or M4V without uploading the file and gives duration and frame size for WebM and MKV, and ffprobe reads the same headers on the command line. The second kind describes what is happening in the video, such as the objects and people on screen, the scene type, the spoken language, and whether music or text overlays are present. No header contains it; a vision model has to sample frames and an audio model has to listen. This page covers both, for one file or a library at scale through an API.
Read a video's metadata here
Runs in your browser. The file stays on your device and nothing is uploaded.
Drop an MP4, MOV, M4V, WebM or MKV file here, or choose one from your device.
Loading the reader.
How It Works
Drop an MP4, MOV, M4V, WebM or MKV file onto the reader at the top of this page, or choose one. The file stays on your device.
For MP4, MOV and M4V, the open-source mp4box.js library reads the movie header and each track header from the file and jumps over the video data itself.
For WebM and MKV, the reader asks your browser's own decoder for the duration and frame size.
Duration, frame size, frame rate, codecs, bitrate and audio details show first, with every track listed below them. Download it all as JSON.
For a whole library, the API code below runs an extractor over every video in a bucket and stores the output as documents you can search.
Code Examples
import os, requests
API = "https://api.mixpeek.com"
H = {"Authorization": f"Bearer {os.environ['MIXPEEK_API_KEY']}",
"X-Namespace": os.environ["NAMESPACE_ID"]}
# 1. a bucket, with a schema that declares the field you will send
bucket = requests.post(f"{API}/v1/buckets", headers=H, json={
"bucket_name": "video-inputs",
"bucket_schema": {"properties": {"video": {"type": "video"}}},
}).json()
# 2. land the file as an object. the URL goes in data, on the blob
requests.post(f"{API}/v1/buckets/{bucket['bucket_id']}/objects", headers=H, json={
"key_prefix": "run-1",
"blobs": [{"property": "video", "type": "video",
"data": "https://example.com/clip.mp4"}],
})
# 3. a collection over that bucket, running the extractor
collection = requests.post(f"{API}/v1/collections", headers=H, json={
"collection_name": "video-to-metadata",
"source": {"type": "bucket", "bucket_ids": [bucket["bucket_id"]]},
"feature_extractor": {"feature_extractor_name": "multimodal_extractor", "version": "v1"},
}).json()
# 4. run extraction over the bucket
requests.post(f"{API}/v1/buckets/{bucket['bucket_id']}/batches", headers=H, json={
"collection_ids": [collection["collection_id"]],
"auto_submit": True,
})
# 5. read the output
docs = requests.get(
f"{API}/v1/collections/{collection['collection_id']}/documents", headers=H
).json()
print(docs)Use Cases
Keep Building
Supported Input Formats
Quick Info
Run it over a library
Mixpeek runs this conversion as a pipeline over a whole library in your object storage, with the output landing as queryable documents. The reader on this page handles one file at a time.
Frequently Asked Questions
Related Converters
Video to Thumbnails
Pull 12 evenly spaced thumbnails from a video right on this page. The video plays from your device in your browser, nothing is uploaded, and each thumbnail downloads as a JPEG. The page also covers generating thumbnails across a video library through an API.
Image to Metadata
Read a photo's EXIF, IPTC and XMP metadata on this page: the date taken, GPS location, camera, lens and exposure. The file is read in your browser and never uploaded. The page also covers what no header holds, such as the objects and text in the picture, and how to pull both from a whole library through an API.
Ready to convert video to metadata?
Start using the Mixpeek Video to Metadata in minutes. Sign up for a free API key and follow the documentation to get started.