|
DVD Subtitle Creator SDK |
||||||||||||||||||||||||
|
Creating lines of subtitle text for the video is not a simple task. The appearance of subtitle texts has to be matched with the presence of vocal duration. Any miss-match could cause situation of out of sync that is not acceptable to the viewers. The procedures of matching vocal-subtitle still require a manual operation with sufficient skill and patience. In this SDK, it contains one dynamic-link library, SPCLIB, accepts subtitle texts and subtitle time code documented in a text file. Users only need to import the text file to SPCLIB for forming a SPC (Subpicture) stream. A SPC stream is a type of specially formatted MPEG stream that holds compressed subtitle packets. The SPC stream also contains Presentation Stamps (PTS), and stream identification and sub-stream identification in each packet, similar to an audio stream. During final multiplexing, the SPC stream is going to be merged with Video and Audio streams, forming a new VOB stream for authoring purpose. User has to prepare subtitles in bitmap format before calling compression function in the SPC library. Each bitmap represents a frame of subtitle. The following example depicts a subtitle frame having two text lines.
The bitmap frame size shall be 720x480 pixels for NTSC TV system or 720x576 pixels for PAL TV system, with 24 bits pixel color depth. The text line(s) can be placed at any spot within the frame space. However user needs to consider the screen safe zone. Any text or character being placed outside of the safe zone may not be fully displayable during playback on standard TV monitors. DVD Spec allows each pixel in the subpicture frame to be painted in one of 16 colors and in one of 16 contrast levels. Pixels also can be grouped together and there are up to 4 groups being allowed:
In this SDK, the each pixel group is represented by a unique color:
It does not mean the final display will show the same colors. User has to assign one of the 16 colors and one of the 16 contrast levels to each pixel group. The final displayed color and contrast of each group will be according the final assignment, not the colors painted on the subtitle bmp. User may prepare all subtitle bitmaps and may write each bitmap file path to a text file. The text will be imported to SPCLIB library and each bitmap file will be entered to the compression routine in the library. Along with bitmap file paths, user also needs to identify and to write the start-time and the end-time for each subtitle frame to be displayed. The start-time is the time that the subtitle frame starts displaying. The end-time is the time that the subtitle frame stops displaying. The end-time cannot be earlier than the start-time. There must be at least 1 frame time difference between the end-time of the previous subtitle frame and the start-time of the current subtitle frame. |
||||||||||||||||||||||||
|
The text file also contains color value and contrast value for each pixel group. Sample text file: |
||||||||||||||||||||||||
Notes: 1. Each input file shall have a file mark. The file mark has to be in the following format: Subtitle File Mark:bmp A subtitle type ( ' bmp ' or ' txt ' ) shall be attached right after the marker. 2. ' system ' – a TV system code shall be followed right after system. The TV system is limited to either ntsc or pal (‘ntsc’ or ‘pal’ shall be in lower cases). The time codes in the whole file therefore follow the specified TV system accordingly. 3. ' text color ' - the assigned color for the text line. The color table provides color code (see Color Table). 4. ' text contrast ' - the assigned contrast for the text line. It is ranged from 0 to 15, 0 being totally transparent and 15 being solid. 5. ' bkg color ' - the assigned background color for the text line. The color table provides color code (see Color Table). 6. ' bkg contrast ' - the assigned background contrast for the text line. It is ranged from 0 to 15, 0 being totally transparent and 15 being solid. 7. ' emphasis2 color ' – the assigned emphasis 2 color for the text line. The color table provides color code (see Color Table). 8. ' emphasis2 contrast ' - the assigned emphasis 2 contrast for the text line. It is ranged from 0 to 15, 0 being totally transparent and 15 being solid. 9. ' emphasis1 color ' – the assigned emphasis 1 color for the text line. The color table provides color code (see Color Table). 10.' emphasis1 contrast ' - the assigned emphasis 1 contrast for the text line. It is ranged from 0 to 15, 0 being totally transparent and 15 being solid. 11.' time code ' - The first column represents start appearing time code in SMPTE format (hr:min:sec:fr). The second column represents end appearing time code in SMPTE format. All time codes are measured in 30 frames per second, non-drop frame mode for NTSC or in 25 frames per second for PAL. 12. ' bmp file path ' - The full path of subtitle bitmap file. |
||||||||||||||||||||||||
|
AuthoringWare Co. All rights reserved, 1997-2006. | Legal | |
||