如何编写可与操作系统交互的VLC插件 [英] How to write VLC plugin that can interact with the operating system

查看:407
本文介绍了如何编写可与操作系统交互的VLC插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找出是否可能和如何(我不在乎语言C / C + +,Lua,Python ...)来做一个VLC插件,其目的将由VLC播放器调用,在视频流的特定时间会做一些动作。



我需要做的动作是打开一个UDP套接字,并发送一些数据从一个文件以及当前播放的视频。



我需要做一个像字幕阅读器,它最好能初始化UDP套接字和发送读取的数据到服务器。 p>

我不确定在Lua中是否可以创建UDP套接字,也许更好的选项是二进制C / C ++插件,但找不到任何示例。

一般来说,我的要求是:


  1. 在VLC启动时加载设置文件

    li>
  2. 需要由播放器在视频流的特定时间触发

  3. 获取源视频流的文件名

  4. 打开相同名称但不同扩展名的文件

  5. 打开UDP套接字

  6. 撰写邮件

  7. 发送消息

  8. 继续循环,直到视频流结束


$ b b

任何信息,示例或网站链接都非常感谢。

解决方案

看起来你想创建一个控件接口模块。这些是在VLC上下文中用C / C ++编写的,并且需要为每个要定位的平台进行(重新)编译。
看看audioscrobbler模块,看看如何与当前输入流交互,以及如何检索元数据,如文件名等。由于这些模块是在C中,打开套接字和传输数据不是一个大问题。



最大的问题可能是你需要一个复杂的编译环境,如果你想要瞄准Windows平台。请查看wiki上的汇编HOWTO的信息 http://wiki.videolan.org/Compile_VLC/ 因为这可能是你在尝试任何编码之前想尝试的。



考虑到这一点,你可以在lua中实现类似特性的扩展,这更容易开发(因为你不需要自己编译VLC,它会跨平台)。打开UDP套接字可能有问题。 TCP只是工作。此网页可能是一个不错的起点: http://www.coderholic.com/extending -vlc-with-lua /


I need to find out if it is possible and how (I do not care about the language C/C++, Lua, Python ...) to make a VLC plugin which purpose will be to be called by the VLC player and at specific times of the video stream will do some action.

The action that I need to do is to open a UDP socket and send some data read from a file that comes along with the video currently played.

I need to make something like a subtitle reader that on it's best can initialize UDP socket and send the read data to the server.

I am not sure that creation of UDP socket is possible in Lua maybe the better option will be a binary C/C++ plugin but can't find any example.

In general at the best my requirements are:

  1. Load settings file at VLC launch
  2. Need to be triggered by the player at specific times of the video stream
  3. Get the file name of the source video stream
  4. Open the file (script) with the same name but different extension
  5. Open a UDP socket
  6. Compose the message
  7. Send the message
  8. Continue the loop until the end of the video stream

Any information, example or site, link is greatly appreciated.

解决方案

Looks like you would like to create a control interface module. Those are written in C/C++ within the VLC context and in turn need to be (re-) compiled for each platform you would like to target. Have a look at the audioscrobbler module to see how to interact with the current input stream and how to retrieve metadata such as file name, etc. Since those modules are in C, opening sockets and transmitting data is not a big deal.

The biggest caveat is probably that you need a complex compilation environment if you would like to target the Windows platform. Have a look at the compilation HOWTO's on the wiki http://wiki.videolan.org/Compile_VLC/ since this is probably what you would like to try prior to doing any coding.

Thinking about it, you can probably achieve a similarly featured extension in lua, which is easier to develop (since you don't need to compile VLC yourself and it will cross-platform). Opening UDP sockets might be problematic though. TCP will just work. This page could be a nice starting point: http://www.coderholic.com/extending-vlc-with-lua/

这篇关于如何编写可与操作系统交互的VLC插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆