Skip to main content

KnowIt

Know better your media files.

Latest Version

tests

License

PyPI - Python Version

Usage

CLI

Extract information from a video file:

$ knowit /folder/Audio Samples/hd_dtsma_7.1.mkv
For: /folder/Audio Samples/hd_dtsma_7.1.mkv
Knowit 0.4.0 found:
{
    "title": "7.1Ch DTS-HD MA - Speaker Mapping Test File",
    "path": "/folder/Audio Samples/hd_dtsma_7.1.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
        }
    ],
    "audio": [
        {
            "id": 2,
            "name": "7.1Ch DTS-HD MA",
            "language": "English",
            "duration": "0:01:37",
            "codec": "DTS-HD",
            "profile": "Master Audio",
            "channels_count": 8,
            "channels": "7.1",
            "bit_depth": "24 bit",
            "bit_rate_mode": "Variable",
            "sampling_rate": "48.0 KHz",
            "compression": "Lossless",
            "default": true
        }
    ],
    "provider": {
        "name": "mediainfo",
        "version": {
            "pymediainfo": "5.0.3",
            "libmediainfo.so.0": "v20.9"
        }
    }
}

Extract information from a video file using ffmpeg:

$ knowit --provider ffmpeg /folder/Audio Samples/hd_dtsma_7.1.mkv
For: /folder/Audio Samples/hd_dtsma_7.1.mkv
Knowit 0.4.0 found:
{
    "title": "7.1Ch DTS-HD MA - Speaker Mapping Test File",
    "path": "/folder/Audio Samples/hd_dtsma_7.1.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
        }
    ],
    "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": {
        "name": "ffmpeg",
        "version": {
            "ffprobe": "v4.2.4-1ubuntu0.1"
        }
    }
}

Using docker:

docker run -it --rm -v /folder:/folder knowit /folder/Audio Samples/hd_dtsma_7.1.mkv
For: /folder/Audio Samples/hd_dtsma_7.1.mkv
Knowit 0.4.0 found:
{
    "title": "7.1Ch DTS-HD MA - Speaker Mapping Test File",
    "path": "/folder/Audio Samples/hd_dtsma_7.1.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
        }
    ],
    "audio": [
        {
            "id": 2,
            "name": "7.1Ch DTS-HD MA",
            "language": "English",
            "duration": "0:01:37",
            "codec": "DTS-HD",
            "profile": "Master Audio",
            "channels_count": 8,
            "channels": "7.1",
            "bit_depth": "24 bit",
            "bit_rate_mode": "Variable",
            "sampling_rate": "48.0 KHz",
            "compression": "Lossless",
            "default": true
        }
    ],
    "provider": {
        "name": "mediainfo",
        "version": {
            "pymediainfo": "5.0.3",
            "libmediainfo.so.0": "v20.9"
        }
    }
}

All available CLI options:

$ knowit --help
usage: knowit [-h] [-p PROVIDER] [--debug] [--report] [-y] [-N] [-P PROFILE] [--mediainfo MEDIAINFO] [--ffmpeg FFMPEG] [--mkvmerge MKVMERGE] [--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, mkvmerge or enzyme.

Output:
  --debug               Print information for debugging knowit and for reporting bugs.
  --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 ffprobe (FFmpeg) binaries
  --mkvmerge MKVMERGE   The location to search for mkvmerge (MKVToolNix) 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, ffprobe (FFmpeg) or mkvmerge (MKVToolNix)

KnowIt supports MKV regardless if MediaInfo, FFmpeg or MKVToolNix are installed.

MediaInfo, FFmpeg or MKVToolNix 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.

ffprobe (FFmpeg) can be downloaded here

mkvmerge (MKVToolNix) can be downloaded here

Download files

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

Source Distribution

knowit-0.6.0.tar.gz (59.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knowit-0.6.0-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

Details for the file knowit-0.6.0.tar.gz.

File metadata

  • Download URL: knowit-0.6.0.tar.gz
  • Upload date:
  • Size: 59.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/6.17.0-1020-azure

File hashes

Hashes for knowit-0.6.0.tar.gz
Algorithm Hash digest
SHA256 827f1a16a613b497a279d7675d42b22b3bd583843003f2aaa091fe2ebcf91a3c
MD5 b0b752f2b3bc4c1a36cbd72f3b4a9e74
BLAKE2b-256 416862577c0c557889f3c7bc49dde19482a03c9bc8f6405382ae4a3ff1055faa

See more details on using hashes here.

File details

Details for the file knowit-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: knowit-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.14 Linux/6.17.0-1020-azure

File hashes

Hashes for knowit-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12676d4d8473f2a7ca117d82b820fa085911ac3b183a50b62f03a85195cbf26f
MD5 f478750df4ede9a60ddcd0dce0a9242c
BLAKE2b-256 ecdbda144107f5c1ce0592a6d2608bcf71262ecd56f6a4a9fe4315181ac5e4bf

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.1

2 files

This release

0.6.0 This release

2 files

0.5.11

2 files

0.5.10

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

1 file

0.3.0

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.4.1

1 file

0.1.4

1 file

0.1.3.2

1 file

0.1.3.1

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1

1 file

0.0.8

1 file

0.0.7

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page