PDA

View Full Version : Create SVCD menu with AviSynth


kru
19th September 2003, 18:39
Here is a script to make chapterselections for your SVCD's:

http://home.tiscali.no/tor1234/TEST.jpg


### Setup

# Enter Source
Source=mpeg2source("D:\NeroImages\VCD\DVD2SVCD\DVD2AVI_PROJECT_FILE.d2v")

# Enter Text
MovieTitle="Sweet Home Alabama"
CDNum="1/2"
EncType="SVCD"

# Chapters (Enter chapeter start frame)
Chapt1Start=0
Chapt2Start=2001
Chapt3Start=4001
Chapt4Start=6001
Chapt5Start=8001
Chapt6Start=10001
ChaptStartafter=200

# Width, Height, Framerate
MenuWidth=720
MenuHeight=576
MenuFramerate=25

# Time
Thump_time=100

# Details (Advanced)
ThumbWidth=150
ThumbHeight=150

NrThumbWidth=4
NrThumbHeight=2

FromEdge=10

### Calculations
StartWidth1=MenuWidth*FromEdge
StartWidth=StartWidth1/100
StartHeight1=MenuHeight*(FromEdge+7)
StartHeight=StartHeight1/100

EndWidth1=MenuWidth*(100-FromEdge)
EndWidth2=EndWidth1/100
EndWidth=EndWidth2-ThumbWidth
EndHeight1=MenuHeight*(100-FromEdge-5)
EndHeight2=EndHeight1/100
EndHeight=EndHeight2-ThumbHeight


### Script

# Background
Background1=Trim(Source,0,-1)
Background2=Loop(Background1)


## Subtitle
# "Title"
Background=Subtitle(Background2, MovieTitle, x=MenuWidth/2, y=25, first_frame=0, last_frame=99999, font="Arial", size=50, text_color=$FFFFFF, align=8)
# "CD Number"
Background=Subtitle(Background, CDNum, x=StartWidth+5, y=MenuHeight-40, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$FFFFFF)
# "CD type" (SVCD, VCD, KVCD, Etc.)
Background=Subtitle(Background, EncType, x=EndWidth2, y=MenuHeight-40, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$FFFFFF, align=6)


# Thump lenght
Clip1=Trim(Source, Chapt1Start+ChaptStartafter,Chapt1Start+ChaptStartafter+Thump_time)
Clip2=Trim(Source, Chapt2Start+ChaptStartafter,Chapt2Start+ChaptStartafter+Thump_time)
Clip3=Trim(Source, Chapt3Start+ChaptStartafter,Chapt3Start+ChaptStartafter+Thump_time)
Clip4=Trim(Source, Chapt4Start+ChaptStartafter,Chapt4Start+ChaptStartafter+Thump_time)
Clip5=Trim(Source, Chapt5Start+ChaptStartafter,Chapt5Start+ChaptStartafter+Thump_time)
Clip6=Trim(Source, Chapt6Start+ChaptStartafter,Chapt6Start+ChaptStartafter+Thump_time)

# Thump Size
Clip1=LanczosResize(Clip1, ThumbWidth, ThumbHeight)
Clip2=LanczosResize(Clip2, ThumbWidth, ThumbHeight)
Clip3=LanczosResize(Clip3, ThumbWidth, ThumbHeight)
Clip4=LanczosResize(Clip4, ThumbWidth, ThumbHeight)
Clip5=LanczosResize(Clip5, ThumbWidth, ThumbHeight)
Clip6=LanczosResize(Clip6, ThumbWidth, ThumbHeight)
# Thumb numbers
Clip1=Subtitle(Clip1, "1", x=0, y=0, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$DD0B01, align=7)
Clip2=Subtitle(Clip2, "2", x=0, y=0, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$DD0B01, align=7)
Clip3=Subtitle(Clip3, "3", x=0, y=0, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$DD0B01, align=7)
Clip4=Subtitle(Clip4, "4", x=0, y=0, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$DD0B01, align=7)
Clip5=Subtitle(Clip5, "5", x=0, y=0, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$DD0B01, align=7)
Clip6=Subtitle(Clip6, "6", x=0, y=0, first_frame=0, last_frame=99999, font="Arial", size=40, text_color=$DD0B01, align=7)


# Mix
v1=Layer(Background, Clip1,"add",255,StartWidth,StartHeight)
v2=Layer(v1, Clip2,"add",255,(MenuWidth/2)-(ThumbWidth/2),StartHeight)
v3=Layer(v2, Clip3,"add",255,EndWidth,StartHeight)
v4=Layer(v3, Clip4,"add",255,StartWidth, EndHeight)
v5=Layer(v4, Clip5,"add",255,(MenuWidth/2)-(ThumbWidth/2), EndHeight)
v6=Layer(v5, Clip6,"add",255,EndWidth, EndHeight)


Trim(v6,0,-1)

DDogg
19th September 2003, 18:54
This looks interesting but I wonder if you could let us know a little more about the "how's and why's". What was your goal exactly and what was the situation that caused you to do this work. I know that would help me understand a little better. Many times I have seen some really brilliant work go by the wayside in this forum when just a blind script is posted with no explanation. I think maybe the original poster thinks they are self explanatory, but that is not always the case to anybody that has not encountered the same need. Also some explicit instructions on how to use it is always very welcome to most readers.

kru
19th September 2003, 20:55
The script is very fine if you should make those menues automatic. I've planed to make a little plugin for DVD2SVCD, that makes chapter selection instead of the title picture.

But it's it can be a lot of work. This is my first avisynth script, and there are many other people that knows more about avisynth than me!

I know I can add motion, background pictures, pictures, fading, etc. But before I start the work with the plugin, I want people to discuss the script, so I can make the plugin better.

katjarella
19th September 2003, 21:42
http://forum.doom9.org/showthread.php?s=&threadid=27176&perpage=20&pagenumber=2

Motion Menues with Avisynth:Originally posted by katjarella
why expensive software?
google.translate : Motion Menu (http://members.lycos.co.uk/verglade8kihr/motionmenu.htm)
:)

Kika
19th September 2003, 22:29
Interesting Script, but Width and Height of the Thumbs are not in 4:3-Format.