Index of /serveur/films/Sources/Official Harmy’s Star Wars Editions MKV/Star.Wars.Despecialized.Edition.v2.7/Subtitles Project Threepio v9.2

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]HELP_WANTED.html2024-08-21 16:22 2.1K 
[   ]Project Threepio.nfo2024-08-21 16:22 3.3K 
[TXT]README.html2024-08-21 16:22 67K 
[DIR]SRT/2024-08-21 16:22 -  
[DIR]Sup-720p/2024-08-21 16:22 -  
[DIR]perl/2024-08-21 16:22 -  
[DIR]resources/2024-08-21 16:22 -  
[DIR]vsfilter/2024-08-21 16:22 -  

 Project Threepio README
Project Threepio
Version 9.2

Please refer to the Project Threepio subtitle discussion thread for more information, updates, and corrections.

This document provides technical guidance for the most common procedures. Some of the procedures have Windows-specific instructions and are marked as such, but there is most likely a way to modify these instructions to get them to work on other platforms (for example, using Wine or alternate software).

Check to make sure your video is compatible with Project Threepio. Be sure to read the section on Project Threepio's subtitle file naming convention to ensure you use the correct subtitle file.

Many of the instructions are specific to subtitles in the 1080p BD-SUP format, but instructions are provided to easily convert 1080p BD-SUP files into other formats.

Many users prefer to use the raw SRT files to generate subtitles on-the-fly using HTPC software. Although this should work, this document does not provide any instructions for how to accomplish or troubleshoot this. Please note that using SRT files for playback is potentially much more complicated and prone to problems than using SUP files--and even if everything goes perfectly with the SRT files, they still won't look as nice as the SUP files. Unless you know that they simply will not work for your particular needs, save yourself the headache and just use the SUP files.


Audio/Video Compatibility

Project Threepio's subtitle file naming convention

How to put subtitles in an MKV/Blu-ray/AVCHD/DVD

Procedure for MKV

Procedure for Blu-ray/AVCHD

Procedure for DVD

How to create 1080p BD-SUP files from the included SRT files [instructions are Windows-specific]

How to convert OTF font files to the TTF format

How to scale 1080p subtitles for different display sizes

How to mark 1080p "title" subtitles as forced

How to adjust subtitles to accompany video without burnt-in alien subtitles

"Native" and "Matching" Subtitles (English)

"Full" and "Titles" Subtitles (non-English)

How to synchronize subtitles to a different video frame reference

Synchronizing 1080p subtitles

Synchronizing SRT files

How to reframe 1080p subtitles for different video frames

How to convert 1080p BD-SUP subtitles to other formats

1080p BDN+XML

720p BD-SUP

720p BDN+XML

NTSC DVD SUP/IFO

NTSC DVD SUB/IDX

PAL DVD SUP/IFO

PAL DVD SUB/IDX

How to edit or create SRT files

How to create compatible SRT files for RTL scripts

How to extract subtitle images from 1080p BD-SUP files

Links


Audio/Video Compatibility

Project Threepio's subtitles work best with audio and video that have the following characteristics:

Examples: Harmy's Despecialized Editions, Team Blu/dark_jedi's Trilogy Blu-ray & DVD Preservations.

The document includes detailed instructions for modifying the subtitles to work better with audio and video sources that have different characteristics, such as scans of film reels, international versions, Laserdisc preservations, etc.

Project Threepio's subtitle file naming convention

Project Threepio subtitle files use the following naming convention:

ROTJ-spa-419-full.sup

Film prefix: can be one of the following:
Language code: the ISO 639-3 language code, sometimes with a modifier to indicate dialect, writing system, and/or SDH subtitles

Type of subtitle: can be one of the following:
Format: can be one of the following:
If you need help identifying the correct code for your language, refer to this list of supported languages with corresponding language codes.

How to put subtitles in an MKV/Blu-ray/AVCHD/DVD

Procedure for MKV

Required software: MKVToolnix

  1. If necessary, create BD-SUP files in the appropriate resolution using these instructions (1080p and 720p files are included)
  2. Run MKVMerge GUI
  3. Add the video, audio, and BD-SUP files (not SRT files!) to the Input Files
    I add subtitles in this order (roughly descending order by world L1+L2 speakers, with English first and macrolanguages/dialects grouped), but order may not be relevant to you:
     
    1. English (eng)
    2. English SDH (eng-sdh)
    3. English (matching) (eng-match; not recommended for DVD projects)
    4. Mandarin, Simplified (zho-cmn-hans; 简体中文)
    5. Mandarin, Traditional (zho-cmn-hant; 繁體中文)
    6. Cantonese (zho-yue; 粵語)
    7. American Spanish (spa-419; Español Americano)
    8. American Spanish Titles (spa-419-titles; only with dub)
    9. Castilian Spanish (spa-es; Castellano)
    10. Castilian Spanish Titles (spa-es-titles; only with dub)
    11. Hindi Titles (hin-titles; हिन्दी; only with SW/ROTJ dub)
    12. French (fra; Français)
    13. French Titles (fra-titles; only with dub)
    14. Arabic (ara; العربية)
    15. Russian (rus; Русский)
    16. Russian Titles (rus-titles; only with ESB/ROTJ non-voiceover dub)
    17. Brazilian Portuguese (por-br; Português Brasileiro)
    1. European Portuguese (por-pt; Português Europeu)
    2. German (deu; Deutsch)
    3. German Titles (deu-titles; only with dub)
    4. Indonesian (ind; Bahasa Indonesia)
    5. Malay (msa; Bahasa Melayu)
    6. Japanese (jpn; 日本語)
    7. Japanese Titles (jpn-titles; only with dub)
    8. Italian (ita; Italiano)
    9. Italian Titles (ita-titles; only with dub)
    10. Korean (kor; 한국어)
    11. Vietnamese (vie; Tiếng Việt)
    12. Turkish (tur; Türkçe)
    13. Persian/Farsi (fas; فارسی)
    14. Polish (pol; Polski)
    15. Thai (tha; ไทย)
    16. Thai Titles (tha-titles; only with SW dub)
    17. Ukrainian (ukr; Українська)
    1. Romanian (ron; Română)
    2. Dutch (nld; Nederlands)
    3. Croatian (hrv; Hrvatski)
    4. Hungarian (hun; Magyar)
    5. Greek (ell; Ελληνικά)
    6. Czech (ces; Čeština)
    7. Swedish (swe; Svenska)
    8. Bulgarian (bul; Български)
    9. Danish (dan; Dansk)
    10. Hebrew (heb; עברית)
    11. Finnish (fin; Suomi)
    12. Norwegian (nor; Norsk)
    13. Slovenian (slv; Slovenščina)
    14. Estonian (est; Eesti)
    15. Icelandic (isl; Íslenska)
    16. Navajo Titles (nav; Diné Bizaad; only with SW dub)
    Subtitles in bold are the ones I prioritize for formats limited to 32 subtitle tracks (Blu-ray/AVCHD/DVD); more languages could be added by excluding "titles" subtitles and their associated dubs
  1. Under general track options, select the language per track as needed
  2. Specify an output filename and select Start Muxing

Procedure for Blu-ray/AVCHD

Required software: tsMuxerGUI, ImgBurn, Wine (for non-Windows platforms only)

  1. If necessary, create BD-SUP files in the appropriate resolution using these instructions (1080p and 720p files are included)
  2. Run tsMuxerGUI
  3. Add the video, audio, and BD-SUP files (not SRT files!) to the Input Files (the Blu-ray/AVCHD format is limited to 32 PGS subtitle streams--do not add more, even though tsMuxerGUI allows this!)
    I add subtitles in this order, but order may not be relevant to you.
  4. Under tracks, select the language ID per track as needed
  5. Under Output, select Blu-ray disk or AVCHD disk as needed, and select a file path
  6. Click Start muxing to create the Blu-ray/AVCHD folder structure
  7. Run ImgBurn (if you are not running Windows, you will need to run this using Wine)
  8. Select Write Files/Folders to disc
  9. Add the BDMV and CERTIFICATE folders
  10. Click the burn icon (folder with arrow pointing to disc)
  11. If you receive a warning about UDF filesystems, let ImgBurn make the changes it suggests

Procedure for DVD

Required software: ImgBurn, Wine (for non-Windows platforms only)

  1. If necessary, create DVD SUP/IFO files using these instructions (NTSC DVD SUP/IFO files are included)
  2. Run the modified MuxMan executable found in the resources folder (if you are not running Windows, you will need to run this using Wine)
  3. Under File, choose Load Project
  4. Select the dvd-palette.mxp file in the resources folder
    NOTE: If you don't include the palette, the subtitles may end up a mottled pink color. Palette files in other formats are also available for other muxing software.
  5. Select the video and audio streams
  6. Under SubPictures, choose the DVD SUP files (the DVD format is limited to 32 subtitle streams, and some authoring and playback software is limited to even fewer)
    I add subtitles in this order, but order may not be relevant to you.
  7. For each stream, be sure to specify a language and select both LB and WIDE
  8. Select a destination folder
  9. Click Start to create the DVD folder structure
  10. Run ImgBurn (if you are not running Windows, you will need to run this using Wine)
  11. Select Write Files/Folders to disc
  12. Add all of the folders in your DVD folder structure
  13. Click the burn icon (folder with arrow pointing to disc)
  14. If you receive a warning about UDF filesystems, let ImgBurn make the changes it suggests

How to create 1080p BD-SUP files from the included SRT files [instructions are Windows-specific]

NOTE: Under most circumstances, you will not need to do this! You should only do this if you want to alter the appearance or text of the subtitles to be different from the included ones! If you are not doing this, just mux the included BD-SUP files.

Required software: AviSynth, Java Runtime, Perl Runtime, ImageMagick (matching and reconstructed alien subtitles only), BDSup2Sub, easySUP, Wine (for non-Windows platforms only)

Required fonts: Arial, Adobe Heiti Std R (convert to TTF), Microsoft JhengHei, Mangal, Kozuka Gothic Pr6N Medium (convert to TTF), Dotum, Tahoma, Droid Sans Fallback Full, P3PO SW Matching (included in resources folder), P3PO ROTJ Matching (included in resources folder), P3PO SW Intl Matching (included in resources folder)

NOTE: The shift_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

FONT NOTES: EasySUP does not support OTF fonts, so fonts in OTF format must be converted to TTF. Some systems may have multiple Microsoft JhengHei fonts installed, and easySUP doesn't show the full font names. To choose the correct Microsoft JhengHei font, the correct one is listed first.

  1. Copy the DLL files from the vsfilter folder into easySUP's tools folder, overwriting existing files
  2. Run whichever of the following commands are appropriate (change paths to match your system):
    • Typical: perl perlprep_subs.pl SRT*-full.srt SRT*-titles.srt SRT*-native.srt
    • RTL (right-to-left: Arabic, Hebrew scripts): perl perlprep_subs-rtl.pl SRT*-rtl.srt
    • Matching and Reconstructed Alien: perl perlprep_subs-match.pl SRT*-eng-native.srt SRT*-alien-*.srt
    These scripts will create new SRT files. NOTE: The resulting SRT files contain formatting data specifically for easySUP with the modified vsfilter.dll file. Do not use these modified SRT files for any other purpose!
  3. Run easySUP (this software has not been verified to work on non-Windows platforms using Wine)
  4. Load the appropriate modified SRT file (NOTE: if creating matching or reconstructed alien subtitles, choose the native SRT file that has been modified by the "match" script)
  5. Confirm the following settings for most subtitles (NOTE: some settings reset when you load a new SRT file):

    FormatResolutionModeFrame RateFont/Size/StyleFont ColorOutlineOutline ColorBackgroundSafe ZoneMarginShadowAlignmentOpacity
    Latin, Cyrillic, Greek, Hebrew ScriptsBD SUP1080Full frame23.976Arial, 64, NormalWhite3BlackNone0%1803Center100%
    Mandarin/SimplifiedBD SUP1080Full frame23.976Adobe Heiti Std Regular, 75, NormalWhite3BlackNone0%1663Center100%
    Mandarin/Traditional and CantoneseBD SUP1080Full frame23.976Microsoft JhengHei, 84, BoldWhite3BlackNone0%1663Center100%
    HindiBD SUP1080Full frame23.976Mangal, 95, NormalWhite3BlackNone0%1663Center100%
    Arabic ScriptBD SUP1080Full frame23.976Arial, 90, NormalWhite3BlackNone0%1753Center100%
    JapaneseBD SUP1080Full frame23.976Kozuka Gothic Pr6N Medium, 97, NormalWhite3BlackNone0%1633Center100%
    KoreanBD SUP1080Full frame23.976Dotum, 64, BoldWhite3BlackNone0%1803Center100%
    ThaiBD SUP1080Full frame23.976Tahoma, 90, NormalWhite3BlackNone0%1773Center100%
    Other Unspecified ScriptsBD SUP1080Full frame23.976Droid Sans Fallback, 75, NormalWhite3BlackNone0%1753Center100%
    SDH----------------Opaque----0----
    Matching and Reconstructed AlienBD SUP1080Full frame23.976See Matching ChartSee Matching Chart0*BlackNone0%See Matching Chart0*Center100%
    * Matching and reconstructed alien subtitles are generated without a border or drop shadow, because the shift_subs.pl script is used to add effects for better fidelity to the theatrical appearance

    Matching Chart: To be used only with matching and reconstructed alien subtitles

    Star Wars/The Empire Strikes BackReturn of the Jedi
    Font/Size/StyleFont ColorMarginFont/Size/StyleFont ColorMargin
    English 35mmP3PO SW Matching, 89, NormalCustom RGB
    R: 229 G: 233 B: 221
    157P3PO ROTJ Matching, 89, NormalCustom RGB
    R: 229 G: 233 B: 221
    162
    German 35mmUnknownUnknownUnknownP3PO ROTJ Intl Matching, 85, NormalCustom RGB
    R: 229 G: 233 B: 221
    175
    Italian 35mmP3PO SW Intl Matching, 85, NormalCustom RGB
    R: 253 G: 253 B: 246
    192P3PO ROTJ Intl Matching, 89, NormalCustom RGB
    R: 229 G: 233 B: 221
    180
  6. Click Start to generate a BD-SUP file, and save it to the SUP-1080p folder
  7. Create a folder named tmp_XML and then run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  8. Run the following command (change paths to match your system):
    perl perlshift_subs.pl tmp_XML
  9. Delete the unmodified 1080p BD-SUP files from the SUP-1080p folder
  10. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o SUP-1080p\%~nf.sup tmp_XML\%~nf.xml
    • Other platforms: for f in tmp_XML/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "SUP-1080p/${FN2%%.*}.sup" "$f"; done
  11. Remove the tmp_XML folder

How to convert OTF font files to the TTF format

Required software: FontForge

  1. Open the OTF file in FontForge
  2. From the CID menu, select Flatten (if available)
  3. From the File menu, select Generate Fonts...
  4. Select the TrueType format and click Save
  5. You will see some warnings and errors. For the fonts used by Project Threepio, these do not appear to be serious.

How to scale 1080p subtitles for different display sizes

The ideal size for a subtitle is very dependent on display size and seating distance (and, in an ideal world, would be adjustable by the player). Subtitles included with Project Threepio, like those included on commercial discs, are designed with typical home display sizes and seating distances in mind. For displays outside that size range, these subtitles may not be the best size, and you may want to adjust their sizes to better fit your needs. Project Threepio includes scripts that allow you to scale the subtitles between 33% and 110% of their original size. In the commands below, replace the text PERCENTAGE with the percentage you want to use.

Subtitle Scaling Factor Guidelines For Various Display Sizes and Seating Distances*
Metric Imperial/US
<1.5 m1.5-4.5 m>4.5 m
<79 cm100%110%110%
79-152 cm83%100%110%
153-229 cm67%83%100%
230-305 cm50%67%83%
306-381 cm33%50%67%
>381 cm33%33%50%
<5 ft5-15 ft>15 ft
<31 in100%110%110%
31-60 in83%100%110%
61-90 in67%83%100%
91-120 in50%67%83%
121-150 in33%50%67%
>150 in33%33%50%
* The ideal subtitle size also varies depending on several factors that are harder to quantify, so these guidelines may serve only as a reasonable starting point

Required software: Java Runtime, BDSup2Sub, Perl Runtime, ImageMagick

  1. Create two folders, named tmp_XML and SUP-1080p-scaled
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlscale_subs.pl PERCENTAGE tmp_XML
  4. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o SUP-1080p-scaled\%~nf.sup tmp_XML\%~nf.xml
    • Other platforms: for f in tmp_XML/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "SUP-1080p-scaled/${FN2%%.*}.sup" "$f"; done
  5. Remove the tmp_XML folder

How to mark 1080p "title" subtitles as forced

None of the subtitles included with Project Threepio are marked as forced*. If you wish to mark the "title" subtitles (those used to translate onscreen text) as forced, follow the instructions below to convert the 1080p subtitles. If you do this, it is recommended that you ignore the pre-made titles subtitles and instead convert the full subtitles--this process will mark only the title subtitles within the full subtitles as forced. Any subtitles converted from these 1080p subtitles will inherit the forced properties.

Required software: Java Runtime, BDSup2Sub, Perl Runtime

NOTE: The force_titles.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create two folders, named tmp_XML and SUP-1080p-forced
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*-full.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*-full.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlforce_titles.pl tmp_XML
  4. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o SUP-1080p-forced\%~nf.sup tmp_XML\%~nf.xml
    • Other platforms: for f in tmp_XML/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "SUP-1080p-forced/${FN2%%.*}.sup" "$f"; done
  5. Remove the tmp_XML folder

* Marking specific subtitles as forced will auto-enable them and not allow the viewer to turn them off when they match the player's native language. This is typically done when the film is shown dubbed, to translate the parts of the film that are not translated by the dub. Due to the ambiguity of how a player should react to multiple forced subtitles using the same language code (e.g. multiple Spanish dialects), the possibility of unneccessarily forced subtitles for alternate dubbing options (e.g. Russian voiceovers don't need subtitles, but other Russian dubs do), and the likelihood that the viewer will watch the films with English audio, Project Threepio, by default, relies on the viewer or disc author to select the appropriate subtitle stream.

How to adjust subtitles to accompany video without burnt-in alien subtitles

Project Threepio, by default, assumes that the video its subtitles accompany has burnt-in alien subtitles in English, and excludes those lines from its English subtitles, and shifts its non-English subtitles for that alien dialogue and neighboring dialogue to the top of the frame to avoid overlap. If the video does not have burnt-in alien subtitles, then Project Threepio's default subtitles for these scenes are completely inadequate in English and poorly-positioned in other languages. You can use the submerge.pl and unshift_subs.pl scripts to fill in the missing English subtitles and return these subtitles to their normal positions at the bottom of the frame, respectively.

"Native" and "Matching" Subtitles (English)

NOTE: This process merges "native" and "alien" subtitles into a single merged subtitle. The "alien" subtitles may need to be manually adjusted for specific preservations. If you want to use SRT files, the "nocrawl" SRT file is appropriate for subtitle-free preservations.

Required software: Java Runtime, BDSup2Sub, Perl Runtime

NOTE: The submerge.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create a folder named tmp_XML and then run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*-native.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*-native.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*-alien-*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*-alien-*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlsubmerge.pl tmp_XML
  4. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o SUP-1080p\%~nf.sup tmp_XML\%~nf.xml
    • Other platforms: for f in tmp_XML/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "SUP-1080p/${FN2%%.*}.sup" "$f"; done
  5. Remove the tmp_XML folder

"Full" and "Titles" Subtitles (non-English)

Required software: Java Runtime, BDSup2Sub, Perl Runtime

NOTE: The unshift_subs.pl script works best when "titles" subtitles are processed in the same batch as their corresponding "full" subtitles. This is because the script uses normally-positioned subtitles from the "full" subtitles to improve its calculations for the new positions for the shifted subtitles. The unshift_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create two folders, named tmp_XML and SUP-1080p-unshift
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*-full.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*-full.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*-titles.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*-titles.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  4. Run the following command (change paths to match your system):
    perl perlunshift_subs.pl tmp_XML
  5. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o SUP-1080p-unshift\%~nf.sup tmp_XML\%~nf.xml
    • Other platforms: for f in tmp_XML/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "SUP-1080p-unshift/${FN2%%.*}.sup" "$f"; done
  6. Remove the tmp_XML folder

How to synchronize subtitles to a different video frame reference

Project Threepio, by default, assumes that the video its subtitles accompany uses video frames matching the NTSC 2006 Bonus Disc (GOUT) release of the trilogy. Some preservations use other frame references, some of which are pre-defined in the resync_subs.pl script. You can also add new frame references by editing the script. The pre-defined frame references are:

There is also one special frame reference defined for the Star Wars mono mix:

In the commands below, replace the text FRAME_REF with the frame reference you want to use.

NOTE: If you are making multiple scripted alterations to the subtitles (shifting positions, marking as forced, etc), synchronization must be performed last. The resync_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

Synchronizing 1080p subtitles

Required software: Java Runtime, BDSup2Sub, Perl Runtime

  1. Create two folders, named tmp_XML and SUP-1080p-resync-FRAME_REF
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*-full.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlresync_subs.pl FRAME_REF tmp_XML
  4. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML-resync-FRAME_REF\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o SUP-1080p-resync-FRAME_REF\%~nf.sup tmp_XML-resync-FRAME_REF\%~nf.xml
    • Other platforms: for f in tmp_XML-resync-FRAME_REF/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "SUP-1080p-resync-FRAME_REF/${FN2%%.*}.sup" "$f"; done
  5. Remove the tmp_XML and tmp_XML-resync-FRAME_REF folders

Synchronizing SRT files

Required software: Perl Runtime

How to reframe 1080p subtitles for different video frames

Project Threepio, by default, assumes that the video frame is a rectangle with an aspect ratio of approximately 2.37:1. Graphical subtitles may not be optimally positioned for preservations using a different video frame. You can use the reframe_subs.pl script to shift subtitles in (toward the center of the screen) a specified percentage of the total image height (including black bars).

Known reframing percentages are:

In the commands below, replace the text PERCENTAGE with the percentage you want to use.

Required software: Java Runtime, BDSup2Sub, Perl Runtime

  1. Create two folders, named tmp_XML and SUP-1080p-reframe
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*-full.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlreframe_subs.pl PERCENTAGE tmp_XML
  4. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o SUP-1080p-reframe\%~nf.sup tmp_XML\%~nf.xml
    • Other platforms: for f in tmp_XML/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "SUP-1080p-reframe/${FN2%%.*}.sup" "$f"; done
  5. Remove the tmp_XML folder

How to convert 1080p BD-SUP subtitles to other formats

1080p BDN+XML

Required software: Java Runtime, BDSup2Sub, Perl Runtime

NOTE: The xmlprep_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create a folder named BDN+XML-1080p
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o BDN+XML-1080p\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "BDN+XML-1080p/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlxmlprep_subs.pl BDN+XML-1080p

720p BD-SUP

Required software: Java Runtime, BDSup2Sub, Perl Runtime, ImageMagick

  1. Create two folders, named tmp_XML and SUP-720p
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlconvert_res.pl 720p tmp_XML
  4. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -r 720 -T 24p -o SUP-720p\%~nf.sup tmp_XML\%~nf.xml
    • Other platforms: for f in tmp_XML/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 720 -T 24p -o SUP-720p/${FN2%%.*}.sup "$f"; done

720p BDN+XML

Required software: Java Runtime, BDSup2Sub, Perl Runtime, ImageMagick

NOTE: The xmlprep_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create a folder named BDN+XML-720p
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o BDN+XML-720p\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 1080p -T 24p -o "BDN+XML-720p/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perlconvert_res.pl 720p BDN+XML-720p
  4. Run the following command (change paths to match your system):
    perl perlxmlprep_subs.pl BDN+XML-720p

NTSC DVD SUP/IFO

Required software: Java Runtime, BDSup2Sub, Perl Runtime, ImageMagick

NOTE: The dvdprep_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create two folders, named tmp_XML and SUP-NTSC DVD
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 480 -T 30p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 480 -T 30p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perldvdprep_subs.pl tmp_XML
  4. Remove the tmp_XML folder
  5. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML_dvdprep\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -a 0 -r 480 -T 30p -o "SUP-NTSC DVD\%~nf.ifo" tmp_XML_dvdprep\%~nf.xml
    • Other platforms: for f in tmp_XML_dvdprep/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -a 0 -r 480 -T 30p -o "SUP-NTSC DVD/${FN2%%.*}.ifo" "$f"; done
  6. Remove the tmp_XML_dvdprep folder

NTSC DVD SUB/IDX

Required software: Java Runtime, BDSup2Sub, Perl Runtime, ImageMagick

NOTE: The dvdprep_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create two folders, named tmp_XML and SUB-NTSC DVD
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 480 -T 30p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 480 -T 30p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perldvdprep_subs.pl tmp_XML
  4. Remove the tmp_XML folder
  5. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML_dvdprep\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -a 0 -r 480 -T 30p -o "SUB-NTSC DVD\%~nf.idx" tmp_XML_dvdprep\%~nf.xml
    • Other platforms: for f in tmp_XML_dvdprep/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -a 0 -r 480 -T 30p -o "SUB-NTSC DVD/${FN2%%.*}.idx" "$f"; done
  6. Remove the tmp_XML_dvdprep folder

PAL DVD SUP/IFO

Required software: Java Runtime, BDSup2Sub, Perl Runtime, ImageMagick

NOTE: The dvdprep_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create two folders, named tmp_XML and SUP-PAL DVD
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 576 -T 25p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 576 -T 25p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perldvdprep_subs.pl tmp_XML
  4. Remove the tmp_XML folder
  5. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML_dvdprep\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -a 0 -r 576 -T 25p -o "SUP-PAL DVD\%~nf.ifo" tmp_XML_dvdprep\%~nf.xml
    • Other platforms: for f in tmp_XML_dvdprep/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -a 0 -r 576 -T 25p -o "SUP-PAL DVD/${FN2%%.*}.ifo" "$f"; done
  6. Remove the tmp_XML_dvdprep folder

PAL DVD SUB/IDX

Required software: Java Runtime, BDSup2Sub, Perl Runtime, ImageMagick

NOTE: The dvdprep_subs.pl script uses the Project Threepio file naming conventions to determine file characteristics. Files not using these naming conventions may be handled incorrectly.

  1. Create two folders, named tmp_XML and SUB-PAL DVD
  2. Run the following command (change paths to match your system):
    • Windows: for %f in ("SUP-1080p\*.sup") do java -jar resources\BDSup2Sub512.jar -x 0 -r 576 -T 25p -o tmp_XML\%~nf.xml SUP-1080p\%~nf.sup
    • Other platforms: for f in SUP-1080p/*.sup; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -r 576 -T 25p -o "tmp_XML/${FN2%%.*}.xml" "$f"; done
  3. Run the following command (change paths to match your system):
    perl perldvdprep_subs.pl tmp_XML
  4. Remove the tmp_XML folder
  5. Run the following command (change paths to match your system):
    • Windows: for %f in ("tmp_XML_dvdprep\*.xml") do java -jar resources\BDSup2Sub512.jar -x 0 -a 0 -r 576 -T 25p -o "SUB-PAL DVD\%~nf.idx" tmp_XML_dvdprep\%~nf.xml
    • Other platforms: for f in tmp_XML_dvdprep/*.xml; do FN1=$f; FN2=${FN1##*/}; java -jar resources/BDSup2Sub512.jar -x 0 -a 0 -r 576 -T 25p -o "SUB-PAL DVD/${FN2%%.*}.idx" "$f"; done
  6. Remove the tmp_XML_dvdprep folder

How to edit or create SRT files

Recommended software: Gaupol, but any text or subtitle editor should work (with modified instructions)

  1. If creating a new file, make sure it is using the UTF-8 encoding with a byte order mark (Gaupol calls this UTF-8-SIG)
  2. Open the English subtitle template file (named "*-eng-template.srt"), and then open the file to be edited as a translation (this allows side-by-side view)
  3. Make your edits, observing these rules:
    • For RTL scripts, make edits to the "rtl" file, then copy changes to the "compat" file using the RTL compatibility conversion script
    • For RTL scripts, if opening an existing "rtl" file displays punctuation on the wrong side of the text, use a different editor that fully conforms to the Unicode Bidirectional Algorithm
    • No subtitle should ever occupy more than two lines
    • Try not to allow lines to exceed 32 in length, 34 in extreme cases (as measured by Gaupol)
    • If a line needs to be shortened, try summarization, deleting unnecessary phrases, and combining with text from an adjacent line (but avoid abbreviation)
    • Try to follow Project Threepio style conventions as closely as appropriate for your language:
      • Use an en-dash to signify double-dialogue: – (IMPORTANT: this character triggers the double-dialogue alignment code in Project Threepio's Perl scripts)
      • Use typographical apostrophes and quotes: ’ “ ”
      • Use trailing and leading ellipses to signify continuing text: ...
    • Do not include subtitle credits or any other non-subtitling text in the files. Any non-subtitling text will be removed. If you want credit for subtitles you have worked on, I will give credit in the project discussion thread.
  4. Save your translation

How to create compatible SRT files for RTL scripts

Many pieces of software (particularly media players) do not fully conform to the Unicode Bidirectional Algorithm, and require specially-formatted text to display the subtitles correctly. The script below will use the "rtl" files for all RTL scripts to generate new "compat" SRT files, which work around most of the BiDi implementation quirks we've encountered.

NOTE: Under most circumstances, you will not need to do this! You should only do this if you want to alter or add RTL SRT files. If you are not doing this, just use the included "compat" files.

Required software: Perl Runtime

How to extract subtitle images from 1080p BD-SUP files

Subtitle images in BD-SUP files are stored in a somewhat exotic variety of the PNG format (indexed color with 8-bit alpha). To ensure the best software compatibility, they are converted to a more widely-supported variety of the PNG format after they are extracted.

Required software: Java Runtime, BDSup2Sub, ImageMagick

Links

AviSynth

BDSup2Sub (included with Project Threepio)

easySUP

FontForge

Fonts: Arial, Adobe Heiti Std R, Microsoft JhengHei, Mangal, Kozuka Gothic Pr6N Medium, Dotum, Tahoma, Droid Sans Fallback Full

Gaupol

ImageMagick

ImgBurn

Java Runtime (JRE)

MKVToolnix

Perl Runtime

tsMuxerGUI

Wine