Dynamic Adaptive Streaming over HTTP (DASH) is a popular adaptive bitrate streaming technique that allows users to enjoy high-quality video content seamlessly. One of the key components of a DASH system is the manifest file, which contains metadata about the video content, such as the available bitrates, resolutions, and segment URLs. In this article, we will discuss how to use multiple subtitles in a DASH manifest with Google Transcoder, a powerful and easy-to-use transcoding tool.
Introduction to DASH Manifest
A DASH manifest file is an XML file that contains metadata about the video content. It includes information about the available bitrates, resolutions, and segment URLs. The manifest file is used by the DASH player to determine which segment to request next based on the current network conditions. The manifest file also includes information about the audio and subtitle tracks that are available for the video content. In this article, we will focus on how to include multiple subtitle tracks in a DASH manifest file.
Using Multiple Subtitles in DASH Manifest
Google Transcoder is a powerful transcoding tool that can be used to create DASH manifests with multiple subtitle tracks. To use multiple subtitles in a DASH manifest with Google Transcoder, you need to follow these steps:
- Create a subtitle file for each language that you want to include in the manifest. The subtitle file should be in the WebVTT format.
- Upload the subtitle files to a web server or a cloud storage service. Make sure that the subtitle files are accessible via HTTP or HTTPS.
- Create a DASH manifest file using Google Transcoder. You can use the Google Cloud Console or the Google Cloud SDK to create the manifest file. When creating the manifest file, make sure to include the URLs of the subtitle files in the
Subtitleelement. - Test the DASH manifest file using a DASH player. Make sure that the subtitle tracks are displayed correctly in the player.
Step 1: Creating Subtitle Files
The first step in using multiple subtitles in a DASH manifest with Google Transcoder is to create a subtitle file for each language that you want to include in the manifest. The subtitle file should be in the WebVTT format. You can use a text editor or a specialized tool to create the subtitle file. The subtitle file should contain the timestamps and the subtitle text. The timestamps should be in the format of HH:MM:SS.MS.
Step 2: Uploading Subtitle Files
The second step is to upload the subtitle files to a web server or a cloud storage service. Make sure that the subtitle files are accessible via HTTP or HTTPS. You can use a web hosting service or a cloud storage service such as Google Cloud Storage or Amazon S3 to host the subtitle files. Make sure to note down the URLs of the subtitle files, as you will need to include them in the DASH manifest file.
Step 3: Creating DASH Manifest File
The third step is to create a DASH manifest file using Google Transcoder. You can use the Google Cloud Console or the Google Cloud SDK to create the manifest file. When creating the manifest file, make sure to include the URLs of the subtitle files in the Subtitle element. The Subtitle element should be included in the AdaptationSet element that corresponds to the video content. You can include multiple Subtitle elements in the AdaptationSet element to include multiple subtitle tracks.
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT10S" type="static" mediaPresentationDuration="PT0H55M43.537S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
<Period id="0" start="PT0S" duration="PT0H55M43.537S">
<AdaptationSet id="0" contentType="video" segmentAlignment="true">
<Representation id="0" mimeType="video/mp4" codecs="avc1.4d401f" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="3150000">
<BaseURL>video/video_1280x720_24fps_3150kbps.mp4</BaseURL>
<SegmentTemplate initialization="video/video_1280x720_24fps_3150kbps.mp4" media="video/video_1280x720_24fps_3150kbps_$Number$.m4s" timeShiftBufferDepth="PT10S" startNumber="1">
<SegmentTimeline>
<S d="0.000000" r="10"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Subtitle id="0" mimeType="text/vtt" lang="en">
<BaseURL>subtitle/subtitle_en.vtt</BaseURL>
</Subtitle>
<Subtitle id="1" mimeType="text/vtt" lang="fr">
<BaseURL>subtitle/subtitle_fr.vtt</BaseURL>
</Subtitle>
</AdaptationSet>
</Period>
</MPD>
Step 4: Testing DASH Manifest File
The final step is to test the DASH manifest file using a DASH player. Make sure that the subtitle tracks are displayed correctly in the player. You can use a DASH player such as dash.js, Shaka Player, or Bitmovin Player to test the DASH manifest file. If the subtitle tracks are not displayed correctly, make sure to check the URLs of the subtitle files and the Subtitle elements in the DASH manifest file.
Using multiple subtitles in a DASH manifest with Google Transcoder is a simple and effective way to provide multilingual support for your video content. By following the steps outlined in this article, you can easily include multiple subtitle tracks in your DASH manifest file. Make sure to test the DASH manifest file using a DASH player to ensure that the subtitle tracks are displayed correctly.
References
| Reference | Description |
|---|---|
| ISO/IEC 23009-1:2019 | Dynamic Adaptive Streaming over HTTP (DASH) - Part 1: Media presentation description and segment formats |
| WebVTT | Web Video Text Tracks Format (WebVTT) - A format for displaying captions or subtitles for video content |
| WebVTT API | A JavaScript API for parsing and displaying WebVTT tracks in a web browser |
| Google Transcoder | A powerful and easy-to-use transcoding tool for creating DASH manifests |