1

Below is the code I'm using to display the video however when the program starts all that is seen is a black screen. Hopefully someone on stackies has used GMP Widget before, as completely lost what to do now

#include "mainwindow.h"
#include <QApplication>
#include "qmpwidget.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QMPwidget widget;
widget.setMPlayerPath("C:/MPlayer/Mplayer.exe");
widget.show();
widget.start(QStringList("-benchmark"));
widget.load("BigBuckBunny_320x180.mp4");

return a.exec();
}

I have also linked the repo for this module as it's too large to list the two files.

Link to qmpwidget repo

if anyone has an idea how to solve this that would be great.

Also if anyone has any better solution to creating an RTSP client I am all ears as really struggling to find a decent method of producing this RTSP client.

ION
  • 177
  • 1
  • 3
  • 16

1 Answers1

1

I tried your source file on Linux and it's working, but I only after I comment the CONFIG += pipemode in the src directory.

Apparently it is only necessary to compile it to Mac OSX, according to the documentation:

Normally, embedding MPlayer into a GUI application is done by attaching the process to an existing window. Unfortunately, this doesn't work on Mac OS X at all, so QMPwidget provides an additional "pipe mode" for running MPlayer on this operating system. Although this mode works on all operating systems, the standard mode should perform significantly better in terms of CPU usage and audio / video synchronization.

The pipe mode is included if the QMake configuration variable pipemode is set.

When I compiled with this option enabled, my tests were always crashing when I tried loading a file.

Dielson Sales
  • 1,715
  • 1
  • 20
  • 25