KdenPlayer

Linux is suffering from not having a production quality video player. By this I mean that there are no player that can do backward frame stepping and accuracy/responsiveness often have a lot to wish for.
Kdenlive has great video viewing qualities with its clip monitor.
Would it be possible to create a standalone video player based on Kdenlives clip monitor?
What I'm after is a player that does one thing and does it very well. Play video clips. Accurate and with frame stepping. Not having a lot of extra bling as filters and settings as other players has all too much of.
Of course you can open up your clips in Kdenlive when you want to watch them with accuracy but having a standalone player would ease video workflow on linux tremendously.

Have a look at inigo, MLT command-line player.
Inigo is used by Kdenlive.
You can probably create a powerful standalone player using Inigo.

Thank you.
Inigo seems interesting! Only problem is I don't have the necessary programming skills to get going. Some simple bash-scripts and lua-scripts is all I've done...
When checking up on Inigo I found out that there was one player based on it, Fireswamp, but it seemed to be no development on that, latest tarball was from june 2004. Also I wasn't able to compile it.
 

How about that, I just created an account specifically to ask if there was a media player like this in the works :) If not, I'm going to start on it. I tried out the MLT basic SDL viewer app tutorial and got it working with minimal work, although it seems like that tutorial might need updating to match the current API. On the plus side, even though the documentation for MLT is sparse, the whole thing seems well-designed to the degree that functions seem to do what you'd expect just from the names (!) so it's actually a lot of fun.

The basic features I'd like are just frame stepping, trimming and exporting, and maybe the ability to do real basic edits like adding a soundtrack. Stay tuned ...

Sweet!
This is the best news I've heard this week!

If you need any non-programming help, just let me know. Testing, artwork etc.

If I could make a small feature wish perhaps? Video scrubbing; drag the timeslider and the video scrubs. A plus if audio scrubs as well.

Cheers!

Question for anyone who knows how to use Mlt: how do you attach the Consumer to a QWidget other than a QMainWindow? (I'm guessing this is what you're supposed to do, just based on what goes on in renderer.c ... )

This works fine:

----------------------------------------------------------

MainWindow w;
consumer = new Mlt::Consumer(*profile,"sdl_preview");

winid = w.winId();
consumer->set("window_id",winid);

-------------------------------------------------------

But this gives me X errors:

------------------------------------------------------------

QWidget *ViewWidget;
ViewWidget = w.findChild("ViewWidget");

winid = ViewWidget->winId();
consumer->set("window_id",winid);

------------------------------------------------------------

any hints? So far I can make a nice little player app, but the controls and the display are still in different windows :)

You have to setenv SDL_WINDOWID to the X11 id of your Qt drawable. You should grep the kdenlive source for SDL_WINDOWID and learn from it.

thanks! I think I found the relevant part, though I'm getting the same results as before.

the code is pretty short, so I'll just paste it here, but let me know if I should post attachments instead:

/************ MainWindow.h **************/

#include
#include

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
MainWindow(QWidget *parent = 0);

QLabel *video_frame;
};

/*************** main.cxx *****************/

#include
#include
#include
#include
#include
#include "MainWindow.h"
#include

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
resize(600,400);
setWindowTitle("MLTPlayer");

QWidget *centralWidget = new QWidget(this);
setCentralWidget(centralWidget);

QVBoxLayout *vbox = new QVBoxLayout();
centralWidget->setLayout(vbox);

video_frame = new QLabel();
vbox->addWidget(video_frame);
}

int main(int argc, char *argv[])
{
Mlt::Profile *profile;
Mlt::Repository *repository;
Mlt::Consumer *consumer;
Mlt::Producer *producer;
int winid;

QApplication a(argc, argv);
MainWindow w;

profile = new Mlt::Profile();
repository = Mlt::Factory::init();

if (repository)
{
consumer = new Mlt::Consumer(*profile,"sdl_preview");
producer = new Mlt::Producer(*profile,NULL,argv[1]);
consumer->connect(*producer);

w.show();

winid = w.video_frame->winId();
char winidstring[32];
sprintf(winidstring,"%d",winid);
setenv ("SDL_WINDOWID",winidstring,1);
setenv ("SDL_VIDEO_YUV_HWACCEL","0",1);
setenv ("SDL_VIDEODRIVER","x11",1);

consumer->start();

a.exec();

consumer->stop();
delete(consumer);
delete(producer);
Mlt::Factory::close();
}
else
{
std::cerr }
return 0;
}

/************* Output *************/

X Error: BadWindow (invalid Window parameter) 3
Major opcode: 3 (X_GetWindowAttributes)
Resource id: 0x300000d
X Error: BadMatch (invalid parameter attributes) 8
Major opcode: 78 (X_CreateColormap)
Resource id: 0x9d4e9a04
X Error: BadDrawable (invalid Pixmap or Window parameter) 9

etc.

If I use the whole window, instead of just the QLabel inside it, it works fine:

winid = w.winId();

I'm sure I'm missing something really simple....

Just to make sure, I also had it print out the window ID's and compare with xwininfo, and they're correct.

solved the embedding problem. From qtforum.org, someone suggesting that you may have to ensure native windows for widgets:

that fixes it, so now I can get to work on the rest. note it may be different on Windows or OSX, but for me right now Linux is my main target because that's where there's the greatest need for this little app.

QApplication app(argc, argv);
app.setAttribute(Qt::AA_NativeWindows,true);

Exciting that you're on your way with this app!

Yeah, I'd say concentrate on Linux. Windows and Mac already have a tool that plays videos accurate with good controls, the Quicktime player. Linux has none of the sort.