diff --git a/CHANGELOG.md b/CHANGELOG.md index 9da16f3..fb24a19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Each release is tagged in Git and on the Docker repository before. * fix [#147](https://github.com/scottlamb/moonfire-nvr/issues/147): confusing `nvr init` failures when using very old versions of SQLite. +* improve compatibility with Reolink cameras when using the default + `--rtsp-library=retina`. ## `v0.6.5` (2021-08-13) diff --git a/server/Cargo.lock b/server/Cargo.lock index 1e57373..60381e6 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -1870,9 +1870,8 @@ dependencies = [ [[package]] name = "retina" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f1c5358f01c77609ea1b56b86b96ff3b14e2f535bdd51fc214144cf266738b" +version = "0.2.0" +source = "git+https://github.com/scottlamb/retina#6155d4ebcfe61ee92b1e7ebb5525436e89f23bf3" dependencies = [ "base64", "bitreader", diff --git a/server/Cargo.toml b/server/Cargo.toml index ee6b275..d1573b7 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -46,7 +46,7 @@ nom = "6.0.0" parking_lot = { version = "0.11.1", features = [] } protobuf = { git = "https://github.com/stepancheg/rust-protobuf" } reffers = "0.6.0" -retina = "0.1.0" +retina = { git = "https://github.com/scottlamb/retina" } ring = "0.16.2" rusqlite = "0.25.3" serde = { version = "1.0", features = ["derive"] } diff --git a/server/src/stream.rs b/server/src/stream.rs index 899666f..798c26c 100644 --- a/server/src/stream.rs +++ b/server/src/stream.rs @@ -383,7 +383,14 @@ impl RetinaOpener { ), Error, > { - let mut session = retina::client::Session::describe(url, creds).await?; + let mut session = retina::client::Session::describe( + url, + retina::client::SessionOptions::default() + .creds(creds) + .user_agent("Moonfire NVR".to_owned()) + .ignore_spurious_data(true), // TODO: make this configurable. + ) + .await?; let (video_i, mut video_params) = session .streams() .iter() @@ -394,7 +401,7 @@ impl RetinaOpener { }) .ok_or_else(|| format_err!("couldn't find H.264 video stream"))?; session.setup(video_i).await?; - let session = session.play(retina::client::PlayPolicy::default()).await?; + let session = session.play(retina::client::PlayOptions::default()).await?; let mut session = Box::pin(session.demuxed()?); // First frame.