restreamer icon indicating copy to clipboard operation
restreamer copied to clipboard

Restreamer v2 not recognizing raspberry pi camera v3

Open bluekiwidev opened this issue 3 years ago • 6 comments

Describe the bug I recently bought a Raspberry Pi camera (not NOIR or wide version) to watch some birds and I plugged it in and there were two cameras Screenshot 2023-12-03 183322

I tried both of them in the normal setup but it said to check the address. so I tried it in advanced mode and probed it and this was the details: dev/video0 ffmpeg version 5.1.3-datarhei Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.2.1 (Alpine 11.2.1_git20220219) 20220219 configuration: --extra-version=datarhei --prefix=/usr --extra-libs='-lpthread -lxml2 -lm -lz -lsupc++ -lstdc++ -lssl -lcrypto -lz -lc -ldl' --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-static --enable-openssl --enable-libxml2 --enable-libv4l2 --enable-v4l2_m2m --enable-alsa --enable-libfreetype --enable-libsrt --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libvorbis --disable-ffplay --disable-debug --disable-doc --disable-shared libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 [video4linux2,v4l2 @ 0x7fab070690] ioctl(VIDIOC_G_PARM): Not a tty [video4linux2,v4l2 @ 0x7fab070690] Time per frame unknown [video4linux2,v4l2 @ 0x7fab070690] ioctl(VIDIOC_STREAMON): Invalid argument /dev/video0: Invalid argument

dev/video1 ffmpeg version 5.1.3-datarhei Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.2.1 (Alpine 11.2.1_git20220219) 20220219 configuration: --extra-version=datarhei --prefix=/usr --extra-libs='-lpthread -lxml2 -lm -lz -lsupc++ -lstdc++ -lssl -lcrypto -lz -lc -ldl' --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-static --enable-openssl --enable-libxml2 --enable-libv4l2 --enable-v4l2_m2m --enable-alsa --enable-libfreetype --enable-libsrt --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libvorbis --disable-ffplay --disable-debug --disable-doc --disable-shared libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 [video4linux2,v4l2 @ 0x7f9e606690] Cannot find a proper format for codec 'none' (id 0), pixel format 'nv12' (id 23) /dev/video1: Invalid argument

To Reproduce Steps to reproduce the behavior:

  1. buy a Raspberry Pi camera (not NOIR or wide)
  2. plug it in
  3. go into Restreamer and select advanced mode
  4. click hardware device
  5. choose unicam dev/video0 or dev/video1 either of them doesn't work

Expected behaviour I plug it in and then select the camera (unicam). and get past the "choose your video input" stage

Screenshots Screenshot 2023-12-03 185004 Screenshot 2023-12-03 184929

Screenshot 2023-12-03 184826 Screenshot 2023-12-03 184815

Desktop (please complete the following information):

  • OS: Raspberry pi os bookworm
  • Browser Microsoft edge
  • Version v16.13.1 (linux/arm64)

bluekiwidev avatar Dec 03 '23 05:12 bluekiwidev

Now I wonder if this supports Bookworm (with its new release). I'm going to try the legacy

bluekiwidev avatar Dec 03 '23 06:12 bluekiwidev

Ok I just tried bullseye and still same problem

bluekiwidev avatar Dec 03 '23 06:12 bluekiwidev

Ok i made a workaround: you have to use libcamera-vid to stream it to a rtmp url that restreamer gives you and boom it works this is the command i used libcamera-vid -t 0 -g 10 --bitrate 4500000 --inline --width 1920 --height 1080 --framerate 30 --rotation 180 --codec libav --libav-format flv --libav-audio --audio-bitrate 192000 --av-sync 200000 -n -o rtmp://RASPBERRY_PI_IP/THE_REST_OF_THE_URL.stream

bluekiwidev avatar Dec 05 '23 07:12 bluekiwidev

This worked for me on Bookworm just as well, however it has quite some delay.

Maybe someone has an idea how to work around the delay!

bytes-max avatar Jan 02 '24 00:01 bytes-max

I have set up a Raspberry Pi 5 and HQ camera with a solar telescope. I want to live stream the 8 April total solar eclipse. I am having the same problem as you describe at the beginning of this thread. I am not able get the workaround you posted to work. I get "Cannot real RTMP handshake response" and "terminate called after throwing an instance of 'std::runtime_error' what(): lib: unable to open output mix for rtmp://127.0.0.1:8080/ui.stream: End of file Aborted" I interpreted your entry "rtmp://RASPBERRY_PI_IP/THE_REST_OF_THE_URL.stream" as "rtmp://127.0.0.1:8080/ui.stream" since my Restreamer IP address is "http://:8080/ui/" I tried several variations of "rtmp://127.0.0.1:8080/ui.stream" including "rtmp://127.0.0.1:8080/ui/.stream" "rtmp://127.0.0.1/8080/ui/.stream" All give the same error message. I realize that I am not linking the correct RTMP address, but I have not found documentation on how to format it correctly.

raybender242 avatar Mar 11 '24 22:03 raybender242

This is what worked for me with Bookworm Add source with Network Source

Image

Copy the URL: example: rtmp://rajendra.local/04b6e0d1-491e-4399-8dc3-2a041669c110.stream

in Raspberry pi stream to this rtmp URL. Try different configurations. Following are the some that worked for me: libcamera-vid -t 0 --inline --width 854 --height 480 --framerate 24 --bitrate 500000 --codec libav --libav-format flv -n -o rtmp://rajendra.local/04b6e0d1-491e-4399-8dc3-2a041669c110.stream

libcamera-vid -t 0 -g 10 --bitrate 4500000 --inline --width 1920 --height 1080 --framerate 10 --rotation 180 --codec libav --libav-format flv --libav-audio --audio-bitrate 192000 --av-sync 200000 -n -o rtmp://rajendra.local/04b6e0d1-491e-4399-8dc3-2a041669c110.stream

Downside, there is 7 to 8 seconds of delay in the stream.

bkrajendra avatar Jan 29 '25 19:01 bkrajendra