Live data from Hacker News

How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

tomoliver.net

51–60 of 67 posts

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#51

Earlier quoted context omitted.

The problem with buying a webcam proper is that the industry has reached a "good enough" point where manufacturers will re-release essentially the same camera with no real improvements in resolution, hardware, or software. I bought a Logitech webcam during the pandemic. Imagine my surprise when the webcam resolution was worse than the one built into my XPS 13.

This is frustrating, I thought that the pandemic was going to create a demand for high quality webcams. I'd settle for a 4K phone quality. I bought the Logitech Brio thinking I'd get better picture than my phone (since it's a dedicated camera), which was a bit of a disappointment. I don't think it's terrible, but I had higher expectations of it.

thats exactly how i feel over the brio, picture is greate but i hoped for more

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#52

Earlier quoted context omitted.

Normally you can leave live view (768x512 resolution, 0.4 MP in this case, usually not much higher for modern cameras) running indefinitely. Besides the low resolution especially on older cameras the readout for live view will use pixel skipping to conserve power at the expense of quality. This is why "the pro streamers" don't use the live view image, but instead go the HDMI-to-UVC route using the camera's video mode…

Unfortunately most cameras do not provide "clean" HDMI output. That is, the HDMI output contains camera UI symbols like focus points, battery state, lighting, etc. Configuration options to disable those UI symbols are generally not available, at best one can disable some of them. A model with "clean" HDMI is usually more expensive and you have to explicitly look for it as a feature. Live view readout via USB is somet…

You can sort-of "clean" whatever output you get from your camera because the symbols are typically around the periphery. Adjust focus+zoom so that your subject is within the rectangle that doesn't have symbols, take the camera output and put it through OBS with a crop filter and you've got something that's clean.

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#53
post #18
post #16

whole guide about using some gphoto software, yet not a single link in article btw it's only for Linux, so don't even bother reading the linked web, if you are in windows http://www.gphoto.org/ Correct title: How to use your DSLR from 2008 as a webcam IN LINUX in 2022 (NixOS) I wished people would not omiss such important information in title when writing articles or linking them wasting everyone's time including ser…

NixOS is Linux

How am I supposed to know that? I assumed it's some special custom firmware/OS for Nikon cameras before opening the link.

You way overestimate popularity and general knowledge of some rare Linux distros even among IT guys.

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#54
post #49

Hmm but what's so wrong with a DSLR from 2008 that he wants to throw it away? Recent cameras may have a lot more pixels but the optics should still be just as good.

MILC's have shorter flange distance therefore more weird lenses can be created. Also they're smaller, lighter, and quieter due to the elimination of the moving mirror.

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#55

Note if the author reads this (perfect is the enemy of good, feel free to ignore): You can make udev run systemd services directly, replacing RUN=... by e.g. TAG+="systemd", ENV{SYSTEMD_WANTS}+="foo.service" That might require you also remove the 'enabled = true' for the service, and make sure gphoto2 dies when the camera is unplugged? Anyway, it was a nice read :)

Using your suggestion I ended up with the following for a Canon 7D:

  services.udev.extraRules = ''
    ACTION=="add", \
    ATTR{idVendor}=="04a9", \
    ATTR{idProduct}=="319a", \
    ENV{SYSTEMD_WANTS}+="external_webcam.service", \
    SUBSYSTEM=="usb", \
    TAG+="systemd"
  '';

  systemd.services.external_webcam = {
    enable = true;
    script = ''
      ${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie |
        ${pkgs.ffmpeg}/bin/ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2  /dev/video0
    '';
    wantedBy = ["multi-user.target"];
  };
Worked first try! [1]

[1] https://gitlab.com/engmark/root/-/commit/ae59aad118e6effcf47...

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#56
post #33

Earlier quoted context omitted.

Which may someday replace Arch in the saying that Arch people never forget to mention they are using Arch :-).

Throughout the article, they use NixOS specific features. You can't really follow this in Arch without installing Nix and changing some parts of the instructions.

Yes but those are fairly straightforward commands that are not really relevant (the post is about using v4l2 and gphoto).

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#57
post #49

Hmm but what's so wrong with a DSLR from 2008 that he wants to throw it away? Recent cameras may have a lot more pixels but the optics should still be just as good.

New cameras are much much better. There's a lot more to quality than just optics and pixels

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#58
post #28

Earlier quoted context omitted.

Can be disabled

Live view auto shutoff can be disabled? No it can't[1], not without modified firmware that either doesn't exist[2] or is only available from sketchy mega uploads[3]. There are other[4] hacky workarounds, but nothing clean. [1] https://www.reddit.com/r/Nikon/comments/c5wjg6/how_to_turnof... [2] https://www.reddit.com/r/Nikon/comments/hqp2wu/any_way_to_tu... [3] https://www.youtube.com/watch?v=gKSY0eEC5gM [4] https://w…

You forgot to specify what camera you use. No need to extrapolate from your camera to all Nikons.

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#59

Earlier quoted context omitted.

The problem with buying a webcam proper is that the industry has reached a "good enough" point where manufacturers will re-release essentially the same camera with no real improvements in resolution, hardware, or software. I bought a Logitech webcam during the pandemic. Imagine my surprise when the webcam resolution was worse than the one built into my XPS 13.

This is frustrating, I thought that the pandemic was going to create a demand for high quality webcams. I'd settle for a 4K phone quality. I bought the Logitech Brio thinking I'd get better picture than my phone (since it's a dedicated camera), which was a bit of a disappointment. I don't think it's terrible, but I had higher expectations of it.

Smartphone's outer camera quality is what every manufacturer invest much now. It looks impossible to compete with, unless the sensor and lens are big.

Re: How to use your DSLR from 2008 as a webcam in 2022 (NixOS)

#60

Coincidentally, I read about the v4l2loopback driver which enables this yesterday. It was in an article about how it it a PITA to get working on Fedora due to the requirement for signed kernel modules. Glad to see it's easier on NixOS. https://dev.to/archerallstars/i-am-no-longer-use-fedora-36-t...

It's in rpmfusion, so pretty much plug and play.
Post reply on HN