PDA

View Full Version : Text in Avisynth


spanky123
8th January 2007, 03:38
I posted elsewhere, but was told I should post here. So here goes:

I'm trying add text to a video with the avisynth script.

So far I been using Subtitle and it works fine when I want to insert English text.

However, now I want to insert foreign text (ie. Swedish, Greek, Russian)
but it just comes up looking something like 'G?ia ?a?' instead of say, Γεια σας

I have the languages needed installed in xp (Control Panel > Regional and Language Settings > Languages > Details and then added the ones I want) and can type no problems in the other languages in just about any other program besides notepad.

Atm I'm using:
Subtitle("text_in_foreign_language_here",0,50,1,100,"Arial",100,$FF0000)
And it doesn't work for me. With English text it works.

*Note that I have to type the text in an external program first that accepts the foreign fonts/languages and then copy it into notepad. Notepad doesn't show the fonts though. It's kinda just blank there and it prompts me to save as some 'unicode' thing or something if i want. What is this ?

Some help please.
If there is some other feature that let's you add foreign language text to your avisynth video, that's fine too

Thanks

Velocity 7
8th January 2007, 03:50
Are you subbing? Might I suggest using Aegisub instead and use TextSub to subtitle in the resulting file?

spanky123
8th January 2007, 03:55
All I want to do is add text like titles. Very short. . . maybe a couple words

I would use Subtitle() in the script, but I've now been told that it doesn't support unicode, so I am not able to use it with Foreign Characters.

I can make the subtitle files (.srt) using Subtitle Workshop, but it still plays back all jiberrish - still 'G?ia ?a?' instead of say, Γεια σας

IanB
8th January 2007, 06:27
Subtitle() internally use the Windows GDI function int TextOut(HDC hdc, int x, int y, char *text, int len) so you are constrained to the current Code Page of the host application.

Note the code page of your text editor used to enter your .AVS script will need to match the code page for your video encoding app.

Someone did a Unicode text plugin some time ago, I searched for it but could not find it, maybe someone else remembers it.

Fizick
8th January 2007, 12:40
http://forum.doom9.org/showthread.php?t=102124

spanky123
9th January 2007, 15:58
Subtitle() internally use the Windows GDI function int TextOut(HDC hdc, int x, int y, char *text, int len) so you are constrained to the current Code Page of the host application.

Sorry. I got no idea what any of that means. Could you please explain

http://forum.doom9.org/showthread.php?t=102124

Yes. So far I can only do it using VSfilter.dll and TextSub()

How do I adjust say the height, position and animate (ie. scrol or zoom) the text though ? Can I use TextSub() with Animate() somehow or do I have to do all this in the .ssa file ?

foxyshadis
9th January 2007, 19:46
Sorry. I got no idea what any of that means. Could you please explain
It means that the only way to use foreign characters is to change the language of your windows, in regional/language options, or there's some utility I forgot the name of that Microsoft offers. Extended characters will look different when you're using a different code page. But you can't use unicode at all in Subtitle() yet, without switching it to use an entirely new API.

How do I adjust say the height, position and animate (ie. scrol or zoom) the text though ? Can I use TextSub() with Animate() somehow or do I have to do all this in the .ssa file ?

SSA for everything, although you can manipulate some of it in avisynth. Tools like AegisSub help, but they still aren't pick-up-and-go. SSA/ASS is rather complex since it was designed to be a full typesetting language.

matrix
10th January 2007, 01:22
If you can put your text on a bitmap, it's easy to do it using overlay.
Write your text on a black bmp.
clip=avisource("your source")
text=imagereader("your pic.bmp", 0, 1, 29.97)
overlay(clip, text, x=0, y=0, mask=text)
Or if the text is a different color.
overlay(clip, text, x=0, y=0, mask=text.tweak(0.0,0.0))
And use trim to place it at the position you want.

spanky123
10th January 2007, 07:59
Is there some sort of GUI for creating .ssa ?

Or anything that'll make it easier to make one. Atm it's looking like a night-mare.

Sub Station Alpha seems to be no longer updated.
I'm familiar with Subtitle Workshop but only with .srt - not familiar with animating and all the features of .ssa

Any suggestions ?

foxyshadis
10th January 2007, 08:09
Whole forum dedicated to it: http://forum.doom9.org/forumdisplay.php?f=12

AegiSub is the only tool that's still updated on a regular basis, afaik.

tacman1123
19th May 2008, 18:39
SubtitleEx handles the foreign characters better, at least some of them (I think at least UTF-8).

Tac