RSATom / QmlVlc

[ABANDONED] libvlc wrapper for Qt Quick 2/Qml
Other
140 stars 56 forks source link

VLC rc module #37

Closed kevkha closed 9 years ago

kevkha commented 9 years ago

I would like to be able to control the player via CLI like so https://wiki.videolan.org/Documentation:Modules/rc/ Can this be done with this wrapper/library?

RSATom commented 9 years ago

I.e. you need have two windows one with video output, second with command line to send commands?

kevkha commented 9 years ago

Yes, just one GUI player like the demo and use a script or CLI on the other to feed the video or control some basic functions such as play, pause etc...

From VLC doc

rc
Always enabled
This is the Remote Control interface module. It allows you to control VLC via commands, such as play, stop, etc... or via a script. This interface is text-based, so you should use it when you are in console mode .
Options:
--rc-show-pos, --no-rc-show-pos : Indicates whether the position in the stream must be shown (outputs one timer line every seconds) (default disabled)
--fake-tty, --no-fake-tty : Enables or disables TTY virtual terminal emulation (default disabled)
RSATom commented 9 years ago

It's possible, but you have to implement CLI yourself.

kevkha commented 9 years ago

Since VLC already had this module can we port it into your wrapper without much efforts. Just try to not recreating the wheels :)

RSATom commented 9 years ago

Don't know. RC act as a VLC GUI, but we already have one - don't sure they could work together.

kevkha commented 9 years ago

Some good info here https://n0tablog.wordpress.com/2009/02/09/controlling-vlc-via-rc-remote-control-interface-using-a-unix-domain-socket-and-no-programming/

RSATom commented 9 years ago

I understand how it works, and think it will not work with QmlVlc.

kevkha commented 9 years ago

Could you consider it as an enhancement? It would be nice to have this module in QmlVlc. Thanks.

RSATom commented 9 years ago

Don't think it's possible implement some generic solution which will be useful to many... So I'm afraid you have to do it yourself. Sorry.

kevkha commented 9 years ago

I see there is a src module here https://github.com/videolan/vlc/tree/master/src/modules but not sure where to begin. Perhaps, alternate solution is implementing RTSP server/client with QmlVlc. Any thought?

RSATom commented 9 years ago

What final task you trying to solve by this? Do you need control player over network or something else?

kevkha commented 9 years ago

Yes, my project requires to feed video and control the video viewer remotely.

RSATom commented 9 years ago

Will you have any server where your application will connect?

kevkha commented 9 years ago

Previously, I used normal VLC player with RC module and I added a web interface to send player controls like pause and toggle audio track but I did not have much control with the viewer. With your library I have more control with the front end but back end is lack. To answer your question, currently both back end and front end are on the same host.

RSATom commented 9 years ago

I mean maybe it will be simpler just get commands from server by player itself, not send it to player?

kevkha commented 9 years ago

Not a bad idea. If we can't push then we pull from player. Still though, as a front end developer I really want the users to be able to control the player by other means (web, mobile) not depending on the RC (remote control).

RSATom commented 9 years ago

I still little not understand your idea. 1) How your users see the video? Via some sort of client application? Or maybe they have no direct access to it (some sort of big display in public place maybe) - and that's why you need remote control application? 2) And it seems you have some sort of streaming server? Do you use QmlVlc on it?

kevkha commented 9 years ago
  1. It's a karaoke player and everyone sees one player on a TV. Obviously, there is only one IR remote control for many people which is not good. So I implemented a back end web server for them to search and queue song using a web/mobile interface (no more fighting over the RC). Also, using this interface to control some basic commands to player.
  2. Songs are stored locally and I use script to feed to VLC player programtically over VLC RC Module. Now I want to replace VLC player with your QmlVlc and need to retain everything in # 1
RSATom commented 9 years ago

It seems now I understand you. Let me think a little about it.

kevkha commented 9 years ago

Thank you and sorry for not explaining the details before. If your QmlVlc library has Command Line API that would be perfect ;-)

RSATom commented 9 years ago

and I use script to feed to VLC player programtically over VLC RC Module.

what type of script do you use?

kevkha commented 9 years ago

Currently, I use Perl and some Python. Any supported scripting language by the OS should do. Thanks.

RSATom commented 9 years ago

And you just emulate user typing? right?

kevkha commented 9 years ago

That's correct.

RSATom commented 9 years ago

Did you try send commands same way to QmlViewer?

kevkha commented 9 years ago

Yes I tried with your demo but not working. I go to the debug folder where demo is and fire the command with pause for instance but it opens up another player instance instead of pausing.

RSATom commented 9 years ago

So if you could handle emulated keyboard input directly in QmlVlcDemo like application - it will be enough for you?

kevkha commented 9 years ago

Some basic IR controls I can do mapping but not sure solution for mri feeding and I need to query status of concurrent (is playing) video from script too.

RSATom commented 9 years ago

i.e. it should be interactive... then I think you should make some basic server (sock or http) on application side and connect to it from your favorite scripting engine. Btw, did you consider using NW.js for this task? As I know it's allow implement basic http server with ease, and it could use WebChimera Plugin (based on QmlVlc)

RSATom commented 9 years ago

or you could try something like this: http://doc.qt.io/qt-5/qtcpserver.html

kevkha commented 9 years ago

I found your WebChimera before QmlVlc and love all your works but WebChimera Plugin for desktops and majority of users have mobile devices. I have no c++ exp but going to give it a try. Thanks for the link.

RSATom commented 9 years ago

hm... QmlVlc will not work well on mobile devices too. It require some optimizations.

RSATom commented 9 years ago

I have no c++ exp but going to give it a try. Thanks for the link.

Then it will be much easier for you implement it with NW.js...

kevkha commented 9 years ago

Is it possible to use WebChimera in QML with WebKit as front end player without the need of WebChimera Plugin?

RSATom commented 9 years ago

Your question little bit not clear for me. What do you mean by "use WebChimera" + "without the need of WebChimera Plugin"

RSATom commented 9 years ago

Just if it's now clear for you, WebChimera Plugin = QmlVlc + FireBreath.

FireBreath - just library for simplify NPAPI (i.e. browser) plugins development.

RSATom commented 9 years ago

and on top of WebChimera Plugin @jaruba implemented WebChimera Player - i.e. set of .qml and .js files implementing "ready to use" Web Player UI.

kevkha commented 9 years ago

I want to have more controls of the player from both front end and back end. Since WebChimera offers http protocol so I was thinking creating a web interface using QML with webkit for front end and then mapping keyboard this way but not 100% this will work.

RSATom commented 9 years ago

ok, then I can offer you following solution: 1) RC for frontend: http server on node.js (inside NW.js) + WebChimera Plugin/Player JS API 2) RC from backend: XMLHttpRequest from QML to backend server + WebChimera Plugin QML API

RSATom commented 9 years ago

WebChimera Plugin JS API: https://github.com/RSATom/WebChimera/wiki/JavaScript-API WebChimera Plugin QML API: https://github.com/RSATom/WebChimera/wiki/QML-API WebChimera Player JS API: http://wiki.webchimera.org/Player_JavaScript_API

kevkha commented 9 years ago

Thank you. I will create a PoC and see it will full fill my needs. This thread is getting lengthy and I guess we can rest it. I will file new one when need be. Thanks again for everything.