Media Player Broker
Project description
README
Media Player Broker (mpb) is an application that helps you play and track media you have watched over disparet locations. mpb keeps track of what you have played at Location A so when you are at Location B you can see what you have watched from either location to avoid digging through history command output over SSH.
mpb is not a player itself but it can be configured to launch your player of choice to view media.
The Need
Rather than living in the cloud I have my videos duplicated at various locations. I needed something that remembers what episode of MacGyver I had watched in one location so when I was in another location I could continue watching the next episode without digging through history
output or keeping track of what was played where.
mpb consists of a CLI application (the client) and a database (couchdb). From the client you injest
your media metadata. This extracts the file names from file paths and stores the data in the database. After injesting, you can list
your media which shows you the media Item, whether it has been watched or not along with a Rating, Notes, and the Sources the item is available at. You can then use the play
command along with the Item to watch the Item. After playback is completed you are prompted to mark the item as played/watched, Rate it and add Notes - all of which are used in the list
command to show what you have already watched and what is new.
mpb can also be used by multiple 'users' - you can share a 'user' so your wife can see what you have watched or you can keep separate users so your wife sees what she has watched and you know what you have watched.
Install
We recommend using pipx to install mpbroker: pipx install mpbroker
. You can also install via pip: pip install --user mpbroker
.
mpbroker uses a config file to store your setup. This file contains information such as your media player, the database url, and types of data to injest. You can grab the sample config file from mpbroker/example/user_config.toml and place it in a config location. mpbroker searches the following locations for the config file (in order of precedence):
- $MPB_CONFIG_HOME: set this environment variable to any path you like and place the mpbroker
user_config.toml
file in this location - $XDG_CONFIG_HOME/mpbroker
- $APPDATA/mpbroker
- $HOME/.config/mpbroker
Configure
Notices
- an example
user_config.toml
file can be found in the project example directory - if you do not want to use the standard locations and do not want to set a
MPB_CONFIG_HOME
envvar you can setMPB_CONFIG_HOME
on the command line before calling mpb such asMPB_CONFIG_HOME=/opt/tmp mpb list 'The_Matrix'
To set up MPB you need to:
- create your
user_config.toml
file (see above for locations of this file) - configure your user_config.toml file (at a minimum you will need to set/change the
database.db_uri
value) - ensure your mpb database is available
- use the
db-init
command to initialize your db if it is a new instance!
- use the
If you are testing mpb or do not have a database you can use docker-compose to start a local database with docker-compose up
from the project's docker-compose.yml file. If you use the local database your database.db_uri
would be: http://admin:couchdb@localhost:5984
Using MPB
mpb has built in help (mpb --help
) which should give you enough info to get going.
A Quick Start:
- you will likely want to
injest
some media - next you can use
list
to view/find an item to play - finally you can
play
an item
Injestion
Injestion is the process of loading media metadata into your mpbroker database.
Extract Metadata
Extracting metadata on injestion increases the injestion time but adds the following data to each injested media item:
file_size: # filesize in human readable format (569 MiB, 1.1 GiB)
file_type: # file type (video/H265)
file_format: # file format (Matroska)
encoding: # encoding (x265)
duration: # duration in human readable format (1 h 52 min, 2 h 48 min)
resolution: # resulution in width x height format (720 x 480)
aspect_ratio: # display aspect ratio (16:9)
audio_format: audio format (AAC)
audio_sampling: audio sample rate (48000)
Injestion Time Details
- ~500 videos
- with metadata extraction: 6.05s
- without metadata extraction: 99.05s
- 2785 videos
- with metadata extraction: 596.53s
- without metadata extraction: 72.75s
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mpbroker-0.7.1.tar.gz
.
File metadata
- Download URL: mpbroker-0.7.1.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.17.4-artix1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d37058cbdb7ad2c52dd6755127e0986b1d92698daa907ac1c6f5356c462ffba |
|
MD5 | 66c80c6a695466922fc06a495aeb3635 |
|
BLAKE2b-256 | 814fbc419170616d655209dde95a65bd569c62a94b2151555c3cdd1dfcb67fc0 |
File details
Details for the file mpbroker-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: mpbroker-0.7.1-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.17.4-artix1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 342f39992d8b79303abf287310ba03ef4a7faa4b54ebc76493c640cb588b5dcc |
|
MD5 | 90226890a76d40cdbe69d91950347df0 |
|
BLAKE2b-256 | b0065900fc2ad1c7bcbb4a9de92b197d816c4377cd20add2580358d5330aa57e |