My application needs to keep track of what videos were played in VLC and their progress in the progress bar.
Preferable, it would be best to collect the information if VLC is already running rather than having to restart it with command line variables.
I tried to use the console, but it does not read all of the console output and none of the commands work when written into the input stream.
Process p;
p = new Process();
p.StartInfo.FileName = @"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe";
p.StartInfo.Arguments = "\"C:\\mymovie.mp4\"";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.OutputDataReceived += (sender2, e2) =>
{
if (e2.Data != null)
{
Log("Received output data: " + e2.Data);
}
else
Log("Received output data: NULL");
};
p.ErrorDataReceived += (sender2, e2) =>
{
if (e2.Data != null)
{
Log("Received Error data: " + e2.Data);
}
else
Log("Received Error data: NULL");
};
p.Start();
p.BeginOutputReadLine();
p.BeginErrorReadLine();
p.StandardInput.WriteLine("get_time");
p.StandardInput.Flush();
So then I tried to use the remote control API via sockets.
IPEndPoint socketAddress = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 54165);
var vlcServerProcess = Process.Start(@"-I rc --rc-host " + socketAddress.ToString());
However, this method opens up a console window that I don't want visible and plays the video without any of the GUI controls. Just a d3d window.
I need it to look and behave completely normal if that is possible through this method.
Is there any other simple method I can do to get the current playing file name and progress without having to write a VLC plugin or read the process's memory?