I would like to get some list of all available subtitles tracks like:
#1 - id, name
#2 - id, name
#3 - id, name
...
So list would tell how much subtitles tracks I have, show id and name of each track
Is there any FFmpeg
option to show such list?
Example
ffprobe
command to list the stream ID and language:
ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 input.mkv
Result
5,eng
6,fao
7,ain
This shows the stream id #5 is English, #6 is Faroese, and #7 is Ainu. See List of ISO 639-1 codes for the language abbreviations.
-map
option
You can use this information to create your command. If you want the English and Ainu languages use:
-map 0:5 -map 0:7
or
-map 0:s:0 -map 0:s:2
or
-map 0:s:m:language:eng -map 0:s:m:language:ain
See the -map
option documentation for more info.
FFmpeg seems doesn't have such option
so we can only parse all printed data by ffmpeg -i VIDE_FILE_NAME
(filtering out not stream text track lines)
also FFmpeg doesn't really prints that ID (it's just stream position made by FFmpeg) like MediaInfo would print