导出视频处理视频小程序

发布于 2024-10-02 13:13:55 字数 1829 浏览 2 评论 0原文

当我尝试导出处理视频的处理小程序以在浏览器中工作时,我遇到了反复出现的问题。这是一个简单的应用程序,可以停止、播放和暂停 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文