This new version of GSVideo introduces a couple of interesting new features. First of all, it implements the capture device listing API, i.e.: the GSCapture.list() method that returns a String array with the names of the available capture devices. GSCapture.list() can be also called passing a String parameter with the name of the source element to use, for example: GSCapture.list(“ksvideosrc”).
The constructor of the GSCapture class has been simplified, so it can take the name of the selected catpure device: cam = new GSCapture(this, 320, 240, “/dev/video0”). In combination with the list method, the following can be done as well:
String cameras = GSCapture.list();
for (int i = 0; i < cameras.length; i++) println(cameras[i]);
cam = new GSCapture(this, 320, 240, cameras);
Another new feature is the possibility of ending a GSPipeline with a filesink element, which allows saving video to file:
pipe = new GSPipeline(this, "ksvideosrc ! queue ! videorate ! video/x-raw-yuv,frame
rate=25/1 ! xvidenc ! queue ! avimux ! queue ! filesink location=test.avi");
There is a windows-only package of GSVideo that includes an entire distribution of gstreamer, so there is no need of a separate gstreamer installation.