August 23, 2016

Subtitles support for VOD

Nimble Streamer has wide VOD streaming feature set which covers many HLS-related capabilities like ABR streaming or multiple tracks support.

Now Nimble Streamer is capable of adding subtitles to VOD streams.
Supported formats include  WebVTT, SRT and TTML.

Let's see how they can be used. Major scenarios for VOD subtitles usage can be split into those two categories:

  • Simple scenario - a VOD file with one rendition has one corresponding language subtitles file. This is most common use case and it's handled in a simple way.
  • Complex scenarios like multiple languages for multiple renditions or other versions of the content. It's based on SMIL files usage and it can cover various use cases.
Let's take a look at both of them.

One subtitles file and one rendition


If you have just 1 subtitles file, you need to name it the same way as the original MP4 file. Like this:
/home/user/content/mp4/sample_with_subtitles.srt
/home/user/content/mp4/sample_with_subtitles.mp4
So when you have VOD route set, your playlist URL will look like
http://your.domain/mp4/sample_with_subtitles.mp4/playlist.m3u8
And the playlist itself will be formed like this:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="sub",NAME="English",URI="subtitle.m3u8?nimblesessionid=91",LANGUAGE="eng"
#EXT-X-STREAM-INF:BANDWIDTH=1049607,CODECS="avc1.66.30,mp4a.40.2",RESOLUTION=424x240,SUBTITLES="sub"
chunk.m3u8?nimblesessionid=91
Now the player will be able to get subtitles using the URI mentioned there.

Default language

Unlike TTML, the WebVTT and SRT formats have no language code in their structure so there's no way to determine it. This is why we added vod_subtitle_default_language_id parameter into Nimble configuration file. It's alpha3 language code and it's "eng" by default if nothing else is specified.
If you need to use combination of different languages on the same server, you should look at the next section.

Multiple subtitles and/or renditions


SMIL format is a way you can describe VOD content which has combination of video and audio, like aforementioned ABR streaming.

This format can also be used for subtitles. You can specify which subtitle files will be used for which video files. Having SMIL file, the result URL will look like this:
http://your.domain/path/smil:bunny.smil/playlist.m3u8
Let's take a look at some examples. All sample SMIL files and playlists mentioned below can be found on WMSPanel github page.

One WebVTT subtitles file for 4 renditions of same video


Simple use case when you have just 1 subtitles file and you need to apply it to multiple renditions.


Two SRT subtitle files for 4 different renditions


Check 2 "textstream" elements specifying applied English and Spanish SRT subtitles.


One TTML subtitles file with 5 languages for 4 renditions


Here one textstream file specifies a reference to TTML file containing 5 languages.


Mix of languages and renditions


You can see "first_group" of subtitles (see subgroup="first_group") containing one set of languages (English, German and Norwegian) and it's applied to bigbuckbunny_450_first.mp4 and bigbuckbunny_750_first.mp4 files.
The default group of subtitles contains English, French and Spanish and it's applied to bigbuckbunny_450.mp4 and bigbuckbunny_750.mp4 files that a basically same movies but have probably other audio tracks or logos etc.
So defining groups of subtitles and assigning them to each "video" tag will make Nimble Streamer produce corresponding playlist entries.
If you don't specify the groups then all languages will be used by the player to display to the user.


As you see simple SMIL syntax allows mixing various combinations of content and subtitles so it's up to you to define what is best for your case.

Contact us if you have any questions or suggestions regarding this feature set.

Related documentation


Nimble StreamerHLS feature setVOD streaming in NimbleTTML format,

2 comments:

  1. Is there also support for subtitles when using Dash?

    ReplyDelete