[英]Trouble running a .mov file in processing 3
I have this code written to display a movie in a new window in processing.我编写了这段代码来在处理中的新窗口中显示电影。 When I run the code I get the display window, but nothing shows up inside it.
当我运行代码时,我得到了显示窗口,但里面什么也没有显示。
I've tried different movies and file types, different display sizes and frame rates with no luck.我尝试过不同的电影和文件类型、不同的显示尺寸和帧速率,但都没有成功。 It recognizes the movie file in the data folder but says that it isn't available.
它识别数据文件夹中的电影文件,但说它不可用。 I'm really new to this so it might have been a simple mistake
我真的很陌生,所以这可能是一个简单的错误
import processing.video.*;
Movie movie;
void setup() {
size (200, 200);
movie = new Movie(this, "test.mov");
print(movie.available());
}
void movieEvent(Movie M) {
M.read();
}
void draw() {
image(movie, 0, 0);
}
I've also tried switching the draw and movieEvent sections with no luck.我也试过在没有运气的情况下切换 draw 和 movieEvent 部分。 I'm really stumped.
我真的很难过。
You code looks correct.你的代码看起来是正确的。 (Personally I would use upper case for classes only, (eg
movieEvent(Movie m)
, but doesn't change the way the code runs) (我个人只会对类使用大写,(例如
movieEvent(Movie m)
,但不会改变代码的运行方式)
The one thing that appears missing is actually the play()
or loop()
call:似乎缺少的一件事实际上是
play()
或loop()
调用:
import processing.video.*;
Movie movie;
void setup() {
size (200, 200);
movie = new Movie(this, "test.mov");
print(movie.available());
movie.loop();
}
void movieEvent(Movie ,) {
m.read();
}
void draw() {
image(movie, 0, 0);
}
If the movie still doesn't play it might be worth doing a few more tests to isolate the issue: is it with the video file or video library on your system for some reason.如果电影仍然无法播放,则可能需要进行更多测试以隔离问题:是否出于某种原因与系统上的视频文件或视频库有关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.