View Full Version : Please help. Text subtitles in Avisynth script
josiba
1st June 2002, 19:47
I am trying to open an avs script in cce to encode svcd from divx source with permanent subtitles. These are in a separate srt file. I searched a lot but I couldn't find a way to do this.
The best I managed to do was using virtualdub subtitler filter with ssa subs, but it seems that this only works in RGB colorspace, so there is no point in using avisynth instead of virtualdub, the speed advantage is lost anyway, right? :confused:
I think there is a textsub filter which comes with vobsub, but I don't know how to use it or if it will work in YUY2 colorspace...
Thanks a lot for any help at all.
dividee
1st June 2002, 23:47
:angry: Did you look at vobsub documentation?
TextSub("subs.srt")
should be enough (and yes it works in YUY2)
josiba
1st June 2002, 23:59
I'm sorry, but I still can't do it.
In windows media player I get the following message:
"Script error: there is no function named "textsub"
(E:\Filmes\Lord of the Rings\Lord_of_the_Rings.avs, line 7)
The avs script is as follows:
--------------------
LoadPlugin("F:\VIDEO\DVD2SVCD\SIMPLE~1\SIMPLE~1.DLL")
LoadPlugin("F:\VIDEO\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
AVISource("E:\Filmes\LORDOF~1\LORD_O~1.AVI")
ConvertToYUY2()
BilinearResize(448,286,29,0,582,272)
AddBorders(16,97,16,97)
TextSub("E:\Filmes\LORDOF~1\Lord_subs.srt")
ResampleAudio(44100)
--------------------
Can you help?
Thanks
dividee
2nd June 2002, 00:03
You also need to load the plugin !
LoadPLugin("PATH_TO_THE_PLUGIN\textsub.vdf")
josiba
2nd June 2002, 00:04
Oh, just forget it. I was being so stupid !!!
How could I use textsub without loading it?
I added the line
LoadPlugin("E:\Filmes\LORDOF~1\textsub.vdf")
and now everything works...
Thanks a lot anyway.
Cheers.
josiba
2nd June 2002, 00:07
Eh, eh.
Now I don't need Virtualdub, I can do everything with Avisynth!
More speed, yummy :)
Again, thank you all for your help.
1loser
3rd June 2002, 15:06
removed
bill_baroud
3rd June 2002, 18:01
the .sub format supported by Vobsub is the Subviewer one, not the MicroDVD format....
you can put anything you want in a .sub (rename a .ssa in .sub, the filter work...)...
Subadjust can convert your file with any problem if you need ...
(and i just remain, Subrip too)
Subviewer(2.0) look like this :
[COLF]&HFFFFFF,[STYLE]bd,[SIZE]26,[FONT]Tahoma
00:00:18.39,00:00:22.65
Now the latest weather forecast[br]for northwest Koriko.
00:00:22.93,00:00:25.86
Skies are clearing up,[br]thanks to a high-pressure front...
1loser
3rd June 2002, 20:29
Originally posted by bill_baroud
the .sub format supported by Vobsub is the Subviewer one, not the MicroDVD format....
Thx for the information. It's working now.
1loser
4th June 2002, 20:47
I changed the font size but it's still coming out the same size, too big. Also I would like to change the color to yellow. I know yellow is FFFF00 but when changed it stayed white. Seems like it's using a default setting for some reason.
I would like to understand the first line of settings and how they can be changed to get different results.
[COLF]&HFFFFFF,[STYLE]no,[SIZE]12,[FONT]Arial
00:00:36.60,00:00:39.08
This is a simple story...
Also I did a first pass with CCE using VBR to create the vaf file and now I need to do a multi 1 pass. Can I change the font size at this point or do I have to start over with the first pass. I also was wondering if I have to include the sub title reference on the first pass or just on the second one.
Any help would be greatly appreciated.
Belgabor
5th June 2002, 12:19
By changing font size you're in fact changing the video to encode (since you're 'burning in' the subs) = redo first pass whenever you change the settings I'm afraid.
Regards
Belgabor
REIGN_
5th June 2002, 13:04
[QUOTE]Originally posted by 1loser
[B]
subviewer 1 or 2?
1loser
5th June 2002, 14:34
Belgabor, thx for the info that I need to redo first pass.
REIGN_, I'm using subviewer 2. Also would you suggest another format?
gabest
5th June 2002, 21:30
The textsub filter reads the microdvd format, unless it has some syntax error. Check if it opens in subresync. Also, with a frame-number based format, the third (fps) parameter is better to be given too. Otherwise it defaults to 25. ( TextSub("filename"=string[, charset=integer[, fps=float]]) )
The style settings for subviewer aren't supported. If anybody had a URL pointing to the offical format specs... :)
1loser
6th June 2002, 01:15
I tried this and it didn't work.
{915}{977}This is a simple story...
I converted it with subadjust 1.56 to subviewer 2.0 and it works good except I can't change the font size or color.
[COLF]&HFFFFFF,[STYLE]no,[SIZE]12,[FONT]Arial
00:00:36.60,00:00:39.08
This is a simple story...
bill_baroud comment: the .sub format supported by Vobsub is the Subviewer one, not the MicroDVD
format. So I assumed the first format is MicroDVD.
gabest comment: The textsub filter reads the microdvd format, unless it has some syntax error. Are you saying that there must be an error in the my MicroDVD subs since it didn't work?
Check if it opens in subresync. Yes it does. Also, with a frame-number based format, the third (fps) parameter is better to be given too. I don't understand "the third (fps) parameter is better to be given too." Otherwise it defaults to 25. In this case there isn't a problem since it needs to be 25 fps. ( TextSub("filename"=string[, charset=integer[, fps=float]]) ) These statements always confuse me and I have no idea what this means until it's made real clear.
The style settings for subviewer aren't supported. What format support style settings?
Is there a very simple guide they makes everything real clear because I'm getting more confused.
I do I appreciate all the help
gabest
6th June 2002, 03:04
Originally posted by 1loser
I tried this and it didn't work.
{915}{977}This is a simple story...
Well, it did for me... Check if the path and file name was alright. That "AVI2SVCD D drive" and "AVI2SVCD D" seems wrong to me.I converted it with subadjust 1.56 to subviewer 2.0 and it works good except I can't change the font size or color.
[COLF]&HFFFFFF,[STYLE]no,[SIZE]12,[FONT]ArialYep, because the exact file format is still unknown to me, and because of this I couldn't add support. Of course I could figure it out from a few samples, but I didn't feel the need so far, 99% of the subtitles are in .srt or microdvd's .sub.Are you saying that there must be an error in the my MicroDVD subs since it didn't work?As I already said, I've just tried that single line, and it worked fine here.( TextSub("filename"=string[, charset=integer[, fps=float]]) ) These statements always confuse me and I have no idea what this means until it's made real clear. argument name = data type, [..] means optionalThe style settings for subviewer aren't supported. What format support style settings?Subviewer's format does, but textsub can't interpret it yet. Is there a very simple guide they makes everything real clear because I'm getting more confused.No, there isn't.
1loser
6th June 2002, 03:31
You are right, I was using the wrong path and later removed the path and put everything into the same directory.
Tried from MicroDVD docs.
{C:$00FFFF}{F:Comic Sans MS}{S:16}
I must be doing something wrong since when I play it back in any media player they still use a default setting.
gabest
6th June 2002, 04:46
Originally posted by 1loser
Tried this from your documentation.
{\c&H<00FFFF>&}:{\fn<Comic Sans MS>}:{\fs<16>}:
Your quick reference says "Between {...}:" so I inserted them for each style. Your docs are not verbose enough for me :)Noooo, those are only the style modifier tags for the substation alpha format (.ssa/.ass) :)Tried from MicroDVD docs.
{C:$00FFFF}{F:Comic Sans MS}{S:16}
I must be doing something wrong since when I play it back in any media player they still use a default setting.
Try this one as the first line:
{DEFAULT}{}{C:$00FFFF}{F:Comic Sans MS}{S:16}
1loser
6th June 2002, 07:53
Originally posted by gabest
Try this one as the first line:
{DEFAULT}{}{C:$00FFFF}{F:Comic Sans MS}{S:16}
It works with default but it seems only some sizes and fonts are supported. The lowest size might be 12 points if I use 8 or 10 it uses a default size. Also the bold doesn't seem to work.
Does the textsub plugin have a limited # of styles and fonts? Are they listed in the documentation?
bill_baroud
7th June 2002, 20:15
i don't have the time to read all the post carefully but, if you want a subtitle format which support styles editing & co, why don't you use the SSA format ?
It's the most advanced format (with .ass) which allow such operation and which have a powerfull editing tool.
and textsub/subtiler filter work with all the features...
1loser
8th June 2002, 08:36
Originally posted by bill_baroud
if you want a subtitle format which support styles editing & co, why don't you use the SSA format ?
It's the most advanced format (with .ass) which allow such operation and which have a powerfull editing tool.
and textsub/subtiler filter work with all the features...
I guess I need to learn more about this format. Is this called SSA - Substation alpha? I see that subadjust can convert to that format.
Btw, the textsub LoadPlugin DOES work with MicroDVD as the author of Vobsub mentioned in this thread.
bill_baroud
10th June 2002, 12:22
@gabest : i have uploaded the Readme from subviewer here (http://breizhbill.baroud.free.fr/Subviewer.htm)
i think there is all the specs you need
(sorry, it's in french, the author is belgian, if you need some help...)
hope it's help
@1loser : sorry for my error, i was thinking that microDVD won't work with textsub.
[edit] it looks like nobody have respond to you about the FPS :
if you use MicroDVD format, which is based on frame number (and not on time like the other format), you must specify the frame rate of your video here. if it's PAL, it's 25, if ntsc, 23.976 or 29.97 etc...
gabest
10th June 2002, 13:15
I have one question about the format.
In the given example:
[COLF]&HFFFFFF,[STYLE]bd,[SIZE]18,[FONT]Arial
00:00:01.00,00:00:02.00
Uh Uh [br] Yeah Yeah [br] Yeah Yeah Uh
[COLF]&HFF0000
00:00:02.50,00:00:05.00
Miami uh uh
[SIZE]36
00:00:05.50,00:00:07.00
Southbeach bringin the heat uh
What is the color of the third subtitle? And would be the size of the fouth? Are the new attributes apply only the current line or through the rest of the file?
bill_baroud
11th June 2002, 02:57
if i have understand it right, all the line after a new style are affected by this style, while a new style is not applied
in your case :
the third event will be in &FF0000 (red ?) and with a size font of 36...and all the line after that.
[...]si vous laissez vide, les autres lignes s'afficheront sous le dernier des styles employés.
>> if you leave this empty, the other line will be displayed with the last style used.
(well i'm not very good in english, hopes the translation is understandable)
cheers.
1loser
12th June 2002, 13:36
Originally posted by bill_baroud
if you use MicroDVD format, which is based on frame number (and not on time like the other format), you must specify the frame rate of your video here. if it's PAL, it's 25, if ntsc, 23.976 or 29.97 etc... [/B]
I guess if the frame rate is 25 you don't have to specify it. I say that because I didn't and it came out correct for two movies so far.
How should this line read with the frame rate included?
{DEFAULT}{}{C:$00FFFF}{F:arial narrow}
I wish I could make the font smaller but when I used {S:10} it didn't come out any smaller than a default value.
bill_baroud
12th June 2002, 15:47
because the microDVD format is not very usefull and powerfull, just when you use MircoDVD itself, i don't really care if it works with other tool than MicroDVD.
I repeat myself, Textsub seems to not support all the features of this format (perhaps i'm wrong, but that the way i feel it) so if you want play with font size , use a format which is _fully_ supported by Textsub, like SSA (you could edit it with SubStationAlpha > http://www.eswat.demon.co.uk) or Advanced SSA.
gabest
12th June 2002, 15:59
Just found out that the {S:..} tag was read as an integer into a floating point variable, that's why it wasn't working well... :p
1loser
12th June 2002, 21:31
Originally posted by gabest
Just found out that the {S:..} tag was read as an integer into a floating point variable, that's why it wasn't working well... :p
Thanks for the info. I don't understand what that means but is that something that can be easily changed?
gabest
15th June 2002, 07:54
Yes, it is. Btw, v2.15 is out :)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.