Wireless IP Camera

  • 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.


  • 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

    Einmal editiert, zuletzt von Ambientheater77 () aus folgendem Grund: Merged a post created by Ambientheater77 into this post.

  • 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



Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!