Page 1 of 1

Ability to access the subtitle info?

Posted: 10 Jul 2012 23:36
by sbutts
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

Re: Ability to access the subtitle info?

Posted: 11 Jul 2012 13:42
by mederi
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.

Re: Ability to access the subtitle info?

Posted: 11 Jul 2012 17:52
by sbutts
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

Re: Ability to access the subtitle info?

Posted: 12 Jul 2012 22:18
by mederi
You are right. The "Dico" script has such function, but it is too complicated. I better do it my way. Thanks.