View Full Version : SupTitle: an AviSynth PGS (.SUP) Subtitle Plugin
Zachs
3rd July 2009, 10:07
Hi folks,
I've looked around for an AviSynth plugin to hard sub (I mostly hard sub the forced subtitles) my rips but was unable to find any.
So I've created an AviSynth plugin called SupTitle to do just that. It handles .SUP files extracted from eac3to (both HD and BD). Note that some users have tried to use SupTitle on DVD and HDTV subs and complained it doesn't work. So let me reiterate - SupTitle handles HD-DVD and Bluray .SUP files extracted by eac3to.
You'll need Microsoft .NET Framework 4 installed.
Cheers.
Current version: v2.0.8
Download: http://www.zachsaw.com/?pg=suptitle_pgs_avisynth_plugin
*** Make sure you read the installation guide in detail or you'll get an error message from AviSynth complaining "Could not load plugin".
Kurtnoise
3rd July 2009, 10:14
If there's enough interest, I'll make it available for download.
yes, please...;)
You'll need .NET 2 framework installed.
why ?
Zachs
3rd July 2009, 12:45
The plugin is coded in MC++ and C#. But, all the frame-to-frame intensive ops are coded in ASM.
sneaker_ger
5th July 2009, 22:17
I'm also interested. Please put it online - I'm pretty sure Kurtnoise and I aren't the only ones who'd like to give it a try.
Zachs
6th July 2009, 03:39
Ok, here it is.
SupTitle: an AviSynth PGS (.SUP) Subtitle Plugin (http://www.zachsaw.co.cc/?pg=suptitle_pgs_avisynth_plugin)
# Supported colorspaces - YV12, YUY2, RGB24, RGB32
# SIMD optimizations
# Alpha channel transparency blending
# Handles both HD-DVD and Blu-ray .SUP subtitle files extracted by eac3to
# Perfect for hardsubbing forced subtitles with forced flag detection (e.g. subs for foreign dialogues)
# Supports seek and jump
Note: It takes a while to start especially with large SUP files. SupTitle reads, verifies and caches all the SUP metadata on startup.
b66pak
6th July 2009, 16:18
thanks...
_
sneaker_ger
7th July 2009, 12:32
Thank you!
Zachs
8th July 2009, 08:41
New version v1.0.1 is available. I've implemented additional optimizations. Speed improvement is definitely noticeable. Test the latest version instead.
Cheers.
GrofLuigi
8th July 2009, 18:48
Hi,
Sorry for my noobishness, but can this be useful for SD-DVD? Is there something that can rip DVD to .SUP format that this plugin accepts?
GL
Zachs
9th July 2009, 01:41
This plugin accepts blu-ray and hd-dvd sup files extracted by eac3to. If you can convert DVD subs to the same format, then chances are SupTitle will not reject it.
GrofLuigi
9th July 2009, 15:01
This plugin accepts blu-ray and hd-dvd sup files extracted by eac3to. If you can convert DVD subs to the same format, then chances are SupTitle will not reject it.
Thank you for your reply, that's what I thought. Will try to make it work somehow in the future (I'm busy with other things right now).
GL
Adub
10th July 2009, 17:11
I have to ask, why the hell would you do that? There are already subtitle plugins for SD DVD's. VSFilter anyone? There is no point in converting to a HD format (and losing quality in the process), when you could just sub the SD version using already available tools.
GrofLuigi
10th July 2009, 23:10
I have to ask, why the hell would you do that? There are already subtitle plugins for SD DVD's. VSFilter anyone? There is no point in converting to a HD format (and losing quality in the process), when you could just sub the SD version using already available tools.
I had a stupid idea to hardcode the original subtitles as they appear (bitmaps, .sub & .idx, not rendered with fonts). VSFilter can't do that, I think... Can it?
No conversion to HD planned. :)
GL
Wilbert
11th July 2009, 15:12
If there's enough interest, I'll make it available for download.
Am I correct that you are not allowed to use it in a commercial setting (because that's what this eula is saying)? I would be nice if you could release it as open source.
Zachs
13th July 2009, 01:38
Am I correct that you are not allowed to use it in a commercial setting (because that's what this eula is saying)?
Yes you're right.
I would be nice if you could release it as open source.
No plans for open source ATM.
Gokumon
13th July 2009, 17:46
VSFilter can't do that, I think... Can it?
The VS in VSFilter is for VobSub so of course it supports Vobsub format sub/idx. It also supports the MicroDVD format of bitmapped subtitles.
sneaker_ger
19th August 2009, 00:07
I'm having a problem with your plugin. The subtitle in this sample is displayed in blue instead of the correct red.
Sample (http://www.mediafire.com/?1zvzzm4hze0)
Zachs
20th August 2009, 06:20
Hmm. Which app did you use to display the subtitle?
I think it depends on how the app converts YUV to RGB.
SupTitle uses the following formula:
YUV to RGB Conversion
B = 1.164(Y - 16) + 2.018(U - 128)
G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128)
R = 1.164(Y - 16) + 1.596(V - 128)
From here http://www.fourcc.org/fccyvrgb.php
Which app created the sup file?
Zachs
20th August 2009, 09:05
Also, there seems to be some unknowns in the PGS format such as the sequence of the Y'cbcr bytes.
That's the reason you get to swap cr/cb in BDSup2Sub.
I'd be interested to see how a standalone player displays the subtitle.
sneaker_ger
20th August 2009, 14:34
I tried creating the subtitles with PunkGraphicStream, avs2bdnxml + bdssup2sub and avs2bdnxml + bdsubedit. I don't have a standalone blu-ray player yet, but in MPC-HC and Power DVD all the subtitles are displayed in the correct red colors.
I'm using AviSynth's "blankclip" and it happens in RGB24, RGB32, YUY2 and YV12. While the subtitles appear blue in all four color spaces, in RGB24 and RGB32 the whole image gets green (overlaying anything that was beneath it). For playing I use VirtualDub and MPC-HC.
Zachs
21st August 2009, 01:28
OK. It looks like I've got cr/cb swapped.
I'll get it fixed.
Zachs
21st August 2009, 05:54
Ok. It's done.
http://www.zachsaw.co.cc/?pg=suptitle_pgs_avisynth_plugin
Version 1.0.2
* Changed the way Ycbcr is decoded (you can still switch back to the original method by setting swapCbCr to true).
* Additionally, it now uses the ITU BT.709 colormetry.
* Function arguments forcedOnly and swapCbCr (new) are now named and optional.
E.g. SupTitle("C:\subtitle-forced.sup", forcedOnly=false, swapCbCr=false)
sneaker_ger
21st August 2009, 13:55
Thx, but now the plugin is not loaded by AviSynth (2.5.8) anymore. ("Can't load plugin")
Zachs
21st August 2009, 16:21
Did you replace both SupCore.dll and SupTitle.dll from the distro?
Zachs
21st August 2009, 16:37
Looks like something *is* wrong...
should be some linker settings to do with how managed and unmanaged parts of the dll are linked.
I'm afraid I won't be able to get it fixed till next week.
Will be quite busy over the weekend unfortunately.
Zachs
22nd August 2009, 02:23
I've recompiled it, could you try it again?
suptitle_v1.0.2.zip (http://www.zachsaw.co.cc/downloads/suptitle_v1.0.2.zip) 41.34kB
sneaker_ger
22nd August 2009, 13:34
Works and colors are correct. The only remaining issue now is that the whole image becomes green in RGB color spaces.
Zachs
22nd August 2009, 16:41
Yup. I'll look into that.
Zachs
24th August 2009, 02:32
SupTitle v1.0.3 fixes the green image in RGB colorspaces issue.
sneaker_ger
24th August 2009, 04:41
"Can't load plugin"
Zachs
24th August 2009, 05:51
Try v1.0.4.
suptitle_v1.0.4.zip (http://www.zachsaw.co.cc/downloads/suptitle_v1.0.4.zip)
BTW, do you have Microsoft Visual Studio installed? 2008 perhaps?
Reason I want to know is 'cos I still haven't exactly figured out the actual cause of the "can't load plugin" error but I'm guessing it's got to do with some missing MS library files...
It's working on my machine so you'll have to help out a little to see if it works on yours.
Zachs
24th August 2009, 06:28
Try installing these:
"Microsoft Visual C++ 2005 Redistributable Package (x86)" (http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en)
and
"Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)" (http://www.microsoft.com/downloads/thankyou.aspx?familyId=200b2fd9-ae1a-4a14-984d-389c36f85647&displayLang=en)
and
Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update (http://www.microsoft.com/downloads/details.aspx?familyid=766A6AF7-EC73-40FF-B072-9112BAB119C2&displaylang=en)
Specifically: vcredist_x86.exe
Zachs
24th August 2009, 12:55
After you've installed the above, make sure you have the following folder in your Windows\winsxs folder:
x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_d08d7da0442a985d
Note the build number 4053, which is the MSVC++ SP1 CRT.
sneaker_ger
24th August 2009, 15:27
I had Windows XP with Visual Studio 2008 installed until a few days ago, when the hard disk failed. I'm currently on a Windows 2003 system I had laying around without Visual Studio. Having lost the old versions of SupTitle it could be that version 1.0 would have given the same error on my "new" system and that it's not a regression of SupTitle.
After having installed the vc++ red it works now. But while 1.0.3 fixed the RGB issue it's back in 1.0.4.
Zachs
25th August 2009, 01:37
Yeah you're right. Only in RGB32 though. RGB24 is working fine.
This side-by-side configuration thing (e.g. in our case SupTitle requires a specific build number of the MSVC++ CRT) is something Microsoft introduced to alleviate the long standing problem of DLL Hell. But it introduces another problem in distributing standalone apps. A lot of people have been asking Microsoft to implement an auto-fetch feature, or at least show a proper message which prompts the user to a web page to download the package.
Zachs
25th August 2009, 04:07
But while 1.0.3 fixed the RGB issue it's back in 1.0.4.
Fixed in v1.0.5.
sneaker_ger
25th August 2009, 05:21
Thx, works fine.
And I also don't get why Microsoft doesn't include the reds into their Service Packs or on Windows Update. They're small and needed for many programs but instead of these small useful packages they redistribute things like live essentials and what not.
Zachs
26th August 2009, 01:57
FYI, suptitle v1.0.6 is out.
Startup time (load + verify of sup) has been reduced tremendously, as well as further sub rendering speed-ups.
sneaker_ger
30th August 2009, 20:57
I'm having problems with this sample (http://www.mediafire.com/?mdwkiigiu4n) and version 1.0.6:
1.) The suptitles don't appear at all. It works fine in version 1.0.2 though.
2.) Using old versions they appear, but the timing is one frame off. They should appear on 00:00:01.001 but they do on 00:00:01.043. This 1 frame off thing also to happens at the end of subtitles occasionally.
Zachs
31st August 2009, 02:29
I'll take a look.
Zachs
31st August 2009, 03:06
What's the frame rate of your source?
Edit: I think I know what's going on.
It's a rounding error that's resulting 1000.999999 being treated as 1000.
I'll change it such that it rounds up / down more accurately.
I've found the problem with the subtitle not showing with v1.0.6.
It's another 10L caused by code refactoring.
sneaker_ger
31st August 2009, 03:25
24000/1001
Zachs
31st August 2009, 05:50
v1.0.7 now available.
Fixes both problems.
http://www.zachsaw.co.cc/?pg=suptitle_pgs_avisynth_plugin
sneaker_ger
31st August 2009, 14:01
That was fast, Thanks! Working fine.
Red Leader
11th September 2009, 18:58
Suptitle is great and I was wanted this for a long time.
To make installation easier, maybe you should insist that .NET 2005 is required, and that .NET 2008 does not includes 2005 functions
I had the "can't load plugin" before realizing that.
Also, it that's not too complex, could Suptitle display PGS that are not text? I tried to display a non-text .SUP file (graphic comments with trivia about the movie), and SupTitle could not display it, while regular subtitles from the same movie worked perfectly.
Zachs
13th September 2009, 16:42
Thanks for the suggestions.
PGS is all bitmap - it doesn't differentiate between a text and non-text sub. Could you post your file somewhere and let me know what and where to look at?
Red Leader
14th September 2009, 04:29
Here is the file ready for download.
http://dl.free.fr/rug5GtpiA
There must be some data that makes SupTitle stall. The graphics are comments in one color, appearing regularly at the bottom of the movie, on the sides or in the center.
Zachs
14th September 2009, 13:49
I'll take a look at it - what's the time code I should be looking at?
And what did you use to create the sup file?
Red Leader
15th September 2009, 01:52
eac3to was used to demux the movie (m2ts file from bluray) each subtitle tracks is demuxed to a .sup file, including regular subtitles and graphics
suptitle stalls as soon as the avs script is opened
here is the error message
10288
Zachs
15th September 2009, 15:29
Yup definitely something I haven't come across before.
Will have a look and see if I could figure out the format...
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.