Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : RFID and Video

$
0
0
I am working on a similar project. I got my video to play with my RFID tag but it's extremely choppy and does not continue playing (only audio) when I remove the tag. I used a piece of your code in mine. Now the choppiness is the problem!

  1. import processing.serial.*;
  2. import processing.video.*;

  3. Serial rfidPort;
  4. String tagID = "";
  5. Movie[] myVids = new Movie[1];

  6. void setup(){ 
  7.   size(800,600);
  8.  
  9.   println(Serial.list());

  10.   String portnum = Serial.list()[0];

  11.   rfidPort = new Serial(this, portnum, 2400);

  12.   rfidPort.buffer(12);

  13.   PFont myFont = createFont(PFont.list()[2], 24);
  14.   textFont(myFont);
  15.   myVids[0] = new Movie(this, "brave.mp4");


  16. void draw(){

  17.   text(tagID, width/4, height/2 - 24);
  18. }
  19. void serialEvent(Serial rfidPort) {
  20.     tagID = trim(rfidPort.readString()); 
  21.       if (tagID.equals("84003435BC") == true) {
  22.       image(myVids[0],0,0);
  23.       myVids[0].play();
  24. }} void movieEvent(Movie m) {
  25.   m.read();
  26.   m.available();
  27. }

Viewing all articles
Browse latest Browse all 1768

Trending Articles