[Unit] # udev starts this when the Cam Link 4K appears. Only the device's stop is # tied in: a start dependency on it would leave a job waiting whenever the # base v4l2-relayd.service is started with no Cam Link attached. ConditionPathExists=/dev/camlink4k StopPropagatedFrom=dev-camlink4k.device Requires=camlink-4k-loopback.service After=camlink-4k-loopback.service [Service] RestartSec=2 # The packaged command line, plus sync=false on the sink. v4l2src stamps each # frame with its capture time, so by the time it reaches the sink it is already # past due and a synced sink drops every one of them. ExecStart= ExecStart=/bin/sh -c 'DEVICE=$(grep -l -m1 -E "^${CARD_LABEL}$" /sys/devices/virtual/video4linux/*/name | cut -d/ -f6); exec /usr/bin/v4l2-relayd -i "${VIDEOSRC}" $${SPLASHSRC:+-s "$${SPLASHSRC}"} -o "appsrc name=appsrc caps=video/x-raw,format=${FORMAT},width=${WIDTH},height=${HEIGHT},framerate=${FRAMERATE} ! videoconvert ! v4l2sink name=v4l2sink sync=false device=/dev/$${DEVICE}" $EXTRA_OPTS'