You can capture a live-view feed from your USB-connected Canon DSLR with gphoto2 (param: --capture-movie). The biggest limitation here is that the resulting mjpeg stream resolution is 1056x704, and that's the highest possible quality via USB. This mjpeg stream can be piped to ffmpeg. As an alternative, you could get yourself an USB<>Mini-HDMI recording dongle (e.g. "Elgato Cam Link"), this will give you a FullHD (1920x1080) resolution and you can use your Canon DSLR like any USB webcam, which can also be piped to ffmpeg.