Restreamer v2 not recognizing raspberry pi camera v3
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
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:
- buy a Raspberry Pi camera (not NOIR or wide)
- plug it in
- go into Restreamer and select advanced mode
- click hardware device
- 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
Desktop (please complete the following information):
- OS: Raspberry pi os bookworm
- Browser Microsoft edge
- Version v16.13.1 (linux/arm64)
Now I wonder if this supports Bookworm (with its new release). I'm going to try the legacy
Ok I just tried bullseye and still same problem
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
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!
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://
This is what worked for me with Bookworm Add source with Network Source
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.