How do I know if subtitles (text track) are external or part of video container file?
Posted: 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
Output
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?
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
}
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?