处理未加载视频

发布于 2025-01-20 17:51:06 字数 1660 浏览 3 评论 0原文

我正在使用Processing 4.0b7(也尝试过以前的版本),并安装了它的视频库。我有以下代码(我实际上只是想播放视频):

import processing.video.*;
Movie video;

void setup() {
  size(640, 480);
  video = new Movie(this, "video.mp4");
  video.play();
}

void draw() {
  if (video.available()) {
    video.read();
    image(video, 0, 0);
  }
}

我在名为 data 的文件夹中有“video.mp4”,与草图位于同一文件中。 每当我尝试运行代码时,都会收到以下错误:

(java.exe:28748): GLib-CRITICAL **: 19:04:53.545: g_dir_open_with_errno: assertion 'wpath != NULL' failed
Cannot load GStreamer plugins from C:\Users\Estêvão\Documents\Processing\libraries\video\library\windows-amd64\gstreamer-1.0
Processing video library using bundled GStreamer 1.16.2
java.lang.IllegalArgumentException: No such Gstreamer factory: playbin
    at org.freedesktop.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:307)
    at org.freedesktop.gstreamer.Element.makeRawElement(Element.java:104)
    at org.freedesktop.gstreamer.elements.PlayBin.<init>(PlayBin.java:118)
    at processing.video.Movie.initGStreamer(Unknown Source)
    at processing.video.Movie.<init>(Unknown Source)
    at ex5_2_1.setup(ex5_2_1.java:26)
    at processing.core.PApplet.handleDraw(PApplet.java:2142)
    at processing.awt.PSurfaceAWT$9.callDraw(PSurfaceAWT.java:1440)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:356)
RuntimeException: Could not load movie file video.mp4
RuntimeException: Could not load movie file video.mp4
RuntimeException: Could not load movie file video.mp4

我使用的是 Windows 11。我认为问题出在库安装上,但我已要求视频正常运行的朋友向我发送他们的处理文件,我仍然遇到同样的问题。还删除了所有与处理相关的内容并重新安装了几次,但我仍然无法让它工作。其他库(例如声音)正在运行。

I'm using Processing 4.0b7 (also tried with previous versions), and installed its Video Library. I have the following code (Im literally just trying to play a video):

import processing.video.*;
Movie video;

void setup() {
  size(640, 480);
  video = new Movie(this, "video.mp4");
  video.play();
}

void draw() {
  if (video.available()) {
    video.read();
    image(video, 0, 0);
  }
}

I have "video.mp4" on a folder named data, on the same file as the sketch.
Whenever I try to run the code, I get the following error:

(java.exe:28748): GLib-CRITICAL **: 19:04:53.545: g_dir_open_with_errno: assertion 'wpath != NULL' failed
Cannot load GStreamer plugins from C:\Users\Estêvão\Documents\Processing\libraries\video\library\windows-amd64\gstreamer-1.0
Processing video library using bundled GStreamer 1.16.2
java.lang.IllegalArgumentException: No such Gstreamer factory: playbin
    at org.freedesktop.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:307)
    at org.freedesktop.gstreamer.Element.makeRawElement(Element.java:104)
    at org.freedesktop.gstreamer.elements.PlayBin.<init>(PlayBin.java:118)
    at processing.video.Movie.initGStreamer(Unknown Source)
    at processing.video.Movie.<init>(Unknown Source)
    at ex5_2_1.setup(ex5_2_1.java:26)
    at processing.core.PApplet.handleDraw(PApplet.java:2142)
    at processing.awt.PSurfaceAWT$9.callDraw(PSurfaceAWT.java:1440)
    at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:356)
RuntimeException: Could not load movie file video.mp4
RuntimeException: Could not load movie file video.mp4
RuntimeException: Could not load movie file video.mp4

I'm using Windows 11. I think the problem is coming from the library instalation, but I've asked for friends who have their video working to send me their Processing files, and I'm still getting the same problem. Also deleted everything Processing-related and reinstalled it several times, and I still can't get it to work. Other libraries such as sound are working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

辞旧 2025-01-27 17:51:06

我终于解决了这个问题。
草图在带有特殊字符的文件夹上。我已经更改了文件夹的名称,但是我一直遇到相同的错误,所以我认为这不是问题。
但是,我的名字也有一个特殊的角色,因此我的用户名也是如此。处理之前,请先通过Windows用户文件夹,然后到达Sketch文件夹,事实证明这就是使程序不起作用的原因。
无论如何,谢谢大家的帮助!

I've finally solved the problem.
The sketch was on a folder with special characters. I had already changed the name of the folder, but I kept getting the same bug, so I assumed that wasn't the problem.
But well, my name has a special character as well, therefore, so does my username. Processing goes through the Windows user folder before getting to the sketch folder, and turns out that's what was making the program not work.
Thank you all for your help, anyways!

ゃ懵逼小萝莉 2025-01-27 17:51:06

不幸的是,我没有时间对此进行详细调试(例如,这与路径中的特殊(Unicode)字符有关,或者在Processing-Video库中更深入的内容有关)。

目前,我建议使用较旧版本的处理。
我可以用处理3.5.4 procection Video 2.0库(谢谢@csharp的有用评论)

更新我可以确认您可以使用处理视频2.1 使用Windows 11上的处理4.0B7。

您需要:

  1. 删除当前视频库
  2. UNZIP视频.zip(链接到上面处理4的视频版本2.1)
  3. 重新启动处理(如果您已经打开了)

您可以运行代码或 Processing&gt;示例&gt;贡献图书馆&gt;用于处理4&GT的视频库;电影&gt;循环进行测试。

Unfortunately I won't have the time to debug this in detail (e.g. if it's something to do with special(unicode) characters in paths or something deeper within the processing-video library).

For now I suggest using an older version of Processing.
I can confirm the video library works on Windows 11 with Processing 3.5.4 and the Procecessing video 2.0 library (Thank you @cSharp for the helpful comments)

Update I can confirm you can use Processing video 2.1 with Processing 4.0b7 on Windows 11.

You would need to:

  1. remove the current video library
  2. unzip video.zip (link to video version 2.1 for Processing4 above)
  3. restart Processing (if you had it open already)

You can run your code or Processing > Examples > Contributed Libraries > Video Library for Processing 4 > Movie > Loop to test.

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