ffmpeg, subtitles, and WebM

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
AliceWonder
Posts: 11
Joined: Mon Mar 10, 2014 1:16 am

ffmpeg, subtitles, and WebM

Post by AliceWonder » Mon Mar 10, 2014 1:30 am

I am using MakeMKV with Fedora 20, ffmpeg 2.1.4 from rpmforge.

I am transcoding the rips to WebM - this is for my laptop I travel with and I can not install any third party codecs or software not available in stock Fedora on my laptop for security reasons. Well, I have root, I could, but I'm not suppose to.
Ripping is on my home desktop where I have more freedom.

I've noticed that my bluray discs use a subritle format known as PGS and I can extract them via mkvextract.

Is there a nice perferably CLI utility to convert them to WebVTT ??

Secondly, some movies have subtitles that are displayed even when you have subtitles disabled.
For example, if the audio language is English but the audio track has french for artistic effect, English subtitles are often displayed for those parts.

I'm assuming that for WebM I will probably have to encode such subtitles onto the video itself, anyone familiar with how to identify these translation subtitles and put them on the VP8 video stream itself so they are always present?

Thank you for any assistance.

Romansh
Posts: 873
Joined: Sat Jan 22, 2011 7:09 pm

Re: ffmpeg, subtitles, and WebM

Post by Romansh » Mon Mar 10, 2014 1:45 pm

Not sure if there's anything that can convert PGS to WebVTT directly, you might have to use SRT as an intermediate.

Forced subtitles can be:

- in the main subtitle track, flagged as forced

- in their own dedicated track, flagged as forced

- in their own dedicated track, NOT flagged as forced

Determining which scenario it is usually requires testing all tracks in the output.

AliceWonder
Posts: 11
Joined: Mon Mar 10, 2014 1:16 am

Re: ffmpeg, subtitles, and WebM

Post by AliceWonder » Wed Mar 12, 2014 1:21 pm

okay here's what I ended up doing -

PGS to text formats looks like it requires software that requires Windows.

So with Kill Bill Part 1 - this was very time consuming but I like the results -

I manually created a .srt file with the subtitles from the Japanese portions of the movie.
Converted that file to .ass via ffmpeg

Edited the resulting .ass file for positioning (font size etc.)

Passed that .ass file to ffmpeg during transcode to webm so they become part of the video stream.

I still have some adjustment to do, but the subtitles are already better than they are on the Bluray disc.

Easier to read as I am placing them in the black bar below the film area. - the Bluray (at least the one I have) puts the subtitles directly on the movie and they can be very hard to read when they are similar color to the background. This solves that.

As far as non-forced subtitles, I'm not doing them initially. Eventually when all my discs are ripped and forced subtitles are embedded via libass and ffmpeg, then I may start to make some subtitle files using WebVTT but AFAIK no stand-alone player will display WebVTT subtitles embedded as a track in the WebM container, so there's no point right now.

Once I finish adjusting the Kill Bill 1 subtitles, then on to Kill Bill 2...

Fortunately most of my Bluray discs don't have a lot of forced subtitles so once Kill Bill series is done, rest will be cake.

Post Reply