Log in

View Full Version : got a question about animating subtitles


matrix
5th July 2002, 05:14
Hi everybody.

I have this script:
AviSource("c:\Movie\t1.avi")
Animate(200,250,"subtitle", "THE MATRIX",240,220,200,200,"Times New Roman",0,$FF00FF, "THE MATRIX",140,200,250,250,"Times New Roman",36,$FF00FF)
Animate(220,250,"subtitle","SVCD",240,220,220,220,"Times New Roman",0,$FF00FF,"SVCD",200,250,250,250,"Times New Roman",36,$FF00FF).Subtitle("THE MATRIX",140,200,250,400,"Times New Roman",36,$FF00FF).Subtitle("SVCD",200,250,250,400,"Times New Roman",36,$FF00FF)
Animate(400,450,"subtitle", "THE MATRIX",140,200,400,400,"Times New Roman",36,$FF00FF, "THE MATRIX",240,220,450,450,"Times New Roman",0,$FF00FF)
Animate(400,450,"subtitle","SVCD",200,250,400,400,"Times New Roman",36,$FF00FF,"SVCD",240,220,450,450,"Times New Roman",0,$FF00FF)
What I'm trying to do is having the texts zooming in, from 0 to a certain point size, play for a while then zooming out to 0. The way I put it here, it does it but it's kind of choppy. (this btw, is just a test script)
Is there any way it can be done to do it nice and smooth? I think it can be done, there was a thread some time ago, where tact x did something similar, but I'm not sure I understand all those arguments.
Can somebody give me a hand?
I'd appreciate any ideas
__________________
Thanks
matrix

bill_baroud
5th July 2002, 14:12
hm, i just propose an alternative :

use the latest subtitle format of Gabest, Advanced SSA, which come with a Avisynth filter, TextSub.


if you read the specs, you have some function to animate some line of you subtitle script.

like this :

\fsc<x or y><percent> : <x or y> x scales horizontally, y scales vertically <percent>

you can animate this with the function \t

it's the specs example anyway : {\t(t1,t2,1,\fscx200\fscy200)} multiply the size of the font by 2 during t1-t2.

i think the animation will be smoother, but i haven't test it.

btw, adobe after effect is the best tool to do what you want ;)


cheers.

matrix
5th July 2002, 16:40
i just propose an alternative
Thanks for your sugestions, I'll keep them in mind for now.
I thought there might be a simpler alternative, since it's just some text I want to introduce into my menus, and instead of just having it appear and dissapear, I thought of giving it some extra "flavor".

Thanks again
matirx

poptones
5th July 2002, 16:57
I suggest just making the text a transparent layer and using animate to scale it. If your text is light colored it's a cinch to do: just make a black clip, overlay your text, and apply it to itself as a mask like this: clipwithtext.mask(clipwithtext). The when you "add" it to the background all that will be overlayed is the text. You can resize, change its color - whatever you wanna do.

edit: if the text is a light color it's actually even eassier than that. Make your black clip, add the tesxt you want, resize it (or whatever you want to do) and overlay it in YUY2 using layer(mytext,"lighten",bright). Make "bright" any number from 0-255, and it'll "mask" all by itself by only overlaying where the background is darker than the text. I honestly don't see how it could get any easier - even with aftereffects.

matrix
5th July 2002, 22:49
I appreciate you guis taking the time to give some suggestions.
it's a cinch to do:
I bet it is. If you have idea of what you're doing. But I'm afraid I don't understand a thing.
I was looking into avisynth tutorial,(I belive it's an amazing program for what it can do),and messing around with animate. Well, I see that one can do a lot of things with it. So I wrote that script and it worked. The text itself looks ok, just the way it was coming out looked choppy, coming in steps. By lowering the # of frames, instead of 50,to just 20, it looks a lot better. I was looking for smth really simple, just avisynth alone, without involving any other program.
I know it can do just what I want, but I guess I have much to learn about it.

Again, thanx for trying to help. I appreciate it

_________
Regards
matrix

TactX
6th July 2002, 11:53
Originally posted by matrix
I think it can be done, there was a thread some time ago, where tact x did something similar, but I'm not sure I understand all those arguments.

You mean me ?

Here it goes:

You need to supersample your frames to get smooth motion when using animate.

try this script (very slooooow !)

-----------------------------------------------------
AviSource("D:\kotd\pass_2.avi") # Input-AVI is 640x272
bilinearresize(3200,1360) # Supersampling by x5

# the coordinates of the subtitles need to be supersampled by x5 too
Animate(200,250,"subtitle", "THE MATRIX",1200,1100,200,250,"Times New Roman",0,$FF00FF, "THE MATRIX",700,1000,200,250,"Times New Roman",180,$FF00FF)
Animate(220,250,"subtitle","SVCD",1200,1100,220,220,"Times New Roman",0,$FF00FF,"SVCD",1000,1250,250,250,"Times New Roman",180,$FF00FF).Subtitle("THE MATRIX",700,1000,250,400,"Times New Roman",180,$FF00FF).Subtitle("SVCD",1000,1250,250,400,"Times New Roman",180,$FF00FF)
Animate(400,450,"subtitle", "THE MATRIX",700,1000,400,450,"Times New Roman",180,$FF00FF, "THE MATRIX",1200,1100,400,450,"Times New Roman",0,$FF00FF)
Animate(400,450,"subtitle","SVCD",1000,1250,400,450,"Times New Roman",180,$FF00FF,"SVCD",1200,1100,400,450,"Times New Roman",0,$FF00FF)

bilinearresize(640,272) # resize to normal res.
--------------------------------------------------

The only thing you would need to change are the resize lines to your required size.


From your previous script I have seen that you've tried to "animate" by frames (...400,400,... as start frames, and ...450,450,... as end frames).
Did you try to get non-linear zooming with that ?
This does work of course but you cannot supersample the number of frames, so the motion will be more than choppy !
If you want to get non-linear zooming, you need to use animate within animate (If you're interested in that, just tell me).

btw, nice to see that there are really some people that use animate besides me :D

matrix
6th July 2002, 15:01
You mean me ?
That's exactly who I mean.
When I decided to do that, I searched the forums and I saw that post of yours. I read it several times, but I can't figure out what all those arguments mean.
And yes, animate within animate. That's what I ment. I thought that would do it.
The sample you posted there, works just fine, but when trying to do that in my script, to fit my needs, I just get errors. And of course. It's like I type all that stuff blindfolded, coz I don't know what it means.
Anyway, if you could give me a hand here, I'd really appreciate it.

Thanks
matrix

TactX
6th July 2002, 15:39
Animate within animate is not much more difficult than "normal" animate. The script just gets unreadable :(

But I think you've done quite well so far :)

Lets get it on...

So you're obviously doing SVCD. Right ?
Is it PAL or NTSC (because of the resolution).

post your res. and we'll see how to fit your needs :)

matrix
6th July 2002, 16:31
It is SVCD

matrix
6th July 2002, 16:34
Sorry Ntsc sohould've said

TactX
6th July 2002, 16:37
Originally posted by TactX
So you're obviously doing SVCD. Right ?
Is it PAL or NTSC (because of the resolution).

PAL or NTSC (480x480 or 480x576 or some off-standard-bs) ?


EDIT: Hehe, you were faster than me !!! I'll go for it now.

TactX
6th July 2002, 18:47
-------------------
bilinearresize(2560,1920)

animate(200,250,"animate",200,250,"subtitle", "THE MATRIX",860,880,200,250,"Times New Roman",0,$FF00FF, "THE MATRIX",860,880,200,250,"Times New Roman",200,$FF00FF,200,250,"subtitle", "THE MATRIX",860,880,200,250,"Times New Roman",0,$FF00FF, "THE MATRIX",860,880,200,250,"Times New Roman",144,$FF00FF)

bilinearresize(640,480) # resize to normal res.
trim(199,251)
-------------------


This script uses animate within animate to get non-linear zooming for "THE MATRIX".
It uses 4x supersampling (I've had BIG problems when using x10, memory usage got up to 1 GB :( , and then AviSynth crashed)

Try it and tell me if this pleases you.

matrix
6th July 2002, 22:33
Oh yeah. Both ways the motion is nice and smooth. And I noticed it takes out the..(some kind of holo around the text), even though I don't mean to use any holo color(probbably it's in there by default?),whithout the supersampling there is a little black around the text. So this, takes that out.
What I am wondering is: When doing animate whithin animate, is it possibile to modify the horiz. position for the last part, to have the text coming from the middle, like the other one? This way the left side of the text is in the same position. Otherwise, just the supersampling on the original script, did a terrific job. It's slow indeed, but worth the extra time.
Either way, I'm glad I asked the question.

100X, thank you.

TactX
6th July 2002, 23:16
Originally posted by matrix
What I am wondering is: When doing animate whithin animate, is it possibile to modify the horiz. position for the last part, to have the text coming from the middle, like the other one? This way the left side of the text is in the same position.

This is exactly the problem I had to deal with !
I tried to solve this problem, but even with 4x supersampling the motion was really choppy :(

Maybe I'll get the answer tommorow (I'm much too drunk to deal with "animate" atm) !

Sorry......

matrix
7th July 2002, 00:50
Maybe I'll get the answer tommorow
Not a problem.
Whenever you feel like..., fine with me

_______________
Cheers
matrix

TactX
7th July 2002, 11:25
With this line, the text should come from the middle (still a bit choppy, higher supersampling should solve this, but it will make Avisynth crash):

animate(200,250,"animate",200,250,"subtitle", "THE MATRIX",1280,880,200,250,"Times New Roman",0,$FF00FF, "THE MATRIX",650,880,200,250,"Times New Roman",216,$FF00FF,200,250,"subtitle", "THE MATRIX",1280,880,200,250,"Times New Roman",0,$FF00FF, "THE MATRIX",860,880,200,250,"Times New Roman",144,$FF00FF)


You could also try this one (text coming from the side and text-size gets bigger (both non-linear)):

animate(200,250,"animate",200,250,"subtitle", "THE MATRIX",-200,880,200,250,"Times New Roman",0,$FF00FF, "THE MATRIX",860,880,200,250,"Times New Roman",216,$FF00FF,200,250,"subtitle", "THE MATRIX",860,880,200,250,"Times New Roman",0,$FF00FF, "THE MATRIX",860,880,200,250,"Times New Roman",144,$FF00FF)


However, I think you can play around with the settings a bit until the results please you.

matrix
7th July 2002, 18:31
Thanks for the help

I've tryed them both, and they look good. I like the effect of the second one too, and even though the coordinates for this nonlinear zooming, don't make much sense to me right now, I think if playing around with them, I'll get it.
____________
Thanks
matrix

Gant
9th July 2002, 01:56
ok... maybe this wuestion would fit here... wheree can i find info about the animate features and capabilities... since the original docs talk nothing about it :(

Thnaks in advanced,

Matta.

Gant

TactX
9th July 2002, 11:37
Read the AviSynth reference (http://www.videotools.net/doc/reference.htm) here.

Gant
9th July 2002, 22:55
wow... the reference has been updated too

great :)

Thanks again m8 :)

Matta.