View Full Version : SupTitle: an AviSynth PGS (.SUP) Subtitle Plugin
Zachs
3rd July 2009, 11: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 .NET 2 framework installed.
Cheers.
Current version: v2.0.2 (22 June 2010)
Download: http://www.zachsaw.co.cc/?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, 11: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, 13: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, 23: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, 04: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, 17:18
thanks...
_
sneaker_ger
7th July 2009, 13:32
Thank you!
Zachs
8th July 2009, 09: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, 19: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, 02: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, 16: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, 18: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
11th July 2009, 00: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, 16: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, 02: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, 18: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, 01: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, 07: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, 10: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, 15: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, 02:28
OK. It looks like I've got cr/cb swapped.
I'll get it fixed.
Zachs
21st August 2009, 06: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, 14:55
Thx, but now the plugin is not loaded by AviSynth (2.5.8) anymore. ("Can't load plugin")
Zachs
21st August 2009, 17:21
Did you replace both SupCore.dll and SupTitle.dll from the distro?
Zachs
21st August 2009, 17: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, 03: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, 14: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, 17:41
Yup. I'll look into that.
Zachs
24th August 2009, 03:32
SupTitle v1.0.3 fixes the green image in RGB colorspaces issue.
sneaker_ger
24th August 2009, 05:41
"Can't load plugin"
Zachs
24th August 2009, 06: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, 07: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, 13: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, 16: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, 02: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, 05: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, 06: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, 02: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, 21: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, 03:29
I'll take a look.
Zachs
31st August 2009, 04: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, 04:25
24000/1001
Zachs
31st August 2009, 06:50
v1.0.7 now available.
Fixes both problems.
http://www.zachsaw.co.cc/?pg=suptitle_pgs_avisynth_plugin
sneaker_ger
31st August 2009, 15:01
That was fast, Thanks! Working fine.
Red Leader
11th September 2009, 19: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, 17: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, 05: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, 14: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, 02: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, 16: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, 06: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, 09: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, 19: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, 13:14
Thank you for this filter! Great work.
Blue_MiSfit
19th September 2009, 23:25
This plugin is a lifesaver!
Thanks so much!
Zachs
21st September 2009, 04: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, 03: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, 05:17
What's your script?
ChldsPlay
13th May 2010, 05: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, 04:08
You didn't insert a line break in the middle of the clip.SupTitle statement did you?
ChldsPlay
14th May 2010, 07: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, 08:52
Try your script without SupTitle first. Isolate the problem.
ChldsPlay
15th May 2010, 01: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, 13:21
There you go.
lotrmith
20th May 2010, 18: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, 19: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, 02: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, 05: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, 06: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, 07: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, 13: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, 22:59
Dude, just wanted to say: doumo arigatou gozaimasu! :) Just the program I've been waiting for for ages!
asarian
7th June 2010, 23: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, 04: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, 13: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, 15: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, 04: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, 05: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, 06: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, 06: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, 06:28
Also, have you tried with other SUP files?
asarian
9th June 2010, 06: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, 06: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, 06:54
When you tried blankclip, did you have other plugins loaded as well or just SupTitle?
asarian
9th June 2010, 07: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, 13: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, 14:53
Try copying the two MS Visual C++ CRT dll files into your system32 folder.
sneaker_ger
9th June 2010, 15:20
That did it, thank you. :o
asarian
9th June 2010, 19: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, 02: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, 03: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, 16: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, 02: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, 03: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, 12: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, 14: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, 08: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, 15:29
Are you sure that these are forced subs? Try "forcedOnly=false" if you haven't.
asarian
17th June 2010, 23: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, 23:13
Are we still talking about those you uploaded above (http://forum.doom9.org/showpost.php?p=1406826&postcount=86)?
asarian
17th June 2010, 23: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, 23: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, 03: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, 16: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, 16:23
On opening the file in BDSup2Sub you can set a negative delay in the "Converion Options" dialogue.
Zachs
22nd June 2010, 02: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, 04: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, 08: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, 10: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, 14: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, 20: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, 08: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, 11:37
http://rapidshare.com/files/457044840/suptitle_v2.0.2_x86.zip
http://rapidshare.com/files/457044862/suptitle_v2.0.2_x64.zip
Donholio
12th April 2011, 19:23
Thanks Sneaker_Ger
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.