|
|
|
|
The jmcvideo library is a wrapper for playing videos and grabbing video data for any of the formats that the JMC library supports. It works on Windows, OSX, and Linux, using native bindings when possible. The framerates for playback are very fast, up to 300fps fullscreen for multiple YouTube quality .flv videos playing simultaneously. There are two versions of the library, one that interfaces with Processing and one directly for Java using the Java openGL bindings.
The Processing version can be used as a replacement for the current Processing video library (which is itself a wrapper for the QuickTime For Java library and which doesn't seem to work in OS X 10.5.6). The library includes two renderers, JMCMovie, which is an extension of PImage, and operates exactly like the Processing Movie library, and JMCMovieGL, which is faster and stores the video data in an openGL texture and contains some specialized drawing methods.
The newest version of the library has been tested extensively on Mac (OSX 10.5.7). Previous versions were tested using various formats on Mac (OSX 10.5.6) as well as Linux (Ubuntu 8.04) and Windows (XP SP2 & Vista Home Basic). Please let me know if other formats are supported and I will update the following usage matrix:
| OSX | video? | sound? | backwards? | streaming? | codecs? |
| .mov | yes | yes | yes | yes | no |
| .flv | yes | yes | yes | yes | no |
| .ogg | yes | yes | ? | ? | xiph |
| .3gp | yes | yes | yes | ? | no |
| .avi | yes | no | no | ? | no |
| .mp4 | yes | yes | no | ? | no |
| Windows | video? | sound? | backwards? | streaming? | codecs? |
| .wmv | yes | yes | ? | ? | no |
| .mov | yes | yes | yes | yes | no |
| .flv | yes | yes | yes | yes | k-lite |
| .ogg | ? | ? | ? | ? | ? |
| .3gp | yes | yes | yes | ? | no |
| Ubuntu | video? | sound? | backwards? | streaming? | codecs? |
| .flv | yes | yes | yes | yes | no |
| .ogg | yes | yes | ? | ? | no |
| .mov | yes | yes | yes | yes | no |
downloads for Processing
jmcvideo.jar - For all platforms.
VideoLoop - Plays a short video in a loop using a PImage.
VideoLoopGL - Plays a short video in a loop using an openGL texture.
VideoURL - Streams a movie trailer over http.
VideoBounceGL - Plays a video backwards and forwards between specified points in the video.
VideoJogGL - Plays a video, allowing the user to interactively seek within the video.
VideoSpeedGL - Plays a video, allowing the user to interactively change the speed of playback.
VideoSwitchGL - Demonstrates how to switch between multiple videos.
There are also some older jmcvideo 1.1 demos, which demonstrate different video effects and may or may not work on all platforms. I haven't updated them yet for jmcvideo 1.2, but most likely they work with a few minor changes.
Please feel free to contribute to the demos section by sending me any code or links to my email or by posting on the jmcvideo thread on the Processing forums.
Browsable javadocs can be found here.
source code and git repository
You can browse the source code online here or clone the project from github like so:
> git://github.com/angusforbes/jmcvideo.git
1) Create the jmcvideo library folder in your Processing sketch folder. For example, on OSX it will look something like this:
On other platforms it will look similar.
2) Download jmcvideo.jar from this site and put it in the jmcvideo library folder. For example, on OSX:
3) Download JavaFX 1.2 for your platform from the javafx.com site. Find the appropriate JMC files and copy them into the jmcvideo library directory you have created. For example, for OSX you will need the following files:
/Library/Frameworks/JavaFX.framework/Versions/1.2/lib/desktop/jmc.jar
/Library/Frameworks/JavaFX.framework/Versions/1.2/lib/desktop/jmcServerDaemon
For Windows, you will need to find the files jmc.dll and jmc.jar. For Linux, you will need to find the files libGStreamer.so and jmc.jar.
The jmcvideo library folder for OSX, for example, will then contain the following files:
jmcServerDaemon
jmcvideo.jar
libCoreVideoSupport.jnilib
4) Add "import jmcvideo.*;" to any of your programs that use the jmcvideo library. See the demo sketches above for examples.
Feel free to make suggestions or point out bugs by emailing me at angus.forbes@mat.ucsb.edu or better yet through posting in the "JMCVideo 1.2" thread on the Processing forums.
A number of modifications have been made from the previous version to this version. Thanks to everyone who emailed me suggestions or pointed out issues on the Processing forums.
- The dispose method works properly.
- Streaming video is improved.
- CPU usage is minimized.
- The Processing pixel format and the openGL texture format are available.
- The "repeat" and "bounce" functionality work correctly.
- The seek resolution is better (before it was limited to 1 second intervals, now
you can specify time at arbitrary resolution to jump to individual frames).
- Ability to set up start and stop markers to control looping or bouncing at specified points.
- Simpler demos to illustrate jmcvideo functionality.
- Ability to grab download progress.
processing - open source programming language
javafx - javafx sdk download
jogl - java bindings to opengl
gsvideo - another cross-platform video library
pushing pixels - great blog entry about JMC
informIT article - list of function signatures for JMC
kochobisexual - some video samples were recorded on my cellphone at a kocho show in NY
heat death - some video samples were recorded at a heat death show in Santa Barbara
angus forbes - my portfolio