Document command line usage

deepcrayon
Jeff Moe 2023-09-14 11:49:21 -06:00
parent 52d5334e34
commit a01d26d34f
1 changed files with 31 additions and 7 deletions

View File

@ -39,21 +39,42 @@ pip install -r requirements.txt
# Usage
## Server
Note, this isn't right yet, I just hardcode URL into Python script.
Will add some command line options, perchance.
Run the server on a machine all the clients can reach.
This can be the same server that hosts the video stream,
or a completely different machine for any arbitrary URL.
```
./sync_mpv_server.py
$ ./sync_mpv_server.py -h
usage: sync_mpv_server.py [-h] [-i IP] [-p PORT] [-u URL]
mpv synchronization server
options:
-h, --help show this help message and exit
-i IP, --ip IP Server IP address (default 0.0.0.0)
-p PORT, --port PORT Server network port (default 51984)
-u URL, --url URL URL to play
```
On first run, it will prompt you for password, which will be saved for
future runs.
The server password is stored in *plaintext* here:
`~/.config/sync-mpv/serverpassword.conf`.
## Client
This would be nice to have some command line options too.
The client runs on the machine that will run `mpv`, which it spawns.
```
./sync_mpv_client.py
$ ./sync_mpv_client.py -h
usage: sync_mpv_client.py [-h] [-i IP] [-p PORT]
mpv synchronization client
options:
-h, --help show this help message and exit
-i IP, --ip IP Server IP address
-p PORT, --port PORT Server Port
```
It will prompt you for a IP address. Enter the IP address of the
@ -63,6 +84,7 @@ It will prompt for a username, which can be whatever.
It will prompt for a password, which is the main one set in the server.
This will all be stored in the configuration file
`~/.config/sync-mpv/sync-mpv.conf`
The password is stored in *plaintext*.
# Notes
@ -73,16 +95,16 @@ The client runs on as many machines as you want, including the server.
The server listens on an IP address and port for TCP connections.
The server doesn't do any video processing, the load is near zero.
The server just coordinates connections and synchronization.
When a new client connects, the other clients may pause for a second,
When a new client connects, the other clients may pause for a moment,
which sucks.
The server has the URL to play.
The client connects, gets the URL, starts playback and synchronization.
There are usernames and a single shared password.
The password is supposedly secure across the network with some
Python AES library, but I doubt it.
The password is stored in plaintext in `~/.config/sync-mpv/serverpassword.conf`.
This thing actually appears to work, wow.
# Development
To "develop", install the requirements:
@ -113,6 +135,7 @@ https://github.com/mpv-player/mpv/issues/1272
* "Older" `mplayer` has this ability with options like `-udp-master`, but it
doesn't support SRT and recent codecs.
# Similar Projects
There are many different similar projects, namely have two+ machines
play the same video at the same time. I tried many of them, but they
@ -126,6 +149,7 @@ it is ideally 20ms or below.
* Too much overhead (e.g. QT).
* Audio only. Something like JACK doing streaming video would be ideal.
# Copyright
Unofficial project, not related to mdnghtman or mpv.