How do I know if subtitles (text track) are external or part of video container file?

This forum is about all development around libVLC.
user456
Blank Cone
Blank Cone
Posts: 20
Joined: 16 Dec 2017 19:52

How do I know if subtitles (text track) are external or part of video container file?

Postby user456 » 25 Feb 2018 19:07

When using libVLC for Android how do I know if subtitles (text track) are external (.srt, ass) or part of video container file (text track inside .mkv)?

https://code.videolan.org/videolan/libv ... id-samples

https://code.videolan.org/videolan/vlc-android

Code: Select all

// MediaPlayer.getSpuTracks() - Get the list of available spu (subtitle) tracks.

Code: Select all

MediaPlayer.TrackDescription[] trackDescriptions = mMediaPlayer.getSpuTracks();

Code: Select all

for (int i = 1; i < trackDescriptions.length; i++) {

Code: Select all

MediaPlayer.TrackDescription description = trackDescriptions[i];

Code: Select all

Log.i(TAG, "loadSpuTrack " + description.name + ", id " + description.id);

Code: Select all

}
Output
loadSpuTrack Track 1, id 2
loadSpuTrack Track 2, id 3
loadSpuTrack Track 3, id 4
loadSpuTrack Track 4, id 5
loadSpuTrack Track 5, id 6

It just searches and adds all external text track files (.srt, .ass) from parent file (directory) of video file (.mkv) and from video file itself

But there is no API (Java methods inside MediaPlayer or LibVLC classes) to identify if added subtitles are external or internal (from video file container), no method to disable adding external subtitles

Is there any solution?

Rémi Denis-Courmont
Developer
Developer
Posts: 15142
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How do I know if subtitles (text track) are external or part of video container file?

Postby Rémi Denis-Courmont » 25 Feb 2018 19:19

No.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests