Page 1 of 1

Not able to stream USB camera over RTSP on Luckfox Pico Mini B

Posted: 2025-03-31 11:15
by chanauria
Summary:

I'm trying to build a dual-camera setup for a project.

For this, I purchased three devices:

Luckfox Pico Mini B
SC3336 CSI Camera Module (B)
A generic USB Camera (for testing purpose)

Luckfox Pico Mini B is running Buildroot image on SPI NAND Flash (128MB). Since Luckfox Pico Mini B and SC3336 camera module are compatible with each other on Buildroot but not via Ubuntu as mentioned here: https://wiki.luckfox.com/Luckfox-Pico/L ... CSI-Camera due to which, I'm constrained to run my USB camera on Buildroot.

I'm able to get RTSP feed over ethernet for the SC3336.

I'm accessing board console over SSH on eth0 interface (192.168.144.93) and configured usb0 port as a host to run the USB camera.

Objective: To stream the USB Camera over RTSP in addition to SC3336 (that is already streaming). It doesn't matter whether the two RTSP feeds are over different ports or same (via a different URL).

What I've already done:

I was able to run ethernet on Luckfox Pico Mini B.
I have been able to get the USB camera detected on the board. Running the command v4l2-ctl --list-devices I get this:

Code: Select all

C[root@luckfox root]# v4l2-ctl --list-devices
rkisp-statistics (platform: rkisp):
        /dev/video21
        /dev/video22

rkcif-mipi-lvds (platform:rkcif):
        /dev/media1

rkcif (platform:rkcif-mipi-lvds):
        /dev/video2
        /dev/video3
        /dev/video4
        /dev/video5
        /dev/video6
        /dev/video7
        /dev/video8
        /dev/video9
        /dev/video10
        /dev/video11
        /dev/video12

rkisp_mainpath (platform:rkisp-vir0):
        /dev/video13
        /dev/video14
        /dev/video15
        /dev/video16
        /dev/video17
        /dev/video18
        /dev/video19
        /dev/video20
        /dev/media2

USB2.0 PC CAMERA: USB2.0 PC CAM (usb-xhci-hcd.0.auto-1):
        /dev/video0
        /dev/video1
        /dev/media0
I have been able to capture image frames and record a small video locally on Buildroot using ffmpeg but not able to further stream it on RTSP.

If I try to run ffmpeg in order to start another stream on port 8554, I loose the SSH access to the board:

Code: Select all

ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -f rtsp rtsp://0.0.0.0:8554/usb
And then I have to re-login. I tried vlc as well but no luck. I have tried a lot of intricate command combinations for FFmpeg in order for this to work over days but still the same disconnection problem.

I then thought to integrate the USB camera to the already running RTSP server for the CSI camera since I was already able to capture the video frames as mentioned above. The already working RTSP links for the CSI camera asw we know are:

rtsp://192.168.144.93/live/0
rtsp://192.168.144.93/live/1

I thought that I'll do something like this for the USB camera:

rtsp://192.168.144.93/live/2
rtsp://192.168.144.93/live/3

However, the only thing that I'm able to figure out now is how to stop and start the RTSP server.

To Stop:
./RkLaunch-stop.sh

To start:
./rkipc

I further looked into these in the SDK but I'm not able to understand or figure out where to integrate the USB camera along with the CSI camera and therefore I need help with that.

Additionally, I see the following scripts already loaded in the Buildroot path /oem/usr/bin/ but not sure how to use them. I tried running them but they RTSP stream doesn't work:

sample_demo_dual_camera
sample_demo_dual_camera_wrap
sample_demo_multi_camera_eptz
I can provide as much info as required in order to get help on this. Please let me know.

Looking for help with this project. 🙏

Re: Not able to stream USB camera over RTSP on Luckfox Pico Mini B

Posted: 2025-04-01 2:51
by Crocodile
Hello, your question can refer to viewtopic.php?p=5311&hilit=USB+CSI#p5311, the initialization of USB and CSI cameras is very different, and all the test commands with the "sample_" prefix and the "simple_" prefix are for CSI cameras

Re: Not able to stream USB camera over RTSP on Luckfox Pico Mini B

Posted: 2025-04-10 7:41
by ismlcmtzn
Hi, can you help with this problem? I'm trying to use dual cameras, but I couldn't stream RTSP from a USB camera.

Re: Not able to stream USB camera over RTSP on Luckfox Pico Mini B

Posted: 2025-04-12 2:21
by Crocodile
Hello Software function implementationWe only provide suggestions, we have not tested the use of UVC for RTSP streaming, the provided https://github.com/LuckfoxTECH/luckfox_ ... pi_example routine through opencv-mobile to take the image for streaming, although it does not support UVC camera, However, the underlying layer of opencv-mobile is implemented through v4l2, and you can try to reference the source code of luckfox_pico_rkmpi_example and opencv-mobile