Update 'README.md'
This commit is contained in:
parent
ac5c705052
commit
91f9455c7a
26
README.md
26
README.md
|
@ -2,17 +2,25 @@
|
|||
A TCP multi-broadcast media streaming server/client. [Check out the past source](/Fierelier/fstream/src/commit/1890b316f543f579e9a63f3a2ddb689eeef9c855), for simpler implementation.
|
||||
|
||||
# Client
|
||||
- `client.py 127.0.0.1:61920 watch fier exampleChannel 123 | ffplay -i - -fflags nobuffer -flags low_delay -infbuf -fast -framedrop` - Watch `fier`'s `exampleChannel` channel at `127.0.0.1:61920`, supplying `123` as a password, and pipe it into ffplay for playback.
|
||||
- `ffmpeg -f dshow -audio_buffer_size 10 -i audio=virtual-audio-capturer -f gdigrab -framerate 30 -i desktop -vf scale=-1:480 -c:v libx264 -pix_fmt yuv420p -preset fast -tune zerolatency -c:a aac -bufsize 2M -maxrate 1M -f mpegts - | client.py 127.0.0.1:61920 broadcast 8192 fier 123 exampleChannel 456` - Broadcast Windows desktop as `fier` to `127.0.0.1:61920`, supplying `123` as the user password. `8192` is the buffer size (in bytes), `exampleChannel` is the channel, `456` is the password. Pipe the output from ffmpeg.
|
||||
You can send and receive any data using the right software. Here are some examples with ffmpeg:
|
||||
- `fstream.py 127.0.0.1:61920 watch,user=fier,channel=exampleChannel,channel-password=123 | ffplay -i -` - Watch `fier`'s `exampleChannel` channel at `127.0.0.1:61920`, supplying `123` as a password, and pipe it into ffplay for playback.
|
||||
- `ffmpeg -f gdigrab -framerate 30 -i desktop -vf scale=-2:480 -c:v libx264 -pix_fmt yuv420p -maxrate 1M -f h264 - | fstream.py 127.0.0.1:61920 broadcast,user=fier,user-password=123,delay=0.1,channel=exampleChannel,channel-password=456` - Broadcast Windows desktop as `fier` to `127.0.0.1:61920`, supplying `123` as the user password with a server loop-delay of `0.1` seconds. `exampleChannel` is the channel, `456` is the channel's password. Pipe the output from ffmpeg.
|
||||
|
||||
# Server Protocol
|
||||
The protocol is currently in an early stage, and is bound to change.
|
||||
.
|
||||
# Server
|
||||
## Settings
|
||||
Edit `modules/settings.py` for generic server/socket-related settings, and `modules/fstream/settings.py` for fstream related settings.
|
||||
|
||||
## Creating a user
|
||||
Make a folder called `users` and make a file in it called `YourUsername.ini`, put this in it:
|
||||
```ini
|
||||
[DEFAULT]
|
||||
password=foobar
|
||||
```
|
||||
If you would like to implement your own authentication, make your own module to replace the `authenticate()` function - see `modules/fstream/authent.py` and `modules/fstream/main.mods`.
|
||||
|
||||
# The Protocol
|
||||
## Establishing a connection
|
||||
Establish a TCP connection with the server, and send the payload. If the server likes your payload, it will stream data to you, or accept more of your data.
|
||||
|
||||
## The payload
|
||||
Send a UTF-8 string identifying the client's intentions. **Fill the request with trailing spaces until the request is 1024 bytes.**
|
||||
|
||||
- `watch,fier,exampleChannel,123` - Watch `fier`'s `exampleChannel` channel, supplying `123` as the channel's password. It will blast you with the media data.
|
||||
- `broadcast,4096,fier,123` - Broadcast as `fier` into the `exampleChannel` channel, supplying `123` as the broadcast password and `456` as the channel password. `4096` is the buffer size. Just blast the data to the server after this, with the appropriate buffer size.
|
||||
Send the length of the payload as a 4-byte (32-bit) big endian unsigned integer, a null byte (hex:`00`) and a UTF-8 encoded string identifying the client's intentions. For example: `watch,user=fier,channel=exampleChannel,channel-password=123` or `broadcast,user=fier,user-password=123,delay=0.1,channel=exampleChannel,channel-password=456`. If you are a watcher, you will be blasted with data. If you are a broadcaster, you can now blast data.
|
Loading…
Reference in New Issue