We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › New Cross-platfrom JMC Video Library Available
Pages: 1 2 3 4 5 
New Cross-platfrom JMC Video Library Available (Read 24258 times)
Re: New Cross-platfrom JMC Video Library Available
Reply #30 - Mar 6th, 2009, 3:43am
 
Hi: I read the whole thread. I get the same exception:

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: com.sun.media.jmcimpl.plugins.directshow.DShowEngine.ndsInit()Z

at com.sun.media.jmcimpl.plugins.directshow.DShowEngine.ndsInit(Native Method)

at....

I follow up all replies. My config:
WXP SP3
JDK 6u12
JFX 1.1
P5 1.0.3
K-LITE 4.7.0 FULL

GSVideo doesn't work either.
I've got two XP systems in the same HD. The windows installation I'm currently developing is located in:

H:\WINDOWS.0\
H:\Program Files_2\

does it have something to do?

Everything else work fine on both installations.
Tryied jmcvideo on the other installation and got the same.

Any thoughts?
thank you very much !

diex


Re: New Cross-platfrom JMC Video Library Available
Reply #31 - Mar 6th, 2009, 6:24am
 
@thomas_omaley

hi, what format are you trying to play? and where is your video file located? It needs to be in the data path for your sketch. do the basic "loop" demos work? If they do, then just use those as a template. if not, then I'm not sure what is going on... you might want to try different formats and see if you can get them to work. The .wmv format should definitely work on xp even without the codecs installed.

hth, Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #32 - Mar 7th, 2009, 4:06pm
 
Hi Angus:
Yeah... thats what I think but it doesn't work and I cant figure out what's going on.
Examples doesn't work either. Sketches not even starts due to the exception.
Don't you think something could be happening related to the windows installation issue I posted? I mean because of the UnsatisfiedLinkError. I don't know how java reads file paths. One hypothesis could be that something is scrambled in the windows registry.
It's that possible?
I tryed .MOV (DV), .flv, .wmv and nothing.

I'll keep on trying


regards !
d
Re: New Cross-platfrom JMC Video Library Available
Reply #33 - Mar 7th, 2009, 4:31pm
 
GOT IT !!

Absolute unix-like (backslashed) path:

"C:/processing-1.0.3-expert/sketchbook/VideoLoop/data/angrycat.flv"

dataPath("angrycat.flv") doesn't work.
so the question now is how can I make a portable application?
Smiley

thanks !
d
Re: New Cross-platfrom JMC Video Library Available
Reply #34 - Mar 8th, 2009, 3:29am
 
Hey am having trouble running a sketch - its only running bout a third of the time, i keep getting an array out of bounds error
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!

or it just comes up as a black square behind the bubble.
Just been running it on vista home basic with a variety of different formats .mov .avi etc same problem.

My problems at the moment are

1.How to get multiple videos in without crashing the system-
  need to get 2 live streams and 2 .mov files.
2 How to blend the video within the bubble using a mask png to cover the edges.

Appologies for the messy code

import jmcvideo.*;
JMCMovie myMovie;

Bubble mybubble;
PImage bubble;
PImage img;
PImage cover;



void setup() {
  mybubble = new Bubble();
  size (600, 600);
  bubble = loadImage( "bubble_big.png");
  img = loadImage("airport2.jpg");
  cover = loadImage("bubble-mask2.png");
  myMovie = new JMCMovie(this,"angrycat.flv");
  myMovie.loop();

}

 void movieEvent(JMCMovie myMovie) {
 myMovie.read();
}

void draw (){
  background(0,0,250);
  mybubble.move();
  mybubble.display ();
}

 
 class Bubble { //define class
 float xpos;  // variables
 float ypos;
 float xspeed;
 
 Bubble() {  //constuctor
 
 xpos = width/4;
 ypos = height/4;
 xspeed = 1;
 }
 
 void display() {   //function
 img.mask(cover);
 //image(cover, xpos,ypos,200,200);
 image(img, xpos, ypos,100,100);
 //bubble.blend(img,0,0,100,100,0,0,100,100,ADD);
 image(bubble,xpos,ypos,100,100); // Draw image
 }
 
void move() {  //function
 xpos = xpos + xspeed;
 if (xpos > width) {
 xpos = 0;
 }
 }
  }
Re: New Cross-platfrom JMC Video Library Available
Reply #35 - Mar 9th, 2009, 1:31am
 
//Is it possible to use an url with JMC video?

//I can do this with the quicktime library

//This results in an error
String VIDEO_FILE = "http:/ /www.movie-list.net/classics121807/bladerunner_tsr_h640_ml.mov";

//Note. remove the space between http:/ / ...
//this was done to prevent auto weblinking in the post

vid = new JMCMovie(this, dataPath(VIDEO_FILE));

//This works
vid = new JMCMovie(this, "trans1.mov");

/*
trans1.mov is located in the data folder of the sketch, however the url only seems to work with the quicktime library. I have had better experience with JMC over the last few days as it gives me a wider range of formats to choose from.

I would like to take the movies straight from the url as it would change based on user input. Is this possible or use the quicktime libraries only for URL videos ?
*/
Re: New Cross-platfrom JMC Video Library Available
Reply #36 - Mar 9th, 2009, 2:42am
 
@owaun

Hi, yes it is possible to stream videos over http using the jmcvideo library. I've posted an example in this thread. Basically you just need to pass in an URL instead of a String. I was able to stream flv, mov, and ogg using OSX. You'll need to use the VideoGL class at the moment (which is faster anyway). I will be making an update which lets you use the PImage version (JMCMovie) class over http as well, but I want to investigate some possible memory leaks before I make the next update available.

@ekinsy

Hi, the code/vid for MoviePainter by Eric Nguyen might help you with blending/masking a video. It's at: http://mindtangle.net/2009/02/23/moviepainter

I'm not sure what the ArrayIndexOutOfBoundsException is exactly. I'll do some tests with multiple streams and see if I can replicate. Some of my demos are using 4 or 5 movies simultaneously and I haven't noticed any issues (on OSX).

-Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #37 - Mar 9th, 2009, 2:48am
 
@thomas_omaley

Hi, if you want to export an application, you can copy the data folder containing your movie into the exported application folder and then the dataPath("yourmovie.flv") will work as expected.

There is a bug in the JMC which isn't letting videos load properly as resources from a jar file. This is preventing applets from being exported properly. There should be a fix soon. Meanwhile, if anyone has a workaround which will lets jmcvideo work with applets please post to this thread!

-Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #38 - Mar 9th, 2009, 4:15am
 
@spiraljetty

Thanks a lot for the advice. It worked. I also saw your original post in this same very thread and then read your advice above. Tried it and it worked. It finally attempted to load the video and then I had to install the k-lite pack to get the ogg example to use.

In response to the question above of having videos loading issues before the app. Well I tried two methods and they both worked. I experience the same loading times. So I came up with the two methods, however the first one is the most useful. The second is only for the random backgrounds.

Method 1:
Since before I was using JMCVideo, I was using the quicktime library. To get around the loading times. I created a batch file that creates a text file of all the specified filenames in the \Sketch_folder\data\ folder

Example
dir *.jpg,*.png,*.bmp,*.jpeg,*.pct,*.mpeg,*.avi,*.mov,*.mpeg,*.ogg /on /b >files.txt

For this purpose use just media files
Example
dir *.mpg,*.avi,*.mov,*.mpeg,*.ogg,*.mp4,*.wmv /on /b >files.txt

Now you can have multiple file extensions but before I was using the quicktime library, but with JMCVideo I can have all kinds of media files streaming simultaneously.

The second line of the .bat file would be to launch the .exe in the autonamed application.windows folder or whichever folder is created. The batch file can reside directly in the data folder or in the application.windows root folder.. just simply put data\ before the file extensions... however I have found, regardless of the files being in the data folder or in the root folder of the .exe; Processing seems to find them somehow.

Once the sketch is launched the text file can be read line by line and the filenames of the video are in the array. Once they are in the array then can be called at will. As for loading a movie array..this works but I have no control over the pre-loading it takes to put all the movies in the array; which kinda defeats the purpose of the filenames in the array.

One can write a procedure to handle each file based on it's extension. However this is optional.

Method 2
Load a text file <auto generated> or simply typed by hand. Each line would contain the location of each file or movie on the system as well as URL's
Example
1.http://www.movie-list.net/classics121807/bladerunner_tsr_h640_ml.mov
2.c:\movies\park-ride.mov
3.transformers.mov
4.opportunity.jpeg
1 - URL  2-Physical drive location 3. Data folder default 4.Photo (this is where the procedure to determine the files by extension could be useful)

I have found doing this bridges the gap of not having the files embedded in the Application.Windows program. I can add links to movies to an already compiled sketch. Also I have found when I get better at Processing, I can devise a way to dispose of each video after I have looped a pre-determined amount of times. I would like to start loading a specified video so when one movie ends it coincides with the completion of another video. I would like to attain smooth transitions. I have not been able to do it as yet. There is still a visible jump from one movie to the other. I want to get to the point I can fade one movie out and fade the other movie in.

Also I have managed to get the realtime-masking of the background video done pretty well. I have it with multimple videos in the forefront and as the background and backlayer , multiple images in both background, foreground and backlayer and 3D rotational as well. When I click a specified colour of the desired clip, I can optionally change the entire video to the specified hue or simply remove the colour alltogether to reveal the jpeg,bmp, or even the streaming video behind. ALL THIS AND ROTATIONAL as well..PROCESSING ROCKS!

Right now I am trying to get the background as a totally different sketch. However I am only so far able to get  it run as the forefront and using keystrokes to remove layers from it until I can phase into the back sketch.

I LOVE PROCESSING!
Re: New Cross-platfrom JMC Video Library Available
Reply #39 - Mar 18th, 2009, 9:30pm
 
Hi Angus, this library seems really useful! Just trying it out now, massive improvement on the built in Processing movie library. One quick question -- how do you play a video and make it *not* loop by default (just stop playing when it finishes playing)?

Also, it's cross-platform, so does that mean I can "Export Application" for windows from Mac OS X and it'll run on a win PC?
Re: New Cross-platfrom JMC Video Library Available
Reply #40 - Mar 19th, 2009, 12:07am
 
@pcho

Hi, thanks. You can use play() instead of loop() and the video will stop at the end of playback instead of looping. You can also use bounce() to have it reverse playback (only works with some formats).

Processing's export application will let you specify which operating systems you want to export to. However, you will have to copy in the native files for each distribution. For instance if you create the sketch on OSX and want to export to Windows, you will have to replace the .jnilib files with the .dll files from the jmcvideo windows distribution. Also, you will probably have to copy in the data folder to the application directory. If you need more details let me know.

HTH, Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #41 - Mar 19th, 2009, 12:20am
 
@spiraljetty

Thanks Angus -- I'm finding that when I use play() it still loops the video. I'm getting looping behavior when I run the examples that use "play" as well (like VideoGrains -- when it reaches the end of the video, it loops to the beginning again). I'm on Mac OS X.
Re: New Cross-platfrom JMC Video Library Available
Reply #42 - Mar 22nd, 2009, 11:03am
 
Hi,

I've made a series of bug fixes and updates to jmcvideo largely in response to the helpful comments on this thread. It is now hosted on github if you want to look at the source code or clone the project. The "switchVideo" methods are all working, the memory leak is fixed, the play/bounce/loop methods all do what they are supposed to, there are constructors for videos named by URL, URI, File, or String, and I've made the methods for the PImage version and the openGL version more similar. There are some slight syntax changes, so take a look at the basic demos (VideoLoop and VideoLoopGL) for examples. The main one is that "VideoGL" was refactored and is now named "JMCMovieGL".

git://github.com/angusforbes/jmcvideo.git

http://www.mat.ucsb.edu/~a.forbes/PROCESSING/jmcvideo/

-Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #43 - Mar 23rd, 2009, 2:15am
 
Hi,
Thanks for make linux-video in processing better!!!

I have debian, i download the last version of JMC from git.

I run the example "VideoLoop" ok.
But i can not run your example: "VideoLoopGL" (and i need the OpenGL render for my project)

When i run the sketch i get a white screen and the window crash without errors.

My question is:

It's possible to use the JMCMovie object inside the Opengl renderer? (I get the same error if i use JMCMovie inside a sketch with size(x,y,OPENGL) )

Thanks.
Re: New Cross-platfrom JMC Video Library Available
Reply #44 - Mar 23rd, 2009, 3:31am
 
@lot

Hi, I haven't tested at all on any linux platform except for ubuntu 8.04. VideoLoopGL *should* work fine on Ubuntu (and Windows and OSX). I am also able to run the VideoLoop sketch using size(w,h,OPENGL) as well as size(w,h,P2D). It doesn't sound like it's a codec issue since the PImage version is working for you. Do other JOGL/openGL projects work for you? Let me know if you are able to resolve this.

-Angus
Pages: 1 2 3 4 5