knowit


Nameknowit JSON
Version 0.5.2 PyPI version JSON
download
home_pagehttps://github.com/ratoaq2/knowit
SummaryKnow better your media files
upload_time2023-01-19 21:28:57
maintainer
docs_urlNone
authorRato
requires_python>=3.8.1,<4.0.0
licenseMIT
keywords video mkv mp4 mediainfo metadata movie episode tv shows series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # KnowIt

Know better your media files.

[![Latest
Version](https://img.shields.io/pypi/v/knowit.svg)](https://pypi.python.org/pypi/knowit)

[![tests](https://github.com/ratoaq2/knowit/actions/workflows/test.yml/badge.svg)](https://github.com/ratoaq2/knowit/actions/workflows/test.yml)

[![License](https://img.shields.io/github/license/ratoaq2/knowit.svg)](https://github.com/ratoaq2/knowit/blob/master/LICENSE)

  - 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/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](http://mediaarea.net/MediaInfo) and install the proper package
for your system.

ffprobe (FFmpeg) can be downloaded
[here](https://ffmpeg.org/download.html)

mkvmerge (MKVToolNix) can be downloaded
[here](https://mkvtoolnix.download/downloads.html)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ratoaq2/knowit",
    "name": "knowit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0.0",
    "maintainer_email": "",
    "keywords": "video,mkv,mp4,mediainfo,metadata,movie,episode,tv,shows,series",
    "author": "Rato",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/9a/48/1824f124e128e2ada77caa37ea8e3b36b4d016a6b2b6e93cf7c8f85c6b2d/knowit-0.5.2.tar.gz",
    "platform": null,
    "description": "# KnowIt\n\nKnow better your media files.\n\n[![Latest\nVersion](https://img.shields.io/pypi/v/knowit.svg)](https://pypi.python.org/pypi/knowit)\n\n[![tests](https://github.com/ratoaq2/knowit/actions/workflows/test.yml/badge.svg)](https://github.com/ratoaq2/knowit/actions/workflows/test.yml)\n\n[![License](https://img.shields.io/github/license/ratoaq2/knowit.svg)](https://github.com/ratoaq2/knowit/blob/master/LICENSE)\n\n  - Project page  \n    <https://github.com/ratoaq2/knowit>\n\n## Usage\n\n### CLI\n\nExtract information from a video file:\n\n    $ knowit /folder/Audio Samples/hd_dtsma_7.1.mkv\n    For: /folder/Audio Samples/hd_dtsma_7.1.mkv\n    Knowit 0.4.0 found:\n    {\n        \"title\": \"7.1Ch DTS-HD MA - Speaker Mapping Test File\",\n        \"path\": \"/folder/Audio Samples/hd_dtsma_7.1.mkv\",\n        \"duration\": \"0:01:37\",\n        \"size\": \"40.77 MB\",\n        \"bit_rate\": \"3.3 Mbps\",\n        \"container\": \"mkv\",\n        \"video\": [\n            {\n                \"id\": 1,\n                \"duration\": \"0:01:37\",\n                \"width\": \"1920 pixel\",\n                \"height\": \"1080 pixel\",\n                \"scan_type\": \"Progressive\",\n                \"aspect_ratio\": \"1.778\",\n                \"pixel_aspect_ratio\": \"1.0\",\n                \"resolution\": \"1080p\",\n                \"frame_rate\": \"23.976 FPS\",\n                \"bit_depth\": \"8 bit\",\n                \"codec\": \"H.264\",\n                \"profile\": \"Main\",\n                \"profile_level\": \"4\",\n                \"media_type\": \"video/H264\",\n                \"default\": true\n            }\n        ],\n        \"audio\": [\n            {\n                \"id\": 2,\n                \"name\": \"7.1Ch DTS-HD MA\",\n                \"language\": \"English\",\n                \"duration\": \"0:01:37\",\n                \"codec\": \"DTS-HD\",\n                \"profile\": \"Master Audio\",\n                \"channels_count\": 8,\n                \"channels\": \"7.1\",\n                \"bit_depth\": \"24 bit\",\n                \"bit_rate_mode\": \"Variable\",\n                \"sampling_rate\": \"48.0 KHz\",\n                \"compression\": \"Lossless\",\n                \"default\": true\n            }\n        ],\n        \"provider\": {\n            \"name\": \"mediainfo\",\n            \"version\": {\n                \"pymediainfo\": \"5.0.3\",\n                \"libmediainfo.so.0\": \"v20.9\"\n            }\n        }\n    }\n\nExtract information from a video file using ffmpeg:\n\n    $ knowit --provider ffmpeg /folder/Audio Samples/hd_dtsma_7.1.mkv\n    For: /folder/Audio Samples/hd_dtsma_7.1.mkv\n    Knowit 0.4.0 found:\n    {\n        \"title\": \"7.1Ch DTS-HD MA - Speaker Mapping Test File\",\n        \"path\": \"/folder/Audio Samples/hd_dtsma_7.1.mkv\",\n        \"duration\": \"0:01:37\",\n        \"size\": \"40.77 MB\",\n        \"bit_rate\": \"3.3 Mbps\",\n        \"container\": \"mkv\",\n        \"video\": [\n            {\n                \"id\": 0,\n                \"width\": \"1920 pixel\",\n                \"height\": \"1080 pixel\",\n                \"scan_type\": \"Progressive\",\n                \"aspect_ratio\": \"1.778\",\n                \"pixel_aspect_ratio\": \"1.0\",\n                \"resolution\": \"1080p\",\n                \"frame_rate\": \"23.976 FPS\",\n                \"bit_depth\": \"8 bit\",\n                \"codec\": \"H.264\",\n                \"profile\": \"Main\",\n                \"default\": true\n            }\n        ],\n        \"audio\": [\n            {\n                \"id\": 1,\n                \"name\": \"7.1Ch DTS-HD MA\",\n                \"language\": \"English\",\n                \"codec\": \"DTS-HD\",\n                \"profile\": \"Master Audio\",\n                \"channels_count\": 8,\n                \"channels\": \"7.1\",\n                \"bit_depth\": \"24 bit\",\n                \"sampling_rate\": \"48.0 KHz\",\n                \"default\": true\n            }\n        ],\n        \"provider\": {\n            \"name\": \"ffmpeg\",\n            \"version\": {\n                \"ffprobe\": \"v4.2.4-1ubuntu0.1\"\n            }\n        }\n    }\n\nUsing docker:\n\n    docker run -it --rm -v /folder:/folder knowit /folder/Audio Samples/hd_dtsma_7.1.mkv\n    For: /folder/Audio Samples/hd_dtsma_7.1.mkv\n    Knowit 0.4.0 found:\n    {\n        \"title\": \"7.1Ch DTS-HD MA - Speaker Mapping Test File\",\n        \"path\": \"/folder/Audio Samples/hd_dtsma_7.1.mkv\",\n        \"duration\": \"0:01:37\",\n        \"size\": \"40.77 MB\",\n        \"bit_rate\": \"3.3 Mbps\",\n        \"container\": \"mkv\",\n        \"video\": [\n            {\n                \"id\": 1,\n                \"duration\": \"0:01:37\",\n                \"width\": \"1920 pixel\",\n                \"height\": \"1080 pixel\",\n                \"scan_type\": \"Progressive\",\n                \"aspect_ratio\": \"1.778\",\n                \"pixel_aspect_ratio\": \"1.0\",\n                \"resolution\": \"1080p\",\n                \"frame_rate\": \"23.976 FPS\",\n                \"bit_depth\": \"8 bit\",\n                \"codec\": \"H.264\",\n                \"profile\": \"Main\",\n                \"profile_level\": \"4\",\n                \"media_type\": \"video/H264\",\n                \"default\": true\n            }\n        ],\n        \"audio\": [\n            {\n                \"id\": 2,\n                \"name\": \"7.1Ch DTS-HD MA\",\n                \"language\": \"English\",\n                \"duration\": \"0:01:37\",\n                \"codec\": \"DTS-HD\",\n                \"profile\": \"Master Audio\",\n                \"channels_count\": 8,\n                \"channels\": \"7.1\",\n                \"bit_depth\": \"24 bit\",\n                \"bit_rate_mode\": \"Variable\",\n                \"sampling_rate\": \"48.0 KHz\",\n                \"compression\": \"Lossless\",\n                \"default\": true\n            }\n        ],\n        \"provider\": {\n            \"name\": \"mediainfo\",\n            \"version\": {\n                \"pymediainfo\": \"5.0.3\",\n                \"libmediainfo.so.0\": \"v20.9\"\n            }\n        }\n    }\n\nAll available CLI options:\n\n    $ knowit --help\n    usage: knowit [-h] [-p PROVIDER] [--debug] [--report] [-y] [-N] [-P PROFILE] [--mediainfo MEDIAINFO] [--ffmpeg FFMPEG] [--mkvmerge MKVMERGE] [--version] [videopath [videopath ...]]\n    \n    positional arguments:\n      videopath             Path to the video to introspect\n    \n    optional arguments:\n      -h, --help            show this help message and exit\n    \n    Providers:\n      -p PROVIDER, --provider PROVIDER\n                            The provider to be used: mediainfo, ffmpeg, mkvmerge or enzyme.\n    \n    Output:\n      --debug               Print information for debugging knowit and for reporting bugs.\n      --report              Parse media and report all non-detected values\n      -y, --yaml            Display output in yaml format\n      -N, --no-units        Display output without units\n      -P PROFILE, --profile PROFILE\n                            Display values according to specified profile: code, default, human, technical\n    \n    Configuration:\n      --mediainfo MEDIAINFO\n                            The location to search for MediaInfo binaries\n      --ffmpeg FFMPEG       The location to search for ffprobe (FFmpeg) binaries\n      --mkvmerge MKVMERGE   The location to search for mkvmerge (MKVToolNix) binaries\n    \n    Information:\n      --version             Display knowit version.\n\n## Installation\n\nKnowIt can be installed as a regular python module by running:\n\n    $ [sudo] pip install knowit\n\nFor a better isolation with your system you should use a dedicated\nvirtualenv or install for your user only using the `--user` flag.\n\n## External dependencies\n\nKnowIt can use MediaInfo, ffprobe (FFmpeg) or mkvmerge (MKVToolNix)\n\nKnowIt supports MKV regardless if MediaInfo, FFmpeg or MKVToolNix are\ninstalled.\n\nMediaInfo, FFmpeg or MKVToolNix increases the number of supported\nformats and the number of extracted information.\n\nMediaInfo is the default provider. Visit their\n[website](http://mediaarea.net/MediaInfo) and install the proper package\nfor your system.\n\nffprobe (FFmpeg) can be downloaded\n[here](https://ffmpeg.org/download.html)\n\nmkvmerge (MKVToolNix) can be downloaded\n[here](https://mkvtoolnix.download/downloads.html)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Know better your media files",
    "version": "0.5.2",
    "split_keywords": [
        "video",
        "mkv",
        "mp4",
        "mediainfo",
        "metadata",
        "movie",
        "episode",
        "tv",
        "shows",
        "series"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e396bfa586206395b47b153b95556c2f3a5daa562449e516751b4c7cf89ffb2",
                "md5": "92efc617cbd4332864d3e05c2d2d6466",
                "sha256": "c492b3450b0d02de9e700bb010112dbefbd1f1dfc1c612154d18bef356a821bd"
            },
            "downloads": -1,
            "filename": "knowit-0.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "92efc617cbd4332864d3e05c2d2d6466",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 39228,
            "upload_time": "2023-01-19T21:28:55",
            "upload_time_iso_8601": "2023-01-19T21:28:55.883312Z",
            "url": "https://files.pythonhosted.org/packages/8e/39/6bfa586206395b47b153b95556c2f3a5daa562449e516751b4c7cf89ffb2/knowit-0.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a481824f124e128e2ada77caa37ea8e3b36b4d016a6b2b6e93cf7c8f85c6b2d",
                "md5": "b7b952787d50b9db8a5b8264f5000bc3",
                "sha256": "f673ffab903c3f86b38c0a67fa70c672d424f6981f5c4b0101de1cba63d75ebb"
            },
            "downloads": -1,
            "filename": "knowit-0.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b7b952787d50b9db8a5b8264f5000bc3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 29126,
            "upload_time": "2023-01-19T21:28:57",
            "upload_time_iso_8601": "2023-01-19T21:28:57.411399Z",
            "url": "https://files.pythonhosted.org/packages/9a/48/1824f124e128e2ada77caa37ea8e3b36b4d016a6b2b6e93cf7c8f85c6b2d/knowit-0.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-19 21:28:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ratoaq2",
    "github_project": "knowit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "knowit"
}
        
Elapsed time: 0.02950s