- Tauri has a frontend and a backend service. It does not ship with a nodejs backend option according to this and this. The tool to do everything with JS is Electron.
- If you really want to use Tauri with full JS/TS stack, you can load the backend as a binary
sidecar
, the same way you would compile flask to embed it in Electron.
This is the designated use case for Tauri:
- Backend: Rust
- Frontend: TS and React
Possibilities for video stream:
- MJPEG through http and custom protocol in Tauri
register_uri_scheme_protocol
Docs. Ongoing discussion for streaming content to frontend in Tauri: tauri-apps/tauri#5385 - MJPEG through websocket-plugin. Not stable, no v1.0.0 release yet.
- Create your own streaming server outside Tauri and connect through localhost-plugin. Not ideal.
- WebRTC (Real Time Communication): access camera from frontend.
- Most likely won't work with custom camera other than integrated one.
- Also, saving video to FS might be difficult, at least more difficult than other solutions.
- UDP protocol is not safe for important data. No built-in signalling.
- Community has been waiting for WebRTC example, link.
Inspirations:
- Grommet and SQLite plugin: https://github.com/chezhe/aleph
- Codebase and servers connection: https://github.com/Trivernis/mediarepo
- React image annotation: https://github.com/kkoomen/pointless
Full Rust application. Dioxus is far behind React or any other JS frontend framework, see roadmap
- Tauri
- Video streaming uses http: https://github.com/tauri-apps/tauri/blob/dev/examples/streaming/main.rs and tauri-apps/tauri#3138 and tauri-apps/tauri#4133
- API is Remote Procedure Call (RPC)
- Object methods can be called through Remote Method Invocation with
remote-trait-object
: https://docs.rs/remote-trait-object/0.4.0/remote_trait_object/
- Iced: https://github.com/iced-rs/iced
- Slint: https://slint-ui.com/
- Qt (through ritual, unsafe according to https://github.com/rust-qt/ritual)
- Egui https://www.egui.rs/#demo
- GTK4 https://gtk-rs.org/ and GStreamer https://crates.io/crates/gstreamer
- FLTK https://github.com/fltk-rs/fltk-rs
- Yew https://yew.rs/. Rust equivalent of React JS.
- Xylem https://raphlinus.github.io/rust/gui/2022/05/07/ui-architecture.html
- Dioxus https://dioxuslabs.com/
- (Druid https://github.com/linebender/druid)
(Webcam) Streaming options:
- Web streaming quickly and clearly explained: https://blog.logrocket.com/build-video-streaming-server-node/
- Gstreamer https://github.com/slint-ui/slint/tree/simon/gstreamer, https://github.com/sdroege/gstreamer-rs
- Rscam https://docs.rs/rscam/latest/rscam/
- FFMPEG https://github.com/unpatched/internet-broadcasting-service/blob/master/examples/encoder.rs
- NGINX-based media streaming server https://github.com/arut/nginx-rtmp-module
- Do we need an RTMP server?
Community posts/threads:
- https://www.reddit.com/r/rust/comments/vzz4mt/advice_for_the_next_dozen_rust_guis/
- Do not go with Qt;
- Again, do not go with Qt;
- Druid lacks a lot of widgets;
- egui ruled out because "its container/size story is awful";
- Slint could be a good option according to this post, as is it like QML in Rust; there is a branch trying to embed Gstreamer video feed into Slint, still under progress.
- Dioxus could be a good option (Web-based desktop app like Tauri, similar to React concepts);
- Tauri is a good option, but could have issues in our case with framebuffer.