diff --git a/.gitignore b/.gitignore index e027a52d..f2a19592 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,8 @@ *tar.gz *.deb *.rpm +ffplayout.1.gz +ffpapi.1.gz /assets/*.db* /dist/ /public/ diff --git a/README.md b/README.md index dd8c7105..7bc63be2 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,24 @@ +--- +title: ffplayout +section: 1 +header: User Manual +footer: ffplayout 0.13.0 +date: July 28, 2022 +--- + **ffplayout** ================ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -The ffplayout apps are mostly made to run on Linux as system services. But in general they should run on all platforms which are supported by Rust. - -Check the [releases](https://github.com/ffplayout/ffplayout/releases/latest) for pre compiled version. - ## **ffplayout-engine (ffplayout)** [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. +The ffplayout apps are mostly made to run on Linux as system services. But in general they should run on all platforms which are supported by Rust. + +Check the [releases](https://github.com/ffplayout/ffplayout/releases/latest) for pre compiled version. + ### Features - have all values in a separate config file @@ -19,7 +27,7 @@ Check the [releases](https://github.com/ffplayout/ffplayout/releases/latest) for - playing clips in [watched](/docs/folder_mode.md) folder mode - send emails with error message - overlay a logo -- overlay text, controllable through [messenger](https://github.com/ffplayout/messenger) or [ffplayout-frontend](https://github.com/ffplayout/ffplayout-frontend) (needs ffmpeg with libzmq and enabled JSON RPC server) +- overlay text, controllable through [ffplayout-frontend](https://github.com/ffplayout/ffplayout-frontend) (needs ffmpeg with libzmq and enabled JSON RPC server) - EBU R128 loudness normalization (single pass) - loop playlist infinitely - [remote source](/docs/remote_source.md) @@ -50,7 +58,7 @@ For preview stream, read: [/docs/preview_stream.md](/docs/preview_stream.md) ## **ffplayout-api (ffpapi)** -ffpapi is an [REST API](/ffplayout-api/README.md) for controlling the engine, manipulate playlists, add settings etc. +ffpapi serves the [frontend](https://github.com/ffplayout/ffplayout-frontend) and it acts as a [REST API](/ffplayout-api/README.md) for controlling the engine, manipulate playlists, add settings etc. ### Requirements @@ -99,7 +107,6 @@ Check [install](docs/install.md) for details about how to install ffplayout. ## **Warning** - (Endless) streaming over multiple days will only work when config have **day_start** value and the **length** value is **24 hours**. If you need only some hours for every day, use a *cron* job, or something similar. ----- @@ -174,4 +181,5 @@ Output from `{"media":"current"}` show: "id": 1 } ``` + 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. diff --git a/debian/postinst b/debian/postinst index ab80a07e..9fc6ebbe 100644 --- a/debian/postinst +++ b/debian/postinst @@ -2,8 +2,8 @@ sysUser="ffpu" -if ! id $sysUser &>/dev/null; then - adduser --system --no-create-home $sysUser +if [ $(id -u $sysUser 2>/dev/null || echo -1) -ge -1 ]; then + adduser --system $sysUser fi if [ ! -d "/usr/share/ffplayout/db" ]; then diff --git a/debian/postrm b/debian/postrm index 349ed77e..5776a251 100644 --- a/debian/postrm +++ b/debian/postrm @@ -10,6 +10,6 @@ if [ -d "/var/log/ffplayout" ]; then yes | rm -rf "/var/log/ffplayout" fi -if id $sysUser &>/dev/null; then +if [ $(id -u $sysUser 2>/dev/null || echo -1) -ge 0 ]; then userdel -rf $sysUser fi diff --git a/docs/install.md b/docs/install.md index 659fdf14..ffc31b2e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -20,3 +20,16 @@ When you don't need the frontend and API, skip enable the systemd service **ffpa When playlists are created and the ffplayout output is configured, you can start the process: `systemctl start ffplayout`, or click start in frontend. If you want to configure ffplayout over terminal, you can edit **/etc/ffplayout/ffplayout.yml**. + +### Manual Install +----- + +- copy the binary to `/usr/bin/` +- copy **assets/ffplayout.yml** to `/etc/ffplayout` +- create folder `/var/log/ffplayout` +- create system user **ffpu** +- give ownership from `/etc/ffplayout` and `/var/log/ffplayout` to **ffpu** +- copy **assets/ffplayout.service** to `/etc/systemd/system` +- activate service and run it: `systemctl enable --now ffplayout` + +You can also install the [released](https://github.com/ffplayout/ffplayout/releases/latest) ***.deb** or ***.rpm** package. diff --git a/docs/output.md b/docs/output.md index 0aa7b7d4..dacd2686 100644 --- a/docs/output.md +++ b/docs/output.md @@ -2,7 +2,18 @@ ffplayout supports different types of outputs, let's explain them a bit: ## Stream -The streaming output can be used for ever kind of classical streaming. For example for **rtmp, srt, rtp** etc. Every streaming type, which are supported from ffmpeg should be working +The streaming output can be used for ever kind of classical streaming. For example for **rtmp, srt, rtp** etc. Any streaming type supported by ffmpeg should work. + +**Remember that you need a streaming server as a destination if you want to use this mode.** + +You can use for example: + +- [SRS](https://github.com/ossrs/srs) +- [OvenMediaEngine](https://www.ovenmediaengine.com/ome) +- [Nginx-RTMP](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-video-streaming-server-using-nginx-rtmp-on-ubuntu-20-04) +- [Ant-Media-Server](https://github.com/ant-media/Ant-Media-Server) + +Of course, you can also use media platforms that support streaming input. ### Multiple Outputs: @@ -59,6 +70,10 @@ In desktop mode you will get your picture on screen. For this you need a desktop In this mode you can output directly to a hls playlist. The nice thing here is, that ffplayout need less resources then in streaming mode. +HLS output is currently the default, mostly because it works out of the box and don't need a streaming target. In default settings it saves the segments to **/usr/share/ffplayout/public/live/**. + +**It is recommend to serve the HLS stream with nginx or another web server, and not with ffpapi (which is more meant for previewing).** + **HLS multiple outputs example:** ```YAML diff --git a/ffplayout-api/README.md b/ffplayout-api/README.md index cf3c215b..d7c320e9 100644 --- a/ffplayout-api/README.md +++ b/ffplayout-api/README.md @@ -1,3 +1,11 @@ +--- +title: ffpapi +section: 1 +header: User Manual +footer: ffpapi 0.5.1 +date: July 28, 2022 +--- + **ffplayout-api** ================ @@ -21,7 +29,23 @@ Then run the API thru the systemd service, or like: ffpapi -l 127.0.0.1:8787 ``` -If you plan to run ffpapi with systemd set permission from **/usr/share/ffplayout** and content to user **www-data:www-data**. +Possible Arguments +----- + +```BASH +OPTIONS: + -a, --ask ask for user credentials + -d, --domain domain name for initialization + -h, --help Print help information + -i, --init Initialize Database + -l, --listen Listen on IP:PORT, like: 127.0.0.1:8787 + -m, --mail Admin mail address + -p, --password Admin password + -u, --username Create admin user + -V, --version Print version information +``` + +If you plan to run ffpapi with systemd set permission from **/usr/share/ffplayout** and content to user **ffpu:ffpu**. User **ffpu** has to be created. **For possible endpoints read: [api endpoints](/docs/api.md)** diff --git a/ffplayout-engine/Cargo.toml b/ffplayout-engine/Cargo.toml index 513d3c78..05bf3db5 100644 --- a/ffplayout-engine/Cargo.toml +++ b/ffplayout-engine/Cargo.toml @@ -56,6 +56,8 @@ assets = [ ["../assets/ffplayout.yml", "/usr/share/ffplayout/ffplayout.yml.orig", "644"], ["../assets/ffplayout.conf", "/usr/share/ffplayout/ffplayout.conf.example", "644"], ["../README.md", "/usr/share/doc/ffplayout/README", "644"], + ["../assets/ffpapi.1.gz", "/usr/share/man/man1/", "644"], + ["../assets/ffplayout.1.gz", "/usr/share/man/man1/", "644"], ["../public/**/*", "/usr/share/ffplayout/public/", "644"], ] maintainer-scripts = "../debian/" @@ -78,6 +80,8 @@ assets = [ ["../assets/ffplayout.yml", "/usr/share/ffplayout/ffplayout.yml.orig", "644"], ["../assets/ffplayout.conf", "/usr/share/ffplayout/ffplayout.conf.example", "644"], ["../README.md", "/usr/share/doc/ffplayout/README", "644"], + ["../assets/ffpapi.1.gz", "/usr/share/man/man1/", "644"], + ["../assets/ffplayout.1.gz", "/usr/share/man/man1/", "644"], ["../public/**/*", "/usr/share/ffplayout/public/", "644"], ] @@ -93,7 +97,9 @@ assets = [ { source = "../assets/ffplayout.service", dest = "/lib/systemd/system/ffplayout.service", mode = "644" }, { source = "../assets/ffplayout@.service", dest = "/lib/systemd/system/ffplayout@.service", mode = "644" }, { source = "../assets/11-ffplayout", dest = "/etc/sudoers.d/11-ffplayout", mode = "644" }, - { source = "../README.md", dest = "/usr/share/doc/ffplayout/README", mode = "644", doc = true }, + { source = "../README.md", dest = "/usr/share/doc/ffplayout/README", mode = "644" }, + { source = "../assets/ffpapi.1.gz", dest = "/usr/share/man/man1/ffpapi.1.gz", mode = "644", doc = true }, + { source = "../assets/ffplayout.1.gz", dest = "/usr/share/man/man1/ffplayout.1.gz", mode = "644", doc = true }, { source = "../LICENSE", dest = "/usr/share/doc/ffplayout/LICENSE", mode = "644" }, { source = "../assets/logo.png", dest = "/usr/share/ffplayout/logo.png", mode = "644" }, { source = "../assets/ffplayout.yml", dest = "/usr/share/ffplayout/ffplayout.yml.orig", mode = "644" }, diff --git a/ffplayout-engine/README.md b/ffplayout-engine/README.md index 993f3619..a2aea8d9 100644 --- a/ffplayout-engine/README.md +++ b/ffplayout-engine/README.md @@ -1,19 +1,6 @@ **ffplayout-engine** ================ -Installation under Linux ------ - -- copy the binary to `/usr/bin/` -- copy **assets/ffplayout.yml** to `/etc/ffplayout` -- create folder `/var/log/ffplayout` -- create system user **ffpu** -- give ownership from `/etc/ffplayout` and `/var/log/ffplayout` to **ffpu** -- copy **assets/ffplayout.service** to `/etc/systemd/system` -- activate service and run it: `systemctl enable --now ffplayout` - -You can also install the [released](https://github.com/ffplayout/ffplayout/releases/latest) ***.deb** or ***.rpm** package. - Start with Arguments ----- @@ -37,7 +24,6 @@ OPTIONS: ``` - You can run the command like: ```Bash diff --git a/scripts/build_all.sh b/scripts/build_all.sh index db123b91..3f903b7d 100755 --- a/scripts/build_all.sh +++ b/scripts/build_all.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +source $(dirname "$0")/man_create.sh + if [[ ! -d public ]]; then cd ffplayout-frontend diff --git a/scripts/man_create.sh b/scripts/man_create.sh new file mode 100755 index 00000000..56ce34ca --- /dev/null +++ b/scripts/man_create.sh @@ -0,0 +1,24 @@ +#!/usr/bin/bash + +yes | rm -f assets/ffplayout.1.gz +yes | rm -f assets/ffpapi.1.gz + +engine_docs=( + "README.md" + "ffplayout-engine/README.md" + "docs/install.md" + "docs/output.md" + "docs/live_ingest.md" + "docs/preview_stream.md" +) + +api_docs=( + "ffplayout-api/README.md" + "docs/api.md" +) + +pandoc "${engine_docs[@]}" -s --wrap=preserve -t man -o assets/ffplayout.1 +pandoc "${api_docs[@]}" -s --wrap=preserve -t man -o assets/ffpapi.1 + +gzip assets/ffplayout.1 +gzip assets/ffpapi.1