{"id":13587071,"url":"https://github.com/scottlamb/retina","last_synced_at":"2025-05-16T04:07:05.519Z","repository":{"id":41056538,"uuid":"373669117","full_name":"scottlamb/retina","owner":"scottlamb","description":"High-level RTSP multimedia streaming library, in Rust","archived":false,"fork":false,"pushed_at":"2024-03-06T17:46:13.000Z","size":650,"stargazers_count":199,"open_issues_count":37,"forks_count":41,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-03-15T22:10:07.875Z","etag":null,"topics":["ip-camera","rtsp","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/retina","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottlamb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-03T23:36:23.000Z","updated_at":"2024-04-21T17:24:49.253Z","dependencies_parsed_at":"2023-11-11T23:26:03.986Z","dependency_job_id":"78c58748-a7fc-4e28-a05e-c46aae1e6e2a","html_url":"https://github.com/scottlamb/retina","commit_stats":{"total_commits":217,"total_committers":4,"mean_commits":54.25,"dds":"0.055299539170506895","last_synced_commit":"320f208fc781c4328eee1d57ea59ffaff8ba863b"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fretina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fretina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fretina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottlamb%2Fretina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottlamb","download_url":"https://codeload.github.com/scottlamb/retina/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464897,"owners_count":22075571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ip-camera","rtsp","rust"],"created_at":"2024-08-01T15:06:00.152Z","updated_at":"2025-05-16T04:07:00.497Z","avatar_url":"https://github.com/scottlamb.png","language":"Rust","funding_links":[],"categories":["Rust","rust"],"sub_categories":[],"readme":"# retina\n\n[![crates.io version](https://img.shields.io/crates/v/retina.svg)](https://crates.io/crates/retina)\n[![Documentation](https://docs.rs/retina/badge.svg)](https://docs.rs/retina)\n[![CI](https://github.com/scottlamb/retina/workflows/CI/badge.svg)](https://github.com/scottlamb/retina/actions?query=workflow%3ACI)\n\nHigh-level RTSP multimedia streaming library, in Rust. Good support for\nONVIF RTSP/1.0 IP surveillance cameras, as needed by\n[Moonfire NVR](https://github.com/scottlamb/moonfire-nvr). Works around\nbrokenness in cheap closed-source cameras.\n\nStatus: In production use in Moonfire NVR. Many missing features.\n\nProgress:\n\n*   [x] client support\n    *   [x] basic authentication.\n    *   [x] digest authentication.\n    *   [x] RTP over TCP via RTSP interleaved channels.\n    *   [x] RTP over UDP (experimental).\n    *   *   [ ] re-order buffer. (Out-of-order packets are dropped now.)\n    *   [x] RTSP/1.0.\n    *   [ ] RTSP/2.0.\n    *   [ ] SRTP.\n    *   [ ] ONVIF backchannel support (for sending audio).\n    *   [ ] ONVIF replay mode.\n    *   [x] receiving RTCP Sender Reports (currently only uses the timestamp)\n    *   [ ] sending RTCP Receiver Reports\n*   [ ] server support\n*   I/O modes\n    *   [x] async with tokio\n    *   [ ] async-std\n    *   [ ] synchronous with std only\n*   codec depacketization\n    *   [x] video\n        * [x] H.264 (RFC 6184](https://datatracker.ietf.org/doc/html/rfc6184))\n            *   [ ] SVC\n            *   [ ] periodic infra refresh\n            *   [x] multiple slices per picture\n            *   [ ] multiple SPS/PPS\n            *   [ ] interleaved mode\n            *   [x] AAC output format\n            *   [ ] Annex B output format ([#44](https://github.com/scottlamb/retina/issues/44))\n        * [x] H.265 ([RFC 7798](https://tools.ietf.org/html/rfc7798))\n        * [x] MJPEG ([RFC 2435](https://datatracker.ietf.org/doc/html/rfc2435))\n    *   audio\n        *   [x] AAC\n            *   [ ] interleaving\n        *   [x] [RFC 3551](https://datatracker.ietf.org/doc/html/rfc3551)\n            codecs: G.711, G.723, L8/L16\n    *   [x] application: ONVIF metadata\n*   [ ] clean, stable API. (See [#47](https://github.com/scottlamb/retina/issues/47).)\n*   quality errors\n*   *   [x] detailed error description text.\n*   *   [ ] programmatically inspectable error type.\n*   [ ] good functional testing coverage. (Currently lightly / unevenly tested.\n        Most depacketizers have no tests.)\n*   [ ] fuzz testing. (In progress.)\n*   [x] benchmark\n\nHelp welcome!\n\n## Getting started\n\nTry the `mp4` example. It streams from an RTSP server to a `.mp4` file until\nyou hit ctrl-C.\n\n```shell\n$ cargo run --package client mp4 --url rtsp://ip.address.goes.here/ --username admin --password test out.mp4\n...\n^C\n```\n\n## Example client\n\n```shell\n$ cargo run --package client \u003cCMD\u003e\n```\n\nWhere CMD:\n\n* **info** - Gets info about available streams and exits.\n* **mp4** - Writes RTSP streams to mp4 file; exit with Ctrl+C.\n* **onvif** - Gets realtime onvif metadata if available; exit with Ctrl+C.\n* **jpeg** - Writes depacketized JPEG images to disk; exit with CTRL+C.\n\n## Example WebRTC proxy\n\nThis allows viewing a H.264 video stream from your browser, with the help of\n[`webrtc-rs`](https://crates.io/crates/webrtc).\n\n```shell\n$ cargo run --package webrtc-proxy -- --help\n```\n\n## Acknowledgements\n\nThis builds on the whole Rust ecosystem. A couple folks have been especially\nhelpful:\n\n*   Sebastian Dröge, author of\n    [`rtsp-types`](https://crates.io/crates/rtsp-types)\n*   David Holroyd, author of\n    [`h264-reader`](https://crates.io/crates/h264-reader)\n\n## Why \"retina\"?\n\nIt's a working name. Other ideas welcome. I started by looking at dictionary\nwords with the letters R, T, S, and P in order and picking out ones related to\nvideo:\n\n| `$ egrep '^r.*t.*s.*p' /usr/share/dict/words'` |                                                                              |\n| ---------------------------------------------- | ---------------------------------------------------------------------------- |\n| \u003cb\u003er\u003c/b\u003ee\u003cb\u003et\u003c/b\u003eino\u003cb\u003es\u003c/b\u003eco\u003cb\u003ep\u003c/b\u003ee        | close but too long, thus `retina`                                            |\n| \u003cb\u003er\u003c/b\u003ee\u003cb\u003et\u003c/b\u003ero\u003cb\u003esp\u003c/b\u003eect                | good name for an NVR, but I already picked Moonfire                          |\n| \u003cb\u003er\u003c/b\u003eo\u003cb\u003et\u003c/b\u003ea\u003cb\u003es\u003c/b\u003eco\u003cb\u003ep\u003c/b\u003ee          | misspelling of \"rotascope\" (animation tool) or archaic name for \"gyroscope\"? |\n\n## License\n\nYour choice of MIT or Apache; see [LICENSE-MIT.txt](LICENSE-MIT.txt) or\n[LICENSE-APACHE](LICENSE-APACHE.txt), respectively.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottlamb%2Fretina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottlamb%2Fretina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottlamb%2Fretina/lists"}