As the title states I'm trying to figure out how to remove some .ass subtitles from an MKV video. I've looked high and low to try and figure this out but have had no success. The most common thing I've read is to use MKVextractGui, well i used the older one at first and it extracted the subtitles but would always give me a blank subtitle file that has the following message:
'Error: Unrecognized command line option '.
Then I switched to MKVextractGui 2, the only problem this time is that when I set it to extract the subs, it will say everything worked correctly, but the file was never where I specified it to be. So I tried extracting other tracks from the video like the fonts, audio, video, etc and they all appeared, just not the subtitles themself.
So far the only way I've gotten the subtitles to a point where I could actually edit them was by using MKVmerge, so I could remove everything but the subtitles. The only thing with this is that I have to first open up Aegisub, and choose to open the subtitles with a characterset, however when I do this the subtitles timing becomes wrong and starts directly at the start of the video.
Anyways, all I'm trying to do is make it so I can edit these subtitles a bit, get rid of all the fancy styling and placements and convert them to .srt files, keep the timing correctly, and burn them to dvd so i don't have to deal with annoying characters poping up on the screen because that's where they were encoded to be placed somewhere.
Anyways I appreciate any help.
FFMpeg is the swiss army knife of video editors and motion artists worldwide. Let’s take a look at one of the lesser-known (and kinda unexpected) features.
The options for customizations are actually option names from the ASS subtitles spec ('Advanced SubStation Alpha'). This is what FFmpeg uses internally (via libass). These can be applied both with the ass and subtitles filters. When using the subtitles video filter, FFmpeg converts the subtitles internally to ASS. Subtitles are pretty much the same. The subtitles will be printed in the info and then you can extract them, similar to: ffmpeg -threads 4 -i VIDEO.mkv -vn -an -codec:s:0.2 srt myLangSubtitle.srt 0.2 is the identifier that you have to read from the info. As I understand it video and audio codecs can be implied from file extension, but subtitles require explicit definition. If you add in the codec specification to srt then it should work. Ffmpeg -i subs.ass -c:s srt output.srt 1.
FFmpeg can easily extract embedded subtitles from videos. This command will grab the default subtitle track and export it as a srt file:
Ffmpeg Extract Pgs Subtitles
What if we want to get a different subtitle? First we need to figure out the track number for that subtitle by running ffmpeg ‑i input_file. You will get an output that something like this:
Notice the tracks are numbered #0:2, #0:3, etc. This is the value we want to pass over to the map command to select the proper subtitle.
Removing HTML from subtitles
There are a number of applications and online services that can strip html tags from subtitles (like HTML Stripper), but you can also solve this quickly with good old sed:
You can make an alias to this in your favorite shell so you don’t have to remember or copy/paste it all the time. Keep in mind that the results of sed won’t be as good as a HTML stripper and company, since this is just a simple regex. That said, it’s usually more than enough for subtitles.
Ffmpeg Dvd Subtitles
Converting to other formats
While FFmpeg can get this done for you with a limited number of formats (depending on how it was compiled) there is a better alternative. SubtitleEdit is a handy open source application that can convert between 200+ subtitle formats (and do a lot more of course).
If you want to bring those subtitles into Blender check out the SubsImport addon.
Batch rendering is complicated
Ffmpeg Extract Vobsub
Ffmpeg Extract Subtitle From Mkv
But it doesn’t have to be! Render+ lets you setup, run batches and a whole lot more from the comfort of Blender’s interface.
Try out Render+ today!