GNOME Bugzilla – Bug 521755
Should allow using a camera as webcam
Last modified: 2010-01-06 16:06:06 UTC
It should be possible to use certain cameras as webcams, and control the shutter from cheese. I see libgphoto2 has capture, and capture_preview fields for some cameras: http://www.gphoto.org/doc/api/struct__CameraFunctions.html Maybe this could be implement in gvfs' libgphoto2 backend, to avoid cheese conflicting with the mounts.
not sure how gvfs works, but this might be possible.
Yeah, it would be useful with some kind of way to do this so the device won't have to be unmounted. Am not sure the best way; maybe opening a special file gphoto2://[usb:001,042]/.capture will be sufficient? If we need to specify parameters it could be done like a HTTP request, e.g. gphoto2://[usb:001,042]/.capture?type=image (ditto for /.capture-preview probably) Then you'd open this file for reading and we'd return the captured image. Would be pretty easy to implement this in the gvfs gphoto2 backend I think. Thoughts?
I'd rather use a name that wouldn't be allowed on a FAT filesystem, so we can be certain that it won't exist. Also, appending the suffix depending on the type of data would be useful. gphoto2://[usb:001,042]/%3Acapture.jpg gphoto2://[usb:001,042]/%3Acapture.mjpeg or something. Does anyone actually have a camera that supports that? :)
http://www.gphoto.org/doc/remote/
what about using gstreamer for that?
is it ok for you to move the bug forward to gstreamer?
Moving back to gvfs, it should be implemented there.
Hi, I just stumbled over this bug while looking for another gvfs-gphoto2 bug. I think this should be closed as not a bug. As you may know I'm a contributor to various kernel side webcam drivers, and we (v4l kernel upstream and libgphoto2 upstream) have been working on supporting the webcam mode of so called dual mode cameras for a while, also see: https://fedoraproject.org/wiki/Features/BetterWebcamSupportF13 webcams really should not be represented as some mjpg file in gvfs. These devices are streaming devices! So the file size would be unknown (as would be the the length of the "movie" to put inside the mjpg file, and the framerate, as webcam framerates are not constant). And webcams can do multiple resolutions, and have things like contrast and brightness controls. IOW a plain file interface is simply not suited for this. And guess what ? We already have an API for this it is called video4linux and Theodore Kilgore (a libghoto2 dev) has been working on adding kernel drivers for the webcam mode of these devices. This has to be done inside the kernel as v4l is a kernel API for /dev/video devices, and many of these cams use USB isynchronious mode which is hard to do from userspace. Making these cameras function as regular v4l devices also means that all existing webcam applications (ie cheese) will just work with them. Note there is currently a gvfs bug which is getting in the way of the kernel drivers, as gvfs does not properly re-attach the kernel driver to the device on unmount (which it causes to detach when mounting the device), I've a patch for this, see bug 521755 . Regards, Hans p.s. I can't help but adding a note here that when you guys make plans like this involving webcams and / or libgphoto2 that it would be could to discuss this with the involved upstreams (linux-media mailing list for webcams, gphoto2 mailinglist for gphoto2), and preferably do so while things are still in the planning phase.
That was supposed to be a "useful hack". Having the drivers for this in the kernel is obviously a much better idea.
(In reply to comment #9) > That was supposed to be a "useful hack". Having the drivers for this in the > kernel is obviously a much better idea. Yeah, I completely agree.