メディアプラグインについて

以下の条件でMediaPluginをbuildしました。

  • Ubuntu 24.04 (x86_64)

  • choreonoidのソース (20251112のmaster)

  • cmake -DBUILD_MEDIA_PLUGIN=ON として build

  • 以下のaptは導入済みで, cmake, makeは問題ない
    libpulse-dev, libsndfile-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev

使ってみたところ、以下のエラーで Seg Faultしました。
(View → Show View → Media にチェック した)

--- エラーメッセージ
QOpenGLContext::makeCurrent() called with non-opengl surface 0x555557710b10
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770f630
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770e3b0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770d840
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770ecf0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770ecf0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770d840
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770e3b0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555770f630
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x555557710b10
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x555557711540
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x555557711540
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x5555577127a0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x5555577127a0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555771eb10
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555771eb10
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555771fcf0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x55555771fcf0
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x555557721070
QRhiGles2: Failed to make context current. Expect bad things to happen.
QOpenGLContext::makeCurrent() called with non-opengl surface 0x555557721070
QRhiGles2: Failed to make context current. Expect bad things to happen.
---
--- 以下, GDBのトレース
Thread 1 "choreonoid" received signal SIGSEGV, Segmentation fault.
Downloading source file /build/libx11-aL6a2q/libx11-1.8.7/build/src/../../src/FillRct.c
0x00007ffff74e26a4 in XFillRectangle (dpy=0x0, d=12583038, gc=0x555557721900, x=0, y=0, width=1070, height=781) at ../../src/FillRct.c:48
warning: 48     ../../src/FillRct.c: No such file or directory
(gdb)
(gdb) bt
#0  0x00007ffff74e26a4 in XFillRectangle (dpy=0x0, d=12583038, gc=0x555557721900, x=0, y=0, width=1070, height=781) at ../../src/FillRct.c:48
#1  0x00007fffebfbca15 in cnoid::GSMediaView::paintEvent(QPaintEvent*) () at /home/irsl/temp/choreonoid/build/lib/choreonoid-2.4/libCnoidMediaPlugin.so
#2  0x00007ffff6bd46ff in QWidget::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
---

MediaPluginをビルドして動いている方はいらっしゃいますでしょうか?
いつ頃のソース、環境(Linux or Windows)などを教えていただけるとありがたいです。

ご報告ありがとうございます。
すみません、Qtが5から6になったときにいろいろと変わったところがあって、MediaPluginがそれに対応できていなかったようです。

修正をアップしましたので、お試しいただけますでしょうか。

こちらで試したところでは、これで正常に動作しています。

あと、メディアを最後まで再生したときに、タイムバーが0に戻ってしまう不具合がありましたので、そちらも修正しました。

あわせて、Windows用のDSMediaViewも修正しています。

DSMediaViewはDirectShowというAPIを使っているのですが、どうもこのAPIは古いもので、対応している動画フォーマットも少ないことが分かりました。

今はMedia FoundationというAPIを使うべきだったようです。そちらを使用するMFMediaViewも実装してみたのですが、再生はできるようになったものの、背景部分にゴミが表示されて消えないといった症状があるので、まだデフォルトではDSMediaViewを使うようにしています。

返信遅くなりました。
手元環境で試せており、動くことが確認できております。

ありがとうございました。

動いたとのことでよかったです。
ご報告ありがとうございました。