scottlamb / retina

High-level RTSP multimedia streaming library, in Rust
https://crates.io/crates/retina
Apache License 2.0
218 stars 46 forks source link

Enhancement: piping output into retina #54

Open jlpoolen opened 2 years ago

jlpoolen commented 2 years ago

This is an enhancement request. I'm not sure if it is account for in the tree of tasks under the section server support --> I/O modes --> async-std

The Raspberry Pi project libcamera has an example of running an rtsp server by running their program libcamera-vid and piping it into cVLC to handle the rtsp server portion. (The rtsp server for cVLC may be LIVE555, but I'm not sure.)

Following instructions at https://www.raspberrypi.com/documentation/accessories/camera.html#libcamera-and-libcamera-apps which states to run a server, use this command line:

libcamera-vid -t 0 --inline -o - | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/stream1}' :demux=h264

Instead, I used this modified version which includes the IP address of the Pi server running this command:

libcamera-vid -t 0 --inline -o - | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://192.168.1.12:8554/stream1}' :demux=h264

I'm having problems with Moonfire-nvr running Retina and shaking hands with the Raspberry Pi Zero 2's instance of the above command line, See Moonfire-nvr Issue #192.

The above consists of two parts: 1) libcamera-vid getting the data from the attached camera then piping it int 2) cVLC. I'm wondering if Retina could easily be enhancement to accept piped input the way cVLC does so I could accomplishing something like:

  libcamera-vid -t 0 --inline -o - | retina.....

Either accepting STDIN, or some file descriptor one could configure.

scottlamb commented 2 years ago

Yeah, that sounds like something we can do when adding server support.