After a bunch of fiddling I just got this working, so figured I'd post the magic incantation here for posterity, as well as how I cracked it. I have an Elgato Cam Link 4K hooked up to a Panasonic Lumix DSLR, so I get that beautiful soft focus in remote meetings. It worked nicely in MacOS but I didn't have much luck in Ubuntu: programs would detect /dev/video0 and /dev/video1 but it would just never work. FFmpeg said something about corrupted bytes.
The camera DID work fine in OBS Studio though. So I started OBS from the command line and took note of the stuff it spewed in the log, most notably "50fps", "yuy", and "1920x1080". I googled ffmpeg's various pixel formats and it had one called "yuyv422".
Next thing I got from another forum: install v4l2loopback. This creates a dummy video capture stream that you can pipe stuff to. So the magic incantation is this:
Code:
sudo modprobe v4l2loopback
ffmpeg -f v4l2 -framerate 50 -pix_fmt yuyv422 -video_size 1920x1080 -i /dev/video0 -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video2
This makes ffmpeg read from the /dev/video0 stream with the options I got from OBS, and pipes it to our new dummy stream in the "yuv420p" format (which seems a little bit more standard). Now I can pick that dummy device and use it as expected!
Hope this helps somebody from the future
Bookmarks