Advice/Help on GS-Video RAW
in
Contributed Library Questions
•
1 year ago
Hello people,
Deep in my archives i've found a sketch i made a while ago which tries to load raw movie data with gsvideo. As for the sketch, i can display movie-data in the top-half of the window and it is somewhat intermixed (both the location and colorchannels) which results in a nice effect but not really what i'm after. In short i'd basically like to know how to properly display the movie in the window, after that i can probably manage the byte-rearranging/glitching.
Help will always be greatly appreciated, thanks!
FRid
(tested with an .avi and (3) .mov-files)
Deep in my archives i've found a sketch i made a while ago which tries to load raw movie data with gsvideo. As for the sketch, i can display movie-data in the top-half of the window and it is somewhat intermixed (both the location and colorchannels) which results in a nice effect but not really what i'm after. In short i'd basically like to know how to properly display the movie in the window, after that i can probably manage the byte-rearranging/glitching.
Help will always be greatly appreciated, thanks!
FRid
(tested with an .avi and (3) .mov-files)
- import codeanticode.gsvideo.*;
GSPlayer video;
PImage img;
PrintWriter output;
void setup() {
size(640, 480);
video = new GSPlayer(this, "Tron1.avi", GSVideo.RAW);
video.loop();
video.volume(0);
img = createImage(640, 480,RGB);
}
void playerEvent(GSPlayer player) {
player.read();
}
void draw() {
if (video.data != null) {
println("Data size: " + video.data.length);
println("Data caps: " + video.dataCaps);
img.loadPixels();
byte[] data = video.data;
for (int i = 0; i < 153600; i++) {
img.pixels[i] = color(data[i], data[i+156300], data[i+212600]); //These values are found emperically
}
img.updatePixels();
image(img, 0, 0, width, height);
}
}
1