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.
Page Index Toggle Pages: 1
Working with JMYRON and Movie Maker (Read 1405 times)
Working with JMYRON and Movie Maker
Feb 16th, 2007, 9:44pm
 
I'm recently working on a project which involves recording a movie from a web cam.
I'm using the JMYRON and Movie Maker Libraries. I am able to record the movie from the camera capture with no problems. Then added a date on the top of the image, however this text doesn't record into the movie file.
Is there any way to blend the text with the pixels so Movie Maker can record the text as well?
Re: Working with JMYRON and Movie Maker
Reply #1 - Feb 16th, 2007, 9:47pm
 
MovieMaker will record whatever you want, as long as you do things in the right order, and use the right commands.

If it's not doing what you expect, post the code and hopefully someone will be able to see what the problem is.
Re: Working with JMYRON and Movie Maker
Reply #2 - Feb 16th, 2007, 10:00pm
 
Ok, thanks for the fast reply. Here is the code so far:

Quote:


import JMyron.*;
import moviemaker.*;

JMyron m;
MovieMaker mm;
boolean grabar;
boolean comienzo;
int d = day();    
int mo = month();  
int y = year();  


void setup(){
 size(320,240);
 m = new JMyron();
 m.start(width,height);  
 m.findGlobs(0);
 println("Myron " + m.version());
 println("Forced Dimensions: " + m.getForcedWidth() + " " + m.getForcedHeight());
 loadPixels();
 mm = new MovieMaker(this,width,height,"Memiro.mov", MovieMaker.JPEG, MovieMaker.HIGH,30);

}

void draw() {
 m.update();
 m.imageCopy(pixels);
 PFont font;
 font = loadFont("Ziggurat-HTF-Black-32.vlw");
 updatePixels();
 textFont(font, 10);
 String s = String.valueOf(d);
 text(s, 0, 10);
 s = String.valueOf(mo);
 text(s, 20, 10);
 s = String.valueOf(y);
 text(s, 35, 10);

 comienzo = true;
 
 if(keyPressed) {
   if (key == 'j' || key == 'J') {
     grabar = true;
     println("Grabando");
   } else if (key == 'k' || key == 'K') {
     grabar = false;
     println("No está grabando");    
   } else if (key == 's' || key == 'S') {
     mm.finishMovie();
     stop();  // termina el programa
   }
 }

 if (grabar) {
   mm.addFrame(pixels,width,height);
   comienzo = false;
   }
   
 if(comienzo){
   
   textFont (font, 14);
   text("Presione J para grabar",   100, 210);
   fill(250, 250, 210);
   text("Presione K para pausar",   100, 225);
   fill(250, 250, 210);
   text("Presione S para terminar", 100, 240);
   fill(250, 250, 210);
   }

}


public void stop(){
 m.stop();
 super.stop();
}


Re: Working with JMYRON and Movie Maker
Reply #3 - Feb 16th, 2007, 10:27pm
 
I think you need to add "loadPixels();" before the mm.addFrame command.
Re: Working with JMYRON and Movie Maker
Reply #4 - Feb 16th, 2007, 10:39pm
 
you just need to draw the text before grabbing the frame. move the "if (grabar)" block to the end of draw().
Re: Working with JMYRON and Movie Maker
Reply #5 - Feb 16th, 2007, 10:50pm
 
Quote:
I think you need to add "loadPixels();" before the mm.addFrame command.

Yes this did the trick, thank you very much for your help!
And fry: thanks for your help too.
Page Index Toggle Pages: 1