Page 1 of 1

How to add logo and subtitle dynamically with API

Posted: 31 Oct 2008 12:15
by tyros
Hi!

I'm working on a problem a long time ago, but I can't solve it. I'm writing a C++ program which can dynamically control vlc media player, but I can't solve how to add dynamically subtitle or logo to a media. I read the mediacontrol API documentation and I found a function called "mediacontrol_display_text" but when I use it, I don't see the message what i wrote.

I tried to match QProcess with the rc interface, but QProcess can't run vlc in rc. Then i tried to run QProcess with xterm -e vlc -I rc. It works but I can't write to do process input, there was no reaction.

Can anybody help me, how can I add logo or subtitle dynamically with a C++ program?

It should be very important.

Thanks, everybody for helping!

Re: How to add logo and subtitle dynamically with API

Posted: 04 Nov 2008 11:25
by asergiu
m_proc = new QProcess(this);
m_proc->start("vlc -I rc --rc-fake-tty --sub-filter marq -f");

should do the work.... I can control it afterwards from QProcess.

This raises a question though for the developpers. It seems that more people are trying to integrate VLC in their applications and I am not sure there is an appropriate solution yet. Is there a chance we get full embeddable support for VLC ? I know is not something easy - and that should be carreffuly thought but here it is - the ideea is launched.

TO be clear: embeddable - I mean not a separate executable but just an API that would allow me to start a video in my window or fullscreen (or in VLC's window) and then be able to do anything from the API like I was clicking in the VLC's menus.

"Voila le defi - par contre si ca se faisait pas je comprendrait bien."
Adrian

Re: How to add logo and subtitle dynamically with API

Posted: 05 Nov 2008 10:50
by tyros
Thanks for helping! I'll try it.

Have a good day!

Re: How to add logo and subtitle dynamically with API

Posted: 06 Nov 2008 16:48
by tyros
Hi!

I tried that you said, but still doesn't work. Here is the code I tried:

#include <QApplication>
#include <QProcess>
#include <QDebug>

int main(int argc, char* argv[])
{
QApplication app(argc,argv);
QProcess *proc=new QProcess;

// proc->setReadChannelMode(QProcess::MergedChannels);
proc->start("vlc -I rc --rc-fake-tty --sub-filter marq -f");

if(proc->waitForStarted())
{
qDebug() << "try it";
QString comm="quit\n";
QByteArray bytes=comm.toUtf8();
proc->write(bytes);

/*QString comm="add ~/ftp/Building_a_Basic_Approval_Workflow.wmv\n";
QByteArray bytes=comm.toUtf8();
proc->write(bytes);
comm="play\n";
bytes=comm.toUtf8();
proc->write(bytes);*/
}

return app.exec();
}

I tried to quit the program, but after I run it and see "ps aux" it still run. Then I tried to add a file to the playlist and play it, but nothing happened. vlc -I rc --rc-fake-tty --sub-filter marq -f run, but i can't control it.

Can you help me, what I am doing wrong?

Thanks!

Re: How to add logo and subtitle dynamically with API

Posted: 06 Nov 2008 17:03
by tyros
Hi!

I tried that you said, but still doesn't work. Here is the code I tried:

#include <QApplication>
#include <QProcess>
#include <QDebug>

int main(int argc, char* argv[])
{
QApplication app(argc,argv);
QProcess *proc=new QProcess;

// proc->setReadChannelMode(QProcess::MergedChannels);
proc->start("vlc -I rc --rc-fake-tty --sub-filter marq -f");

if(proc->waitForStarted())
{
qDebug() << "try it";
QString comm="quit\n";
QByteArray bytes=comm.toUtf8();
proc->write(bytes);

/*QString comm="add ~/ftp/Building_a_Basic_Approval_Workflow.wmv\n";
QByteArray bytes=comm.toUtf8();
proc->write(bytes);
comm="play\n";
bytes=comm.toUtf8();
proc->write(bytes);*/
}

return app.exec();
}

I tried to quit the program, but after I run it and see "ps aux" it still run. Then I tried to add a file to the playlist and play it, but nothing happened. vlc -I rc --rc-fake-tty --sub-filter marq -f run, but i can't control it.

Can you help me, what I am doing wrong?

Thanks!