Skip to content

Instantly share code, notes, and snippets.

@moon0440
Created October 7, 2020 16:30
Show Gist options
  • Save moon0440/1a7877be71030cff1c839f081f7c0f35 to your computer and use it in GitHub Desktop.
Save moon0440/1a7877be71030cff1c839f081f7c0f35 to your computer and use it in GitHub Desktop.
CamLink 4k with hero 5 camera. Creates video4linux dummy device for ubuntu 20.04
sudo modprobe v4l2loopback devices=1 exclusive_caps=1
# v4l2-ctl --list-devices
# Get the video devices for the camlink and dummy.
#Dummy video device (0x0000) (platform:v4l2loopback-000):
# /dev/video2
#
#Cam Link 4K: Cam Link 4K (usb-0000:08:00.0-2):
# /dev/video0
# /dev/video1
# /dev/media0
#
# Then set
#ELGATO=/dev/video0
#V4LOOP=/dev/video2
#
# OR
ELGATO=$(v4l2-ctl --list-devices | awk '/Cam Link 4K/{getline;gsub(/^[ \t]+/, "", $0); print}')
V4LOOP=$(v4l2-ctl --list-devices | awk '/Dummy video device/{getline;gsub(/^[ \t]+/, "", $0); print}')
ffmpeg -f v4l2 -input_format yuyv422 -framerate 60 -video_size 1920x1080 -i $ELGATO -pix_fmt yuyv422 -codec copy -f v4l2 $V4LOOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment