improve Reolink interoperability with new Retina

Attempt at #114 and #144. Let's see how much it helps.
This commit is contained in:
Scott Lamb 2021-08-19 15:06:20 -07:00
parent 6270cc0ee4
commit 5c3c61838f
4 changed files with 14 additions and 6 deletions

View File

@ -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)

5
server/Cargo.lock generated
View File

@ -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",

View File

@ -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"] }

View File

@ -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.