Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Know better your media files

Project Description

Know better your media files.

Project page:https://github.com/ratoaq2/knowit

Usage

CLI

Extract information from a video file:

$ knowit /folder/Audio Samples/hd_dtsma_7.1.mkv
For: /folder/Audio Samples/7.1Ch DTS-HD MA - Speaker Mapping Test File.mkv
Knowit 0.2.4 found:
{
    "title": "7.1Ch DTS-HD MA - Speaker Mapping Test File",
    "path": "/folder/Audio Samples/7.1Ch DTS-HD MA - Speaker Mapping Test File.mkv",
    "duration": "0:01:37",
    "size": "40.77 MB",
    "bit_rate": "3.3 Mbps",
    "container": "mkv",
    "video": [
        {
            "id": 1,
            "duration": "0:01:37",
            "width": "1920 pixel",
            "height": "1080 pixel",
            "scan_type": "Progressive",
            "aspect_ratio": 1.778,
            "pixel_aspect_ratio": 1.0,
            "resolution": "1080p",
            "frame_rate": "23.976 FPS",
            "bit_depth": "8 bit",
            "codec": "H.264",
            "profile": "Main",
            "profile_level": "4",
            "media_type": "video/H264",
            "default": true,
            "language": "Undetermined"
        }
    ],
    "audio": [
        {
            "id": 2,
            "name": "7.1Ch DTS-HD MA",
            "language": "English",
            "duration": "0:01:37",
            "codec": "DTS-HD",
            "profile": [
                "Master Audio",
                "Core"
            ],
            "channels_count": [
                8,
                6
            ],
            "channels": "7.1",
            "bit_depth": "24 bit",
            "bit_rate": [
                null,
                "1.5 Mbps"
            ],
            "bit_rate_mode": [
                "Variable",
                "Constant"
            ],
            "sampling_rate": "48.0 KHz",
            "compression": [
                "Lossless",
                "Lossy"
            ],
            "default": true
        }
    ],
    "provider": "libmediainfo.so.0"
}

Extract information from a video file using ffprobe:

$ knowit --provider ffmpeg /folder/Audio Samples/hd_dtsma_7.1.mkv
For: /folder/Audio Samples/7.1Ch DTS-HD MA - Speaker Mapping Test File.mkv
Knowit 0.2.4 found:
{
    "title": "7.1Ch DTS-HD MA - Speaker Mapping Test File",
    "path": "/folder/Audio Samples/7.1Ch DTS-HD MA - Speaker Mapping Test File.mkv",
    "duration": "0:01:37",
    "size": "40.77 MB",
    "bit_rate": "3.3 Mbps",
    "container": "mkv",
    "video": [
        {
            "id": 0,
            "width": "1920 pixel",
            "height": "1080 pixel",
            "scan_type": "Progressive",
            "aspect_ratio": 1.778,
            "pixel_aspect_ratio": 1.0,
            "resolution": "1080p",
            "frame_rate": "23.976 FPS",
            "bit_depth": "8 bit",
            "codec": "H.264",
            "profile": "Main",
            "default": true,
            "language": "Undetermined"
        }
    ],
    "audio": [
        {
            "id": 1,
            "name": "7.1Ch DTS-HD MA",
            "language": "English",
            "codec": "DTS-HD",
            "profile": "Master Audio",
            "channels_count": 8,
            "channels": "7.1",
            "bit_depth": "24 bit",
            "sampling_rate": "48.0 KHz",
            "default": true
        }
    ],
    "provider": "ffprobe"
}

All available CLI options:

$ knowit --help
usage: knowit [-h] [-p PROVIDER] [-E] [-v] [-r] [--report] [-y] [-N]
                   [-P PROFILE] [--mediainfo MEDIAINFO] [--ffmpeg FFMPEG]
                   [--version]
                   [videopath [videopath ...]]

positional arguments:
  videopath             Path to the video to introspect

optional arguments:
  -h, --help            show this help message and exit

Providers:
  -p PROVIDER, --provider PROVIDER
                        The provider to be used: mediainfo, ffmpeg or enzyme.

Input:
  -E, --fail-on-error   Fail when errors are found on the media file.

Output:
  -v, --verbose         Display debug output
  -r, --raw             Display raw properties
  --report              Parse media and report all non-detected values
  -y, --yaml            Display output in yaml format
  -N, --no-units        Display output without units
  -P PROFILE, --profile PROFILE
                        Display values according to specified profile: code,
                        default, human, technical

Configuration:
  --mediainfo MEDIAINFO
                        The location to search for MediaInfo binaries
  --ffmpeg FFMPEG       The location to search for FFmpeg (ffprobe) binaries

Information:
  --version             Display knowit version.

Installation

KnowIt can be installed as a regular python module by running:

$ [sudo] pip install knowit

For a better isolation with your system you should use a dedicated virtualenv or install for your user only using the --user flag.

External dependencies

KnowIt can use MediaInfo or FFmpeg (ffprobe)

KnowIt supports MKV regardless if MediaInfo or FFmpeg are installed.

MediaInfo or FFmpeg increases the number of supported formats and the number of extracted information.

MediaInfo is the default provider. Visit their website and install the proper package for your system.

FFmpeg (ffprobe) can be downloaded here

Release History

Release History

This version
History Node

0.2.4

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.4.1

History Node

0.1.4

History Node

0.1.3.2

History Node

0.1.3.1

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1

History Node

0.0.8

History Node

0.0.7

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
knowit-0.2.4.tar.gz (25.0 kB) Copy SHA256 Checksum SHA256 Source Jun 20, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting