Skip to main content

libmediainfo_cffi

This library provides a convenient CFFI wrapper for libmediainfo, a lightweight library that displays information about video and audio files. Supported attributes here.

Quickstart

Easy enough:

from libmediainfo_cffi import MediaInfo
data = MediaInfo.read_metadata(path)

You can also pass options, e.g. if you want JSON output:

from libmediainfo_cffi import MediaInfo
data = MediaInfo.read_metadata(path, Inform='JSON')

Differences between this and pymediainfo

The main difference is that this library uses the API mode of CFFI, while pymediainfo uses the ABI mode. Libmediainfo_cffi approach is safer and faster but it’s a bit more complicated to debug, since you need to wrap the C++ mediainfo library in C to comunicate with Python.
On the other hand pymediainfo is more tested, Python only (but needs libmediainfo installed, while with this library you don’t) and supports Python 2 (while this library doesn’t and won’t) and has better crossplatform capabilities (since, again, it uses ABI mode).

Installation

pip install libmediainfo_cffi

Development

Download the source, launch make setup and start tinkering.
Note: the .cpp and .h file in the libmediainfo_cffi directory are not used directly, but read as strings and fed to CFFI. They are useful only for IDE code hinting. Don’t try to compile them with CMake, it won’t work.

Licenses

Copyright (c) 2019 Alessandro Cerruti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This product uses MediaInfo library, Copyright (c) 2002-2019 MediaArea.net SARL.

Metadata

Release files for libmediainfo-cffi 2.1.5

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

Source distribution (sdist)

Source distribution for libmediainfo-cffi 2.1.5
File Size Uploaded
libmediainfo_cffi-2.1.5.tar.gz 3.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for libmediainfo-cffi 2.1.5
File Interpreter ABI Platform
libmediainfo_cffi-2.1.5-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
libmediainfo_cffi-2.1.5-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 12.4 MB

Release files / libmediainfo_cffi-2.1.5.tar.gz

Download URL libmediainfo_cffi-2.1.5.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
650fa36f7caa2a806d130ea9da9294c77d37c245b3b9cb58b5181a340def459f
BLAKE2b-256 checksum
How to use checksums
3f007ed66b2264949b71044361d15ca4e06876d5869ad0a763bd1b7199079fb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

Release files / libmediainfo_cffi-2.1.5-cp37-cp37m-manylinux1_x86_64.whl

Download URL libmediainfo_cffi-2.1.5-cp37-cp37m-manylinux1_x86_64.whl
Size 6.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
5a62febeb0f8028d722b331c677e99adc8e72000ed418349913c85d7d469d5ff
BLAKE2b-256 checksum
How to use checksums
c1169ee3a31bccf2a1f1af33a855939169ffbceff80e00b3c8ec099a5275269e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

Release files / libmediainfo_cffi-2.1.5-cp36-cp36m-manylinux1_x86_64.whl

Download URL libmediainfo_cffi-2.1.5-cp36-cp36m-manylinux1_x86_64.whl
Size 6.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
6524796ff98c02de1da117fd8fab3d7ff7d1b205137941b680cbf7a7f2c52f16
BLAKE2b-256 checksum
How to use checksums
fd27f623fa976992a60455dd621e9a7e6811c3e558350cdd146ef4e541c4f24c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

Release history Release notifications | RSS feed

This release

2.1.5 This release

3 release files

2.1.4

4 release files

2.1.3

4 release files

2.1.2

4 release files

2.1.0

3 release files

2.0.4

3 release files

2.0.3

1 release file

2.0.2

1 release file

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.2

1 release file

1.0.1

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