Page 1 of 1

A way to read currently shown subtitle from an external app

Posted: 11 Oct 2016 16:52
by Kirrrr
Hey there!

I don't know if this question a real Feature Request. I just can't find an appropriate solution among existing programmatic interface options.

:?:
Are there any means to expose currently shown subtitle string via some programmatic inteface (http, RC/telnet, tcp, SendMessage) so it can be processed by other apps?

If there are no such option I guess it is pretty natural to implement it at least by one of possible ways (e.g. as an http subpage). :idea:

Best regards!

Re: A way to read currently shown subtitle from an external app

Posted: 11 Oct 2016 23:28
by Jean-Baptiste Kempf
So far, no there is no way to do that. It would require a custom subtitle renderer

Re: A way to read currently shown subtitle from an external app

Posted: 11 Oct 2016 23:41
by Kirrrr
Thank you for quick reply, Jean-Baptiste!

So, if I understood correctly the only way to have current subtitle string in the external app is to get current playing video, get playing position and parse appropriate subtitles file? (obviously this can be done both in Lua extention or in external app) Thus a double work are done: once subtitles are decoded by player itself and second time they are decoded by extension or external app. Non elegant and pity. =(
Ok. Will try to deal with it. :)

Re: A way to read currently shown subtitle from an external app

Posted: 31 Oct 2016 09:52
by Kirrrr
Well... I would up this topic.

Tossing around in many manners I can't find any erm... humane approach to implement showing of subtitles in externall app. All ways lead to duct-taped solutions with one basic defective element: independent parsing of raw subtitles text, in fact it is a rewriting of subtitling algorythm of the player. Bummer... And there is NO ONE way to EXACTLY get currently displayed subtitle text, despite of the fact that this text is ALREADY AVAILABLE in some form inside the subtitling algorythm.

Just one string variable, but it is concealed inside player's "black box". I can't believe that exposing of this string is unreal. =(

Best regards!

Re: A way to read currently shown subtitle from an external app

Posted: 31 Oct 2016 11:42
by Rémi Denis-Courmont
As J-B already wrote, you could get the subtitle text with a custom text rendering VLC plug-in. There are no needs to duplicate the subtitle file parser nor to second-guess the correct timing here.

Obviously, that will only work if the subtitle is actually text; some subtitles are pixel maps with alpha channel (e.g. DVD).

Re: A way to read currently shown subtitle from an external app

Posted: 31 Oct 2016 11:47
by Kirrrr
As J-B already wrote, you could get the subtitle text with a custom text rendering VLC plug-in.
Oops... My bad. I misunderstood that point.
Thank you!
Will try to lurk further on this subject.

Re: A way to read currently shown subtitle from an external app

Posted: 01 Nov 2016 11:46
by Kirrrr
Rémi, could you please point me to appropriate dev docs which are better to start with? Maybe some suitable examples.

I have some experience in programming with VC++ so I hope it have a sence for me to try to develop such a gizmo (I hope I'm not too presumptuous =) ).

Best regards!

Re: A way to read currently shown subtitle from an external app

Posted: 01 Nov 2016 12:37
by mederi
You could find some useful information here: https://wiki.videolan.org/Developers_Corner
Perhaps the TTS plugin could be a suitable subtitles related example for you: https://trac.videolan.org/vlc/ticket/11893
Could you please compile the win32 sapi plugin for me (sapi.dll)?

Re: A way to read currently shown subtitle from an external app

Posted: 01 Nov 2016 12:42
by Kirrrr
Thank you, mederi!
Could you please compile the win32 sapi plugin for me (sapi.dll)?
Sorry, but not now. I haven't opened MSVS for a very long time. Need some time for recovery. =)