No video window when started from another process

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
Mario_12
New Cone
New Cone
Posts: 6
Joined: 17 Dec 2010 09:08

No video window when started from another process

Postby Mario_12 » 06 May 2018 17:29

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?

Mario_12
New Cone
New Cone
Posts: 6
Joined: 17 Dec 2010 09:08

Re: No video window when started from another process

Postby Mario_12 » 06 May 2018 19:59

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".


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 29 guests