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...
Zachs
16th September 2009, 05:48
I've changed the code so it would read the SUP format you posted.
It'll be available soon.
With regards to the framework dependency issue though, there's really not much I could do besides incorporating the dotnet bootstrap into a proper installer. I'm not keen on doing that as it would increase the download size to a few MBs from ~40KB. I'd rather have the framework as a separate download so users only need to download it once.
Zachs
16th September 2009, 08:34
v1.0.8 is now available.
Adds support for the SUP file format found here (http://forum.doom9.org/showthread.php?p=1325236#post1325236).
Head over to http://www.zachsaw.co.cc/?pg=suptitle_pgs_avisynth_plugin to download.
Red Leader
17th September 2009, 18:57
Great! It works perfectly now, you have redefined the word responsive! Many many thanks. Now we can read the graphics commentaries demuxed from blurays. You just added a major feature that was lacking since the introduction of hidef media. Maybe you could talk to the media player classic developers, it would be fantastic to include SUP reading directly from MPC, what do you think?
vwpassion
19th September 2009, 12:14
Thank you for this filter! Great work.
Blue_MiSfit
19th September 2009, 22:25
This plugin is a lifesaver!
Thanks so much!
Zachs
21st September 2009, 03:04
Maybe you could talk to the media player classic developers, it would be fantastic to include SUP reading directly from MPC, what do you think?
It'll be a lot easier if MPC-HC has some sort of plug-in support which would allow developers to build upon the subtitles rendering part of the software. For now though, you can use AviSynth to do the same and use MPC-HC to play the script.
Zachs
2nd February 2010, 01:45
Just wanted to drop a line to inform all Suptitle users that an updated version (v1.0.9) is now available.
It fixes a problem with some SUP files not loading properly.
ChldsPlay
12th May 2010, 02:18
I'm getting a syntax error. It says: "Script error: syntax error" Then below that is the location of the script followed by line 3, column 0.
I'm not really sure I know what I'm doing, but I think I don't see what I'm doing wrong. I installed everything mentioned.
Zachs
12th May 2010, 04:17
What's your script?
ChldsPlay
13th May 2010, 04:28
LoadPlugin("SupTitle.dll")
clip = MPEG2Source("C:\Users\Kevin\Documents\NeroVision\ExportedVideo\avatar.mpg")
return clip.SupTitle("D:\Avatar\00002.track_4608.sup", forcedOnly=false,
swapCbCr=false, relocate=false, relocOffset="")
For all I know, everything about it is wrong. This is my first time working with AviSynth and scripts.
Zachs
14th May 2010, 03:08
You didn't insert a line break in the middle of the clip.SupTitle statement did you?
ChldsPlay
14th May 2010, 06:46
You didn't insert a line break in the middle of the clip.SupTitle statement did you?
Yes, actually I just copied and pasted the example and changed the file names etc.
I fixed that and now whichever program I use to open it stops working and has to close.
Zachs
14th May 2010, 07:52
Try your script without SupTitle first. Isolate the problem.
ChldsPlay
15th May 2010, 00:06
Try your script without SupTitle first. Isolate the problem.
If I do just:
DirectShowSource("C:\Users\Kevin\Documents\NeroVision\ExportedVideo\avatar.mpg")
It will cause the program to shut down.
Zachs
15th May 2010, 12:21
There you go.
lotrmith
20th May 2010, 17:31
Hello,
I'm trying to embed the forced subtitles of Avatar (the alien language ones) into a .mp4 of the movie that I have converted from the main .m2ts using HDConverttoX.
As of last week I've had zero experience doing anything thing complex, but what I've been able to do so far with HDConverttoX is successfully convert a half dozen other .m2ts sources into .mp4, and in some I've been able to locate forced subtitle tracks and convert with those embedded (using HDConverttoX). The problem I've run into is with movies that don't have a separate track for just the forced subtitles but instead use a forced flag for the individual subtitles in the main subtitle track. I am able to extract the main subtitle track using tsMuxer and then open it with BDSup2Sub and copy it with only the forced subtitles, and now I think I'm on the last step of just trying to put 2 and 2 together.
The guys at HDConverttoX sent me here.
Here's what I've got:
A playable .m2ts source: C:\Users\M\Documents\Avatar\RED_BIRD_2D_WW\BDMV\STREAM\0002.m2ts
A playable .mp4 conversion without any subtitles: C:\Users\M\Documents\Avatar\Avatar.mp4
A forced subtitle track that I want to embed: C:\Users\M\Documents\Avatar\ForcedFinal.sup
Could you help? I understand that your program here is what I need. My difficulty is that I have no idea how to use it, because I am totally inexperienced at all manner of this kind of stuff. I guess what I need are step by step instructions, and talk to me like I'm a 5-year-old (for example, I don't know if your program runs on its own or if I have to write the script lines in Avisynth, and I don't even know how to do that if that's the case). Sorry if I sound dumb! I'm really getting my feet wet here.
I'm supposing that I just enter your script into the script generated by HDConverttoX? Here's an example of the script it runs to convert the m2ts into the mp4:
prompt $d $t $_$P$G
echo job number: 1
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\eac3to.exe" "c:\users\M\documents\avatar\red_bird_2d_ww\bdmv\stream\00002.m2ts" 3: stdout.wav -down16 -down2 | "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\lame.exe" - -h --abr 256 "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdencodertox-pid3.mp3"
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\xvid_encraw.exe" -progress 50 -i "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avs" -avi "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avi" -max_bframes 2 -vhqmode 1 -quality 6 -max_key_interval 125 -lumimasking -bquant_ratio 150 -framerate 23.976 -threads 6 -bitrate 9871 -pass1 -turbo -par 1:1
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\xvid_encraw.exe" -progress 50 -i "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avs" -avi "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avi" -max_bframes 2 -vhqmode 1 -quality 6 -max_key_interval 125 -lumimasking -bquant_ratio 150 -framerate 23.976 -threads 6 -bitrate 9871 -pass2 -par 1:1
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\eac3to.exe" "c:\users\M\documents\avatar\red_bird_2d_ww\bdmv\stream\00002.m2ts" 1:"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\chapters.txt"
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\mp4box.exe" -add "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avi" -fps 23.976 -add "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdencodertox-pid3.mp3":lang=eng -chap "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\chapters.txt" "C:\Users\M\Documents\Avatar\RED_BIRD_2D_WW\BDMV\STREAM\Avatar.mp4"
And here's a sample if I had chosen to embed the main english subtitle track, so you can see when and where it runs it's subtitle operation:
prompt $d $t $_$P$G
echo job number: 1
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\eac3to.exe" "c:\users\M\documents\avatar\red_bird_2d_ww\bdmv\stream\00002.m2ts" 9:"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdencodertox__subs_9.sup"
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\eac3to.exe" "c:\users\M\documents\avatar\red_bird_2d_ww\bdmv\stream\00002.m2ts" 3: stdout.wav -down16 -down2 | "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\lame.exe" - -h --abr 256 "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdencodertox-pid3.mp3"
java -jar "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\BDSup2Sub.jar" "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdencodertox__subs_9.sup" "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdencodertox__subs_9.idx" /res:1080p
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\xvid_encraw.exe" -progress 50 -i "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avs" -avi "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avi" -max_bframes 2 -vhqmode 1 -quality 6 -max_key_interval 125 -lumimasking -bquant_ratio 150 -framerate 23.976 -threads 6 -bitrate 9871 -pass1 -turbo -par 1:1
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\xvid_encraw.exe" -progress 50 -i "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avs" -avi "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avi" -max_bframes 2 -vhqmode 1 -quality 6 -max_key_interval 125 -lumimasking -bquant_ratio 150 -framerate 23.976 -threads 6 -bitrate 9871 -pass2 -par 1:1
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\eac3to.exe" "c:\users\M\documents\avatar\red_bird_2d_ww\bdmv\stream\00002.m2ts" 1:"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\chapters.txt"
"C:\Users\M\Documents\HDConvertToX_2.5.624.4217\applications\mp4box.exe" -add "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdconverttox_00002.avi" -fps 23.976 -add "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\hdencodertox-pid3.mp3":lang=eng -chap "C:\Users\M\Documents\HDConvertToX_2.5.624.4217\job1\chapters.txt" "C:\Users\M\Documents\Avatar\RED_BIRD_2D_WW\BDMV\STREAM\Avatar.mp4"
Am I correct that I have to insert your plugin script somewhere into this mess? If so, what exact script and where would I insert it?
sneaker_ger
20th May 2010, 18:12
You need to install AviSynth and write an avs-script (Just use Windows notepad and save the file as "filename.avs") which should look something like this:
FFVideoSource("0002.m2ts")
SupTitle("ForcedFinal.sup", forcedOnly=False)
You can now open this file in any AviSynth-capable GUI like StaxRip, RipBot, MeGUI etc. (I don't know anything about HDConverttoX).
Notice that the SupTitle function already has an argument called "forcedOnly". If you set it to "true" you can skip the BDSup2Sub step you have been doing until now.
For "FFVideoSource" and "SupTitle" to work you have to download the plugins and copy the included dlls to the avisynth\plugins dir. (Download ffmpegsource here (http://code.google.com/p/ffmpegsource/))
Hope that helps to get you started.
Zachs
21st May 2010, 01:39
This is a good place to start learning about AviSynth.
http://en.wikipedia.org/wiki/AviSynth
You'll need to be familiar with AviSynth and how its plugins are used to work a script before you'll be able to understand how to use SupTitle.
lotrmith
21st May 2010, 04:18
Alright I made some headway with instrutions from the author of HDConverttoX, and here's what's happened:
I edited an avs file associated with the job to be performed by HDC, to include this code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SupTitle.dll")
SupTitle("C:\Users\M\Documents\Avatar\ForcedFinal.sup", forcedOnly=false, swapCbCr=false, relocate=true, relocOffset="")
Running the job resulted in it encoding as it normally does without any errors during the entire process, but the final output .mp4 file had no video image except a black screen with an error message embedded that ran for the length of the film. The error message is as follows:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at SupTitle.GetFrame(SupTitle* , PVideoFrame* , Int32 n, IScriptEnvironment* env)
Anyone know what that might indicate?
Here's our thread with HDC: http://forum.doom9.org/showthread.php?p=1401582#post1401582
Zachs
21st May 2010, 05:02
Yes. v1.0.9 has an issue with Avatar's forced subs. Head over to SupTitle's forum (http://www.zachsaw.co.cc/forum/viewtopic.php?f=14&t=83) to grab the latest version (beta).
lotrmith
21st May 2010, 06:01
Yes. v1.0.9 has an issue with Avatar's forced subs. Head over to SupTitle's forum (http://www.zachsaw.co.cc/forum/viewtopic.php?f=14&t=83) to grab the latest version (beta).
I'll give that a shot. Thanks!
sneaker_ger
21st May 2010, 12:13
For the future: you might want to preview your script in Media Player Classic, VirtualDub or something else before encoding, to see if something's wrong. Saves a lot of time.
asarian
28th May 2010, 21:59
Dude, just wanted to say: doumo arigatou gozaimasu! :) Just the program I've been waiting for for ages!
asarian
7th June 2010, 22:50
Hmm, seems I'm not so happy, after all. Just installed .NET 4, for the latest suptitle 2.0.1, and now I get the following error on the plugin:
"Evaluate: Unrecognized Exception"
I followed your installation guide to the letter, and call the plugin like this:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFMS2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SupTitle.dll")
video=FFVideoSource("D:\Temp\video.mkv").ConvertToYV12().Crop(0, 142, 0, -142)
video=SupTitle(video, "D:\subs\00004 - 11 - Subtitle (PGS).sup", forcedOnly=true, swapCbCr=false, relocate=true, relocOffset="0,140,0,140")
(I eventually need to return 'video' in this script, is why). With relocate off or on, makes no difference.
Any suggestions as to what is going on?
Thanks.
EDIT: Yes, without the plugin everything works fine.
Zachs
8th June 2010, 03:34
It should work.
You did return 'video' at the end of your script right?
I found this thread (http://forum.doom9.org/showthread.php?t=80737) describing the error message you're seeing.
It looks like it's an AviSynth exception. You might want to try grabbing a more stable release of AviSynth.
I can't reproduce the problem on either of my machines (XP-32 and Win7-64).
asarian
8th June 2010, 12:32
It should work.
You did return 'video' at the end of your script right?
I found this thread (http://forum.doom9.org/showthread.php?t=80737) describing the error message you're seeing.
It looks like it's an AviSynth exception. You might want to try grabbing a more stable release of AviSynth.
I can't reproduce the problem on either of my machines (XP-32 and Win7-64).
Zachs, thanks for looking into this.
I have the latest AviSynth, version 2.5.8; not sure how much more stable it will get. :( I even grabbed the latest replacement DirectShowSource.dll for Avisynth 2.5.8 (didn't even know it existed); that makes no difference, either (then again, I'm not even using DirectShowSource here at all, but FFVideoSource). And the "Evaluate: Unrecognized Exception" thread you showed is from 2004; seems unlike 2.5.8 would still be plagued by the same issue; but I can ask around.
Zachs
8th June 2010, 14:37
Can you try with just a blankclip + suptitle?
Also, try that with AviSynth 2.5.8 MT build - that's what I'm using. I have a feeling that it's your build, as others and myself have managed to get it working just fine.
asarian
9th June 2010, 03:32
Can you try with just a blankclip + suptitle?
Also, try that with AviSynth 2.5.8 MT build - that's what I'm using. I have a feeling that it's your build, as others and myself have managed to get it working just fine.
I tried the AviSynth 2.5.8 MT build tonight; no go, alas. :( This time around the Media Player Classic (associated with my avs files, for playing) doesn't even show an error any more, but just collapses into oblivion after 1 or so seconds of blackness.
According to IanB, of avisynth, a plugin would have to behave severely out of bounds for this last-resort exception to occur. My guess is that it's caused by the manifold layered requirements for .NET Framework installs, and that it's somewhere missing something. I have 2 + 4 installed (and 3.5 too, actually). I can't reinstall 2 again, as XP won't let me any more after later updates.
You wouldn't have a debug build lying around, would ya? :)
foxyshadis
9th June 2010, 04:23
Unrecognized Exception always means someone screwed up the memory access in either a codec or a plugin, or it ran out of memory and forgot to crash. I've made it happen more often than I can count. (It could be FFVideoSource as well, don't forget to check that.) It's usually not very hard to catch in a debugger because it'll blow up as soon as it tries to write outside of its allocated structure, but you need the source for that.
asarian
9th June 2010, 05:19
Unrecognized Exception always means someone screwed up the memory access in either a codec or a plugin, or it ran out of memory and forgot to crash. I've made it happen more often than I can count. (It could be FFVideoSource as well, don't forget to check that.) It's usually not very hard to catch in a debugger because it'll blow up as soon as it tries to write outside of its allocated structure, but you need the source for that.
Yeah, I thought of FFVideoSource, and eliminated it as possible cause by using both BlankClip and the script simply without the SupTitle line; both run fine that way.
My setup is a dedicated XP SP3 partition, just for rendering. Other than avisynth, ffdshow, haali media splitter, and a few degrain filters, it's not cluttered by anything else, and generally renders flawlessly. In fact, SupTitle is really the only plugin so far that really seems to freak out.
Zachs
9th June 2010, 05:26
Could you try with just a BlankClip followed SupTitle?
I really can't see how it would only fail on your machine when so many others have reported that it works just fine.
Zachs
9th June 2010, 05:28
Also, have you tried with other SUP files?
asarian
9th June 2010, 05:34
Could you try with just a BlankClip followed SupTitle?
I really can't see how it would only fail on your machine when so many others have reported that it works just fine.
Already tried it with BlankClip (see my previous post; I think we were just writing a post at the same time); makes no difference, unfortunately.
Yeah, I was just gonna say: might be it's tripping over the SUP-file; then I saw you post the same question just now. :) It's a SUP from 2010, the Blu-Ray, extracted with eac3to. I'll try some others, and see how that works out.
Thanks for your continued help, at least.
Zachs
9th June 2010, 05:51
Post the SUP file somewhere and I'll take a look into it.
It could be that SupTitle's run out of memory.
Zachs
9th June 2010, 05:54
When you tried blankclip, did you have other plugins loaded as well or just SupTitle?
asarian
9th June 2010, 06:15
Post the SUP file somewhere and I'll take a look into it.
It could be that SupTitle's run out of memory.
Good call, Zachs! :) Turns out it actually was the SUP file causing the crash! I tried the first one (faulting Japanese (http://rapidshare.com/files/396931948/00004_-_11_-_Subtitle__PGS_.rar.html)), and that's the one which crashes. I then just now tried the English SUP (http://rapidshare.com/files/396927647/00004_-_12_-_Subtitle__PGS_.rar.html) , and that one doesn't crash; but it doesn't show the subs either, whichever mode I try (forcedOnly true/false, relocate true/false). It doesn't cause a crash, though; so at least that impossible part is solved. I feel we're nearing a solution. :)
This is the exact script I use:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFMS2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SupTitle.dll")
video=FFVideoSource("D:\Temp\video.mkv").ConvertToYV12()
video=SupTitle(video, "D:\subs\00004 - 12 - Subtitle (PGS).sup", forcedOnly=false, swapCbCr=false, relocate=true, relocOffset="0,142,0,142")
video=Crop(video, 0, 142, 0, -142)
video=ConvertToRGB(video)
return video
sneaker_ger
9th June 2010, 12:46
I can't get the new version running: "LoadPlugin: unable to load"
Windows XP SP3 32bit
.NET 4.0 (and all the older ones) is installed
Zachs
9th June 2010, 13:53
Try copying the two MS Visual C++ CRT dll files into your system32 folder.
sneaker_ger
9th June 2010, 14:20
That did it, thank you. :o
asarian
9th June 2010, 18:24
Post the SUP file somewhere and I'll take a look into it.
It could be that SupTitle's run out of memory.
Zach, any verdict yet on the SUP samples I posted? :)
asarian
10th June 2010, 01:02
Zachs, I just tried SupTitle on my Avatar Blu-Ray, and it works flawlessly there. :) So, we have established that my install is working now.
Only thing that rests now is for you (or any other volunteer, for that matter) to kindly have a look at the two SUPS which I posted above, onegai shimasu! :) :thanks:
EDIT: Also, relocOffset doesn't appear to be working on the Avatar SUP file (version 2.0.1): no matter how hard I try, I can't lower the subs.
Zachs
10th June 2010, 02:10
Will take a look at the SUPs later if I've got some time to spare.
Avatar's forced subs are 1920x1080, relocOffset can't move it since it's taking up the full screen already.
asarian
10th June 2010, 15:01
Will take a look at the SUPs later if I've got some time to spare.
Avatar's forced subs are 1920x1080, relocOffset can't move it since it's taking up the full screen already.
Thanks, Zachs. Wakatta!
Would make for an interesting feature request, though: to be able to move the SUPS, regardless of whether they already fill the screen (like crop them internally first, then position them to allow for the relocation). The Avatar subs, for one, appear too high up in the screen, for my taste.
Overall, I don't understand why this thread is so short. Your plugin really was a godsent to me, and I don't get why it isn't wildly popular here. :) To be able to add subs in their original, non-fubarred, non-OCR-ed, shape really is a major thing.
Zachs
11th June 2010, 01:32
crop them internally first, then position them to allow for the relocation
The biggest issue I have with that is you won't know if you've over cropped until you review all the frames with subs of the entire movie.
I've had a quick look at the faulting sup - the previous versions would've thrown an exception with message saying the sup's format is unexpected (i.e. I haven't written the part of code that handles that particular format).
The english sup is fine though - perhaps you've cropped away the sup?
asarian
11th June 2010, 02:15
Thank for looking into it, Zachs.
The biggest issue I have with that is you won't know if you've over cropped until you review all the frames with subs of the entire movie.
Does it matter? I mean, cropping is just the user's responsibility anyway, right? In the case of Avatar, the subs appear unusually high; I wouldn't have minded lowering them substantially. Should it turn out I had overcropped somewhere after all, I'd just re-encode.
I've had a quick look at the faulting sup - the previous versions would've thrown an exception with message saying the sup's format is unexpected (i.e. I haven't written the part of code that handles that particular format).
The english sup is fine though - perhaps you've cropped away the sup?
Could very well be, come to think of it. :) I tried it as follows:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFMS2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SupTitle.dll")
video=FFVideoSource("D:\Temp\video.mkv").ConvertToYV12()
video=SupTitle(video, "D:\subs\2.sup", forcedOnly=true, swapCbCr=false, relocate=true, relocOffset="0,142,0,142")
video=Crop(video, 0, 142, 0, -142)
video=ConvertToRGB(video)
return video
That may actually be wrong, as relocOffset shouldn't be applicable at that stage yet (after all, I only crop afterwards). I can't test it yet, as the only machine available to me which has a working SupTitle install on it is doing Avatar now. But I bet that was wrong.
deank
11th June 2010, 11:19
@asarian: You can accomplish what you want by loading your SUP file in BDsup2sub, and select "EDIT/Move all captions". Then select "Move outside bounds" and set "Offset Y:" to bottom offset of your choice.
You'll get a new SUP file, which you can then use with SupTitle plugin.
http://javaforge.com/displayDocument/scrn_move.png?doc_id=76806
Dean
asarian
11th June 2010, 13:51
@asarian: You can accomplish what you want by loading your SUP file in BDsup2sub, and select "EDIT/Move all captions". Then select "Move outside bounds" and set "Offset Y:" to bottom offset of your choice.
You'll get a new SUP file, which you can then use with SupTitle plugin.
:thanks:, Dean! This is exactly what I was looking for! :)
asarian
17th June 2010, 07:49
The english sup is fine though - perhaps you've cropped away the sup?
Hmm, trying this again, and I still can't get the English subs to show, try as I might. This should have worked:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFMS2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SupTitle.dll")
video=FFVideoSource("D:\Temp\video.mkv").ConvertToYV12()
video=SupTitle(video, "D:\subs\2010.sup", forcedOnly=true, swapCbCr=false, relocate=false)
video=Crop(video, 0, 142, 0, -142)
video=ConvertToRGB(video)
return video
Even without the crop, the subs are still a no-show. :( May I ask, what script did you use to get the subs I posted to work?
sneaker_ger
17th June 2010, 14:29
Are you sure that these are forced subs? Try "forcedOnly=false" if you haven't.
asarian
17th June 2010, 22:03
Are you sure that these are forced subs? Try "forcedOnly=false" if you haven't.
I tried them every which way I could think of: forced on/off, relocate on/off, etc. They just don't show up ever, under any circumstance.
sneaker_ger
17th June 2010, 22:13
Are we still talking about those you uploaded above (http://forum.doom9.org/showpost.php?p=1406826&postcount=86)?
asarian
17th June 2010, 22:15
Are we still talking about those you uploaded above (http://forum.doom9.org/showpost.php?p=1406826&postcount=86)?
Indeed, we are. :) The English subs (0004 - 12), which I just renamed to 2010.sup in my script, thinking maybe the spaces in the name could cause the problem.
sneaker_ger
17th June 2010, 22:32
Working fine here using the following script:
BlankClip(length=259200,width=1920,height=1080,fps=24000,fps_denominator=1001,color=000000)
SupTitle("00004 - 12 - Subtitle (PGS).sup")
Please note that the first subtitle appears as late as 0:49:56.410. ( 49 minutes, 56 seconds and 410 miliseconds!)
asarian
18th June 2010, 02:25
Working fine here using the following script:
BlankClip(length=259200,width=1920,height=1080,fps=24000,fps_denominator=1001,color=000000)
SupTitle("00004 - 12 - Subtitle (PGS).sup")
Please note that the first subtitle appears as late as 0:49:56.410. ( 49 minutes, 56 seconds and 410 miliseconds!)
Thanks, sneaker! I had assumed the subs would be there for every line (to be switched on or off by forcedOnly); so yeah, that could account for something. :P
Soon as the current job is done, I'll try again.
asarian
21st June 2010, 15:11
Working fine here using the following script:
BlankClip(length=259200,width=1920,height=1080,fps=24000,fps_denominator=1001,color=000000)
SupTitle("00004 - 12 - Subtitle (PGS).sup")
Please note that the first subtitle appears as late as 0:49:56.410. ( 49 minutes, 56 seconds and 410 miliseconds!)
Now that I've finished a series of other encodes, and got BDSup2Sub, I see indeed the sup file itself is borked: the conversation for the entire movie starts ~50mins too late! No wonder I couldn't find anything! I wonder whether's a way to shift back those times?
sneaker_ger
21st June 2010, 15:23
On opening the file in BDSup2Sub you can set a negative delay in the "Converion Options" dialogue.
Zachs
22nd June 2010, 01:50
asarian, I can't reproduce the "Evaluate: Unrecognized Exception" error using either of your sups.
Your Japanese sub shows up with a proper exception complaining that it doesn't recognize the format:
"System.Exception: Not expecting more than one bitmap per descriptor!"
followed by stacktrace.
I'll take a look into this new format but I still can't get it to fail the same way.
Zachs
22nd June 2010, 03:53
SupTitle v2.0.2 is now available. It should fix the problem with your jap sub - there's a sub frame in there that requires fade-out which SupTitle still doesn't support, but at least will render as static frame.
asarian
22nd June 2010, 07:53
asarian, I can't reproduce the "Evaluate: Unrecognized Exception" error using either of your sups.
Your Japanese sub shows up with a proper exception complaining that it doesn't recognize the format:
"System.Exception: Not expecting more than one bitmap per descriptor!"
followed by stacktrace.
I'll take a look into this new format but I still can't get it to fail the same way.
How strange indeed.
Last night I realized the only thing slightly 'older' on my install is a previous version of FFMS2 (for FFVideoSource); seems the latest version actually doesn't need ffdshow and/or haali splitter any more. Anyway, I can't see how that would affect anything, but I'll upgrade it regardless (after current job finishes, of course).
SupTitle v2.0.2 is now available. It should fix the problem with your jap sub - there's a sub frame in there that requires fade-out which SupTitle still doesn't support, but at least will render as static frame.
I really appreciate your program and your continual efforts, Zach. :) I'll try it out, later today. Thanks!
Zachs
22nd June 2010, 09:09
I tried it with this script:
LoadPlugin("SupTitle.dll")
clip = blankclip(300000, 1920, 1080, "YV12", 24000, 1001, color=$442211)
clip.SupTitle("H:\00004 - 11 - Subtitle (PGS).sup", forcedOnly=false, swapCbCr=false, relocate=true, relocOffset="0, 0, 0, 0")
And v2.0.1 dumped out a very useful exception stacktrace.
asarian
23rd June 2010, 13:58
@asarian: You can accomplish what you want by loading your SUP file in BDsup2sub, and select "EDIT/Move all captions". Then select "Move outside bounds" and set "Offset Y:" to bottom offset of your choice.
You'll get a new SUP file, which you can then use with SupTitle plugin.
Hmm, sadly this doesn't work. :( I tried it with the SUP for Wall-E, and the RESULT (http://little-albatross.net/walle_exp.rar) ís a no-show with SupTitle.
asarian
4th October 2010, 19:49
Any change we can see a 64-bit version of this awesome plugin? Then I could move my entire scripts with MCTemporalDenoise to 64-bit (as I often need to build in the existing Blu-Ray subs).
Zachs
2nd December 2010, 12:49
Yeah. x64 build is here - http://www.zachsaw.co.cc/?pg=suptitle_pgs_avisynth_plugin
greyshadow
29th December 2010, 01:06
Hi Zachs, I use megui gui 0.3.5.0 as I am not a script person, I encode from BR 1080p to 720p x264/AAC, then in mkvmerge add AC3 and soft .srt subtiles, is there a version of your script/plugin I could use with the gui to hardcode foreign .srt or .sup files which I extract with tsmuxer/supRip, I have win 7 (86x)
Zavs
3rd January 2011, 06:01
Hi Zachs, I use megui gui 0.3.5.0 as I am not a script person, I encode from BR 1080p to 720p x264/AAC, then in mkvmerge add AC3 and soft .srt subtiles, is there a version of your script/plugin I could use with the gui to hardcode foreign .srt or .sup files which I extract with tsmuxer/supRip, I have win 7 (86x)
manually add the required info into the script created by megui's AVS Script Creator
Here is an example of the required info (from zachsaw's website)...
LoadPlugin("path_to_where_the_suptitle_dll_is.dll")
DirectShowSource("path_to_your_movie")
SupTitle("path_to_your_subtitle.sup", forcedOnly=false, swapCbCr=false, relocate=true, relocOffset="0,140,0,140")
forcedOnly=false/true, (true if you only want forced subs included)
swapCbCr=false/true, (not really sure on the use of this one...maybe someone can comment)
relocate=true/false, (do you need to move the subtitles? are you cropping?)
relocOffset="0,140,0,140" (where you want to move the subtitles to)
Hopefully this is what you were asking for...
greyshadow
3rd January 2011, 21:57
Thanks, will give it a try tonight and report back
Donholio
12th April 2011, 07:57
Unfortunately, the website hosting Suptitle is now offline. Does anyone have a copy of the script they can share?
sneaker_ger
12th April 2011, 10:37
http://rapidshare.com/files/457044840/suptitle_v2.0.2_x86.zip
http://rapidshare.com/files/457044862/suptitle_v2.0.2_x64.zip
/edit:
Outdated. See start post again.
Donholio
12th April 2011, 18:23
Thanks Sneaker_Ger
Selur
11th April 2012, 21:54
You'll need Microsoft .NET Framework 4 installed.
just wondering can't SubTitle be build statically to avoid the dependencies to .NET ?
sneaker_ger
11th April 2012, 22:06
Oh, there have been updates. Didn't notice that.
stax76
22nd July 2013, 18:22
It would be interesting to know what .NET 4.0 features uses since Windows 7 has only .NET 3.5.
Tappen
27th July 2013, 22:33
Windows 7 has .NET 4.0 and 4.5. Win XP SP3 supports .Net 4.0. The only limit so far is that XP doesn't support 4.5.
stax76
27th July 2013, 22:55
Windows 7 was released Oktober 2009 and includes definitively only .NET 3.5.
.NET 4.0 was released much after Windows 7 at April 2010.
nautilus7
28th July 2013, 15:21
You can install .net 4.0 and 4.5 on windows 7 separetely. Don't see why the confusion.
Lyris
24th September 2013, 09:33
Does anyone have a copy of this plugin? Sounds just like what I need, but I can't seem to find a working download location.
Edit: found it - domain name change!
http://www.zachsaw.com/?pg=suptitle_pgs_avisynth_plugin
desperado836
14th October 2014, 17:39
I made my avisynth script, play it in MPC-HC and the sub works, just it is behind the video approximately 5 seconds, any way to adjust the timing of the subtitle?
stax76
14th January 2015, 10:21
I tried to use SupTitle.dll in StaxRip getting some assembly loading exception with any source I tried, the scripts also crash your C# player and mpc but not necessarily on startup but in the middle or exit. Maybe you can try if you can get it working in StaxRip. This was one of the sources I tried:
General
UniqueID/String : 177566164073448104018223832749740118652 (0x8595FFCED77637EEA8E2852C4F63D27C)
CompleteName : D:\Video\Samples\MKV\AVC - DTS-MA - PGS.mkv
Format : Matroska
Format_Version : Version 4 / Version 2
FileSize/String : 382 MiB
Duration/String : 2mn 11s
OverallBitRate_Mode/String : Variable
OverallBitRate/String : 24.4 Mbps
Encoded_Date : UTC 2014-12-27 20:41:20
Encoded_Application : mkvmerge v7.4.0 ('Circles') 32bit built on Dec 12 2014 12:10:09
Encoded_Library/String : libebml v1.3.0 + libmatroska v1.4.1
DURATION : 00:01:37.305000000
NUMBER_OF_FRAMES : 50
NUMBER_OF_BYTES : 152295
_STATISTICS_WRITING_APP : mkvmerge v7.4.0 ('Circles') 32bit built on Dec 12 2014 12:10:09
_STATISTICS_WRITING_DATE_UTC : 2014-12-27 20:41:20
_STATISTICS_TAGS : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Video
ID/String : 1
Format : AVC
Format/Info : Advanced Video Codec
Format_Profile : High@L4.1
Format_Settings_CABAC/String : Yes
Format_Settings_RefFrames/String : 4 frames
CodecID : V_MPEG4/ISO/AVC
Duration/String : 2mn 11s
BitRate_Mode/String : Variable
BitRate_Maximum/String : 37.0 Mbps
Width/String : 1 920 pixels
Height/String : 1 080 pixels
DisplayAspectRatio/String : 16:9
FrameRate_Mode/String : Constant
FrameRate/String : 23.976 fps
ColorSpace : YUV
ChromaSubsampling : 4:2:0
BitDepth/String : 8 bits
ScanType/String : Progressive
Default/String : Yes
Forced/String : No
colour_primaries : BT.709
transfer_characteristics : BT.709
matrix_coefficients : BT.709
colour_range : Limited
Audio
ID/String : 2
Format : DTS
Format/Info : Digital Theater Systems
Format_Profile : MA / Core
Format_Settings_Mode : 16
Format_Settings_Endianness : Big
CodecID : A_DTS
Duration/String : 2mn 11s
BitRate_Mode/String : Variable
BitRate/String : Unknown / 1 509 Kbps
Channel(s)/String : 6 channels
ChannelPositions : Front: L C R, Side: L R, LFE
SamplingRate/String : 48.0 KHz
BitDepth/String : 24 bits
Compression_Mode/String : Lossless / Lossy
Default/String : Yes
Forced/String : No
Text
ID/String : 3
Format : PGS
MuxingMode : zlib
CodecID : S_HDMV/PGS
CodecID/Info : The same subtitle format used on BDs/HD-DVDs
Default/String : Yes
Forced/String : No
Zachs
14th January 2015, 11:36
SupTitle is discontinued unfortunately due to my server HDD crashing, and the only backup I had was v1.x - fortunately from that experience I now also use cloud-based version control systems for all my active projects.
Dion
17th August 2018, 22:45
I hope someday you come back to this plugin and add support for Avisynth+ and make it work again.
Website seems dead.
But I have the 32bit copy still for people.
https://www.dropbox.com/s/4nvdcplz8jf464c/suptitle_v2.0.8_x86.zip?dl=1
or Maybe if anyone knows an alternative plugin to this.
pommesmatte
5th March 2019, 10:46
I would also be very interested in an alternative, because SupTitle does not work with Avisynth+.
Anybody knowing a solution?
Selur
5th March 2019, 18:49
because SupTitle does not work with Avisynth+.
Just tested and it works fine here, using for example:
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\DGDecodeNV.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\SupTitle.dll")
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
# loading source: E:\bd_probs\Blu-Ray 1080p AVC DTS-HD MA\BDMV\STREAM\00005.m2ts
# input color sampling YV12
# input luminance scale tv
DGSource(dgi="E:\Temp\m2ts_4a3535dbb7070f889ca5f92f88a54966_853323747.dgi",fieldop=2)
# current resolution: 1920x1080
# filtering
# embedding subtitles
Preroll(video=10, audio=0)
# Loading subtitle: E:\Output\00005.track_4608_lang_und.4a3535dbb7070f889ca5f92f88a54966.sup
SupTitle("E:\Output\00005.track_4608_lang_und.4a3535dbb7070f889ca5f92f88a54966.sup")
PreFetch(16)
return last
Cu Selur
Selur
9th June 2019, 18:59
As a side note: seems like SupTile crashes for subtitles created by easyavs2bdnxml
Katie Boundary
9th July 2023, 05:02
THIS proved to be the magic bullet that I was looking for! Thanks!
And to think that Stainless tricked me into screwing around with OCR again... lol
EDIT: Plugin crashes when reading certain subs. I don't know if the subs are corrupted or if it's the plugin.
https://i.imgur.com/lKVrFlq.png
StainlessS
9th July 2023, 14:08
And to think that Stainless tricked me into screwing around with OCR again... lol
You initially asked about BD Image based subs, and also OCR'ed subs,
I mentioned about OCR via SubtitleEdit.
Twas you who veered off into OCR to srt via SubtitleEdit, I just followed your lead.
Katie Boundary
9th July 2023, 17:16
You initially asked about BD Image based subs, and also OCR'ed subs,
I mentioned about OCR via SubtitleEdit.
Twas you who veered off into OCR to srt via SubtitleEdit, I just followed your lead.
LOL no, that's the opposite of what happened.
Me: "How do I get subtitles from Blu-rays?"
You: "Import the .sup files into SubtitleEdit and use OCR to convert them to .srt"
Me: (follows your lead, reports errors)
Anyway, no advice on getting SupTitle to work?
StainlessS
9th July 2023, 21:20
You: "Import the .sup files into SubtitleEdit and use OCR to convert them to .srt"
Well you kinda missed out the part about "but softsubs are better than nothing" and my reply to that.
But, I guess I shoulda figured out that sup files were exactly what you wanted for the BD image subs,
but I aint ever bothered with Image based subs, so it did not click in this here noggin that those were actually what you wanted. :(
Sorry. [To err is human, to forgive divine.]
EDIT: "Anyway, no advice on getting SupTitle to work?" ,
Nope, sorry.
Katie Boundary
10th July 2023, 01:37
Well you kinda missed out the part about "but softsubs are better than nothing" and my reply to that.
No, you apparently missed the part right before that, where I said "Preferably hardsubs" ;)
r0lZ
14th September 2026, 11:18
@Zachs : SupTitle is used by BD3D2MK3D and until now, it has always worked flawlessly. Thanks for that invaluable tool.
However, an user has reported here (https://forum.videohelp.com/threads/395498-BD3D2MK3D-Convert-3D-BDs-or-MKV-to-3D-SBS-TAB-or-FS-MKV-Support-thread/page20#post2803455) a problem with the subtitles of a specific BD 3D. I did some tests and obviously, there is a strange problem (with the original subtitle stream extracted with tsMuxeR and with the 3D stream produced by BD3D2MK3D). I have been unable to understand why that problem exists, as everything seems normal. Can you have a look ? I'll send you a PM with a download link of the problematic subtitles streams.
Thanks in advance.
Columbo
14th September 2026, 12:00
If you can PM me the ripped SUP file(s) I can have a look too.
r0lZ
14th September 2026, 12:38
Done. Thanks.
Columbo
14th September 2026, 15:16
Regarding the 2D sup file...
Suspect 1: four objects are split across two ODS segments
Four subtitles are wide enough that their RLE data exceeds the 64 KB segment limit, so they are written as a first fragment (sequence flag 0x80, length 0xFFEF) plus a last fragment (0x40). That is exactly how the spec says to do it, and forcedpgs and Subtitle Edit reassemble them. But a naive parser that expects one ODS with flag 0xC0 per display set will either fail on the second segment or treat the first fragment as a complete bitmap with data missing. SupTitle's own forum history shows it throwing "Not expecting more than one bitmap per descriptor" on files with more than one ODS in a display set, which is precisely this pattern. Its author also said multi-window entries were something he "was not entirely sure how to process".
If the problems you saw in SupTitle start at or after 28:40, this is almost certainly the cause.
Suspect 2: there is a composition number reset. It's legal but may flummox SupTitle.
Source is not available but the DLL is a .NET assembly, so a decompiler such as ILSpy or dnSpy would show the parsing logic almost verbatim. That would let you confirm whether it chokes on the two ODS fragments per display set or on the composition-number reset.
If we had the source code we could probably fix it, but in its absence you might consider moving to a different app. Zachs reported that he had lost the current source code. :(
r0lZ
14th September 2026, 16:57
Damn! Thanks for the great analysis. If you have read the thread at VideoHelp, you know that the user is happy enough with the 3D subtitles converted to DVD SUB. I will not insists to fix SupTitle, as it works perfectly in 99,9 cases on 100. It is a pity that the code is not available anymore, but we can live with that bug.
BTW, I don't know at what TC the filter crashes. It throws the error immediately when the AVS script is launched.
Thanks again for your investigation.
Columbo
14th September 2026, 17:26
You're welcome. I have the analysis infrastructure from development of forcedpgs. Sup streams with multiple ODS per subtitle and multiple objects per subtitle are more common than you think. Maybe 95% without is a more reasonable estimate. This is the first stream with a composition number reset I have seen, so that sample goes into my test samples collection.
Reel.Deel
14th September 2026, 20:31
Source is not available but the DLL is a .NET assembly, so a decompiler such as ILSpy or dnSpy would show the parsing logic almost verbatim. That would let you confirm whether it chokes on the two ODS fragments per display set or on the composition-number reset.
SupCore.dll ILSpy output:
https://files.catbox.moe/mgy8vh.zip
Columbo
14th September 2026, 21:10
Excellent!
The decompile changes the earlier answer: SupTitle's parser handles subtitles.sup fine. The problem is almost certainly how it was invoked, not the file. EDIT: The cause is not how it's invoked, see following posts.
The decompile is SupCore.dll only, nine C# files. The AviSynth C++ wrapper is not included. Claude ported the Blu-ray loader, end-of-set handling, RLE drawing routine and duplicate cleanup line for line into Python and ran it on subtitles.sup.
Result on subtitles.sup:
- No exception. All 7396 segments consumed, 924 subtitles kept, every bitmap decodes without the "unfinished line" or "line too long" errors.
- Start and end times come out correctly, no overlaps, no zero end times.
- With forcedOnly set to true, it keeps zero subtitles, because nothing in the file is flagged forced.
Both of the earlier suspects are cleared:
- Composition number reset. The metadata reader skips 10 bytes after the segment length, which covers the composition number entirely. It never looks at it.
- Split ODS. The loader reads the 24-bit data length as one byte plus a 16-bit value. It uses that high byte, plus two, as the fragment array size. For objects over 64 KB the high byte is at least 1, so the second fragment fits. The "Not expecting more than one bitmap" exception only fires if a further ODS follows a completed split one, which never happens here.
What is likely going wrong in practice:
- forcedOnly=true. That is SupTitle's usual mode for hardsubbing forced subs. With this file it yields nothing, silently.
- Cropped video without relocate. 922 of the 924 subtitles have their bottom edge below row 940. On a 2.40:1 crop to 1920x800 they are drawn off the frame entirely unless relocate is on. This is the "subtitles don't appear at all" complaint that fills the doom9 thread.
- Wrong fps argument. Frame to time conversion uses the fps passed to the plugin, so a 25 vs 23.976 mismatch drifts the subs by minutes over the film.
Quirks in SupCore that would break other files, for reference:
- A PCS with two objects is marked empty and never displayed. It is not rendered as a two-object composition.
- A PCS object with the cropping flag set throws "Mismatched Info Blocks", because the length check assumes 8 bytes per object.
- The palette is stored per display set. A display set that relies on the epoch's earlier palette, with no PDS of its own, renders fully transparent.
- A PDS with zero entries marks the subtitle empty.
- The Y, Cr, Cb bytes are read into variables named y, v, u and the RGB output is written in BGR order, which cancels out. Colours are BT.709 and correct.
- Duplicate cleanup merges consecutive subtitles with identical bitmap bytes, rectangle and a gap of 60 ms or less, extending the first one's end time.
Columbo
14th September 2026, 21:42
Looking into the 3D conversion stuff...
Columbo
14th September 2026, 21:53
Claude and me are checking the 3D file but for now it seems:
The root cause: BDSup2Sub incorrectly flags every non-first fragment as 0x40 (last), so three-piece objects come out as 0x80/0x40/0x40 instead of 0x80/0x00/0x40, causing SupTitle to misread the middle fragment as "bitmap finished" and throw on the next ODS—two-piece objects avoid this since both flags legitimately match.
subtitles.sup has four objects with two fragments each and none with three. The simulation shows SupTitle loads it without error.
But SupTitle is not reading subtitles.sup in that pipeline. The stack trace comes from line 39 of the AviSynth script BD3D2MK3D generated, and that script feeds SupTitle a file BD3D2MK3D built. The log shows how: subtitles.sup was exported to XML plus PNGs, ImageMagick turned every PNG into a side-by-side image with the text squeezed to half width and duplicated, and BDSup2Sub.jar re-encoded those into MKV3D.track_6_eng.3D.sup. Those are new bitmaps, so their RLE sizes have nothing to do with the original ones. A resampled, antialiased side-by-side image can carry far more colour transitions per row than the clean nine-colour original, so an object that took two fragments before could take three after conversion. Three fragments from BDSup2Sub means 0x80, 0x40, 0x40, which is exactly what makes SupTitle throw the message in the screenshot.
So the claim is: the original file is fine, the derived 3D file is the one that breaks, and the bug is in how BDSup2Sub flags middle fragments combined with how SupTitle counts them.
Columbo
14th September 2026, 22:00
Confirmed! The 3D file is broken as described above.
Possible fixes:
1. Fix BDSup2Sub.
2. Reduce that subtitle's size in the XML before the 3D step, or let BD3D2MK3D use a smaller font or additional cropping so the SBS image RLE stays under two fragments.
3. Patch subtitles.3D.sup: change the middle fragment's flag byte from 0x40 to 0x00. That single byte edit makes it spec-correct, and SupTitle's fragment array has room for it.
4. Fix SupTitle. Any 3D SUP where a subtitle's RLE exceeds about 131 KB will crash SupTitle. This is David's failure, and it would recur on any wide subtitle in any title.
So it's a combo of a SupTitle bug and a BDSup2Sub bug. Each is a real bug on its own terms.
BDSup2Sub's bug is the clearer one. The spec defines the flag byte as two independent bits, first-in-sequence and last-in-sequence. A middle fragment should have neither set. BDSup2Sub writes the last-in-sequence bit on every continuation, so its output claims an object ends two or more times. Most readers get away with it because they ignore the last flag and just append until the declared data length is satisfied, or until a new object id shows up. That is what forcedpgs does.
SupTitle's bug is that it trusts the last flag as the end-of-object signal and then treats any further ODS in the same display set as a second bitmap, which it does not support, so it throws. A more forgiving reader would keep appending, or just ignore a segment that continues an object it already considers complete. SupTitle's own fragment array is sized from the data length and already has room for the third piece. It is only the flag check that stops it.
Either fix alone would make this work. BDSup2Sub writing 0x00 for middle fragments would satisfy SupTitle as written. SupTitle keying on the data length or the first flag instead of the last flag would accept BDSup2Sub's output as written. Most likely neither will get fixed. BDSup2Sub is long unmaintained and SupTitle is closed source with a dead site. The practical fix sits in the file, which is why the one-byte patch works.
Now, does anyone want to continue arguing that AI is a scam? :p
Columbo
14th September 2026, 22:25
Here's another possibility. I can enhance forcedpgs to be able to fix files like the broken 3D file. You'd add a CLI call to forcedpgs to your chain. It would run in "all" mode and just patch the ODS flags. Say please and I'll do it. ;)
Hat tip Reel.Deel for the decompile.
Emulgator
15th September 2026, 17:32
Shivering with awe, master.
Columbo
15th September 2026, 17:48
Hehe, thank you sir! Claude helped a lot of course. I pinged r0lz about it because he's not been online since that last stuff was posted.
Did you know madshi is a big fan and user of AI coding tools and models? He turned me on to all that. I've experienced insane increases in productivity.
Look for eac3to 4.00 to drop pretty soon.
https://www.rationalqm.us/board/viewtopic.php?p=24877#p24877
r0lZ
15th September 2026, 18:17
Say please and I'll do it. ;)
Well, normally, I don't work any more on BD3D2MK3D (and other stuff like PgcEdit), but if it is sufficient to add a simple CLI command to magically fix the BDSup2Sub output, I'll be happy to do it.
So, yes, please do it. ;-)
Columbo
15th September 2026, 18:27
Alrighty then I'll do it. Other people may find it useful too, and the new option may expand later if I see opportunities to fix other pathologies as well.
r0lZ
16th September 2026, 11:45
Thanks.
BTW, I hate the two versions of BDSup2Sub (++ and java) as they have several important bugs. Luckily, the bugs are not identical in the two versions, and using the good (or less bad) version when it's necessary makes it possible to convert the subtitles to 3D without too many problems (although the problem discussed above is important, but mostly only when the 3D stream is used with SupTitle). I would love to be able to remove the two BDSup2Sub from BD3D2MK3D. It seems that forcedpgs can already be used to replace BDSup2Sub++ to create the XML/PNG intermediate stream. The inverse operation is the only thing that is missing to use forcedgps for all necessary conversions. I don't know if it's easy, but can you envisage to add the possibility to convert the XML/PNG stream back to PGS ? Thanks in advance to at least think about it !
Columbo
16th September 2026, 12:12
I can think about it but there may be a fly in the ointment. forcedpgs currently has a limitation with streams that contain subtitles with multiple objects. When it renders the PNG if the subtitle has multiple objects it renders only the first object. I never completed that because forcedpgs was designed only to edit the forced flags and the PNGs were generated only to assist in identifying the subtitles. Such streams are uncommon but not rare.
So I'll look into 2 things: the reverse path you asked about, and completing the PNG rendering for multiple objects. Meanwhile, I'll make version 1.9 with the repair stuff. I have that working in windows already and will port it to linux today.
Can you tell me about the BDSup2Sub bugs that you know about? Maybe there are other things I can add to the repair functionality.
r0lZ
16th September 2026, 13:00
Thanks!
Can you tell me about the BDSup2Sub bugs that you know about? Maybe there are other things I can add to the repair functionality.
Oh, well, I don't remember right now. I will have to investigate, but I don't have much time right now. I'll let you know as soon as possible.
Columbo
16th September 2026, 13:08
Don't worry about it. I don't need to make extra work for either of us. ;)
r0lZ
16th September 2026, 13:44
Here is already a link to a discussion about some BDSup2Sub++ bugs. Note that the ++ version still has the bug of the bad colors and pixelization when it converts from XML/PNG to PGS. I have experienced the problem with the samples I gave you. (BD3D2MK3D works more or less because it uses the java version instead of ++ but I loaded the XML in the ++ GUI and the result was horrible!)
https://forum.doom9.org/showthread.php?p=1980413#post1980413
Columbo
16th September 2026, 14:00
Thank you for the link! I love horror stories.
Columbo
23rd September 2026, 15:37
@r0lz
Sorry for the delay. I have released forcedpgs/forcedpgsgui 1.9.
To repair your bad sup files, extract forcedpgs.exe and issue the following command:
forcedpgs -i input.sup -o output.sup -m repair_all
https://rationalqm.us/forcedpgs/forcedpgs_1.9.rar
r0lZ
23rd September 2026, 17:12
Huge thanks ! I'll have a look tomorrow...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.