problems with uv4l-server URLs

1.9k views Asked by At

I have a uv4l server set up on my raspi which is serving a no-name webcam. It is using the uvc driver. The server built-in web page mostly works. I can stream webrtc from the pi to my laptop browser, however the mjpeg button brings up a broken-image icon.

Most importantly, no urls seem to work directly from the server, such as http://raspberrypi:8080/stream/video.mjpeg.

Using the chrome inspection window on that url I can see a return of 200 but the server then closes the connection. VLC is unable to open the connection either.

This is my uv4l command ...

/usr/bin/uv4l -k --sched-rr --mem-lock --config-file=/etc/uv4l/uv4l-uvc.conf     \
             --driver uvc --driver-config-file=/etc/uv4l/uv4l-uvc.conf       \
             --server-option=--editable-config-file=/etc/uv4l/uv4l-uvc.conf  \
             --device-id=1908:2310 

Any ideas?

2

There are 2 answers

3
ciccina On

One possible reason is that your UVC-based webcam does not support the MJPEG video format natively so you get a blank page from UV4L. As an alternative to the uv4l-uvc userspace driver, you can tell UV4L to make use of the uvcvideo kernel driver. For example, supposing uvcvideo creates /dev/video0, the commands would be something like:

modprobe uvcvideo
uv4l --external-driver --device-name=video0 --server-option '--port=9000'

However, if uvcvideo does not provide MJPEG either your problem would still remain.

0
mark-hahn On

I have googled extensively and I think I understand what is going on even though I couldn't find any clear explanations. The raspicam driver has a lot of features/options including encoding. The uvc driver does nothing except pass the webcam stream through. The uv4l server does no encoding either.

My webcam has only raw yuyv so I needed a real encoding solution. I've used ffmpeg a lot so I chose it. It can encode using the broadcom h.264 hardware so it is only using 20% of the cpu.

I'm using the ffserver program instead of the uv4l server since I'm only serving http and it is a good match for ffmpeg.