diff --git a/src/mqtt/mod.rs b/src/mqtt/mod.rs index 65b8907..3ed26a8 100644 --- a/src/mqtt/mod.rs +++ b/src/mqtt/mod.rs @@ -10,6 +10,24 @@ use log::*; /// neolink mqtt --config=config.toml /// ``` /// +/// # Example Config +/// +/// ```toml +// [[cameras]] +// name = "Cammy" +// username = "****" +// password = "****" +// address = "****:9000" +// [cameras.mqtt] +// server = "127.0.0.1" +// port = 1883 +// credentials = ["username", "password"] +// ``` +// +// `server` is the mqtt server that messages will be sent to +// `port` is the server's mqtt port +// `credentials` are the username and password required to identify with the mqtt server +// use std::sync::Arc; mod app; diff --git a/src/rtsp/mod.rs b/src/rtsp/mod.rs index a38cc4e..c228107 100644 --- a/src/rtsp/mod.rs +++ b/src/rtsp/mod.rs @@ -28,6 +28,30 @@ /// neolink rtsp --config=config.toml /// ``` /// +/// # Example Config +/// +/// ```toml +// [[cameras]] +// name = "Cammy" +// username = "****" +// password = "****" +// address = "****:9000" +// [cameras.pause] +// on_motion = false +// on_client = false +// mode = "none" +// timeout = 1.0 +// ``` +// +// - When `on_motion` is true the camera will pause streaming when motion is stopped and resume it when motion is started +// - When `on_client` is true the camera will pause while there is no client connected. +// - `timeout` handels how long to wait after motion stops before pausing the stream +// - `mode` has the following values: +// - `"black"`: Switches to a black screen. Requires more cpu as the stream is fully reencoded +// - `"still"`: Switches to a still image. Requires more cpu as the stream is fully reencoded +// - `"test"`: Switches to the gstreamer test image. Requires more cpu as the stream is fully reencoded +// - `"none"`: Resends the last iframe the camera. This does not reencode at all. **Most use cases should use this one as it has the least effort on the cpu and gives what you would expect** +// use anyhow::{anyhow, Context, Result}; use crossbeam::utils::Backoff; use log::*;