caprica / vlcj

Java framework for the vlc media player
http://www.capricasoftware.co.uk/projects/vlcj
1.13k stars 260 forks source link

Getting subtitle/spu Text #263

Closed andre111 closed 10 years ago

andre111 commented 10 years ago

Is it possible to implement a method for getting the current subtitle/Spu(what does this abbreviation stand for) text so I could render it myself. It would be perfect if it was possible to do this without having vlc render the subtitle itself.

PS: I'm sorry if this sounds rude/demanding. I'm german and I was struggling to express what I would like to be able to do.

caprica commented 10 years ago

There is no API in LibVLC to do what you want, although I believe it has been requested numerous times before.

The only thing you could conceivably do is read the subtitle file yourself in your own application and synchronise them yourself with the video.

(Your comment did not sound rude/demanding!)

andre111 commented 10 years ago

Ok, I don't think I'm able to do this especially because many of my files have the subtitles included in the movie file in some way or another. The only reason I wanted to do this because VLC seems to render the subtiles in a wiered position, I will open a new isue for that

caprica commented 10 years ago

Well, it would need a change to VLC, then LibVLC, and then vlcj.

I tried to write a patch to VLC for something similar to this myself a while back, and it was kinda working but it was more of a hack than a proper change.

AbdelkarimTayache commented 8 years ago

after two, i still searching for a solution for the same problem, i'm wondering if you found a fix for this problem, i wont to read the content of SPu/subtitles, i have times in my video and i can't read it automatically, so i thinked if there a way to do it programmatically without need to do it manually, please if you have any idea a will appreciate it.

caprica commented 8 years ago

It's a shame, but it's just not possible. It is not exposed through LibVLC, and so it can't be exposed through vlcj either.

It needs a patch to VLC, but that is a significant piece of work and it needs a volunteer to do it.

I can only suggest loading the sub-title file yourself and somehow decoding it and using it based on the timing information it contains.

khrykin commented 6 years ago

You can extract embedded .srt's via ffmpeg/libavcodec. See this SO post for example.