# 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": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.9.0",
"maintainer_email": null,
"keywords": "video, mkv, mp4, mediainfo, metadata, movie, episode, tv, shows, series",
"author": "Rato",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/3a/0f/229a93f213c77bc0fef300cf973fb39bd72b0cbed80c8c441cb9b106a1ab/knowit-0.5.6.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.6",
"project_urls": {
"Homepage": "https://github.com/ratoaq2/knowit",
"Repository": "https://github.com/ratoaq2/knowit"
},
"split_keywords": [
"video",
" mkv",
" mp4",
" mediainfo",
" metadata",
" movie",
" episode",
" tv",
" shows",
" series"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4b32525d13ad3f44d25917a60a52949f8156e09ca8d0de0eec392c208addd835",
"md5": "8035c18ecde7786415f19c2c9cc88e6f",
"sha256": "a073f65d1717fbdb587be9b29f080798572a2389124a9e6fd76163f2ba6fd473"
},
"downloads": -1,
"filename": "knowit-0.5.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8035c18ecde7786415f19c2c9cc88e6f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.9.0",
"size": 39524,
"upload_time": "2024-10-14T16:52:38",
"upload_time_iso_8601": "2024-10-14T16:52:38.728524Z",
"url": "https://files.pythonhosted.org/packages/4b/32/525d13ad3f44d25917a60a52949f8156e09ca8d0de0eec392c208addd835/knowit-0.5.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3a0f229a93f213c77bc0fef300cf973fb39bd72b0cbed80c8c441cb9b106a1ab",
"md5": "2df6a2650ec5dc1a3bf77bdfdbf0a6ec",
"sha256": "6ca8fe4b93d6ec3ff753a8f6f3c641020a6801c11d42545ccb270523281f8cca"
},
"downloads": -1,
"filename": "knowit-0.5.6.tar.gz",
"has_sig": false,
"md5_digest": "2df6a2650ec5dc1a3bf77bdfdbf0a6ec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.9.0",
"size": 28573,
"upload_time": "2024-10-14T16:52:40",
"upload_time_iso_8601": "2024-10-14T16:52:40.325014Z",
"url": "https://files.pythonhosted.org/packages/3a/0f/229a93f213c77bc0fef300cf973fb39bd72b0cbed80c8c441cb9b106a1ab/knowit-0.5.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-14 16:52:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ratoaq2",
"github_project": "knowit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "knowit"
}