Closed s-fairchild closed 1 year ago
Hi,
Capture seems working, probably UDP packet are lost. Did you try using RTP over TCP ?
Best Regards, Michel.
P.S. I suppose /dev/vidoe0
in the command line is a error here ?
@mpromonet Hello, thanks for your quick reply.
yes /dev/vidoe0
was a typo, was supposed to be /dev/video0,hw:CARD=Camera,DEV=0
.
It looks like there were two issues.
-u "$(cat /run/secrets/url)"
also fails.
Execing into the container I can see the process didn't get the variable output as -u is empty
/usr/local/bin/v4l2rtspserver -S2 -p 80 -C1 -A48000 -aS16_LE -u /dev/video0,hw:CARD=Camera,DEV=0
--device /dev/video0:/dev/video0
silently fails, but --device /dev/video0
works.
Using symbolic links is also odd, I'll add my working example using symbolic links incase this is helpful for others in the future.Trying to use a sym link as the video device argument fails, but if it's mapped to /dev/videoX
it works. Not sure why but that also tripped me up.
podman run \
--name v4l2rtspserver \
--pull newer \
--device /dev/v4l/by-id/usb-HD_Camera_Manufacturer_HD_USB_Camera_2020101401-video-index0:/dev/video0 \
--device /dev/snd:/dev/snd \
-p 8554:8554 \
docker.io/mpromonet/v4l2rtspserver:latest-amd64 \
-S1 \
-C1 -A48000 -aS16_LE \
-u ${URL} \
/dev/video0,hw:CARD=Camera,DEV=0
Here's my final solution to get podman secret env variables working.
--cap-add
and --privileged
aren't required.
[Unit]
Description=V4L2 RTSP Server
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=30
ExecStartPre=-/bin/podman kill v4l2rtspserver
ExecStartPre=-/bin/podman rm v4l2rtspserver
ExecStart=podman run \
--name v4l2rtspserver \
--pull newer \
--secret v4l2rtspserver,type=env,target=SECRET \
--secret v4l2rtspserver_url,type=env,target=URL \
--device /dev/v4l/by-id/usb-HD_Camera_Manufacturer_HD_USB_Camera_2020101401-video-index0:/dev/video0 \
--device /dev/snd:/dev/snd \
-v /var/usrlocal/bin/start_v4l2rtspserver.sh:/usr/local/bin/start_v4l2rtspserver.sh \
-p 8554:8554 \
--entrypoint "/bin/bash" \
docker.io/mpromonet/v4l2rtspserver:latest-amd64 \
-c "/usr/local/bin/start_v4l2rtspserver.sh"
ExecStop=/bin/podman stop v4l2rtspserver
[Install]
WantedBy=multi-user.target
#!/bin/bash
# Mounted inside v4l2rtspserver container and executed by bash entrypoint
/usr/local/bin/v4l2rtspserver \
-S1 \
-R home -U user:"${SECRET}" \
-C1 -A48000 -aS16_LE \
-u "${URL}" \
/dev/video0,hw:CARD=Camera,DEV=0
Describe the bug I'm unable to stream rtsp unicast from a container running in Fedora Coreos 36 using podman. Tailing the logs the stream appears to begin then immediately stop, on the client app the stream fails to start. I've tested with
VLC
on my desktop and ipcam ISO app. The camera and command line arguments work in Arch Linux, and Fedora Server 36 running in podman and outside of a container.Logs shown with
-vv
log verbosityTroubleshooting steps taken
--privilege
mode--cap-add ALL
--net=host
To Reproduce Steps to reproduce the behavior: Create a butane config and ignition file following the Fedora coreos documentation Create Fedora Coreos machine (libvirt works well) with this systemd unit:
Expected behavior RTSP stream to start and play video on clients.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS] Fedora 36
Browser [e.g. chrome, safari] VLC
Version [e.g. 22]
Smartphone (please complete the following information):
Additional context Add any other context about the problem here. v4l2rtspserver_logs.txt