Multicam not working

I am having a problem. I did all the process to add a new cam but I cannot see the second cam. I only see the first one I plug in the Raspberry. I even try to change the option to (OPTION="--http-listen=0.0.0.0").
Can someone help me out?

  1. I create a new image in my SD card using the new_stack as in the video. But before I was using the stable version
  2. I added the 2 camera files and assigned different ports (doing sudo add-usb-camera )
  3. even if I do ps -aux | grep camera I see both cameras working + I tried OPTION="--http-listen=0.0.0.0" and OPTION=--http-listen=0.0.0.0
  4. but when I insert the AP address + port I don't see the image coming from the second cam I plug in, whatever it is. 8080 or 8081. It is like it is not listening to all the ports.

should I empty the sd card and do the configuration from scratch?

Did you use "add-usb-camera" from the command line per the instuctions?

Once you do the file that this creates is what you want to edit.

I edited that file.
I set the port for both cameras, one 8080 and the other 8081.
The for the one in port 8081 I add the option to listen to all interfaces using “—http-listen=0.0.0.0”.
Everything looks set up correctly, but then it only shows the stream of one camera and the other gives me a server error

Did you try

http://IP_OF_YOUR_PI:8081/webcam/?action=stream

Multicam does not automatically set this up. It is up to you to provide the stream details.

Yes!

  1. I did:
    http://IP_OF_YOUR_PI/webcam/?action=stream
    And I see the 2default cam in 8080.
  2. when I did:
    http://IP_OF_YOUR_PI:8081/webcam/?action=stream or http://IP_OF_YOUR_PI:8081/?action=stream
    it gave me "server error"
  3. The problem is that if I unplug the 'default' cam (the first I pluged in) in port 8080, and I do http://IP_OF_YOUR_PI:8081/?action=stream I can see the stream from the second cam.

What files exist in /boot/camera-streamer ?

Also please post your log files as per the forum "Stickie".

In /boot/camera-streamer I have: ($ ls /boot/camera-streamer/
libcamera.conf usb-webcam_edu.conf usb-webcam_albi.conf)

  • a file for the raspberry pi cam with port 8082 and I am not using it
  • a file for camera in 8080 (called usb-webcam_edu.conf)
  • and a file for the camera in 8081 (called usb-webcam_albi.conf)

In webcamalbi I added the option to read all interfaces (OPTIONS=--http-listen=0.0.0.0).

for the log files I am not in the lab rn, I can send it tomorrow.

by the way I really appriciate your help

If you are not using a Raspberry Pi camera, which apparently you don't have, that libcamera.conf file should NOT be there -OR- you cannot use port 8080 for any of your USB cameras since that is grabbed by libcamera.conf.

That is likely the issue.

Ok, thank you, I'll try to delete libcamera.conf and let you know.

But it look strange, because I changed its port from 8080 to 8082, so I had 8080 and 8081 free for my usb cams.

In fact when I plug in only webacm_albi (the one in port 8081) I can see the stream.
OR
If I plug in only webacm_edu (the one in port 8080) I can see the stream.

BUT
I can't when I try http:///webcam/?action=stream http://:8081/webcam/?action=stream I don't see the second one I pluged in.

I'LL TRY TO DELETE ALL FILES IN /boot/camera-streamer/ AND DO FROM SCRATCH THE NEW FILES FOR MY 2 WEBCAMS AND LET U KNOW... what do u think?

I hope that was mistyped. It should be http://IP_OF_YOUR_PI:8081/webcam/?action=stream

with the "IP_OF_YOUR_PI" replaced by the actual IP.

And yes deleting the configuration files if you don't have a raspicam installed, rebooting and then running the add-usb-webcam script will help.

Yes sorry for the misspelled!!!

I’ll try what u told me, if still not working I’ll provide with pictures.
Thank you so much

Shouldn't it be "http://IP_OF_YOUR_PI:8081/?action=stream"

Yep I agree, but because it wasn’t working I tried both

http://IP_OF_YOUR_PI:8081/webcam/?action=stream is what I am currently using for multicam on the latest release and stack.

Are you sure? /webcam/ would be running it through haproxy (normally on port 80), proxied to 8080, whereas using the port number goes straight to the streamer so you can skip the /webcam/ prefix. If you have made changes to haproxy then ok, but this is definitely not standard.

Yes, that is what I am using for four cameras on different ports.

All work in Multicam and directly accessing the URL.

No changes to haproxy.cfg at all.

The first raspicam does appeared proxied from 80 to 8080 by default, but both /?action=stream and /webcam/?action=stream work for all of the cameras.

This exists in haproxy.cfg but that is what came with the image and is the only entry there about the cameras. I don't recall making any changes and the file dates correspond to the original installation.



frontend public
        bind :::80 v4v6
        bind :::443 v4v6 ssl crt /etc/ssl/localcert.pem
        option forwardfor except 127.0.0.1
        use_backend webcam if { path_beg /webcam/ }
        use_backend webcam_hls if { path_beg /hls/ }
        use_backend webcam_hls if { path_beg /jpeg/ }
        default_backend octoprint

backend webcam
        http-request replace-path /webcam/(.*) /\1
        server webcam 127.0.0.1:8080
        errorfile 503 /etc/haproxy/errors/503-no-webcam.http

what is this script u gust send? should I check it or modify it?

What I posted is part of /etc/haproxy.cfg

That was in response to Charlie's comment.
You should not need to make any changes to this file if you are using an unmodified image with the latest camera stack and have not restored a prior backup.

So this should not apply to your installation, though feel free to compare your file entries to the above.

Also

I made my modifications to the usb camera configuration files so they read like this...

OPTIONS='--http-listen="0.0.0.0"'

Note that there is a single quote at the start, then a double quote for "0.0.0.0" followed by another single quote.

You may want to try that and restart.

The single quote is required to pass multiple arguments via options, for example.

OPTIONS='--http-listen="0.0.0.0" --camera-format="MJPEG" --camera-auto_focus="0"'

Thank you!! it is working!! I did all the things u tell me and I also had to modify the default format form YUYV to MJPEG.