AfterDawn.com
AfterDawn Blu-ray Encoding Tutorial

Blu-ray

AfterDawn Blu-ray Encoding Tutorial Lesson 8
Convert Text Subtitles To Images


In addition to video and audio, there is another common type of content commonly found on Blu-ray discs. Although often referred to as subtitles, which does describe what these streams are normally used for, in reality these streams are subpictures. A subpicture is a still image which can be displayed over the top of the video. And just like video or audio, subpictures are stored in streams.



But of course subtitles naturally start out life as text files, not images, and outside the world of disc-based formats (Blu-ray and DVD) that's how they stay. Whether your subtitles are extracted from an existing video file or you create them for yourself, chances are good they are in a text format such as SRT or SSA. In this lesson you will learn how to convert those text-based subtitle files to a subpicture stream suitable for Blu-ray authoring.




Converting From Other Subtitle Formats


Not all text-based subtitles are in SRT, SSA, or ASS format. If you need to convert subtitles from one of these other formats using these instructions you will need to convert them to one of these three first. You can find instructions for converting to SRT format in our guide titled Troubleshooting Text-based Subtitle Playback Problems (Click here to open in new window).


If your subtitles are in an image-based format like VobSub, you should check out our guide for Converting SUB/IDX subtitles to BDN XML (Click here to open in new window).




The Complete AfterDawn Blu-ray Encoding Tutorial


Creating assets for Blu-ray authoring is relatively easy, but not necessarily simple. To make it easier to learn we have divided this tutorial into several individual lessons, each of which addresses a single step in the process. At the top and bottom of each lesson is a navigation menu where you can jump to any other lesson in the series. You can easily return to a previous section for review or skip over any future section. It is recommended that you read the entire series at least the first time through.



Lesson 1 - Prepare Source Video

In the first lesson you will learn how to analyze your source video, ensuring AviSynth will be able to decode it properly, and also formulate a plan for making any changes which may be required. In most cases this will also involve creating an index, which is a sort of map to the contents of a video.

Lesson 2 - Create AviSynth Script

In the second lesson you will learn to use MeGUI's AVS Script Creator tool to provide instructions for loading your source video and performing any required processing. This may include resizing video to the desired resolution and either deinterlacing or bobbing interlaced video to make it progressive.

Lesson 3 - Create Chapter File and Calculate Bitrate

In lesson three you wil learn how to create a file specifying chapter points and calculate the correct bitrate for your encoded video.

Lesson 4 - Encode Video

In lesson four you will learn about the proper settings for encoding your video.

Lesson 5 - Encode AC-3 Audio

In lesson five you will learn how to encode your audio to AC-3 format using MeGUI and either the Aften encoder or FFmpeg. When you complete this step you will have Blu-ray compliant audio files.

Lesson 6 - Advanced Bitrate Calculation

In lesson six you will learn more advanced techniques for calculating bitrate when you are authoring a Blu-ray disc from multiple video files.

Lesson 7 - Advanced Audio Processing

In this lesson you will learn how to use Audacity to combine individual audio files to produce either an uncompressed (LPCM) or Dolby Digital (AC-3) audio stream

Lesson 8 - Convert Text Subtitles To Images

In Lesson 9 you will become familiar with the process of converting subitles from the text-based SRT, SSA, and ASS formats to Blu-ray compliant SUP or BDN XML format.

Lesson 9 - Prepare A Still Menu Background

After completing Lesson 10 you should be able to create a single frame video file for use as the background for a Blu-ray still menu. You will also be able to extract a video frame as a regular still image file (such as a PNG or JPEG) and how to convert those common files into single frame, Blu-ray compliant video streams.

Lesson 10 - Make Menu Buttons With GIMP

This lesson will teach you the basics of making your own buttons for Blu-ray menus using the free image editor GIMP. It also includes tips on how to add elements necessary for a functional Blu-ray menu to a still image and assemble a mockup so you know what your menu will look like before you start the authoring process.



Official AfterDawn Blu-ray Encoding Tutorial feedback thread


We have created a dedicated discussion in our forums (open in new window) for feedback on this tutorial. We would love to hear your whatever thoughts you have. Tell us what you liked or what you didn't like. Let us know if there was something you didn't understand or even something that was just plain wrong. We strive for 100 percent accuracy in our guides, but nobody's perfect. Any help you can give us in getting a little closer to that goal is appreciated. Our goal is to help you out, and anything we can change to do a better job of that is an improvement.






Lesson 8 Objectives


  • Be able to convert common text-based subtitles in SRT, SSA, or ASS format into Blu-ray compliant bitmap-based subtitle streams
  • Know how to customize where on the screen subtitles appear
    • Aligning subtitles to the left, right or center
    • Setting an offset from the bottom of the screen
  • Customize the font, style (normal, bold, italic, or bold and italic), size, and color of subtitles
  • Apply effects to your subtitle streams including outline, shadows, solid backgrounds, and transparency
  • Understand how and why to use a safe zone to limit the area available to display subtitles


Convert Other Text-based Subtitles to SRT


If you have text-based subtitles you would like to convert, but they aren't in SRT, SSA, or ASS format you should take a look at a guide we published last year (Click here to open in new window) which covered that exact topic.




Unlike video or audio, still images (by definition) are not normally found in streams. While the contents of a video frame or audio sample is directly related to both the frames/samples which came before and the ones which follow, a subpicture is related only to content in other (video and/or audio) streams. In fact, a subtitle stream does not even need to contain more than one image.


As a result there are multiple ways subpicture streams may be formatted. The two most common, and the ones this lesson will focus on, are SUP and BDN-XML. The majority of Blu-ray authoring programs will accept subpictures in one or both of these formats and they can both be produced using the same free software and simple process.



Required Software


easySUP
Java for 32-bit Windows
Java for 64-bit Windows



easySUP is actually just a GUI for a variety of other tools, most of which are included in the same download and will automatically be copied to the correct location. You will also need to make sure to have Java installed (select the appropriate version for your OS) before you run easySUP. You will also need AviSynth which should already have been installed from the first lesson in this tutorial.



Installing easySUP


easySUP installation part 1 - AfterDawn.com

Browse for folder


The download for easySUP is a self extracting (7-Zip) archive. When you run it there will be a browse button for selecting the folder to extract the files to.




easySUP installation part 2 - AfterDawn.com

Select a folder


Select the folder to extract the easySUP files into. For versions of Windows later than XP (Vista, 7, and beyond) it's recommended to choose a folder other than Program Files or Program Files (x86) to avoid permissions issues which can prevent user installed software from working correctly. The easiest alternative is simply creating your own equivalents to these folders. I call mine Programs and Programs (x86). Since I'm running a 64-bit version of Windows and this is 32-bit software I'll install to Programs (x86).




Once easySUP has been copied to your hard drive you may want to create a shortcut on your desktop or pin it to your Start Menu or taskbar to make it more convenient to run later.




Converting Text Subtitles With easySUP


Converting subtitles to Blu-ray compatible SUP or BDN XML format with easySUP is as simple as selecting the input file, setting some basic options to match the accompanying video stream, adjusting the appearance of the subtitles, and previewing the results.




Main interface of easySUP - AfterDawn.com


1. Loading a subtitle file


Clicking anywhere in this text box will cause the Open dialog to appear where you can browse to the subtitle file you wish to convert.




2. General output file settings


In this section you will find settings for the entire subtitle stream and the file which it will be saved in. These settings will be determined by the requirements of your Blu-ray authoring software and properties of the video your subtitles are written for.




easySUP Export Settings - AfterDawn.com

1. Format

They standard Blu-ray subtitle formats for Blu-ray authoring are BD SUP (not to be confused with the DVD SUP format) and BDN XML. If your authoring software supports both it's usually simpler to use BD SUP format because it consists of just one file, similar to the way video and audio streams are stored. A subtitle stream in BDN XML format, on the other hand, uses a separate image (PNG) file for each subtitle and is generated in an archive (RAR) file which you will need to extract before adding it to your Blu-ray project. Both should produce identical results.

2. Mode

This sets the size of the subtitle images easySUP will create. The default setting of Fast will result in the smallest images, limiting them to the size of the subtitles themselves. Half Frame and Full Frame will create images with either half the resolution or the same resolution of the video file. See number 3 for more details on the resolution setting.

3. Resolution and Frame rate

Set these to match the video your subtitles will be displayed with on your Blu-ray disc. The resolution, in particular, is important both for easySUP to properly size subtitles when using the Half Frame or Full Frame option above (see number 2) and properly scaling the subtitles for previewing and determining when line breaks are needed.



3. Subtitle Formatting


The settings in this section control how the individual subtitles will look.




easySUP Appearance settings - AfterDawn.com

1. Basic font settings

These three fields control the font, style (normal, bold, or italic) and size of the output text. These settings will play a large role in determining how readable your subtitles are.

2. Font color

The color shown here will be used for the main body (not including any outline) of each subtitle character. Clicking on it will open a color selection dialog where you can change it.

3. Outline

These fields control the appearance of the outline around each character. The number in the dropdown list sets the width in pixels. You can remove the border entirely by setting it to 0 but this will almost always result in text which is harder to read, particularly if it is displayed over the video itself rather than a letterbox border. To the right of that is a box showing the color which will be used for the border. As with the color indicator above (in number 2), you can click here to change the color. Finally there are a pair of Background options, None and Opaque. None will leave the area surrounding the subtitle text transparent. Opaque will add a background behind each subtitle the same color as the border. This should be used carefully as it can obscure important parts of the picture. However it can also prevent subtitles which are too similar in color to the video from disappearing into the background.

4. Padding

As a rule, subtitles should not extend all the way to the edges of the video frame because they could be cut off by a Blu-ray player or display. The percentage listed for Safe Zone indicates the padding which will be added on the sides of each subtitle. Keep in mind this number is for both sides, so a setting of 10% means 5% on both the left and right. In other words a setting of 10% (assuming a resolution of 19201080) represents a padding of 96 pixels (1920 10 2 = 96) on each side. In other words no text would be displayed in those areas. The Margin setting does the same thing vertically, but is in pixels rather than a percentage so it is not resolution dependent.

5. Shadow

This sets the size of the shadow which will be shown under each character. Setting it to 0 turns the shadow off entirely, as does setting the background to Opaque.

6. Alignment

Use this slider to align subtitles to the left, center, or right side of the video frame.

7. Opacity

This slider controls how transparent the subtitles are. Dragging it to the left makes the subtitles more transparent. Setting it all the way to the right will produce subtitles which are not transparent at all.



4. Previewing your subtitles


Obviously you'll want to see what your subtitles are going to look like before you perform the conversion. This area of easySUP is where you can do that.




easySUP subtitle preview - AfterDawn.com

1. Preview area

This part of the window will show you a preview of your subtitles scaled to match the resolution you have set for the output file. You can also click here to load (or reload) the preview any time you change the output settings in any way.

2. Select subtitle

This area will present a list of subtitles you can select to preview. Make sure to check the appearance of a variety of different subtitles if you want a clear picture of how they will look after conversion. In particular you should make sure to find some of the longer subtitles when you are adjusting the font size so you can see how much of the video frame they will cover.



Starting the conversion


Click the Start button and easySUP will begin processing your subtitles and converting them to images, and eventually assemble them into a Blu-ray compliant subpicture stream. When all these processes are completed you will be prompted to save the output.




easySUP save dialog - AfterDawn.com

If you are converting your subtitles to SUP format you will be prompted for the location to save them in once conversion has completed. Browse to the folder where you want to save your subtitles for authoring, enter a name for the files, and click on the Save button.




BDN XML Output


If you tell easySUP to create BDN XML subtitles you will not be prompted for a save location after conversion finishes. If you ask for both SUP and BDN XML you will receive the prompt, but only the SUP files will be saved in your selected destination folder. Instead all the files for BDN XML subtitles (and there are many since each individual subpicture is a separate PNG file, are combined in a RAR file. In case you aren't already familiar with it, RAR is an archive format similar to ZIP or 7z. Actually there will be two RAR files created - one for each of the two BDN XML formats. These files will have to be extracted before you can use them for authoring.




Extracting BDN XML Subtitles With 7-Zip


Although the RAR format is native to WinRAR, it can also be read, and the contents extracted, by the excellent free archiving tool 7-Zip. Make sure you get the appropriate version to match your copy of Windows - 32-bit or 64-bit.




7-Zip for 32-bit Windows
7-Zip for 64-bit Windows



Run 7-Zip as Administrator to set options - AfterDawn.com

Configuring 7-Zip (as Administrator)


If you are using Windows Vista or Windows 7 you will need to run 7-Zip once as Administrator in order to set its file association options so it will automatically open various file formats including RAR. Right-click on the 7-Zip File Manager entry on your Start Menu and select Run as Administrator.




Open 7-Zip Options dialog - AfterDawn.com

Once 7-Zip starts, select Options from the Tools menu.




Associate 7-Zip with RAR files - AfterDawn.com

Select any type of archives you want 7-Zip to open. Make sure RAR is among them.




To extract the BDN XML subtitles created by easySUP you will need to first open the folder where the original (text) subtitles are located. This is where easySUP will create the BDN XML archive.




RAR files containing BDN XML subtitles - AfterDawn.com

Double-click on one of the RAR files to begin extraction. Consult your Blu-ray authoring software's manual if you aren't sure which one you need.




Extract BDN XML subtitles from a RAR file created by easySUP - AfterDawn.com

Extracting With 7-Zip


Select the Extract button to open a wizard for copying the files outside the archive.




Enter folder name to extract BDN XML archive - AfterDawn.com

Enter A Folder Name


Make sure to type a folder name at the end of the path listed under Copy to. Otherwise you will end up with a bunch of individual PNG files and a XML file all extracted to the folder your original subtitle files are in. Entering a name tells 7-Zip to create a new folder with that name and extract the subtitle files into it.




Inside the new folder will be a separate PNG file for each subtitle and a XML file with information for authoring software to use when importing them to create a PES (subpicture) stream.




New folder for extracted BDN XML subtitles - AfterDawn.com


When you need to import these subtitles into your authoring software you will simply need to point to the XML file and the rest should be automatic.




Continue To Lesson 9


Content may be the primary focus of a Blu-ray disc, but the primary feature which sets it apart from simply copying a video file to a disc is the use of menus. Of course menus are also content. This is particularly true with Blu-ray where a menu is just another title which happens to have a special interactive graphics stream added. In the next lesson you will learn about the basics of creating menu assets, beginning with instructions for creating the background for a menu from an individual video frame extracted with MeGUI.




AfterDawn Blu-ray Encoding Tutorial


Written by: Rich Fiscus
Last updated: