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 24259 times)
Re: New Cross-platfrom JMC Video Library Available
Reply #45 - Mar 23rd, 2009, 5:34pm
 
Some times ago I got problems on ubuntu to read videos. Finally I installed the openCV librarie and now it works just great.
Re: New Cross-platfrom JMC Video Library Available
Reply #46 - Mar 23rd, 2009, 11:30pm
 
@NYX @enguyen

Hi, this is in direct response to some queries on the posting on the "How to trace a memory leak?"  


I've recently made a bunch of updates to jmcvideo. Here is the source code for the various switchVideo methods:

Code:

public void switchVideo(String filename)
{
mp.setSource(VideoUtils.toURI(new File(parent.dataPath(filename))));
mp.play();
}

public void switchVideo(File file)
{
mp.setSource(VideoUtils.toURI(file));
mp.play();
}

public void switchVideo(URL url)
{
mp.setSource(VideoUtils.toURI(url));
mp.play();
}

public void switchVideo(URI uri)
{
mp.setSource(uri);
mp.play();
}


The "mp" variable stands for the current MediaProvider. Since creating a new MediaProvider uses native resources, it may be a better idea to reuse a single MediaProvider via the swtichVideo method when you want to start playing a second movie. The bug that didn't let you use the relative dataPath has been fixed. If you want to switch to a video that is not in the dataPath, simply create a File object that points to the video and use that version. You can also use the URL version for local files ("file://") and remote files ("http://").

For example, if you have two videos both stored in the sketch's data folder, you can call the first normally:

Code:

JMCMovie myMovie = new JMCMovie("movie1.mov");
myMovie.play();


And then at some other time you can switch to a new movie using the switchVideo method:

Code:

myMovie.switchVideo("movie2.mov");


Of course you can just make two separate JMCMovie objects as well.

I'll make sure that the "mp" variable is public in the next update so that you can create your own custom versions of switchVideo in Processing.

Also, I believe I have fixed the memory leak that was present in the last version of jmcvideo.

I'd appreciate any testing/feedback about this and any other issues. Thanks! -Angus


Re: New Cross-platfrom JMC Video Library Available
Reply #47 - May 6th, 2009, 6:40pm
 
This is a bit strange, but when I run the two videoloop examples, the normal drawing window comes up, and then a second, smaller window pops open called "Active Movie" that plays the movie just once, then stops instead of looping it.

I'm guessing this isn't normal behavior. Any ideas why this is happening?
Re: New Cross-platfrom JMC Video Library Available
Reply #48 - May 15th, 2009, 1:53am
 
hello,

i'm using the JMC video library, attempting to playback a quicktime movie with a valid alpha channel and getting strange results: either the alpha channel is entirely ignored, or the video frames are like 'piling up' on each other - seems like the alpha channel is being recognized by JMC though the buffer is not getting cleared on every frame.

i've tried the trick of using the very same video file as a mask,

Code:

image(myMovie, 0, 0);
myMovie.mask(myMovie);



but no luck.

any clue how to get around this one?
does JMC supports playback of qt movies with an alpha channel?

thanks,
P.
Re: New Cross-platfrom JMC Video Library Available
Reply #49 - May 22nd, 2009, 2:16pm
 
Hi Angus,

I have a simple questing about jump() in JMC Video. For some reason, I need to jump the movie time detail to within a second. However, it seems the library only allows jumping by second. Maybe I missed something from the doc, but I wonder if I can jump to specify time down to millisecond, or any form that smaller then a second.

Thanks,
Eric
Re: New Cross-platfrom JMC Video Library Available
Reply #50 - May 23rd, 2009, 11:49pm
 
Hi Eric, I'll look into it. I think that you can jump by time or by frame, and that on some platforms you only have resolution down to 1 second if you are seeking by time. What OS are you on? -Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #51 - May 26th, 2009, 11:18pm
 
spiraljetty wrote on May 23rd, 2009, 11:49pm:
Hi Eric, I'll look into it. I think that you can jump by time or by frame, and that on some platforms you only have resolution down to 1 second if you are seeking by time. What OS are you on -Angus


Thanks for your reply. I am on Mac OSX 10.5.7. I am able to jump down to millisecond with other video library, but none of them, in general, works as well as JMC in my sketch. BTW, if I can jump by frame would work to, but how can I do this

Thanks,
Eric
Re: New Cross-platfrom JMC Video Library Available
Reply #52 - May 26th, 2009, 11:19pm
 
spiraljetty wrote on May 23rd, 2009, 11:49pm:
Hi Eric, I'll look into it. I think that you can jump by time or by frame, and that on some platforms you only have resolution down to 1 second if you are seeking by time. What OS are you on -Angus


Thanks for your reply. I am on Mac OSX 10.5.7. I am able to jump down to millisecond with other video library, but none of them, in general, works as well as JMC in my sketch. BTW, if I can jump by frame would work to, but how can I do this

Thanks,
Eric
Re: New Cross-platfrom JMC Video Library Available
Reply #53 - May 27th, 2009, 9:23pm
 
Eric Siu wrote on May 26th, 2009, 11:19pm:
spiraljetty wrote on May 23rd, 2009, 11:49pm:
Hi Eric, I'll look into it. I think that you can jump by time or by frame, and that on some platforms you only have resolution down to 1 second if you are seeking by time. What OS are you on -Angus


Thanks for your reply. I am on Mac OSX 10.5.7. I am able to jump down to millisecond with other video library, but none of them, in general, works as well as JMC in my sketch. BTW, if I can jump by frame would work to, but how can I do this

Thanks,
Eric


Seconded.  I'm on Mac OSX 10.5.6 and have the same problem.  Millisecond or frame jumping would be really, really helpful.

Please let us know.

Great work Angus, and thank you.

Ian
Re: New Cross-platfrom JMC Video Library Available
Reply #54 - May 28th, 2009, 11:03pm
 
For some reason, the video refuses to loop in either the VideoLoop or the VideoLoopGL examples: it plays to the end and then stops. Is there any way I can troubleshoot this? I'm on OS X 10.5.7.

And thanks for a great library.

jonathan
Re: New Cross-platfrom JMC Video Library Available
Reply #55 - Jun 1st, 2009, 6:51pm
 
Hi Ian, Erin, and Megabulk,

I am testing a new version of jmcvideo based on the recently released javafx1.2.  The new version is higher resolution and handles millisecond timing (as opposed to having your seeks round to the nearest second).

This increased resolution should fix the looping bugs as well. I'll post a new version of the jmcvideo library shortly.

-Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #56 - Jun 2nd, 2009, 2:35pm
 
Hi Angus, thanks for looking into the looping bug. I'm confused about something else now, which can all be summarized like this:

Code:
void videoFrameUpdated(JMCMovie jmcvideo) {
 println("This never seems to get called.");
}

void movieEvent(JMCMovie jmcvideo)
{
 println("This never seems to get called either.");
 jmcvideo.read(); //doesn't seem to do anything at all, or at least it can be removed from every example I've seen
}



So, I'm trying to process each frame of video, but not in real time, and I'm thinking the program should go something like this:
Code:

read in a new frame of video & pause the video
process the video
when the processing's done
advance to the next frame and start over


but I'm having trouble because there doesn't seem to be any working callback after a new frame's read in.

Am I just missing something? Is there some way of using the callback function that I don't understand?

Thanks very much.
Jonathan
Re: New Cross-platfrom JMC Video Library Available
Reply #57 - Jun 3rd, 2009, 2:55am
 
Hi megabulk,

The method videoFrameUpdated gets called every frame automatically by the jmc library (which handles calling corevideo or gstreamer or whatever for the platform you're on). If you follow the code from that callback you will see how the frame gets passed into Processing (via a buffered image or a texture depending on which class you use).

The fatest way to do video processing would be to use the JMCMovieGL class and process the openGL texture that it updates (maybe using a shader from the GLSL orange book or one of the gpu gems). You should be able to do this in real time.

You could also grab the bufferedImage using JMCMovie and manipulate that. You might be using an older version of the jmcvideo library since I've removed the movieEvent method.

The pausing and seeking are a bit wonky in the javafx1.1 version of jmc. But I've been testing the 1.2 version and its support of "video scrubbing" is quite good. Pausing and looping are better as well. I haven't tested grabbing individual frames (without using the callback i mean) yet.

I'll post the newest version of jmcvideo in a few days and a sample sketch of how to take advantage of the improved features.

HTH, Angus
Re: New Cross-platfrom JMC Video Library Available
Reply #58 - Jun 3rd, 2009, 11:19am
 
Hi,
great library.
I use JMC to play an introduction video. After it played once the draw method switch to draw everything but the video. My problem is that as soon i use the reference that contain the video (i.e. video.stop(), video.dispose() ) the video start again: I can hear the sound.

The other problem is a performance one: even after the video is finished the CPU still burn at 100%. There is a way to totally unload a video reference? I even used myVideo = null; with no success.

I am on Ubuntu 9.04 the video is a .mov file.

Thanks.

Edit:
Another question: what do I need to use JMC with a .mov under Windows XP? The code returns me "Unsupported format execption". Thanks again.
Re: New Cross-platfrom JMC Video Library Available
Reply #59 - Jun 4th, 2009, 10:20pm
 
Hi Angus,

Thanks for adding the millisecond jumping feature in the library. It would be very help. I appreciate that and look forward to the new version.

Eric

spiraljetty wrote on Jun 1st, 2009, 6:51pm:
Hi Ian, Erin, and Megabulk,

I am testing a new version of jmcvideo based on the recently released javafx1.2.  The new version is higher resolution and handles millisecond timing (as opposed to having your seeks round to the nearest second).

This increased resolution should fix the looping bugs as well. I'll post a new version of the jmcvideo library shortly.

-Angus

Pages: 1 2 3 4 5