Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Subtitles

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 8th March 2012, 05:13   #1  |  Link
Rectal Prolapse
Registered User
 
Join Date: Mar 2005
Posts: 433
PGStoBDN tool

Here is my contribution - a command-line tool that will take a sup (PGS) file from eac3to and generate PNGs and a BDN (XML) file.

Link to full source code and the binary here:

http://dl.dropbox.com/u/1156664/PGSt...s-20120311.rar

The binary is in the Release directory under the PGStoBDN\Release directory, called PGStoBDN.exe.

It is compiled under Visual Studio 2010, and includes the zlib and lpng projects for convenience. You might need to adjust the include and library directories in your project to get them to compile and link. Also, I used the Boost 1.47 C++ library, but should be easy to get working with the latest boost.

This tool follows the Blu-ray PGS specification more closely than the other tools (including BDSup2Sub) so should work with PGS streams that have 2 graphical object regions. Also, it *should* work on PGS streams that make use of palette effects, although I cannot test this as I am not aware of any Blu-rays that use this. It should work nicely on fansubbed remuxed Blu-rays that make use of those multi-regions anyways.

Usage:

Code:
F:\>F:\Projects\PGStoBDN\Release\PGStoBDN.exe --help
Allowed options:
  --help                                produce help message
  --version                             print version number
  --original                            output PNG images in the original size
                                        (suitable for OCR)
  --fullpng                             output 1920x1080 PNG images (NOT
                                        IMPLEMENTED) [DEFAULT]
  --nobdnfixtimes                       do not divide BDN times by 1.001 (BDN
                                        output only)
  --bdnfixtimes                         divide BDN times by 1.001 (BDN output
                                        only) [DEFAULT]
  --framerate arg                       frame rate [DEFAULT: 29.97]
  --input-file arg                      input file
  --output-filename-prefix arg          output filename's prefix
  --forcedsubs                          make all subtitles forced
  --forcedonly                          only output forced subtitles
  --dropframes                          flag all subtitle times as drop frames
                                        (BDN output only)
  --nopng                               don't generate any PNGs
  --enhancecontrast                     make all pixels with Y < 140 black, and
                                        pixels with Y >= 140 white (easier to
                                        OCR). Also forces background to black.
  --enhancecontrastthreshold arg (=140) changes the default threshold value for
                                        the --enhancecontrast option.
NOTE: Not all options have been implemented yet, like the enhance ones.

MOTIVATION: I plan to use the engine I wrote (using the Flavor A/V description language) to replace the one in MPC-HC - which also has problems with multiregion PGS and palette effects. I wrote this tool as a proof of concept. Hopefully in the next few months MPC-HC will have first-class Blu-ray subtitle rendering, instead of the rudimentary (and incorrect) rendering it does now!

This tool should be a good compliment to BDSup2sub - the BDN and PNGs generated by PGStoBDN can be used to generate IDX/SUB or even SUP files for use in your own Blu-ray remuxes, for example.

Do what you want with the source code - I just want it out there! You can give me credit if you like, however.

Last edited by Rectal Prolapse; 5th April 2012 at 23:34. Reason: Updated link to latest.
Rectal Prolapse is offline   Reply With Quote
 

Tags
bdn, blu-ray, pgs, xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.