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

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th September 2008, 20:55   #701  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
Quote:
Originally Posted by Ulf View Post
I am currently converting my HD-DVD's to Blu-ray. In order to fit the content on a single layer DVD I downscale the movie to 720p and encode with x264. Everything is straightforward, except for downscaling of the subs. I extract the bitmaps to PNG format using SUPread. These are 8-bit PNG's with variable transparency (set in the tRNS chunk of the PNG files).
Neither Photoshop CS nor GIMP reads the full transparency data. I have found that ImageMagick (convert.exe) actually can convert the PNG's to 32-bit (with transparency preserved) and scale them down to 1280x720. Another command-line program, Pngnq, can convert the 32-bit PGN's back to 8-bit with variable transparency.
I now have a BDN XML file (720p) and a set of 8-bit PNG's. Does anyone know a way doing the opposite of what SUPread does, i.e. to create a "sup" subtitle file from a XML file and PNG's?
I have access to Scenarist and I made one Bly-ray compilation with the 720p content. The end result is perfect with subtitles looking as the original (no jaggy outlines). A much easier (and less costly) way would be to use the free tsMuxeR. The only obstacle is the lack of a program that can create a "sup" file from BDN XML file and PNG's. Can anyone help?
Thanks for the post.
I guess SubtitleWorkshop4 will accept your xml.
Please feedback.
rica is offline   Reply With Quote
Old 30th September 2008, 10:59   #702  |  Link
Ulf
Registered User
 
Join Date: Sep 2008
Location: Sweden
Posts: 66
Quote:
Originally Posted by rica View Post
Thanks for the post.
I guess SubtitleWorkshop4 will accept your xml.
Please feedback.
SubtitleWorkshop4 will not take a xml file as input. I want to create a sup file from a xml bdn file and PNG's.
Scenarist accepts the xml.

I have made a batch file that makes conversion from 1080p to 720p easy:

Code:
@REM Conversion of BDM XML file and PNG files to 720p.
@REM Drop folder(s) with PNG files and BDN XML file in this BAT-file.
@REM Use "SUPRead" to save the bitmaps as PNG from a "sup" subtitle file.

@REM ImageMagick ("convert.exe") has the ability to read the tranparency data
@REM stored in an indexed PNG file (saved in the tRNS chunk in a PGN file).
@REM Bitmaps saved from ".sup" by "SUPread" contains the transparency,
@REM but this information is disregarded by GIMP, Photoshop etc.
@REM ImageMagick opens the file and uses the tranparency data to form a 32 bit
@REM PNG file with variable transparency. The script below scales the image to
@REM 1280x720 and saves it. Observe! "pngnq.exe" can only do a proper conversion
@REM if the downscaling in ImageMagick is done by the simpler downscaling
@REM command "-scale 1280" instead of "-resize 1280".
@REM ImageMagick: http://www.imagemagick.org

@REM "pngnq.exe" converts the PNG file to an indexed 8-bit PNG file with
@REM full transparency retained (saved in the tRNS chunk).
@REM "pngnq.exe" requres the following DLLs: libpng13.dll and zlib1.dll
@REM pngnq: http://pngnq.sourceforge.net/
@REM libpng13.dll: http://www.cybertherial.com/pngnq/libpng13.dll
@REM zlib1.dll: http://www.dll-files.com/dllindex/dll-files.shtml?zlib1

@REM "sed.exe" is the GNU sed editor.
@REM sed.exe: http://sourceforge.net/projects/gnuwin32/

@REM The resulting files can be imported as BDN assets in Sonic Scenarist.
@REM -------------------------------------------------------
set CONV_EXE=C:\Program Files\ImageMagick\convert.exe
set PNGNQ_EXE=C:\Program Files\pngtools\pngnq.exe
set SED_EXE=C:\Program Files\GnuWin32\bin\sed.exe
@REM -------------------------------------------------------
set CONV_OPT=-scale 1280
set SED_OPT="10,12d;s/"1080p"/"720p"/g;s/"1920"/"1280"/g;s/"1080"/"720"/g"
@REM -------------------------------------------------------
cls
:NEXT
IF EXIST "%~f1\_CONVERTED.txt" goto :SKIP
FOR %%a IN ("%~f1\*.png") DO (
  start "CONVERT" /belownormal /b /w "%CONV_EXE%" "%%a" %CONV_OPT% "%%a.png"
  start "PNGNQ" /belownormal /b /w "%PNGNQ_EXE%" -f "%%a.png"
  del /q "%%a"
  del /q "%%a.png"
  copy "%%a-nq8.png" "%%a"
  del /q "%%a-nq8.png"
)
FOR %%a IN ("%~f1\*.xml") DO (
  "%SED_EXE%" %SED_OPT% "%%a" > "%~f1\720p_subtitles.bdn.xml"
)
echo Files converted to 720p > "%~f1\_CONVERTED.txt"
:SKIP
shift
IF NOT "%1"=="" goto :NEXT
@REM -------------------------------------------------------
Save the code as a .BAT file and modify the path' to the executables if needed.
Ulf is offline   Reply With Quote
Old 30th September 2008, 11:27   #703  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
Thanks for the tutorial.
rica is offline   Reply With Quote
Old 30th September 2008, 12:08   #704  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
@Ulf,


I think there is an easier method of converting to 720p.

Just SUPRead is enough.

Options > Image > tick 720p

Savebitmaps > Export sup

You will have a 720p sup.
rica is offline   Reply With Quote
Old 30th September 2008, 21:34   #705  |  Link
Ulf
Registered User
 
Join Date: Sep 2008
Location: Sweden
Posts: 66
Quote:
Originally Posted by rica View Post
@Ulf,


I think there is an easier method of converting to 720p.

Just SUPRead is enough.

Options > Image > tick 720p

Savebitmaps > Export sup

You will have a 720p sup.
Sure, I tried that first. The quality of the bitmaps that SUPRead produces by downscaling to 720p are barely usable.

Do a test and compare! Beware that you have to convert the resulting PNG's to 32-bit by:

convert.exe line0001.png line0001.png

before you actually can compare the results in a image viewer program (Photoshop, GIMP, ...).
Ulf is offline   Reply With Quote
Old 1st October 2008, 14:10   #706  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
Quote:
Originally Posted by Ulf View Post
Sure, I tried that first. The quality of the bitmaps that SUPRead produces by downscaling to 720p are barely usable.

Do a test and compare! Beware that you have to convert the resulting PNG's to 32-bit by:

convert.exe line0001.png line0001.png

before you actually can compare the results in a image viewer program (Photoshop, GIMP, ...).
Yes, you are right. (I haven't noticed since i use srt.)

Code:
C:\>convert.exe -scale 1280 line0002.png out.png
1280*720 created by SUPRead:



1280*720 created by ImageMagick:



Then what would be the command line to scale the whole pngs
inside the folder created by SUPRead? Or shall i have to use the script you gave?


_ _ _ _ _ _

Last edited by rica; 1st October 2008 at 14:26.
rica is offline   Reply With Quote
Old 1st October 2008, 21:50   #707  |  Link
Ulf
Registered User
 
Join Date: Sep 2008
Location: Sweden
Posts: 66
Quote:
Originally Posted by rica View Post
Then what would be the command line to scale the whole pngs
inside the folder created by SUPRead? Or shall i have to use the script you gave?
Use the the script. Save it as "720p.bat" and drop the whole folder created by SUPRead on it. The resulting files can be imported in Scenarist to a 720p project.
Ulf is offline   Reply With Quote
Old 2nd October 2008, 15:39   #708  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
Quote:
Originally Posted by Ulf View Post
Use the the script. Save it as "720p.bat" and drop the whole folder created by SUPRead on it. The resulting files can be imported in Scenarist to a 720p project.
I tried; it worked very well but the question is i can't find out the output files ; when i look into the folder which i drop, i just see a text file which is written "Files Converted to 720p" ? (720p_subtitles.bdn.xml)

And i belive you will find the way of using it with a free tool?

Edit: I inserted libpng13.dll and zlib1.dll in the pngtools folder?

Last edited by rica; 2nd October 2008 at 16:27.
rica is offline   Reply With Quote
Old 2nd October 2008, 18:58   #709  |  Link
Ulf
Registered User
 
Join Date: Sep 2008
Location: Sweden
Posts: 66
Well, I don't know what happened for you Rica. Have you installed the executables needed and put the right path for them in the .BAT file?

And, yes, libpng13.dll and zlib1.dll should be in the same folder as pngnq.exe. The converted files are created in the same folder that contained the original PNG's (with the same name as the originals). It works fine for me (I'm running WinXP).
Ulf is offline   Reply With Quote
Old 2nd October 2008, 20:52   #710  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
Quote:
Originally Posted by Ulf View Post
Well, I don't know what happened for you Rica. Have you installed the executables needed and put the right path for them in the .BAT file?

And, yes, libpng13.dll and zlib1.dll should be in the same folder as pngnq.exe. The converted files are created in the same folder that contained the original PNG's (with the same name as the originals). It works fine for me (I'm running WinXP).
Yes, everything has been made as you described.
More; ex 1080p pngs have dissapeared.
Tried to get an SS, maybe it gives an idea:






Vista 32 ultimate btw...
_ _ _
Attached Files
File Type: txt 720_bat.txt (896 Bytes, 28 views)

Last edited by rica; 2nd October 2008 at 22:42.
rica is offline   Reply With Quote
Old 3rd October 2008, 00:15   #711  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
OK,
i've found my mistake; i should have loaded "static.exe" instead of "dll.exe"

Now it is still converting and i see 1080ps are returning to 720ps gradually:


Last edited by rica; 3rd October 2008 at 00:23.
rica is offline   Reply With Quote
Old 3rd October 2008, 00:36   #712  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
OK, thanks, i have a folder which includes 720p pngs.
Next?
rica is offline   Reply With Quote
Old 3rd October 2008, 22:29   #713  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
I hope pelican will have a look at those posts and update his SUPRead some day.
rica is offline   Reply With Quote
Old 4th October 2008, 00:45   #714  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
I was wondering where this xml is?
Ulf reminded me to tick "Scenarist exp" box under options of SUPread; he said otherwise xml creation doesn't work.
And finally i got xml.
Thanks to Ulf again.
Hope it is gonna work with a free software someday.
rica is offline   Reply With Quote
Old 2nd December 2008, 05:33   #715  |  Link
alc0re
Registered User
 
Join Date: Jun 2008
Posts: 91
@ Ulf or anyone else...

If someone doesn't have access to scenarist....am I SOL right now if I want to create a .sup file for Bluray muxing with TSRemux that is downscaled/resized to 1280x720?

Also, how do I get forced subtitles to work on an AVCHD disc?
alc0re is offline   Reply With Quote
Old 2nd December 2008, 09:51   #716  |  Link
Octo-puss
Registered User
 
Join Date: Jan 2008
Posts: 571
Pardon the OT, but does SOL mean shit out of luck?
Octo-puss is offline   Reply With Quote
Old 2nd December 2008, 19:46   #717  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
@Octo-puss
Yes.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 3rd December 2008, 06:57   #718  |  Link
alc0re
Registered User
 
Join Date: Jun 2008
Posts: 91
If anyone is interested and doesn't know it yet, there is a solution to this problem.

If you don't have access to Scenarist (like me), TSMuxer now accepts .srt files as input and will convert these to a Bluray compliant PGS/.sup subtitle stream.

So, I rip my Bluray using eac3to, including the .sup file I want.

I then ocr the .sup file with SupRip. Save as .srt. Spell check/fix ocr mistakes.

Then open up TSMuxer and add your video/audio/.srt subtitle stream. Set subtitle options in the subtitls tab. I set my font to Arial at a size of 40 for 720p video, with a bottom pixel offset of 36.

Set output to Create Bluray disk. That's it. Subs look great on standalones/PS3.

I apologize if this is old news to anyone, but I thought I'd share what I found just in case this helps anyone that was anxiously awaiting the export .sup as 720 option in SupRead.
alc0re is offline   Reply With Quote
Old 3rd December 2008, 15:23   #719  |  Link
laserfan
Aging Video Hobbyist
 
Join Date: Dec 2004
Location: Off the Map
Posts: 2,461
Quote:
Originally Posted by alc0re View Post
...I then ocr the .sup file with SupRip. Save as .srt. Spell check/fix ocr mistakes.

Then open up TSMuxer and add your video/audio/.srt subtitle stream. Set subtitle options in the subtitls tab. I set my font to Arial at a size of 40 for 720p video, with a bottom pixel offset of 36....

I apologize if this is old news to anyone...
Doesn't hurt to clarify!

I might add that this is useful also for re-positioning subs on a 'scope display i.e. if original subs bleed-into the "black bar" at the bottom, you can use Offset to re-position them for a 2.35:1 screen presentation.
laserfan is offline   Reply With Quote
Old 19th December 2008, 22:15   #720  |  Link
jetli123
Registered User
 
Join Date: Apr 2003
Posts: 7
SUPread & SupRip crashed when using .sup extracted from multiple .m2ts

Hi,
I'm trying to extract the english subtitle from BD Fearless. If I use TSmuxer or ea3to and extract the subtitle .sup from the Director's Cut version which resides in 00153.m2ts file, then SUPread and/or SupRip would read the file fine. However, if I try extracting from the Theatrical version which resides in multiple *.m2ts files (ex: 00134.m2ts+00123.m2ts+***), either program would fail when reading the new .sup file:

SUPread:
Access violation at address 0054EC83 in module 'SUPread.exe'. Write of address FFFFFF68.

SupRip:
Object reference not set to an instance of an object.

Void LoadBluraySup(System.IO.FileStream)

at SupRip.SubtitleFile.LoadBluraySup(FileStream fs)
at SupRip.SubtitleFile.LoadFromSup(String supfile)
at SupRip.SubtitleFile..ctor(String fileName)
at SupRip.MainForm.LoadSubtitleFile(String fileName)


Have anyone try extracting subtitle from multiple *.m2ts files?

Here is the sup file generated from 2 .m2ts files (via eac3to)
http://www.100megs16.com/~thlphoto/test/00134_00123.sup


thx
jetli123 is offline   Reply With Quote
Reply

Tags
supread, suprip

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:36.


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