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 › video performance - am i doing something wrong
Page Index Toggle Pages: 1
video performance - am i doing something wrong? (Read 894 times)
video performance - am i doing something wrong?
Oct 21st, 2005, 10:17pm
 
hi

just starting processing and thought i'd try and do something with a webcam / dv cam and below is my simple attempt.  have read the faq on video and noted the "Video performance is not particularly great" comment but am getting what seem to be very poor performance - slow to start and then the video seems to have poor frame rate.  Is there anything obvious that i am doing wrong or anything i can do to improve performance?  seems to be little difference between using a usb webcam and a dv cam.  thanks in advance.

a+
gar


public class webcam extends PApplet
{

 import processing.video.*;
 Capture v_capture;
 int v_width;
 int v_height;

 //setup function
 void setup()
 {
   //set stage size
   //size(screen.width, screen.height);
   size(500, 500);
   
   //set stage background
   background(0, 0, 0);
   
   //set the framerate
   framerate(20);
   
   //The name of the capture device is dependent those plugged into the computer.
   //To get a list of the choices, uncomment the following line
   //println(Capture.list());
   
   //webcam name
   //String webcam = "Quickcam";
   
   //dv video name
   String webcam = "IIDC FireWire Video";
   
   //width and height stored as a variable
   v_width = 318;
   v_height = 256;
   
   //capture the camera
   v_capture = new Capture(this, webcam, v_width, v_height);
   v_capture.framerate(20);
 }

 //capture event function
 void captureEvent(Capture v_capture)
 {
   //read the latest image from the capture event
   v_capture.read();
 }

 //draw function (this loops - like an exitframe in director)
 void draw()
 {
   //calculate position for video on screen according to window size and video size
   int xpos = (width / 2) - (v_width / 2);
   int ypos = (height - v_height) - 50;
   
   //set the image to be the latest image from capture event
   image(v_capture, xpos, ypos);
 }

}
Re: video performance - am i doing something wrong
Reply #1 - Oct 21st, 2005, 11:14pm
 
try using size(500, 500, P3D). the default renderer is pretty slow at doing pixel stuff.
Re: video performance - am i doing something wrong
Reply #2 - Oct 22nd, 2005, 1:10am
 
Generally from my few experience with Processing and live video id say if you really want to do something in realtime, it will be very difficult. And if you really want to make something focussed on video at fast fps, live capture, no delay AND still have CPU for some nice visuals, then I think Processing is not the weapon of choice.
Re: video performance - am i doing something wrong
Reply #3 - Oct 22nd, 2005, 7:05pm
 
fry wrote on Oct 21st, 2005, 11:14pm:
try using size(500, 500, P3D). the default renderer is pretty slow at doing pixel stuff.


Hi

yes that helps, no strange update of the video now (it seemed to update in blocks and now it does it all at once).  thanks.

beachmeat wrote on Oct 21st, 2005, 11:14pm:
if you really want to make something focussed on video at fast fps, live capture, no delay AND still have CPU for some nice visuals, then I think Processing is not the weapon of choice.


yep i've gathered from peoples comments here, just learning at the moment to see what I can / can't do with processing.

a+
gar
Page Index Toggle Pages: 1