update readme
This commit is contained in:
parent
52dc141bb8
commit
15d635a27b
50
README.md
50
README.md
@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
|
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
|
||||||
|
|
||||||
The main purpose of ffplayout is to provide a 24/7 broadcasting solution that plays a *json* playlist for every day, while keeping the current playlist editable.
|
[ffplayout](/ffplayout-engine/README.md) is 24/7 broadcasting solution. It can playout a folder with containing video clips, or play for every day a *JSON* playlist, while keeping the current playlist editable.
|
||||||
|
|
||||||
**Check [ffplayout-frontend](https://github.com/ffplayout/ffplayout-frontend): web-based GUI for ffplayout**
|
|
||||||
|
|
||||||
**Features**
|
**Features**
|
||||||
-----
|
-----
|
||||||
@ -43,6 +41,10 @@ The main purpose of ffplayout is to provide a 24/7 broadcasting solution that pl
|
|||||||
- JSON RPC server, for getting infos about current playing and controlling
|
- JSON RPC server, for getting infos about current playing and controlling
|
||||||
- [live ingest](/docs/live_ingest.md)
|
- [live ingest](/docs/live_ingest.md)
|
||||||
|
|
||||||
|
**ffplayout-api (ffpapi)**
|
||||||
|
-----
|
||||||
|
ffpapi is an [REST API](/ffplayout-api/README.md) for controlling the engine, manipulate playlists, add settings etc.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
-----
|
-----
|
||||||
|
|
||||||
@ -166,45 +168,3 @@ Output from `{"media":"current"}` show:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
When you are in playlist mode and jumping forward or backwards in time, the time shift will be saved so the playlist is still in sync. But have in mind, that then maybe your playlist gets to short. When you are not resetting the state, it will reset on the next day automatically.
|
When you are in playlist mode and jumping forward or backwards in time, the time shift will be saved so the playlist is still in sync. But have in mind, that then maybe your playlist gets to short. When you are not resetting the state, it will reset on the next day automatically.
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Installation under Linux
|
|
||||||
-----
|
|
||||||
|
|
||||||
- copy the binary to `/usr/bin/`
|
|
||||||
- copy **assets/ffplayout.yml** to `/etc/ffplayout`
|
|
||||||
- copy **assets/ffplayout-engine.service** to `/etc/systemd/system`
|
|
||||||
- activate service and run it: `systemctl enable --now ffplayout-engine`
|
|
||||||
|
|
||||||
You can also install the released ***.deb** or ***.rpm** package.
|
|
||||||
|
|
||||||
Start with Arguments
|
|
||||||
-----
|
|
||||||
|
|
||||||
ffplayout also allows the passing of parameters:
|
|
||||||
|
|
||||||
```
|
|
||||||
OPTIONS:
|
|
||||||
-c, --config <CONFIG> File path to ffplayout.conf
|
|
||||||
-f, --folder <FOLDER> Play folder content
|
|
||||||
-g, --generate <YYYY-MM-DD>... Generate playlist for date or date-range, like: 2022-01-01 - 2022-01-10:
|
|
||||||
-h, --help Print help information
|
|
||||||
-i, --infinit Loop playlist infinitely
|
|
||||||
-l, --log <LOG> File path for logging
|
|
||||||
-m, --play-mode <PLAY_MODE> Playing mode: folder, playlist
|
|
||||||
-o, --output <OUTPUT> Set output mode: desktop, hls, stream
|
|
||||||
-p, --playlist <PLAYLIST> Path from playlist
|
|
||||||
-s, --start <START> Start time in 'hh:mm:ss', 'now' for start with first
|
|
||||||
-t, --length <LENGTH> Set length in 'hh:mm:ss', 'none' for no length check
|
|
||||||
-v, --volume <VOLUME> Set audio volume
|
|
||||||
-V, --version Print version information
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
You can run the command like:
|
|
||||||
|
|
||||||
```Bash
|
|
||||||
./ffplayout -l none -p ~/playlist.json -o desktop
|
|
||||||
```
|
|
||||||
|
@ -1,2 +1,188 @@
|
|||||||
**ffplayout-api**
|
**ffplayout-api**
|
||||||
================
|
================
|
||||||
|
|
||||||
|
ffplayout-api (ffpapi) is a on strict REST API for ffplayout. It makes it possible to control the engine, read and manipulate the config, save playlist, etc.
|
||||||
|
|
||||||
|
To be able to use the API it is necessary to initialize the settings database first. To do that, run:
|
||||||
|
|
||||||
|
```BASH
|
||||||
|
ffpapi -i
|
||||||
|
```
|
||||||
|
|
||||||
|
Then add an admin user:
|
||||||
|
|
||||||
|
```BASH
|
||||||
|
ffpapi -u <USERNAME> -p <PASSWORD> -e <EMAIL ADDRESS>
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run the API thru the systemd service, or like:
|
||||||
|
|
||||||
|
```BASH
|
||||||
|
ffpapi -l 127.0.0.1:8080
|
||||||
|
```
|
||||||
|
|
||||||
|
### Possible endpoints
|
||||||
|
|
||||||
|
For all endpoints an (Bearer) authentication is required.\
|
||||||
|
`{id}` represent the channel id, and at default is 1.
|
||||||
|
|
||||||
|
#### Login is
|
||||||
|
|
||||||
|
- **POST** `/auth/login/`\
|
||||||
|
JSON Data: `'{"username": "<USER>", "password": "<PASS>"`\
|
||||||
|
JSON Response:
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"message": "login correct!",
|
||||||
|
"status": 200,
|
||||||
|
"data": {
|
||||||
|
"id": 1,
|
||||||
|
"email": "user@example.org",
|
||||||
|
"username": "user",
|
||||||
|
"token": "<TOKEN>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
From here on all request **must** contain the authorization header:\
|
||||||
|
`"Authorization: Bearer <TOKEN>"`
|
||||||
|
|
||||||
|
#### User
|
||||||
|
|
||||||
|
- **PUT** `/api/user/{user id}`\
|
||||||
|
JSON Data: `'{"email": "<EMAIL>", "password": "<PASS>"}'`
|
||||||
|
|
||||||
|
- **POST** `/api/user/`\
|
||||||
|
JSON Data:
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"email": "<EMAIL>",
|
||||||
|
"username": "<USER>",
|
||||||
|
"password": "<PASS>",
|
||||||
|
"role_id": 1
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### API Settings
|
||||||
|
|
||||||
|
- **GET** `/api/settings/{id}`\
|
||||||
|
HEADER:
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **PATCH** `/api/settings/{id}`\
|
||||||
|
JSON Data:
|
||||||
|
```JSON
|
||||||
|
"id": 1,
|
||||||
|
"channel_name": "Channel 1",
|
||||||
|
"preview_url": "http://localhost/live/stream.m3u8",
|
||||||
|
"config_path": "/etc/ffplayout/ffplayout.yml",
|
||||||
|
"extra_extensions": ".jpg,.jpeg,.png"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Playout Config
|
||||||
|
|
||||||
|
- **GET** `/api/playout/config/{id}`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **PUT** `/api/playout/config/{id}`\
|
||||||
|
JSON Data: `{ <CONFIG DATA> }`\
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
#### Text Presets
|
||||||
|
|
||||||
|
- **GET** `/api/presets/`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **PUT** `/api/playout/presets/{id}`\
|
||||||
|
JSON Data:
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"name": "<PRESET NAME>",
|
||||||
|
"text": "<TEXT>",
|
||||||
|
"x": "<X>",
|
||||||
|
"y": "<Y>",
|
||||||
|
"fontsize": 24,
|
||||||
|
"line_spacing": 4,
|
||||||
|
"fontcolor": "#ffffff",
|
||||||
|
"box": 1,
|
||||||
|
"boxcolor": "#000000",
|
||||||
|
"boxborderw": 4,
|
||||||
|
"alpha": "<alpha>"
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
- **POST** `/api/playout/presets/`\
|
||||||
|
JSON Data: `{ <PRESET DATA> }`\
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
#### Playout Process Control
|
||||||
|
|
||||||
|
- **POST** `/api/control/{id}/text/`¸
|
||||||
|
JSON Data:
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"text": "Hello from ffplayout",
|
||||||
|
"x": "(w-text_w)/2",
|
||||||
|
"y": "(h-text_h)/2", \
|
||||||
|
"fontsize": "24",
|
||||||
|
"line_spacing": "4",
|
||||||
|
"fontcolor": "#ffffff",
|
||||||
|
"box": "1", \
|
||||||
|
"boxcolor": "#000000",
|
||||||
|
"boxborderw": "4",
|
||||||
|
"alpha": "1.0"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
- **POST** `api/control/{id}/playout/next/`\
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
- **POST** `api/control/{id}/playout/back/`\
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
- **POST** `api/control/{id}/playout/reset/`\
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
- **GET** `/api/control/{id}/media/current/`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **GET** `/api/control/{id}/media/next/`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **GET** `/api/control/{id}/media/last/`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
#### Playlist Operations
|
||||||
|
|
||||||
|
- **GET** `/api/playlist/{id}/2022-06-20`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **POST** `/api/playlist/1/`\
|
||||||
|
JSON Data: `{ <PLAYLIST DATA> }`\
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
- **GET** `/api/playlist/{id}/generate/2022-06-20`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **DELETE** `/api/playlist/{id}/2022-06-20`\
|
||||||
|
Response is in TEXT format
|
||||||
|
|
||||||
|
#### File Operations
|
||||||
|
|
||||||
|
- **GET** `/api/file/{id}/browse/`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **POST** `/api/file/{id}/move/`\
|
||||||
|
JSON Data: `{"source": "<SOURCE>", "target": "<TARGET>"}`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **DELETE** `/api/file/{id}/remove/`\
|
||||||
|
JSON Data: `{"source": "<SOURCE>"}`\
|
||||||
|
Response is in JSON format
|
||||||
|
|
||||||
|
- **POST** `/file/{id}/upload/`\
|
||||||
|
Multipart Form: `name=<TARGET PATH>, filename=<FILENAME>`\
|
||||||
|
Response is in TEXT format
|
||||||
|
@ -1,2 +1,42 @@
|
|||||||
**ffplayout-engine**
|
**ffplayout-engine**
|
||||||
================
|
================
|
||||||
|
|
||||||
|
Installation under Linux
|
||||||
|
-----
|
||||||
|
|
||||||
|
- copy the binary to `/usr/bin/`
|
||||||
|
- copy **assets/ffplayout.yml** to `/etc/ffplayout`
|
||||||
|
- copy **assets/ffplayout-engine.service** to `/etc/systemd/system`
|
||||||
|
- activate service and run it: `systemctl enable --now ffplayout-engine`
|
||||||
|
|
||||||
|
You can also install the [released](https://github.com/ffplayout/ffplayout-engine/releases/latest) ***.deb** or ***.rpm** package.
|
||||||
|
|
||||||
|
Start with Arguments
|
||||||
|
-----
|
||||||
|
|
||||||
|
ffplayout also allows the passing of parameters:
|
||||||
|
|
||||||
|
```
|
||||||
|
OPTIONS:
|
||||||
|
-c, --config <CONFIG> File path to ffplayout.conf
|
||||||
|
-f, --folder <FOLDER> Play folder content
|
||||||
|
-g, --generate <YYYY-MM-DD>... Generate playlist for date or date-range, like: 2022-01-01 - 2022-01-10:
|
||||||
|
-h, --help Print help information
|
||||||
|
-i, --infinit Loop playlist infinitely
|
||||||
|
-l, --log <LOG> File path for logging
|
||||||
|
-m, --play-mode <PLAY_MODE> Playing mode: folder, playlist
|
||||||
|
-o, --output <OUTPUT> Set output mode: desktop, hls, stream
|
||||||
|
-p, --playlist <PLAYLIST> Path from playlist
|
||||||
|
-s, --start <START> Start time in 'hh:mm:ss', 'now' for start with first
|
||||||
|
-t, --length <LENGTH> Set length in 'hh:mm:ss', 'none' for no length check
|
||||||
|
-v, --volume <VOLUME> Set audio volume
|
||||||
|
-V, --version Print version information
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
You can run the command like:
|
||||||
|
|
||||||
|
```Bash
|
||||||
|
./ffplayout -l none -p ~/playlist.json -o desktop
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user