Problem with creating video!
in
Core Library Questions
•
2 years ago
hey guys,
i just wrote a little music visualization program and now i want to export it as a video.
i used the MovieMaker with addFrame and finish. so far so good. it generates a .mov file if i start it, but it it only becomes 129kb big and when i finish the program this file jumps back to 2kb.
something seems to be written wrong but i can't see where my fault is. i also dont know how much keyframes i should use.
maybe you guys can help me out. here's the code.
import processing.video.*;
import ddf.minim.*;
MovieMaker mm;
Minim minim;
AudioPlayer player;
void setup () {
// Sketch einrichten
size (1920, 1080);
noStroke ();
smooth ();
mm = new MovieMaker(this, width, height, "test.mov",
30, MovieMaker.H264, MovieMaker.BEST,5);
minim = new Minim (this);
player = minim.loadFile ("Cragga_-_Please_Mr_Postman__Dubstep_Refix_.mp3");
//player = minim.loadFile ("SATURATE!RECORDS - heRobust - Albumin Ep (STRTEP002) - 10 Shawty Swing My Way (Busted).mp3");
//player = minim.loadFile ("02-mount_kimbie-would_know.mp3");
//player = minim.loadFile ("Kaczinski - Fuck this Melody2.mp3");
player.play ();
}
void draw() {
fill (0,50);
rectMode (CORNER);
rect (0, 0, width, height);
float dimension = player.mix.level () * 600;
rotate(PI/dimension * 10);
println (dimension);
for(int y = 960; y <= height; y = y + y^5){
fill(dimension/5,3,100);
triangle(width/2, 0, dimension, dimension, 600, y);
fill(y/4,y^33,dimension);
triangle(width/2, 600, 0, y, 600, y/66);
fill(y,dimension,dimension);
triangle(dimension * 2, dimension, 0, y, 600, y);
fill(y + 10,dimension,dimension);
triangle(dimension + 100, dimension + 18, dimension, y, 350, y);
fill(y^99,dimension,y^233);
triangle(width/2, 22, 150, y, 450, y);
fill(33,33,y^233);
triangle(dimension + 300, dimension + 22, 100, y, 500, dimension);
fill(222,dimension,y^233);
triangle(dimension, dimension, 33, y, 600, y);
fill(dimension * 2,dimension/4,y^233);
triangle(dimension * 3, dimension + 20, 0, y, dimension, y);
mm.addFrame();
}
import processing.video.*;
}
void keyPressed() {
if (key == 's' ) {
mm.finish(); // Finish the movie if space bar is pressed!
}
}
i just wrote a little music visualization program and now i want to export it as a video.
i used the MovieMaker with addFrame and finish. so far so good. it generates a .mov file if i start it, but it it only becomes 129kb big and when i finish the program this file jumps back to 2kb.
something seems to be written wrong but i can't see where my fault is. i also dont know how much keyframes i should use.
maybe you guys can help me out. here's the code.
import processing.video.*;
import ddf.minim.*;
MovieMaker mm;
Minim minim;
AudioPlayer player;
void setup () {
// Sketch einrichten
size (1920, 1080);
noStroke ();
smooth ();
mm = new MovieMaker(this, width, height, "test.mov",
30, MovieMaker.H264, MovieMaker.BEST,5);
minim = new Minim (this);
player = minim.loadFile ("Cragga_-_Please_Mr_Postman__Dubstep_Refix_.mp3");
//player = minim.loadFile ("SATURATE!RECORDS - heRobust - Albumin Ep (STRTEP002) - 10 Shawty Swing My Way (Busted).mp3");
//player = minim.loadFile ("02-mount_kimbie-would_know.mp3");
//player = minim.loadFile ("Kaczinski - Fuck this Melody2.mp3");
player.play ();
}
void draw() {
fill (0,50);
rectMode (CORNER);
rect (0, 0, width, height);
float dimension = player.mix.level () * 600;
rotate(PI/dimension * 10);
println (dimension);
for(int y = 960; y <= height; y = y + y^5){
fill(dimension/5,3,100);
triangle(width/2, 0, dimension, dimension, 600, y);
fill(y/4,y^33,dimension);
triangle(width/2, 600, 0, y, 600, y/66);
fill(y,dimension,dimension);
triangle(dimension * 2, dimension, 0, y, 600, y);
fill(y + 10,dimension,dimension);
triangle(dimension + 100, dimension + 18, dimension, y, 350, y);
fill(y^99,dimension,y^233);
triangle(width/2, 22, 150, y, 450, y);
fill(33,33,y^233);
triangle(dimension + 300, dimension + 22, 100, y, 500, dimension);
fill(222,dimension,y^233);
triangle(dimension, dimension, 33, y, 600, y);
fill(dimension * 2,dimension/4,y^233);
triangle(dimension * 3, dimension + 20, 0, y, dimension, y);
mm.addFrame();
}
import processing.video.*;
}
void keyPressed() {
if (key == 's' ) {
mm.finish(); // Finish the movie if space bar is pressed!
}
}
1