Nikon DSLR as Webcam
1. Equipment
1.1. Nikon D5600
1.2. Tripod: Neewer Mini Stativ, 38,99 EUR
The tripod is nice, but I dislike the screw which is not very good to fasten with just your fingers.
1.3. Mini HDMI to HDMI Adapter: Link, 2,53 EUR
1.4. Capture card (USB-C): Zhongkaifa HDMI to Type-C Video Capture Card, 18,99 EUR
1.5. Dummy battery for Nikon: Link, 39,99 EUR
This is useful for long sessions. Just plug a power cable and don't be scared to run out of battery.
There are different versions of this battery. I've decided to use a variant which offers USB.
That way, you might be able to power your camera by a powerbank.
Note: The power supply should be able to provide 3A.
2. Alternatives
2.1. Official tool
There is the Nikon Webcam Utility available for Windows and Mac. Linux is not supported, and for a maximum flexibility I've decided to use the HDMI solution.
I can imagine for most users it is the more convenient method though.
2.2. digiCamControl
digiCamControl is an open-source tool which also offers LiveView. No HDMI capture card needed, just the USB connection.
2.3. gPhoto2
See crackedthecode link below.
3. Camera settings
Extend LiveView mode time to the maximum. Unfortunately, on my camera I cannot set it to unlimited.
Make sure to just transfer the video and disable the simple mode.
You might want to set the focus mode to AF-F, however it didn't work for me as well as expected (almost no re-focus), so I kept it manual.
If everything is connected, enter LiveView mode and press the Info button several times until the settings frame disappears.
4. Video4Linux
After everything was connected, the camera showed up immediately without further settings on my Manjaro Linux machine.
List all available formats:
v4l2-ctl --device /dev/video0 --list-formats-ext
5. OBS Studio
Okay, this is pretty well-known today, but a link for the sake of completeness: https://obsproject.com
Big software which provides a lot of options for recording, testing settings etc.
You are free to use any other recording software, and most softwares will detect the video as a webcam input automatically.
6. FPS problems
In YUYV mode, I was only able to get 5 FPS and everything was laggish. However, if I use YV12 mode, I was able to use full 60 FPS.
7. Delay, sync video and audio
I had a video delay of about 300ms. OBS doesn't offer you an option to set the delay for the video. However, setting it for the audio works well.
Make sure to select the Microphone from the Capture Card to get best synced results.