Skip to content

Commit

Permalink
improve Reolink interoperability with new Retina
Browse files Browse the repository at this point in the history
Attempt at #114 and #144. Let's see how much it helps.
  • Loading branch information
scottlamb committed Aug 19, 2021
1 parent 6270cc0 commit 5c3c618
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 2 additions & 3 deletions server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
11 changes: 9 additions & 2 deletions server/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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.
Expand Down

0 comments on commit 5c3c618

Please sign in to comment.