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 ... 3 4 5 
New Cross-platfrom JMC Video Library Available (Read 24262 times)
Re: New Cross-platfrom JMC Video Library Available
Reply #60 - Jun 17th, 2009, 7:14am
 
Hi,
Encountered the issue of loop() refusing to repeat the movie as well. Could track the problem down to the handleLoopingBehavior() method in the JMC class. For some reasons the MediaProvider didn't reacted upon the setPlaybackPercentage() call.

Anyways, tryed to set looping directly via MediaProvider's setRepeating(). That worked so far. This is the patch
Code:

--- angusforbes-jmcvideo-91f322cf51813f976fb088c216c90989bcdc1fbc/src/jmcvideo/JMC.java 2009-03-22 10:28:33.000000000 +0100
+++ src/jmcvideo/JMC.java 2009-06-17 15:54:54.000000000 +0200
@@ -110,12 +110,9 @@
* in the next version of JMC.
*/
public void handleLoopingBehavior()
- {
- if (this.repeat == true && getRate() > 0 && getPlaybackPercentage() >= 1.0)
- {
- setPlaybackPercentage(Math.random() * .001);
- }
- else if (this.bounce == true && getRate() > 0 && getPlaybackPercentage() >= 1.0)
+ {
+
+ if (this.bounce == true && getRate() > 0 && getPlaybackPercentage() >= 1.0)
{
setRate(-1.0);
setPlaybackPercentage(1.0 - (Math.random() * .001));
@@ -125,6 +122,7 @@
setRate(1.0);
setPlaybackPercentage(Math.random() * .001);
}
+
}

/**
@@ -292,17 +290,25 @@
*/
public void play()
{
- this.repeat = false;
+ setRepeating(false);
this.bounce = false;
mp.play();
}
-
+
+ /**
+ * Set repeating
+ */
+ public void setRepeating(boolean repeat) {
+ this.repeat = repeat;
+ mp.setRepeating(repeat);
+ }
+
/**
* Begins video playback, looping forever
*/
public void loop()
{
- this.repeat = true;
+ setRepeating(true);
this.bounce = false;
mp.play();
}
@@ -313,7 +319,7 @@
public void bounce()
{
this.bounce = true;
- this.repeat = false;
+ setRepeating(false);
mp.play();
}



Is this a possiblity or are there reasons not to use setRepeating() directly?

thanks,
silvanji
Re: New Cross-platfrom JMC Video Library Available
Reply #61 - Jun 18th, 2009, 11:42am
 
Hi silvanji,

There was a bug with setRepeating, at least on mac osx using jmc 1.1 and 1.0 with some of the media formats I was testing on, which is why I made that hack (which apparently doesn't do the trick in all cases...).

-angus
Re: New Cross-platfrom JMC Video Library Available
Reply #62 - Jun 24th, 2009, 2:40am
 
Hi Angus,

Thanks for your answer, i suspected something like that ...

Tryed to use jmc from the current JavaFX 1.2 SDK.
Extracted all nescessary files from
/Library/Frameworks/JavaFX.framework/Versions/1.2/lib/desktop/
to processing/libraries_macosx/jmcvideo/library/

It seems the libraries libDecora-SSE.jnilib and libon2_decoder.jnilib aren't in the sdk anymore.

Then built jmcvideo, made the whole library available for processing
and started some tests. Looking good so far, although looping remains still an issue when handled in handleLoopingBehaviour() (video formats tested so far: quicktime / soerenson and mp4 / h264).

Maybe there are enhancements with setRepeating(), though couldn't find anything on the javaFX page.

Will continue playing around - also i read that there should be support for rtsp now ...

thanks,
silvanji
Re: New Cross-platfrom JMC Video Library Available
Reply #63 - Jul 10th, 2009, 7:04am
 
Hello,
I'm having some problems with jmc. I've read the whole discussion but I couldn't find a solution. The weird thing (to me, i'm a beginner with no programming experience) is that some demos are fine (VideoJMC and the VideoPoints, since i can visualize the videos i guess it's not a matter of codecs) while VideoLoop plays the video only once and then stops. VideoLoopGL doesn't open the video. VideoTexture returns me the  message "cannot find a class or type named VideoGL at the lines: VideoGL[] videos = new VideoGL[NUM_VIDEOS];
I'm on XP and I downloaded the latest JavaFX SDK, but no luck.
The last question is about the VideoTextureFade demo mentioned in the jmc home page. It was my intention to try some experiments with that, but the package doesn't include it! Is there any chance to get it?

Any help would be greatly appreciated,
thank you
Pausing/stopping/unloading video
Reply #64 - Jul 22nd, 2009, 2:22am
 
effetto wrote on Jun 3rd, 2009, 11:19am:
....
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 had the same problem. I looked into the source and I think I fixed it. I think it is a bug. When you call pause() or stop() or dispose() (they are all almost the same) the videoFrameUpdated callback function (inside the JMCMovie or JMCMovieGL class) keeps being called. If you extend for example the JMCMovieGL class and overwrite this function and check within the function if the video isPlaying() than CPU usage does go down after pausing/stopping:
Code:

public void videoFrameUpdated(VideoRendererEvent rendererEvent)
 {
   //check if the video is playing
   if(isPlaying()) {
         //call the videoFrameUpdated function of JMCMovieGL or
         //JMCMovie, depending on which of the two you are extending
 super.videoFrameUpdated(rendererEvent);
   }
}

Another way to do this is to change the JMC class and unregister the VideoRendererListener in the pause function (which is called by stop() and dispose()). You have to re-add it when you play the video back again.

I do not understand why myVideo=null does not work. Maybe it has to do with the listener that is not removed, or the mediaProvider that is not removed (JMC.mp)?

Philip
Re: New Cross-platfrom JMC Video Library Available
Reply #65 - Jul 28th, 2009, 8:25pm
 
I'm writing a sketch which processes video not in realtime (that is to say frame-by-frame as it finishes with each one). I had this working with the standard processing video library, but that library doesn't do well with large files (and JMC seems to have no problem loading big ones  Smiley ).

I was doing this with the movie.jump() method.

The problem is, movie.jump() doesn't seem to want to work right in JMC.  It will only jump to seconds in integer intervals (1.0s, 2.0s, etc), missing out 29 odd frames in the process. setCurrentTime() doesn't work any better, nor does setPlaybackPercentage(). I'm passing in doubles (also tried floats), and the documentation says these methods take doubles.

Is this a hard limitation, a bug, or am i doing something wrong?

Alternatively, can anyone recommend a better way to skip through frames one by one?
Re: New Cross-platfrom JMC Video Library Available
Reply #66 - Jul 29th, 2009, 2:56am
 
Is there an equivalent to MovieMaker?
Re: New Cross-platfrom JMC Video Library Available
Reply #67 - Jul 29th, 2009, 1:19pm
 
@ethanbee

Hi, the jmc lib from javafx 1.2 seems to support better timing resolution. That is, you can setCurrentTime or setPlaybackPercentage and it should find the correct frame. The getFrameNumber() method is still broken, so to calculate the exact frames you will have to calculate the time based on the frameRate. Unfortunately, although the VideoTrack class has a getFrameRate method, there seems to be no way to get a handle to the Tracks via the TrackControl in the MediaProvider, so you'll have to know the frameRate in advance.

-angus
Re: New Cross-platfrom JMC Video Library Available
Reply #68 - Aug 2nd, 2009, 1:31pm
 
Thanks angus!
Re: New Cross-platfrom JMC Video Library Available
Reply #69 - Aug 3rd, 2009, 5:44pm
 
Hi, a new version of jmcvideo has been released. So I figure it's time to move to a new thread... Please post any questions/issues regarding jmcvideo 1.2 to http://processing.org/discourse/yabb2/num_1249335436.html

Thanks, Angus
jmc won't work
Reply #70 - Mar 15th, 2010, 3:36pm
 
hey i'm having trouble getting the library working, i keep getting an error ---  jmc library does not exist.---- i've just installed processing 1.1 and I got the 3 files  jmcvideo.jar, jmc.jar (which i had to get from github as i could not find it on the JMC site!), jmc.dll in the right folder and i've dowloaded and installed the JavaFX 1.2 which didn't have the files needed. I have used the library before and had no problems why is it so difficult to work with now?? The instructions on the site could be clearer and would it be possible to put all the nessesary files into 1 zip file??? I've been fighting with this for 2 hours and am fairly fed up with it at this stage
Pages: 1 ... 3 4 5