8 ms·
Using a Canon EOS camera as a webcam in Debian
- chomp 4y agoDoes this actually make a better picture? Won’t your stream still be super compressed by meet/zoom/etc?
- ApolIllo 4y agoYou have a lot more options on lenses and do stuff like background blurring with Bokeh. Some smaller meeting services also provide 4k support.
- thrown_22 4y agoI feed it into OBS and can get 1080p easily on a 5D MKII, a camera that's now more than 15 years old. Better quality than any dedicated webcam I've seen. It's a nice second life for it.
- brippalcharrid 4y agoI thought you needed a 5DmkIII to get 1080p, because the 5DmkII has USB2.0 and is limited to a 200Mbps transfer speed (using MJPEG). And the HDMI resolution is much lower than that.
- daggersandscars 4y agoIt really makes a better picture. Zoom / Meet / Teams / etc does compress a ton, but a big part of the horrendous video quality are webcams. Another, potentially cheaper way to replace a webcam is to use the main (rear) camera of an old cell phone. Digital photography, especially using tiny sensors, is computational photography. Webcams are too cheap to have reasonable processing power internally and webcam companies don’t have the budget to create high quality post processing software for the host computer.
- ISL 4y agoCompression also works better on higher-quality video. The compression algorithm doesn't have to try to properly recover the noise. Also, seconded on the difference a larger sensor and better glass make for a webcam.
- brippalcharrid 4y agoShallow depth of field also means that the video codec only has to concentrate on encoding detail in the [narrow] focal plane. In my experience, the results are stunning (50mm f/1.2L @f/2.0 and diffused LED video lights), and the combination of the well-lit in-focus elements in the image (transmitted by good glass) with the deeply and naturally blurred background would suggest that increasing the number of pixels in the image from ~ 1024x640 to ~ 1920x1080 would probably be far less noticeable than the numbers might suggest.
- nomel 4y agoHere's a comparison that shows how different it is than a MacBook webcam: https://youtu.be/-Ea-xakhZmE?t=41 https://youtu.be/-Ea-xakhZmE?t=41 Dynamic range, noise, and resolution are significantly better.
- chomp 4y agoThat's a pretty good difference, thanks!
- pdpi 4y agoThere’s a bunch of advantages even with bad video from meet or zoom. Big sensor + nicer fast lenses means you require a lot less light. Nice fast glass means you can blur out the background optically without all the artefacts introduced by software background removal. If you use a zoom lens, you have a tonne of control over the framing.
- neuracnu 4y agoI'm curious if this is any more consistent than the webcam software that Canon provided for Windows and Mac. I tried the Mac implementation briefly, but found it to be _extremely_ glitchy (even with hard-wired power).
- pjot 4y agoI had a similar experience as well - though I had to constantly swap batteries… How did you hardwire power?
- lpasselin 4y agoThere are attachments that insert directly into the battery hole which are connected to a power supply.
- woleium 4y agoalso, there are aftermarket versions that cost $30 instead of $150
- coolandsmartrr 4y agoNot a Canon EOS user, but typically there are accessories called "dummy batteries" that take the shape of a standard battery, but is actually used by connecting to the AC socket. This way, the camera can be powered on constantly so long as the venue with the AC doesn't have a power outage.
- pjot 4y agoOf course! Thanks!
- lightedman 4y agoMy EOS Rebel has a DC port on the side below the USB port.
- kotaKat 4y agoI actually came across an Eos “webcam kit” at Walmart in-store that came with a USB cable and the AC adapter. Pricey at ~$90, but they did sell it like that.
- harry8 4y agoHow can you write all of that and miss the fun? apt-get install gnome-video-effects-frei0r #or whatever works for you filter_idx=2 filters=( "videobalance" "quarktv" "rippletv" #2 "streaktv" "radioactv" "vertigotv" "frei0r-filter-twolay0r" "frei0r-filter-distort0r" "dicetv" "edgetv" "warptv" "revtv" "frei0r-filter-cartoon" "shagadelictv") gst-launch-1.0 autovideosrc device=$CAMERA ! videoconvert ! ${filters[$filter_idx]} ! videoconvert ! videobalance ! videoconvert ! v4l2sink device=$VID_LOOPBACK edit: I've always needed an LD_PRELOAD to launch whatever, eg LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so /usr/bin/zoom maybe someone will chime in because they know better than me about all the details here.
- erwincoumans 4y agoUsually running 'sudo ldconfig' will sort this out, once the shared library directory is added in the right ld.so.conf file (for example /etc/ld.so.conf) See also https://blog.andrewbeacock.com/2007/10/how-to-add-shared-libraries-to-linuxs.html?m=1 https://blog.andrewbeacock.com/2007/10/how-to-add-shared-lib...
- Gigachad 4y agoNice post, but that's way too much work to be worth it. You really want your camera and mic setup to just work rather than having to tell someone to wait 10 minutes to call because you need to reload your kernel module.
- worthless-trash 4y agoI think its perhaps the perfect way to avoid meetings.
- failTide 4y agoand another great opportunity to tell everyone what OS you use
- LtWorf 4y agoIt takes 10 minutes to reload a kernel module??? Not even on a 386 :D
- Gigachad 4y agoFirst you have to spend a few minutes searching your bash backlog for the exact modprobe command, then you realize you updated your kernel so you have to recompile and resign it, then you have to fiddle with your video inputs but the gui is somehow out of sync with the actual setting. Then run a test before joining the call. And then the other person has the window under their browser and never looks at your video.
- LtWorf 4y ago> First you have to spend a few minutes searching your bash backlog Ah, you don't have the keys "ctrl" and "R" on your keyboard? And I guess you also don't have grep, so you can't just history | grep modprobe. You should consider investing in a keyboard with all the alphabet on it.
- _joel 4y agoIt's via DKMS and loaded automatically at boot. That's the point of DKMS
- randomf 4y agoI've been wondering for a while and can't find an answer to this: SD to USB adapters exist, but is it possible to hook up an SD-to-USB cable and have a driver present a virtual sd disk to the camera but write the video directly to your computer RAM via USB? That would solve the problem for all dSLRs.
- pdpi 4y agoThat seems pretty roundabout, when you have solutions like the Elgato CamLink that just takes an HDMI input from your camera and shows up as a completely standard USB Video Class device to the OS.
- randomf 4y agoMany models don't give you "clean" HDMI output. It's usually low-res with overlay junk. edit: if the elgato can do it with HDMI, the question remains can it be done directly with SD out? e2: also, SD card readers/adapters are cheap and plentiful, this seems like it should be easier to implement
- calessian 4y agoMy DSLR camera has a mini HDMI out that you can use out of the box, doesn't require the camera to be in recording mode or such. It simply gives you the live video feed -- rather than having it write to SD card, having software on your computer decode the video & show the last frame there. The only option I think (it's been a while) I had to vaguely enable is to have it not show the normal camera UI over HDMI, but that was a simple setting. Having hardware emulate a SD card sounds like a niche product, if anything, whereas the only item I needed for my camera was a mini-HDMI to HDMI cable.
- pdpi 4y agoThe elgato is doing something completely straightforward — video output to video input, done. With only a few details, it’s almost like a regular webcam where the controller is in the usb plug rather than the webcam’s body. The SD thing has all sorts of nastiness to it. First, you won’t have a standard usb video input, so you’re going to need to do a bunch of awkward driver work to get applications to consume the video feed. Second, you’ll have to deal with the lag and jittery video that you get because the camera will almost certainly buffer writes. Then you have to figure out how to get the controller in the SD reader to understand the incoming writes, which it was most certainly not designed to do.
- ISL 4y agoDoes this yield "clean" output, without framelines/exposure data, etcetera?
- rahimnathwani 4y agoThat's only an issue when you're using HDMI out, no?
- ISL 4y agoNot sure, that's why I asked. I can imagine some tethering rigs send over the camera live view by default.
- vdchuyen 4y ago
- carlbarrdahl 4y agoPlayed around with this earlier this year. You can also use it in a browser: https://web.dev/porting-libusb-to-webusb https://web.dev/porting-libusb-to-webusb
- enviclash 4y ago
- chrismorgan 4y agoMy experience of this general approach with a Sony α6100: high and inconsistent latency (mostly 150–200ms, but sometimes towards 400ms), low resolution (1024×576), largely not hot-swappable (most apps required that the video device be created before their process began, and trying to read from it without also starting the stream would often poison things in some way, and various actions would make the pieces just stop working together until you restart all relevant processes), and interacts poorly with other similar things (e.g. I failed to get it to combine with OBS’s virtual camera output: no matter what I did, even with creating multiple devices and attempting to control which thing wrote to which, they’d still get tangled so that neither was of any use). Still, the image quality is good, considerably better than most webcams. (It’s valuable to understand how this approach works: it’s using PTP, which supports roughly the commands “list the files you have” and “give me the file IMG0001.JPG”, and roughly thirty times a second it asks “give me the file ‹what the camera can currently see›.jpg”, and the video stream is that stream of JPEGs. Basically, this whole thing is a dreadful hack.) By contrast, the cheap USB HDMI capture card I subsequently purchased (branded Simplecom DA315, but if you’ve looked into this stuff you’ll immediately recognise it as ODM hardware sold under a million brands) supports higher resolutions, normal latency (vastly lower), is hot-swappable, and doesn’t interfere with anything else trying to use v4l2loopback. Colour is not quite right, so I adjust it a bit on my camera. (This was something that surprised me when I first looked at HDMI capture cards: it seems that they’re all wrong, in differing amounts and directions. I do not understand why they can’t just be correct.) And there’s an aspect ratio problem where apps that request a lower resolution end up with the 16:9 image squashed to 4:3 with black bars added to the side. Not sure if this is a bug in the HDMI capture card firmware, Linux driver, or something else. As a demonstration of this, Google Meet in Firefox will get squished by default, but if I manually change its send resolution from auto (360p, I think) to 720p, it gets unsquished.
- davidinosauro 4y agoI also tried a similar setup (with gphoto2 getting the stream of jpegs, ffmpeg, loopback device) but the deal breakers for me we're: - high latency: in the half-second range, consistently out of sync with the audio - bulkiness: I had to place the camera on the side of the screen rather than on top, so I consistently looked away from the camera With that experience I didn't find it worth to upgrade the setup (with mini HDMI cable, capture card, power supply) and ended up buying a crappy webcam instead
- deanc 4y agoHow does using a DSLR affect camera lifetime? The sensor is presumably consistently exposed?
- kuon 4y agoIt is fine. I have been using an "old" canon EOS 1000 for a few years now. But I use an HDMI capture card with magic lantern running on the camera to get a clean HDMI feed.
- deanc 4y agoWhy do you need magic lantern for that? HDMI capture card would presumably work with stock firmware? I’ve also tried using my old 600d but with the canon provided software and it works pretty okay.
- InvaderFizz 4y agoMagic lantern to remove shutter speed and other menu overlays from the hdmi feed, might also enable long duration HDMI output without the camera going to sleep.
- wereHamster 4y ago… exposed to light. It's still enclosed in a dust-free environment. I'd say unless you shine laser beams directly at the sensor, or point it directly at the sun all day it'll be fine for many years. Also, some (or most / all?) cameras will close the shutter curtain when disabled. Presumably you would enable the camera only when you need it.
- happymellon 4y agoWhat's really interesting is Entangle. https://entangle-photo.org/ https://entangle-photo.org/ It works with a lot of DSLRs, it doesn't require you to do any of these steps, and it captures the output. The only thing it doesn't do is then map that to an output for other applications to pick up. There is an open request for this, but it seems to be out of scope for the application. https://gitlab.com/entangle/entangle/-/issues/68 https://gitlab.com/entangle/entangle/-/issues/68 It could be really neat if this solves the EOS webcam issue in a tidy way.
- nicolaslem 4y agoWith a setup like this, I imagine that the camera is far enough from the center of the monitor to make having "eye contact" impossible. Any solution to this problem?
- ycombinete 4y agoI would love such a soultion. I use my old iPhones as webcams. The Picture quality amazing! But I use a selfie-tripod as a mount, and it has exactly this problem.
- derekja 4y agoBuild a teleprompter. Can see mine in this video https://vimeo.com/512716025 https://vimeo.com/512716025
- yrro 4y agoI wish v4l2loopback was included in the kernel. I've wasted far too much time messing about with DKMS in the past that I now avoid any out-of-tree modules if I can avoid it. And with Secure Boot they become untenable. To be fair there is an issue tracking progress - https://github.com/umlaeute/v4l2loopback/issues/268 https://github.com/umlaeute/v4l2loopback/issues/268 - but it's had no updates in 18 months.
- voltagex_ 4y agohttps://github.com/umlaeute/v4l2loopback/issues/268#issuecomment-708398938 https://github.com/umlaeute/v4l2loopback/issues/268#issuecom... specifically.
- ofrzeta 4y agoI did this but a kind of showstopper was the fully opened aperture in liveview mode that lead to a very shallow depth of field. With my 30mm lens we are talking about centimeters (inches). I never figured a way around this.