Score:0

Using a DSLR camera as a webcam to stream on OBS

hu flag

I've recently changed from Windows to Ubuntu and I'm trying to get my DSLR camera (Canon Rebel T3) to function as a webcam so I can make those cool videos about old racing games and its cars (remember the Renault Espace with an F1 engine from Gran Turismo 2?).

I've followed the steps from this link and watched this video a couple of times, but when I try to insert this command:

gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0

It gives me this error:

ioctl(VIDIOC_G_FMT): Invalid argument
Could not write header for outputfile #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --

Or the terminal gets stuck.

The gphoto2 detects my camera and gives all the information about the camera, but when I try to take a picture, it doesn't save anywhere.

When I go to VLC, my camera isn't in the capture devices, so something might be wrong I guess.

Also, when I try to edit the /etc/modules to register the modprobe, I'm unable to edit anything. I imagine there is something wrong, but since I'm an early Ubuntu user, maybe it's the lack of knowledge.

Attached to this post is my system configuration (maybe that's what's causing the issue).

Kind regards,

Matias N Goldberg avatar
vg flag
Try other pixel formats. yuv420p is not the only one and your cam may not support it.
Matias N Goldberg avatar
vg flag
Also try `ffplay /dev/video0` to see if it can be played. If it can, launch it again in verbose log mode to see what pixel format it is using
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.