Page 1 of 1

No video window when started from another process

Posted: 06 May 2018 17:29
by Mario_12
Hello all,

I have been strugling for a few days with the following problem.
I'm using windows 7 pro 64-bit and VLC 3.02.

I open a command prompt and enter the following commands:

"C:\Program Files\VideoLAN\VLC\vlc.exe" -I rc --rc-host localhost:3000 --rc-quiet --video-on-top --width 150 --height 150

telnet localhost 3000

clear

add C:\Users\<username>\Documents\testfiles\test_video.mp4

The video will start in a new window without any buttons, exactly as I want.

I stop the video by entering "quit" in the telnet session window.

So fa so good.

The problem is the following. I want to do this from within another program I wrote using the Qt framework.

Here's a part of the code (some pieces are omitted for clarity):

video_process = new QProcess(0);

arguments << "--video-on-top" << "-I" << "rc" << "--rc-host" << "localhost:3000" << "--rc-quiet" << "--width" << "150" << "--height" << "150";

video_process->start("C:\\Program Files\\VideoLAN\\VLC\\vlc.exe", arguments);

if(video_process->waitForStarted(5000) == false)
{
msgbox.setText(" \n Cannot start VLC mediaplayer. \n"
" \n Check if VLC is installed in C:\\Program Files\\VideoLAN\\VLC\\ \n" );
msgbox.exec();
return;
}

wait here for a couple of seconds to give it time to startup

vlc_sock = new QTcpSocket;

vlc_sock->connectToHost(QHostAddress("127.0.0.1"), port);

if(vlc_sock->waitForConnected(5000) == false)
{
err = vlc_sock->error();

do some cleanup here
}

vlc_sock->write("clear");

vlc_sock->waitForBytesWritten(200);

wait 11 milliSecs here

vlc_sock->write("add C:\\Users\\<username>\\Documents\\testfiles\\test_video.mp4\n");

vlc_sock->waitForBytesWritten(200);
When I run the program, VLC starts and it connects via the socket to VLC.
Also, VLC responds to every command, but.... there's no video window!
Also, when sending the command get_time after loading the video, get_time returns always 0.
But the command "add C:\Users\<username>\Documents\testfiles\test_video.mp4" returns "vlc: add: returned 0 (no error)"

So, why it doesn't show a video when VLC is started from another process?

What is the solution?

Re: No video window when started from another process

Posted: 06 May 2018 19:59
by Mario_12
Solved. The problem was, I used slashes instead of backslashes in the path to the video file.

Still, weird that VLC's response is "ok".