View Full Version : Scrolling Lyrics...
lovelegend
1st February 2005, 22:10
Wanna add some songs into a DVD, and since it has no picture associates with the songs, I wanna show the lyric while a song is playing. However, the lyric is too long to fit the screen, so I wanna do the effect such that the lyric is scrolling (i.e., the lyric is moving up from the bottom slowly) while the song is playing...
Let say I make the lyric into a bmp file with resolution 720x2400, and the song is 4 mins (240 sec). However, I couldn't find a single filter doing such a thing, so wanna ask if it's possible? And if so, then how could I make the script (I have no clue with that... ^^")?
matrix
2nd February 2005, 01:13
You can do something like this:
main=imagereader("D:\Pics\main.bmp",0,999,29.970)
lyrics=imagereader("D:\Pics\lyrics.bmp",0,999,29.970)
main
Animate(30,500,"layer",lyrics,"lighten",255,0,600,lyrics,"lighten",255,0,-40)
And the parameters for animate are, from frame 30 to 500, and the position of the bitmap, starting at 0 on horiz, and 600 on vertical, and ending at 0, and 40. In this case, the bitmaps are the same resolution.
And keep in mind. It's black background.
Or there was a function, someone posted once, that can do just that.
Here it is:
#----------------------------------------------------------------------#
# VScrollTitle #
#----------------------------------------------------------------------#
# V0.0 #
# #
# Insert a subtitle that scrolls from (below) the bottom to (above) #
# the top of the frame. The total time for the scroll is given in #
# seconds in parameter "Time" #
#----------------------------------------------------------------------#
function VScrollTitle( clip Clop, \
int StartFrame, \
string Title, \
string Font, \
int FontSize, \
int Colour, \
int Time ) {
ef = StartFrame + int( Time * Clop.FrameRate )
return Animate( Clop, StartFrame, ef, "subtitle",\
Title, Clop.width/2, int(Clop.Height*1.2), StartFrame, ef, Font, FontSize, Colour, 0, 5, 0,\
Title, Clop.width/2, 0, StartFrame, ef, Font, FontSize, Colour, 0, 5, 0)
}
clip = AVISource("f:\capture\clip1.avi")
sf = 100
clip = clip.VScrollTitle( sf, "The End", "Arial", 48, $ffffff, 5 )
clip = clip.VScrollTitle( sf+15, "Directed by", "Arial", 14, $ffffff, 5 )
clip = clip.VScrollTitle( sf+24, "Denis", "Arial", 24, $ffffff, 5 )
clip = clip.VScrollTitle( sf+40, "Produced by", "Arial", 14, $ffffff, 5 )
clip = clip.VScrollTitle( sf+49, "Joe", "Arial", 24, $ffffff, 5 )
return clip
Replace the text in red with your source, and see how it works.
kingmob
2nd February 2005, 13:47
And here is a example from avisynth.org:
# Make a scrolling version of the "Version" video
ver = Version()
return Animate(0, 149, "Crop", ver, 0, 0, 64, 32, ver, 448, 0, 64, 32)
This one is horizontal, but it serves its purpose as an example.
trolltuning
2nd February 2005, 16:23
Originally posted by kingmob
And here is a example from avisynth.org:
# Make a scrolling version of the "Version" video
ver = Version()
return Animate(0, 149, "Crop", ver, 0, 0, 64, 32, ver, 448, 0, 64, 32)
This one is horizontal, but it serves its purpose as an example.
That script gives me "You cannot use crop to enlarge or shift a clip."
Dreassica
2nd February 2005, 16:26
Cant u just use SSA subtitling and its advanced effects such as karaoke etc.?
Wilbert
2nd February 2005, 20:07
That script gives me "You cannot use crop to enlarge or shift a clip."
Thx. Try
ver = Version()
return Animate(0, 149, "Crop", ver, 0, 0, 64, 32, ver, ver.width-64, 0, 64, 32)
matrix
3rd February 2005, 01:41
I just tried this script with one of my songs, and it works pretty good.
audio = wavsource("D:\one.wav")
frames = int((29.97 * audiolength(audio)) / audiorate(audio))
video = imagereader("D:\Pics\main.bmp").trim(0,-1).loop(frames).assumefps(29.97).converttoyuy2()
lyrics=imagereader("D:\Pics\lyrics.bmp").trim(0,-1).loop(frames).assumefps(29.97).converttoyuy2()
main=audiodub(video,audio)
lyrics=audiodub(lyrics,audio)
return main.Animate(2800,13800,"layer",lyrics,"lighten",255,0,460,lyrics,"lighten",255,0,-1200)
The picture with the lyrics is 720x1200, black, with white text.
The other one is 720x480
Mabe you wanna try that.
lovelegend
3rd February 2005, 22:37
Sorry for the late reply and thx you guys' help... :)
@matrix
I tried your first script and got the error saying the function "layer" works only on RGB and YUY2, I didn't change the video to YUY2 but I used crop instead (coz I just want a black background)...
Saw your second script and just tried it, the interesting thing is if the lyric is in red, it appears with no problem in some area but appears only partially in another area:
http://hmr9dkc6xgks.hp.infoseek.co.jp/ss01.jpg
http://hmr9dkc6xgks.hp.infoseek.co.jp/ss02.jpg
I'm not familiar with the function Layer, so not sure about the reason of the problem.. :rolleyes:
Anyway, did a search on this forum and found a handy freeware which provides many different transitioins between pictures - Slide Show Movie Maker:
http://www.joern-thiemann.de/subpage/index.htm?/tools/ssmm/index.htm
But it has no layer function, so if you want a background picture, then you should use matrix's script... ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.