After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 521755 - Should allow using a camera as webcam
Should allow using a camera as webcam
Status: RESOLVED NOTGNOME
Product: gvfs
Classification: Core
Component: gphoto backend
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2008-03-11 12:13 UTC by Bastien Nocera
Modified: 2010-01-06 16:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2008-03-11 12:13:19 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.
Comment 1 Marcus Meissner 2008-03-11 15:20:02 UTC
not sure how gvfs works, but this might be possible.
Comment 2 David Zeuthen (not reading bugmail) 2008-03-11 17:16:15 UTC
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?
Comment 3 Bastien Nocera 2008-03-11 17:21:52 UTC
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? :)
Comment 4 Hubert Figuiere (:hub) 2008-03-11 18:05:52 UTC
http://www.gphoto.org/doc/remote/
Comment 5 daniel g. siegel 2008-03-12 14:39:43 UTC
what about using gstreamer for that?
Comment 6 daniel g. siegel 2008-04-02 03:01:59 UTC
is it ok for you to move the bug forward to gstreamer?
Comment 7 Bastien Nocera 2008-05-15 23:48:07 UTC
Moving back to gvfs, it should be implemented there.
Comment 8 Hans de Goede 2010-01-06 11:41:32 UTC
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.
Comment 9 Bastien Nocera 2010-01-06 14:06:58 UTC
That was supposed to be a "useful hack". Having the drivers for this in the kernel is obviously a much better idea.
Comment 10 David Zeuthen (not reading bugmail) 2010-01-06 16:06:06 UTC
(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.