We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I'm trying to work on a sketch that plays 2 videos at the same time. Before diving deeper into this project I've already found an issue. (well, I should've seen that coming)
When I try to play 2 videos at the same time, they start to jitter a lot So I was wondering if there are any workarounds to this, keeping in mind that 2 videos still need to be played at the same time.
thanks!
import ddf.minim.spi.*;
import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.ugens.*;
import ddf.minim.effects.*;
import processing.video.*;
int play_clip;
//Movie clip_a;
Movie[] clip = new Movie[5];
void setup()
{
size(720, 480);
frameRate(24);
imageMode(CENTER);
play_clip = 1;
//clip_a = new Movie(this, "clip_a.mp4");
for ( int i = 1; i < 5; i++)
{
String clip_name = "clip" + (i) + ".mp4";
clip[i] = new Movie(this, clip_name);
}
}
void draw()
{
//clip_a.width
clip[1].play();
clip[1].read();
image(clip[1], width/4, height/4);
clip[3].play();
clip[3].read();
image(clip[3], width/2 + width/4, height/2);
if (keyPressed)
{
if (key == '1')
{
play_clip = 1;
} else if (key == '2')
{
play_clip = 2;
} else if (key == '3')
{
play_clip = 3;
} else if (key == '4')
{
play_clip = 4;
}
}
}
Answers
I don't really think that this is a processing issue. It could be your own computer and its "Virtualization" feature. Make sure that is turned on, it could help. Look online for your specific computer to see how to check if that is on.
http://forum.processing.org/two/discussion/8109/prepare-a-second-video-to-play-without-slowing-down-the-first-video
@TechWiz777 yeah, I've checked but it's on.
@GoToLoop woah thanks for this sketch. I'm having a bit of a hard to trying to understand what exactly is happening on the sketch so I can go on to adapt it to my own code. Could you give me just a run through of what is happening on your logic there?
specially when it gets to "loadClip" functions and after, I'm still a bit confused on how gstream handles the data.
https://code.google.com/p/gstreamer-java/
http://gstreamer-java.googlecode.com/svn/trunk/javadoc/1.5/index.html
m.playbin.getBus().connect(finished);
to activate the callback for each Movie.0
or1
.0
&QTY-1
.loadClip(idx | rnd<<020, rnd + EXT);
->idx | rnd<<020
.new
Movie inside loadClip() as:m.playbin.set("name", id);
transferLoadedToActive(int(gst.get("name").toString()));
->gst.get("name")
.For now that's it. Any doubts, specifically ask for them again. Take care! B-)
I'll thank you (again) beforehand since I think it's best for me to get a better grasp of those functions first instead of just asking everything blindly.
hehe, apologies for my lack of information, I haven't been able to run it yet. Actually, it says I don't have a library for the gstreamer stuff and I'm struggling to find it (I know, it's dumb, and I actually downloaded many things already, none of them were actually a processing library)
But working or not, the thing is that now I have to read a little more about those things, that way I can adapt it to my own logic (instead of just copying your work).
Finally, a bit more info about my sketch: my objective with this(part) is to create a basic vj software.. kinda. If I'm able to have two video slots always available to play, I can have better transitions between videos (instead of just having dry cuts with a single .read video slot). Also, this is all manual, meaning that I choose which video is playing, when to fade etc etc. If you go back to the first sketch in this post you can see a raw logic of selecting videos from an array of files.
Hope this makes everything clear and thanks again :)