A new stable release of the GSVideo library for Processing, 0.8, is available for the Linux, Mac OSX and Windows platforms. This version includes important fixes in memory and thread handling as well as new functionality for media playback and video capture. Follow this link to download the library packages, or keep reading for more details.
Thanks to the work of the Data Arts team at Google Creative Labs (Jono Brandel, George Brower, and Aaron Koblin), which used GSVideo to make a touchscreen video gallery based on the Life in a Day movie, I detected some memory leaks that affected the library when recreating moving objects. Specifically, the following code:
GSMovie movie = new GSMovie(this, "clip1.avi"); ... movie.delete(); movie = new GSMovie(this, "clip2.avi");
would result in the memory used by the first video not being properly disposed. This leak was not noticeable when using a small number of video objects, but in the case of the LIAD installation, thousands of videos needed to be continuously played back over a period of several days, which made the leak apparent. This issue has been solved in this new stable release.
Below you can see a documentation video of the LIAD touchscreen gallery, shown during the Sundance Film Festival this year as part of the Life in a Day premiere. The installation is now being exhibited at the YouTube Symphony event in Sydney, Australia.
Charl Botha found the solution for random crashes that often occurred when capturing live video using the GSCapture class. His patch is now part of the 0.8 release. The issue was caused when different threads tried to access the same video buffer. Although this seemed to affect only the video capture, I applied the improvement contributed by Charl to all GSVideo classes, not only GSCapture. So if you were experiencing random crashes with the GSMovie, GSPipeline or GSPlayer classes, then this release might solve them as well.
Local library path
The GSVideo package for Mac OSX and Windows comes with the GStreamer libraries bundled with it. They are located in library/gstreamer/macosx or library/gstreamer/win. However, in certain situations it could be convenient to place the GStreamer libraries in a different local folder. For this purpose there is a new static variable that controls the specification of this folder:
GSVideo.localGStreamerPath = "/Users/gst/libraries/gstreamer/macosx"; movie = new GSMovie(this, "clip.avi");
This variable also comes handy when using GSVideo from an Eclipse project, to give more flexibility to the placement of the native libraries. Thanks to Charles Bourasseau for his suggestions and code about this issue.
- The GStreamer libraries bundled in the Snow Leopard 64 bits package include a new capture plugin called qtkitvideosrc, based on the QTKit media framework for OSX. At this point, the qtkitvideosrc plugin is accessible only through the GSPipeline object, but it will be automatically used in GSCapture as well as it becomes more mature.
- The GSPlayer and GSPipeline classes introduce a new RAW mode that allows to grab the video or audio frames from the stream right after decoding and without any additional transformations (color conversion, for example), just as a byte arrays for custom processing within the Processing sketch itself. Please check the Pipelines/Raw and Player/Raw examples for further details.
- The GSMovie class now has an additional jump() method for moving into a specific frame in the video. It also adds the length() and frame() methods to query the total duration of the media measured in numer of frames, and the current frame, respectively.
- Several enhancements and simplifications in the API of all the classes, as well as many bugfixes. Please check the online API reference and release notes for more information.