Is it possible to somehow use Wireless IP Camera to with hyperion?
Wireless IP Camera
- panel
- Unerledigt
-
-
Hi,
thanks for this inspiring question.
You can use v4l2loopback and ffmpeg for that.
sudo apt install v4l2loopback-dkms v4l2loopback-utils ffmpeg
-> create a virtual V4L2 device /dev/video9
sudo modprobe v4l2loopback devices=1 video_nr=9 card_label="Virtual-Device9"
-> set capture format for the device
sudo v4l2loopback-ctl set-caps "video/x-raw,format=I420,width=720,height=576,framerate=25/1" /dev/video9
WARNING: This command did freeze on my system, execute this in desktop environment terminal you can close or screen-session over SSH
-> use ffmpeg to get your webcam stream and write it to the device
ffmpeg -i "rtsp://192.168.32.101:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=660" -f v4l2 /dev/video9
I had to make sure no reencoding is needed, my RPi Zero 2W isn't fast enough, so i had to set resolution and pixel-format of the device to the ones of input stream. But if you like you can do reencoding:
ffmpeg -i "rtsp://192.168.32.101:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=660" -s 720x576 -r 25 -pix_fmt yuv420p -f v4l2 /dev/video9
ffmpeg -pix_fmts lists all supported formats. You need to choose a format supported by hyperion.ng and v4l2loopback-ctl. It's a little bit tricky as the names do not match always as you can see below (I420=yuv420p=YU12). For v4l2loopback-ctl they are case sensitive (maybe https://gstreamer.freedesktop.…deotestsrc/?gi-language=c will help).
Good luck.
wbr
Thinner
PS: This is for version 0.12.5 installed on Raspbian Bullseye, in newer versions v4l2loopback-ctl set-caps has changed, i also tried current version from https://github.com/umlaeute/v4l2loopback but didn't succeed yet.
Code
Alles anzeigenv4l2-ctl -d /dev/video9 --all Driver Info: Driver name : v4l2 loopback Card type : Virtual-Device9 Bus info : platform:v4l2loopback-000 Driver version : 6.1.21 Capabilities : 0x85208003 Video Capture Video Output Video Memory-to-Memory Read/Write Streaming Extended Pix Format Device Capabilities Device Caps : 0x05208003 Video Capture Video Output Video Memory-to-Memory Read/Write Streaming Extended Pix Format Priority: 0 Video input : 0 (loopback: ok) Video output: 0 (loopback in) Format Video Capture: Width/Height : 720/576 Pixel Format : 'YU12' (Planar YUV 4:2:0) Field : None Bytes per Line : 720 Size Image : 622080 Colorspace : sRGB Transfer Function : sRGB YCbCr/HSV Encoding: ITU-R 601 Quantization : Limited Range Flags : Format Video Output: Width/Height : 720/576 Pixel Format : 'YU12' (Planar YUV 4:2:0) Field : None Bytes per Line : 720 Size Image : 622080 Colorspace : sRGB Transfer Function : sRGB YCbCr/HSV Encoding: ITU-R 601 Quantization : Limited Range Flags : Streaming Parameters Video Capture: Frames per second: 25.000 (25/1) Read buffers : 2 Streaming Parameters Video Output: Frames per second: 25.000 (25/1) Write buffers : 2 User Controls keep_format 0x0098f900 (bool) : default=0 value=1 sustain_framerate 0x0098f901 (bool) : default=0 value=1 timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0 timeout_image_io 0x0098f903 (bool) : default=0 value=0
-
and I have to say, didn't know that was also possible to get the rtsp stream into Hyperion and is far above my Raspi knowledge
But: I did it with a analog Cam in colour with a 3-11 mm DC lens. That was aimed to the TV and the analog signal connected to a usb grabber.
It worked but. Colours where somewhat off because of the dark spot when dim scenes is playing.
BC backlight compisation was ON on the colour camera,
Result was a meager 7
cons with this setup was no hassle whatsoever with hdcp/arc/edid/ etc
-
Update for using latest version:
-> unload module if loaded, if it doesn't work reboot
sudo modprobe -r v4l2loopback
-> uninstall package manager version
sudo apt remove v4l2loopback-dkms v4l2loopback-utils
-> install latest version
sudo apt install raspberrypi-kernel-headers
git clone https://github.com/umlaeute/v4l2loopback v4l2loopback
cd v4l2loopback
(make clean on rebuild)
make
sudo make install
sudo depmod -a
cd utils
sudo make install
v4l2loopback-ctl --version
-> run
sudo modprobe v4l2loopback devices=1 video_nr=9 card_label="Virtual-Device9"
sudo v4l2loopback-ctl set-caps /dev/video9 "YU12:720x576@25/1"
ffmpeg -i "rtsp://192.168.32.101:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=660" -f v4l2 /dev/video9
Code
Alles anzeigenmodinfo v4l2loopback filename: /lib/modules/6.1.21-v7+/extra/v4l2loopback.ko.xz alias: char-major-10-255 license: GPL version: 0.13.1-19-g4824538 author: Vasily Levin, IOhannes m zmoelnig <zmoelnig@iem.at>,Stefan Diewald,Anton Novikovet al. description: V4L2 loopback video device srcversion: F787587E259AE5311BBD3D5 depends: videodev name: v4l2loopback vermagic: 6.1.21-v7+ SMP mod_unload modversions ARMv7 p2v8 parm: debug:debugging level (higher values == more verbose) (int) parm: max_buffers:how many buffers should be allocated [DEFAULT: 2] (int) parm: max_openers:how many users can open the loopback device [DEFAULT: 10] (int) parm: devices:how many devices should be created (int) parm: video_nr:video device numbers (-1=auto, 0=/dev/video0, etc.) (array of int) parm: card_label:card labels for each device (array of charp) parm: exclusive_caps:whether to announce OUTPUT/CAPTURE capabilities exclusively or not [DEFAULT: 0] (array of bool) parm: max_width:maximum allowed frame width [DEFAULT: 8192] (int) parm: max_height:maximum allowed frame height [DEFAULT: 8192] (int)
Code
Alles anzeigenv4l2-ctl -d /dev/video9 --all Driver Info: Driver name : v4l2 loopback Card type : Virtual-Device9 Bus info : platform:v4l2loopback-009 Driver version : 6.1.21 Capabilities : 0x85200003 Video Capture Video Output Read/Write Streaming Extended Pix Format Device Capabilities Device Caps : 0x05200003 Video Capture Video Output Read/Write Streaming Extended Pix Format Priority: 2 Video input : 0 (loopback: ok) Video output: 0 (loopback in) Format Video Capture: Width/Height : 720/576 Pixel Format : 'YU12' (Planar YUV 4:2:0) Field : None Bytes per Line : 720 Size Image : 622080 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Limited Range) Flags : Format Video Output: Width/Height : 720/576 Pixel Format : 'YU12' (Planar YUV 4:2:0) Field : None Bytes per Line : 720 Size Image : 622080 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Limited Range) Flags : Streaming Parameters Video Capture: Frames per second: 25.000 (25/1) Read buffers : 2 Streaming Parameters Video Output: Frames per second: 25.000 (25/1) Write buffers : 2 User Controls keep_format 0x0098f900 (bool) : default=0 value=1 sustain_framerate 0x0098f901 (bool) : default=0 value=1 timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0 timeout_image_io 0x0098f903 (button) : flags=write-only, execute-on-write
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!