Ability to access the subtitle info?

Discuss your Lua playlist, album art and interface scripts.
sbutts
New Cone
New Cone
Posts: 2
Joined: 10 Jul 2012 23:21

Ability to access the subtitle info?

Postby sbutts » 10 Jul 2012 23:36

I'd like to write a VLC extension that outputs the subtitle info to a tcp port. So instead of using the OSD it would write the subtitles to a socket.

My preferred method would be to access the subtitles via VLCs lua methods. However, I haven't been able to find any methods available that allow a lua script to access the subtitles.
Does anyone know if that is possible?

I guess another method would be to have the lua script open the srt file and trigger when the proper time is reached. I see a method for add_subtitle, is there a corresponding get_subtitle, which would return the subtitle data? Or do I have to use a dialog and have the user load the srt file?

Thanks,
Steve

mederi
Big Cone-huna
Big Cone-huna
Posts: 1949
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Ability to access the subtitle info?

Postby mederi » 11 Jul 2012 13:42

So far, I have not found a way how to access subtitles loaded by VLC. Something like "get_subtitle" is not available in lua scripting. So I think that the only method is to perform the whole subtitling using custom lua script. I work on such an extension.
If you can help me to parse a subtitle string (SRT subtitle file content) to particular data stored in array {{start1, stop1, "text1"}, {start2, stop2, "text2"}, ...}, I can immediately publish the working extension.

sbutts
New Cone
New Cone
Posts: 2
Joined: 10 Jul 2012 23:21

Re: Ability to access the subtitle info?

Postby sbutts » 11 Jul 2012 17:52

So far, I have not found a way how to access subtitles loaded by VLC. Something like "get_subtitle" is not available in lua scripting. So I think that the only method is to perform the whole subtitling using custom lua script. I work on such an extension.
If you can help me to parse a subtitle string (SRT subtitle file content) to particular data stored in array {{start1, stop1, "text1"}, {start2, stop2, "text2"}, ...}, I can immediately publish the working extension.
Ok, that's what I thought.
The Dico script has a function for doing exactly what you're looking for.

Steve

mederi
Big Cone-huna
Big Cone-huna
Posts: 1949
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Ability to access the subtitle info?

Postby mederi » 12 Jul 2012 22:18

You are right. The "Dico" script has such function, but it is too complicated. I better do it my way. Thanks.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 2 guests