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. |
8th March 2012, 05:13 | #1 | Link |
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. 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. |
11th March 2012, 20:02 | #8 | Link |
Registered User
Join Date: Mar 2005
Posts: 433
|
Nikse, give this a try:
http://www.mediafire.com/?9mhf2z18q4m46hj Binary included in the top Release directory, source updated. Let me know if this fixes it. |
Tags |
bdn, blu-ray, pgs, xml |
|
|