Skip to main content

The vidhdr module determines the mime type of video contained in a file or byte stream.

The vidhdr module defines the following function:

vidhdr.what(filepath[, buf])

Tests the image data contained in the file located by filepath, and returns a string describing the image type. If optional buf is provided, the filepath is ignored and buf is assumed to contain the byte stream to test.

The following image types are recognized, as listed below with the return value from what():

Value

Image format

‘video/x-m4v’

Apple TV (.M4V)

‘video/mp4’

MPEG-4 (.MP4) Nero Mobile Profile

‘various’

MP4 w/ MPEG-7 Metadata [per ISO 14496-12]

‘image/jpm’

JPEG 2000 Compound Image (.JPM) [ISO 15444-6]

‘video/3gpp2’

3GPP2 EZmovie for KDDI 3G cellphones

‘image/jpx’

JPEG 2000 w/ extensions (.JPX) [ISO 15444-2]

‘video/mp4’

MP4 Base Media v2 [ISO 14496-12:2005]

‘video/3gpp’

3GPP Media (.3GP) Release 4

‘video/x-m4v’

Apple iPhone (.M4V)

‘video/3gpp’

3GPP Media (.3GP) Release 5

‘video/mp4’

MPEG-4 (.MP4) Nero Standard Profile

‘video/mp4’

MPEG-4 (.MP4) Nero Portable Profile

‘video/mp4’

H.264/MPEG-4 AVC (.MP4) Nero Standard Profile

‘video/mp4’

H.264/MPEG-4 AVC (.MP4) Nero Portable Profile

‘image/jp2’

JPEG 2000 Image (.JP2) [ISO 15444-1 ?]

‘video/3gpp’

3GPP Media (.3GP) Release 7 Streaming Servers

‘audio/mp4’

Apple iTunes AAC-LC (.M4P) AES Protected Audio

‘video/mp4’

MPEG-4 (.MP4) Nero HDTV Profile

‘video/x-m4v’

Apple iTunes Video (.M4V) Video

‘various’

MPEG-21 [ISO/IEC 21000-9]

‘video/mp4’

H.264/MPEG-4 AVC (.MP4) Nero Cinema Profile

‘various’

OMA DCF DRM Format 2.0 (OMA-TS-DRM-DCF-V2_0-20060303-A)

‘audio/mp4’

Apple iTunes AAC-LC (.M4B) Audio Book

‘video/mp4’

H.264/MPEG-4 AVC (.MP4) Nero HDTV Profile

‘audio/x-m4a’

Apple iTunes AAC-LC (.M4A) Audio

‘video/mp4’

H.264/MPEG-4 AVC (.MP4) Nero Mobile Profile

‘video/vnd.dvb.file’

DVB (.DVB) over RTP

‘various?’

SD Memory Card Video

‘video/mp4’

MP4 v2 [ISO 14496-14]

‘video/mp4’

MP4 v1 [ISO 14496-1:ch13]

‘video/mp4’

Protected Video for Adobe Flash Player 9+ (.F4P)

‘video/mp4’

MPEG-4 (.MP4) Nero Cinema Profile

‘video/mp4’

MP4 Base Media v1 [IS0 14496-12:2003]

‘various’

Photo Player, MAF [ISO/IEC 23000-3]

‘audio/mp4’

MPEG-4 (.MP4) for SonyPSP

‘video/mp4’

MPEG-4/3GPP Mobile Profile (.MP4 / .3GP) (for NTT)

‘video/vnd.dvb.file’

DVB (.DVB) over MPEG-2 Transport Stream

‘video/quicktime’

Apple QuickTime (.MOV/QT)

‘video/mp4’

MP4 Base w/ AVC ext [ISO 14496-12:2005]

‘video/mj2’

Motion JPEG 2000 [ISO 15444-3] General Profile

‘video/quicktime’

Sony / Mobile QuickTime (.MQV) US Patent 7,477,830 (SonyCorp)

‘video/3gpp’

3GPP Release 6 General Profile

‘video/mp4’

Video for Adobe Flash Player 9+ (.F4V)

‘video/3gpp’

3GPP Media (.3GP) Release 2 (probably non-existent)

‘video/3gpp’

3GPP Media (.3GP) Release 3 (probably non-existent)

‘video/3gpp’

3GPP Media (.3GP) Release 1 (probably non-existent)

‘video/3gpp’

3GPP Media (.3GP) Release 6 Streaming Servers

‘video/3gpp’

3GPP (.3GP) Release 7 MBMS Extended Presentations

‘video/3gpp’

3GPP (.3GP) Release 6 MBMS Extended Presentations

‘audio/mp4’

Audio for Adobe Flash Player 9+ (.F4A)

‘video/mj2’

Motion JPEG 2000 [ISO 15444-3] Simple Profile

‘audio/mp4’

Audio Book for Adobe Flash Player 9+ (.F4B)

‘audio/mp4’

MP4 v2 [ISO 14496-14] Nero Digital AAC Audio

‘video/3gpp2’

3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-0 V1.0

‘video/3gpp2’

3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-A V1.0.0

‘video/3gpp2’

3GPP2 Media (.3G2) compliant with 3GPP2 C.S0050-B v1.0

You can extend the list of file types vidhdr can recognize by appending to this variable:

vidhdr.tests

A list of functions performing the individual tests. Each function takes two arguments: the byte-stream and an open file-like object. When what() is called with a byte-stream, the file-like object will be None.

The test function should return a string describing the image type if the test succeeded, or None if it failed.

Example:

>>> import vidhdr
>>> vidhdr.what('test.mp4')
'video/mp4'

Release files for vidhdr 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for vidhdr 1.0.1
File Size Uploaded
vidhdr-1.0.1.zip 8.8 kB Details
vidhdr-1.0.1.tar.gz 4.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for vidhdr 1.0.1
File Interpreter ABI Platform
vidhdr-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details
vidhdr-1.0.1-py2.7.egg Legacy Egg format - - Details

Total release size: 26.6 kB

Release files / vidhdr-1.0.1.zip

Download URL vidhdr-1.0.1.zip
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cd4a2e6d0d5aa32e0a43526cc98e4fe6719b79ee7ed2d41866ebbdee8f523ba5
BLAKE2b-256 checksum
How to use checksums
cea6c727ba1b3619ef13fc75c02e151251e40886b874e355100c64d9ff24b720
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / vidhdr-1.0.1.tar.gz

Download URL vidhdr-1.0.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0a07b8bf4e1ec7c9e64b9eb398edf268f456abd108dc6a3bf2a5a6e14fe182cd
BLAKE2b-256 checksum
How to use checksums
22637fb94a7878e30c09720a5f74d7c6a8023782aff1e469a6199ebd29e1a04e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / vidhdr-1.0.1-py2.py3-none-any.whl

Download URL vidhdr-1.0.1-py2.py3-none-any.whl
Size 6.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b223fe503f3b761b96eec76548299e236b499cb3f55c3e9e734f7b942a909e51
BLAKE2b-256 checksum
How to use checksums
4b2a5ebf8e62f2565fc69e8cc27fa31018ebdd1a4f779c2493fa0ff4c8a4e7ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / vidhdr-1.0.1-py2.7.egg

Download URL vidhdr-1.0.1-py2.7.egg
Size 6.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
bd248d8bd900b406659fda87fce864750dc015b83914068cbc8418d64aeba6f9
BLAKE2b-256 checksum
How to use checksums
62ffa4bbe7bbb632afafa9e559c7507b5087e8e87be2509067712d6996614fbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

4 release files

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page