How to add logo and subtitle dynamically with API

*nix specific usage questions
tyros
New Cone
New Cone
Posts: 5
Joined: 31 Oct 2008 12:05

How to add logo and subtitle dynamically with API

Postby tyros » 31 Oct 2008 12:15

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!

asergiu
New Cone
New Cone
Posts: 6
Joined: 19 Sep 2008 18:26

Re: How to add logo and subtitle dynamically with API

Postby asergiu » 04 Nov 2008 11:25

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

tyros
New Cone
New Cone
Posts: 5
Joined: 31 Oct 2008 12:05

Re: How to add logo and subtitle dynamically with API

Postby tyros » 05 Nov 2008 10:50

Thanks for helping! I'll try it.

Have a good day!

tyros
New Cone
New Cone
Posts: 5
Joined: 31 Oct 2008 12:05

Re: How to add logo and subtitle dynamically with API

Postby tyros » 06 Nov 2008 16:48

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!

tyros
New Cone
New Cone
Posts: 5
Joined: 31 Oct 2008 12:05

Re: How to add logo and subtitle dynamically with API

Postby tyros » 06 Nov 2008 17:03

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!


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 12 guests