Xuggler (or Xuggle) is a great Audio/Video library for Java based on FFMpeg (so it can open almost everything existing on the planet)
As it is great, it has not a lot of documentation, specially for subtitles.
i was able to come with a bit of code that is supposed to read subtitles from a file
the only problem is that the text read is without the timecodes or the subtitle numbers as there is in SRT files:
i have this :
instead of this :
so this a problem and i really don't see where it comes from!
here is the code of the function I used:
To run the code you will need the Xuggler library available here : Xuggler 5.4 if the compiler says something about slf4j you will need that library too : slf4j and here is a test file with a subtitle in it : title01_track3.mks
Jean-francois Le Bas wrote:As it is great, it has not a lot of documentation
That quote seems a little backwards to me: any tool should be well documented. If it is not well documented then it would make it less likely for me to call it great.
But back to your question: it looks like you get the subtitles from an IPacket, and it looks like IPacket has methods for getting timestamps - so maybe that is where you get the time codes? As for the subtitle numbers, not sure, but maybe the first IPacket will be subtitle 1, the second IPacket 2, etc... that is pretty naive of me but that is because I don't know the format, I just took a quick peak at the IPacket API (found on the Xuggler website)
Jean-francois Le Bas
posted 6 years ago
thank you for your answer
you were right about timestamps
packet.getFormattedTimeStamp() give me 00:00:15,740
you were also right about the fact that each packet is a subtitle
the only problem is to get the subtitle end time. i tried :