导出视频处理视频小程序
当我尝试导出处理视频的处理小程序以在浏览器中工作时,我遇到了反复出现的问题。这是一个简单的应用程序,可以停止、播放和暂停 .mp4 视频。当我使用Processing IDE 运行它时,它工作得很好。但是执行导出时生成的index.html,视频框变为空白并且没有任何反应,我在控制台中收到此错误:
Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: Could not initialize class quicktime.QTSession
at processing.video.Movie.init(Unknown Source)
at processing.video.Movie.<init>(Unknown Source)
at processing.video.Movie.<init>(Unknown Source)
at sketch_nov14a.setup(sketch_nov14a.java:31)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
也许这是一个已知问题,但我仍然找不到解决方案: BUG 44
这是代码:
import processing.video.*;
Movie theMov;
boolean isPlaying;
boolean isLooping;
void setup() {
size(600,400,P2D);
theMov = new Movie(this, "http://www.sinopsedofilme.com.br/processing/video2.mp4");
/* only use 1 of the following options */
theMov.play(); //plays the movie once
theMov.loop(); //plays the movie over and over
isPlaying = true;
isLooping = true;
}
void draw() {
image(theMov, 0,0);
}
void movieEvent(Movie m) {
m.read();
}
void keyPressed() {
if (key == 'p') {
// toggle pausing
if (isPlaying) {
theMov.pause();
} else {
theMov.play();
}
isPlaying = !isPlaying;
} else if (key == 'l') {
// toggle looping
if (isLooping) {
theMov.noLoop();
} else {
theMov.loop();
}
isLooping = !isLooping;
} else if (key == 's') {
// stop playing
theMov.stop();
isPlaying = false;
} else if (key == 'j') {
// jump to a random time
theMov.jump(random(theMov.duration()));
}
}
I am facing a recurrent problem when I try to export a Processing applet that deals with video to work in the browser. It's a simple application that stops, plays and pauses a .mp4 video. When I run it using Processing IDE, it works just fine. But executing the index.html generated when I export, the video box gets blank and nothing happen and I get this error in the console:
Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: Could not initialize class quicktime.QTSession
at processing.video.Movie.init(Unknown Source)
at processing.video.Movie.<init>(Unknown Source)
at processing.video.Movie.<init>(Unknown Source)
at sketch_nov14a.setup(sketch_nov14a.java:31)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Maybe it is a known issue, but I still can't find the solution: BUG 44
That is the code:
import processing.video.*;
Movie theMov;
boolean isPlaying;
boolean isLooping;
void setup() {
size(600,400,P2D);
theMov = new Movie(this, "http://www.sinopsedofilme.com.br/processing/video2.mp4");
/* only use 1 of the following options */
theMov.play(); //plays the movie once
theMov.loop(); //plays the movie over and over
isPlaying = true;
isLooping = true;
}
void draw() {
image(theMov, 0,0);
}
void movieEvent(Movie m) {
m.read();
}
void keyPressed() {
if (key == 'p') {
// toggle pausing
if (isPlaying) {
theMov.pause();
} else {
theMov.play();
}
isPlaying = !isPlaying;
} else if (key == 'l') {
// toggle looping
if (isLooping) {
theMov.noLoop();
} else {
theMov.loop();
}
isLooping = !isLooping;
} else if (key == 's') {
// stop playing
theMov.stop();
isPlaying = false;
} else if (key == 'j') {
// jump to a random time
theMov.jump(random(theMov.duration()));
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调试技巧
Debugging tips