VLC remotely control from C#

萝らか妹 提交于 2019-11-30 12:00:38

I have some code that is able to control it using sockets on the RC interface. This worked to a degree but has a lot of quirks. go to full screen seems to do nothing for a few seconds after play is invoked. Overall it sort of works.

The other options are:

Write a DirectDraw filter (very hard) but once this is done VLC can be used instead of or in conjunction with FFMPEG. Existing code that drives media player could use vlc.

Write an interop wrapper for libvlc, recently the VLC team split out libvlccore from libvlc so to the best of my knowledge all the interop is out of date. Once you write a wrapper you could embed vlc in a windows app. (if you need to support x64 you need to compile these libs under x64.

Look through the VLC code and find out if there is a way to send these windows messages.

EDIT This appears to have come out this week.

As Eoin mentioned, libvlc can be used to interact with VLC. As a C# user, you may want to try the .NET bindings offered by the libvlc-sharp project.

Edit: Seems like this project has not been maintained for years. I will leave the link anyway, in case you wish to take a look at it and maybe put some of its source to use.

Eoin Campbell

Have you looked at libvlc

You might be able to wrap that up in a library and interact with VLC through that.

If what you are trying to do is control a previously running executable, check out the Process class to enumerate through all the current processes or do it by name. Check the executable to match vlc.exe. You can then get a handle to the main window and do some P/Invoke to send messages as you are doing with your other executables. This is obviously riddled with potential problems such as if the there are changes to the keyboard shotcuts.

How use libvlc in C++ http://unick-soft.ru/art/files/libvlcProject.zip I think, use libvlc in C# very similar.

There's also the rc interface and even a telnet one: http://wiki.videolan.org/Console

However, I'd prefer libvlc if possible.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!