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 519935 - New plugin for video capture on Windows
New plugin for video capture on Windows
Status: VERIFIED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Windows
: Normal enhancement
: 0.10.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-02 16:53 UTC by Ole André Vadla Ravnås
Modified: 2008-08-24 22:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
First take. (76.23 KB, patch)
2008-03-02 16:55 UTC, Ole André Vadla Ravnås
none Details | Review
And also remember to update configure.ac (292 bytes, patch)
2008-03-02 17:12 UTC, Ole André Vadla Ravnås
none Details | Review
winks_plugin (114.03 KB, patch)
2008-08-24 21:47 UTC, Ole André Vadla Ravnås
committed Details | Review

Description Ole André Vadla Ravnås 2008-03-02 16:53:23 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:
Comment 1 Ole André Vadla Ravnås 2008-03-02 16:55:04 UTC
Created attachment 106402 [details] [review]
First take.
Comment 2 Ole André Vadla Ravnås 2008-03-02 17:12:02 UTC
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. :)
Comment 3 Julien Isorce 2008-03-02 20:21:45 UTC
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
Comment 4 Ole André Vadla Ravnås 2008-03-07 01:17:48 UTC
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!
Comment 5 Ole André Vadla Ravnås 2008-07-30 23:13:12 UTC
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.
Comment 6 Julien Isorce 2008-07-31 07:28:19 UTC
Hi, nice, gogo :P
Comment 7 Ole André Vadla Ravnås 2008-08-24 21:47:35 UTC
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.)
Comment 8 Ole André Vadla Ravnås 2008-08-24 22:10:14 UTC
	* 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).