I have downloaded this MKVToolNix but I do not know how to use it for extracting the SRT subtitle. Who know ?
mkvtoolnix comes only with a command line tool for extraction.
There are a few GUIs available from 3rd parties.
On Windows, I use https://sourceforge.net/projects/gmkvextractgui/
But Orcaās tool which I linked to in the other thread will also extract the subtitles, as long as they are in SRT format.
I have a Mac. So I guess this tool will not work for me ? I also have MacX Video Converter Pro. This app should also be able to extract subtitles, but I donāt know how ?
Or is there a MAC equivalent for https://sourceforge.net/projects/gmkvextractgui/ ?
a quick Googling yields this: https://www.macupdate.com/app/mac/23764/imkvextract
I found MKVtools ā¦it looks like it is simple and that it works. Testing it now ⦠it needs quite some time to extract the subtitle. Is that normal ? I thought just cut the subtitle track from the MKV file and done ⦠?
@janscherders said:
I found MKVtools ā¦it looks like it is simple and that it works. Testing it now ⦠it needs quite some time to extract the subtitle. Is that normal ? I thought just cut the subtitle track from the MKV file and done ⦠?
The subtitle is āmuxed inā, which means to get the subtitle, the whole file must be read, because the data packets of the subtitle are interwoven with the video and audio packets.
You could also use Plexās transcoder through a command line/terminal, what ever the correct term for a Mac is. Iām use to using Windows, which would use the command below to extract the first subtitle stream it sees.
PlexTranscoder - i input_file.mkv -map 0:s:0 -c copy subtitle_file.ext
Of coarse you need to know the type of subtitle to name the proper extension. If you have more than 1 subtitle, just change the 0:s:0 to 0:s:1, 0:s:2, etc. for the one you want. If you want all of them, just repeat the command for each subtitle.
That is very interesting!
As @āMovieFan.Plexā has described, we can use -map 0:s:0
to get the first subtitle stream.
If one calls the Transcoder, it will respond with its configuration. This includes all the known encoders
-enable-encoder=flac --enable-encoder=alac --enable-encoder=libvorbis --enable-encoder=libopus --enable-encoder=mjpeg --enable-encoder=wrapped_avframe --enable-encoder=ass --enable-encoder=dvbsub --enable-encoder=dvdsub --enable-encoder=movtext --enable-encoder=ssa --enable-encoder=subrip --enable-encoder=text --enable-encoder=webvtt --enable-encoder=xsub --enable-encoder=pcm_f32be --enable-encoder=pcm_f32le --enable-encoder=pcm_f64be --enable-encoder=pcm_f64le --enable-encoder=pcm_s8 --enable-encoder=pcm_s8_planar --enable-encoder=pcm_s16be --enable-encoder=pcm_s16be_planar --enable-encoder=pcm_s16le --enable-encoder=pcm_s16le_planar --enable-encoder=pcm_s24be --enable-encoder=pcm_s24le --enable-encoder=pcm_s24le_planar --enable-encoder=pcm_s32be --enable-encoder=pcm_s32le --enable-encoder=pcm_s32le_planar --enable-encoder=pcm_u8 --enable-encoder=pcm_u16be --enable-encoder=pcm_u16le --enable-encoder=pcm_u24be --enable-encoder=pcm_u24le --enable-encoder=pcm_u32be --enable-encoder=pcm_u32le --enable-encoder=h264_qsv --enable-encoder=mpeg2_qsv --enable-encoder=hevc_qsv --enable-encoder=h264_vaapi --enable-encoder=hevc_vaapi --enable-encoder=h264_nvenc --enable-encoder=eac3_eae
We do not have to guess the .ext! Instead we directly call the encoder of our targeted subtitle format. e.g.
-c ass ~/Downloads/test5.ass
or
-c subrip ~/Downloads/test5.srt
In both cases, we get a nicely formatted file in the respective subtitle style.
If you want to extract a specific track from an mkv file using MKVToolNix, for instance an audio track or a subtitle track, you just select the track you want extracted, uncheck the boxes next to all the tracks you want to exclude, and then in the destination file, change the file extension from ā.mkvā to ā.aacā or ā.srtā or whatever applies. Then press āstart multiplexingā. You donāt need to use the command line tool to do this.
@affleckdan said:
If you want to extract a specific track from an mkv file using MKVToolNix, for instance an audio track or a subtitle track, you just select the track you want extracted, uncheck the boxes next to all the tracks you want to exclude, and then in the destination file, change the file extension from ā.mkvā to ā.aacā or ā.srtā or whatever applies. Then press āstart multiplexingā. You donāt need to use the command line tool to do this.
I donāt think that is good advice. While the file will have the proper extension, it will actually not be a properly formatted file, and Iām pretty sure it will not work with most, if any, video players, including Plex.
for example, the first 2 lines from a proper .srt fileā¦
1
00:00:07,108 --> 00:00:08,468
- Previously,
on "The Magicians"...
2
00:00:10,144 --> 00:00:11,145
- Quentin...
[cries out]
and from the file created the way suggestedā¦
EĆ££Bā ĀBĆ·ĀBòĀBóĀBāĖmatroskaBā”ĀBā¦ĀSā¬g #Māŗt½MĀ»ÅSĀ«āIĀ©fS¬āMĀ»ÅSĀ«āTĀ®kS¬āÅ MĀ»ÅSĀ«āSĀ»kS¬āĆ MĀ»ĀSĀ«āTĆgS¬Ę!hƬO¾
('I Am The Sun') 64-bitDā°ĖAE+⬠DaĖaā¬Ć©ð#Ʀ s¤ĀBgI@Ć¢[gQĆVāŗ
ĖĆĆTĀ®k¬®ªĆĀsĆ
Ėà Ž1ƤGj%ĀĘĀĖĀ ÅĀ ā ā¹S_TEXT/UTF8SnĘSDHƬD%
C¶u@ĘƧāĀ® ā¹Ā”ā¦Ā .āŗāƵ ®”¨ - Previously,
on "The Magicians"...āŗāà £”ĀĀ
ò - Quentin...
[cries out]āŗ
Best to extract the subtitle properly, even if it takes a little longer.
@leelynds said:
I donāt think that is good advice. While the file will have the proper extension, it will actually not be a properly formatted file, and Iām pretty sure it will not work with most, if any, video players, including Plex.
Yeah, it is still in the matroska container.
Best to extract the subtitle properly, even if it takes a little longer.
If you use one of the frontend GUIās available for mkvextract, it doesnāt even have to take longer.
https://mkvtoolnix.download/links.html
I used MKV Extract GUI a couple of days ago to strip out a perfectly good SRT file and it took about as long as it would take to remux it - so I canāt say it was a long and tedious processā¦
āiMkvExtractā
MKVToolNix works fine with its GUI but also in the terminal on macOS. The raw apps are just hidden in the app itself. To access themā¦
- Right click the MKVToolNix in
/Applications
and clickShow Package Contents
- from there goto
./Contents/MacOS
or./Contents/Resources
to find the MKVToolNix binaries (sorry⦠I cannot check the exact path right now) - Open the app
Terminal
- Drag the binary mkvextract into the terminal window⦠this will copy the full path into terminal (donāt worry, it wonāt move the actual file)
- Follow the MKVToolNix documentation to complete the command to extract your SRT
If you donāt want to do this without a GUI I can also recommend to use an app called Subler. Opening the MKV with Subler will result in Subler creating a new media file, allowing you to chose which tracks to transfer from the MKV (donāt worry if it doesnāt allow you to transfer the movie track⦠all you need is the subtitle). After confirming, you can extract the subtitle from the ānew fileā and exit the app.
This also works great if you have image based DVD/Blu-Ray subtitles. Subler will apply OCR to convert those into SRTs.
Here is a quick way to extract all subtitle tracks from every mkv file in the current directory.
Just save the below code as .BAT or .CMD file format.
@ECHO OFF
ECHO Extracting all .mkv subtitle tracks in current folder.
ECHO.
ECHO.
FOR %%A IN (*.mkv) DO (
FOR /F %%I IN ('mkvmerge --identify "%%A" ^| FIND /C "Track ID"') DO (
IF %%I GTR 0 (
ECHO Analyzing "%%~nxA"
FOR /L %%T IN (0,1,%%I) DO (
mkvmerge.exe --identify "%%~dpnxA" | FIND /C "Track ID %%T: subtitles">NUL
IF NOT ERRORLEVEL 1 mkvextract.exe tracks "%%~dpnxA" %%T:"%%~dpnA-ID%%T".srt
)
)
ECHO.
ECHO.
))
ECHO.
ECHO.
ECHO The end.....
PAUSE
This batch file will require the files mkvmerge.exe and mkvextract.exe. Both come with MKVToolNix
NOTE: This will extract all ass/ssa, srt, sup, idx/sub, (and maybe more) subtitles and save them as MKVfileName-IDx
. Where x
is the MKV TrackID.
ONE CAVEAT THOUGH⦠All but idx/sub end up with the file extension .SRT. You will have to rename that extension if you need the extension to be true for the format. An example of this is SubtitleEdit, where it will not import ā.SUPā sub-pictured subtitles if the extension is .SRT.
@tom80H said:
If you donāt want to do this without a GUI I can also recommend to use an app called Subler. Opening the MKV with Subler will result in Subler creating a new media file, allowing you to chose which tracks to transfer from the MKV (donāt worry if it doesnāt allow you to transfer the movie track⦠all you need is the subtitle). After confirming, you can extract the subtitle from the ānew fileā and exit the app.
This also works great if you have image based DVD/Blu-Ray subtitles. Subler will apply OCR to convert those into SRTs.
Same applies to Subtitle Edit on Windows
I can NOT thank you enough for this!
I have been searching/testing different ways of extracting subtitles and your solution is SPOT-ON. I have tested it on several files so far with no trouble at all. It is SOOO fast. =D
Thank you.