I followed the instructions in your post, and (Although it didn't work upfront) gave me the will to make it work ;)
Little advice: I fixed my set up by finding the correct v4l2 device, because video0 was already assigned. If you run:
v4l2-ctl --list-devices
it will tell you where v4l2 is plugged in your machine, in order to enter the correct command (That was the only part missing for my puzzle) as if you already have a webcam in your computer it will already /dev/video0 assigned, and the gphoto | ffmpeg piping gives too cryptic messages (It complains about the formats not being correct, while it should complain about it not being a v4l2 device)
I mostly shoot with my cell phone these days, not because I mind spending money on cameras, but because it's a better device for most photography. It integrates with the world. Cameras integrate with their manufacturer's closed ecosystems.
brew install gphoto2
brew install ffmpeg --with-ffplay
gphoto2 --abilities
# Abilities for camera : Sony Alpha-A6300 (Control)
# ...
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f matroska - | ffplay -
I'm piping it to ffplay,so this will at least let you test your camera or you could also use it in OBS as a window source. Also, make sure your cameras usb mode is not set to "mass storage" but to a “Remote Camera Control”. $ brew install ffmpeg --with-ffplay
Usage: brew install [options] formula
# Install flags here, nothing about --with.
Error: invalid option: --with-ffplay gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f matroska - | gst-launch-1.0 fdsrc fd=0 ! decodebin ! videoconvert ! videoscale ! autovideosinkit should be,
osxvideosink
I wonder if this works, gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f matroska - | gst-launch-1.0 fdsrc fd=0 ! decodebin ! videoconvert ! videoscale ! osxvideosinkhttps://apple.stackexchange.com/questions/353168/how-can-i-c...
https://cascable.se/pro-webcam/
Compatibility table:
First of all, it works! And it's pretty cool to not need a capture card. But, for most cameras, you only receive at the resolution of the on-camera screen.
In other words, the video stream gphoto2 receives is intended for a camera remote preview screen. Check your camera's resolution before investing in this as a solution -- my very expensive 4k @ 60fps-capable mirrorless camera only produces a pretty poor 640x480 @ 50fps stream using gphoto2.
Additional video recording features like flicker reduction or IS seem to be lacking through this method as well.
In the meantime, I'm patiently awaiting the delivery of my 4k capture card :)
I've been looking for something that does this for a while now, WFH on the Mac Mini without a camera or mic is just dreadful :(
- https://obs.camera/ (which seems to be the most promising)
- https://www.newtek.com/software/ndi-camera/ (mentioned in a forum)
- and EpocCam https://www.kinoni.com/ (from the answer below)
I'll leave these here for people who stumble upon this answer, but if you were talking about another alternative I'd love to know about it. For now I'll give OBS.Camera a go and see if I like it. Thanks!
Pretty sure it “just works”.
Will give this a shot, luckily I'm still in the return window.
E: Works great! Make sure to enable "PC Control" in settings for other Sony cameras. I had it set to USB Mass Storage (which is maybe the default?)
Additionally, many camera features (flicker-reduction, electronic shutter options) are unavailable through this method.
This is really equivalent to a camera remote preview video, not intended to be used for actual video capture.
It work perfectly and the virtual camera can be used with Jitsi, BigBlueButton and the likes :).
And yeah, 100% agree on video quality, it is so much better than what you get from that potato sensor on MBP
Plan to give it a go later tonight but wondering if anyone has any success stories.
[0]https://sourceforge.net/p/gphoto/mailman/message/36174298/
It’s unclear if that’s the list of supported cameras or if it’s a list of cameras and only those with entries in the next two columns are supported.
Either way I can’t wait to get home and mess with it.
edit: forgot to mention that this works over USB, you don't have to pay crazy markup for capture card
edit2: (because I'm so excited about getting this to work) here is a list of supported cameras[2] - sadly I was not able to get GoPro Hero 6 to work.
[0] https://www.crackedthecode.co/how-to-use-your-dslr-as-a-webc...
[1] https://news.ycombinator.com/item?id=23325143
[2] http://www.gphoto.org/proj/libgphoto2/support.php