GNOME Bugzilla – Bug 519935
New plugin for video capture on Windows
Last modified: 2008-08-24 22:10:34 UTC
Please describe the problem: I'm attaching a patch that adds a new element called 'ksvideosrc' that uses Windows Kernel streaming for capturing video. It's the lowest level API for capturing video on Windows, meaning you get tighter control of the capture process than if a higher-level interface like DirectShow was used. The element started out as a quick 'n dirty one evening hack, and although it has matured a bit since then it still could need some loving, like: - gtk-doc comments in the header files - Make private class members private - Implement the drift compensation (see comments in code) - Look into providing a clock that uses KS - Implement PropertyProbe interface Unfortunately I'm not able to provide autofoo for the patch because we're using a custom MSVS toolchain on Windows, but contributions are of course most welcome. The plugin is trivial to build and requires no special magic. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 106402 [details] [review] First take.
Created attachment 106405 [details] [review] And also remember to update configure.ac Note that the provided autofoo is just so that 'make dist' will include all the files -- would be awesome if someone with cygwin and/or mingw could add the missing bits and pieces, and if someone using the upstream MSVS .vcproj-files in win32/vs*/ could add one there as well. :)
Hi, Nice! I am intereted to test it but I did not see it in cvs gst-plugins-bad/sys. Maybe cvs will be updated later. By the way, I have a question about vscc.OutputGranularityX vscc.OutputGranularityY. It seems that you did not used it. I am ok, it is not very important, because it could be strange to use : ... ! video/x-raw-rgb, width =720, height= 575 ! .... 575 instead of 576, but It could happen. I used it in the dshowvideosrc element http://bugzilla.gnome.org/show_bug.cgi?id=517203 (not validated yet, but I am waitting for admins reactions) and I really think that a new GST_TYPE is needed: GST_TYPE_INT_RANGE_STEP. Instead of using GST_TYPE_INT_RANGE for the gstcaps width and height. And here step is the granularity. What do you think about it? More important, in the gst_ks_video_src_fixate you set the video size and framerate as a constant, 352, 288, 15/1. I do not know if Windows Kernel streaming API can give the default video size and framerate but with directshow it is possible. And I experiment it in http://bugzilla.gnome.org/show_bug.cgi?id=517203 .c attached file. Because if 352 and 288 are not supported by a device, the following command line will failed : gst-launch ksvideosrc ! ffmepgcolorspace ! directdrawsink I 'll test your element as soon as I see it in cvs. Julien
OutputGranularity{X,Y} is indeed interesting, I'll see if I can look into that later. (Will probably be hard to find a device to test it with though.) I'm aware of the fixate function fixating to caps that might not be supported at all, I'm going to investigate how to query for the device' preferred resolution and framerate with KS when I find some time. Thanks for the feedback!
I'm finally back on track with this plugin, so I'm hoping to submit an updated patch once I get the current list of issues sorted. Right now I'm working on improving camera compatibility, improve the timestamping (correct against drift), and then look into the default video size and framerate querying.
Hi, nice, gogo :P
Created attachment 117318 [details] [review] winks_plugin Final version of the patch. Has been tested with a bunch of cameras and seems to be working quite alright. (No known compatibility issues.)
* configure.ac: * sys/Makefile.am: * sys/winks/Makefile.am: * sys/winks/gstksclock.c: * sys/winks/gstksclock.h: * sys/winks/gstksvideodevice.c: * sys/winks/gstksvideodevice.h: * sys/winks/gstksvideosrc.c: * sys/winks/gstksvideosrc.h: * sys/winks/kshelpers.c: * sys/winks/kshelpers.h: * sys/winks/ksvideohelpers.c: * sys/winks/ksvideohelpers.h: New plugin for low-latency video capture on Windows (#519935). Uses Kernel Streaming, the lowest level API for doing video capture on Windows (more or less just raw ioctls).