View Full Version : Does this script look OK?
matrix
21st April 2002, 20:46
I'm trying to make a menu with animated thumbnails, and I don't know what, but something isn't right in my script. The menu is supposed to be a background 480x480 with 6 thumbnails 100x100, 2 in each row. Everything seems to be OK, but the last row is something like a new screen joined vertically with the other one.
My scritp looks like this:
x1=480
y1=480
x2=100
y2=100
hgap1=115
hgap2=50
hgap3=115
vgap1=70
vgap2=20
vgap3=20
vgap4=70
dur = 500
tf1=0
tf2=0
tf3=0
tf4=0
tf5=0
tf6=0
bvid=AVISource("C:\Movie\menu.avi").BilinearResize(x1,y1).trim(0,dur)
tvid1 = AVISource("C:\Movie\t1.avi").BilinearResize(x2,y2).Trim(tf1,tf1+dur)
tvid2 = AVISource("C:\Movie\t2.avi").BilinearResize(x2,y2).Trim(tf2,tf2+dur)
tvid3 = AVISource("C:\Movie\t3.avi").BilinearResize(x2,y2).Trim(tf3,tf3+dur)
tvid4 = AVISource("C:\Movie\t4.avi").BilinearResize(x2,y2).Trim(tf4,tf4+dur)
tvid5 = AVISource("C:\Movie\t5.avi").BilinearResize(x2,y2).Trim(tf5,tf5+dur)
tvid6 = AVISource("C:\Movie\t6.avi").BilinearResize(x2,y2).Trim(tf6,tf6+dur)
h1=hgap1
h2=hgap1+x2
h3=hgap1+x2+hgap2+x2
v1=vgap1
v2=vgap1+y2+vgap2
v3=vgap1+y2+vgap2+y2+vgap3
part1=bvid.Crop(0,0,x1,vgap1)
part2=StackHorizontal(bvid.Crop(0,v1,hgap1,y2),tvid1,bvid.Crop(h2,v1,hgap2,y2),tvid2,bvid.Crop(h3,v1,hgap3,y2))
part3=bvid.Crop(0,vgap1+y2,x1,vgap2)
part4=StackHorizontal(bvid.Crop(0,v2,hgap1,y2),tvid3,bvid.Crop(h2,v2,hgap2,y2),tvid4,bvid.Crop(h3,v2,hgap3,y2))
part5=bvid.Crop(0,vgap1+y2+vgap2+y2,x1,vgap3)
part6=StackHorizontal(bvid.Crop(0,v2,hgap1,y2),tvid5,bvid.Crop(h2,v2,hgap2,y2),tvid6,bvid.Crop(h3,v2,hgap3,y2))
mvid= StackVertical(part1,part2,part3,part4,part5,part6)
return mvid
I would very much appreciate is somebody can take look at this , and mabe show me the right way to do it.
Thanks in advance for any answers
Matrix
Acaila
21st April 2002, 21:24
First off I must say, that's one hell of a script you've got there! :D
I'd love to see how that looks when you get it to work.
As for why it doesn't work, I'm guessing here, but in my experience Avisynth usually doesn't like spaces all that much. You should remove all spaces surrounding the "=" signs (12th, 20th-25th and the StackVertical line) in your script and see how that works out.
Good luck.
matrix
21st April 2002, 21:40
Well, belive me, a script like that works and it looks beautiful. I did so many of them, but only with 2 rows of thumbnails, 3 in each row.
I don't know why this one doesn't work, I tryed what you said, and now it gives me an error that stack horizontal image formats don't match. That's on line 33.
Before I changed the script, I could open it in media player, but as I said in my post, the last row was wrong. Right now I can't even open it enymore.
Thanks anyway.
matrix
21st April 2002, 22:24
Wait a minute, I just noticed, the third row is actually another 2nd row.
I have to look more carefully at that script, I should be able to figure out what's wrong with it.
But hey, if somebody has an answer, please, let me know.
dividee
22nd April 2002, 01:38
I guess you've found it now: you have to replace each instance of "v2" by "v3" in the "part6=" line, and add a part7:
...
part6=StackHorizontal(bvid.Crop(0,v3,hgap1,y2),tvid5,bvid.Crop
(h2,v3,hgap2,y2),tvid6,bvid.Crop(h3,v3,hgap3,y2))
part7=bvid.Crop(0,v3+y2,x1,vgap4)
mvid=StackVertical(part1,part2,part3,part4,part5,part6,part7)
return mvid
I didn't test it, but it should be OK.
nice script :)
matrix
22nd April 2002, 16:46
Thanks a lot, dividee. I didn't have the time to try it yet, and I didn't look into it yesterday. I usually open my background with directshow, but yesterday I had tmpg encoding a movie, and DS didn't work so I tried avisource. It did work but as I wrote in my post, the 3rd row was a copy of the second one. And that was the mistake in the script. I belive it should work now, but I still have to try it.
Anyway, thank you very much, and I'll post an answer when I get the chance to try it again.
Pko
22nd April 2002, 23:24
Originally posted by matrix
My scritp looks like this:
Here is a (reduced and translated version) of mine; Is a SVCD with 10 options (musical videos); there are 2 rows of 5 in the upper and 5 in the lower portions of the screen.
In the middle appears a larger version of the streams that plays 10 seconds of each in sequence, with fade in/fade out to link them.
I put only part of the .avs, then I use the "logo" Virtual Dub plugin (by Donald Graft) to draw a menu, animate titles, etc. BTW, the 100 second .avs file takes more than 3 hours to compress with CCE in an Athlon 1900+ X-D
LoadPlugin("C:\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
LoadPlugin("C:\DVD2SVCD\InverseTelecine\Donald Graft\Decomb.dll")
LoadPlugin("C:\DVD2SVCD\SimpleResize\SimpleResize.dll")
# The streams are:
# 01 NTSC int
# 02 NTSC
# 03 NTSC
# 04 NTSC
# 05 NTSC
# 06 PAL
# 07 NTSC int
# 08 NTSC int
# 09 NTSC
# 10 PAL
# Loading, deinterlacing & converting to NTSC as needed
V01=FieldDeinterlace(mpeg2source("E:\Movies\V01.d2v"))
V02=mpeg2source("E:\Movies\V02.d2v")
V03=mpeg2source("E:\Movies\V03.d2v")
V04=mpeg2source("E:\Movies\V04.d2v")
V05=mpeg2source("E:\Movies\V05.d2v")
V06=ConvertFPS(mpeg2source("E:\Movies\V06.d2v"),29.97)
V07=FieldDeinterlace(mpeg2source("E:\Movies\V07.d2v"))
V08=FieldDeinterlace(mpeg2source("E:\Movies\V08.d2v"))
V09=mpeg2source("E:\Movies\V09.d2v")
V10=ConvertFPS(mpeg2source("E:\Movies\V10.d2v"),29.97)
# here I used "Trim" on my .avs to select the starting frame with
# an image & sound that "looks good" when thumbnailed.
# I strip it since it is not necessary
# We take a bit more than 100 seconds (3000 frames) for the small
# thumbnails and resize them
S01=Trim(BicubicResize(V01,64,64),1,3000)
S02=Trim(BicubicResize(V02,64,64),1,3000)
S03=Trim(BicubicResize(V03,64,64),1,3000)
S04=Trim(BicubicResize(V04,64,64),1,3000)
S05=Trim(BicubicResize(V05,64,64),1,3000)
S06=Trim(BicubicResize(V06,64,64),1,3000)
S07=Trim(BicubicResize(V07,64,64),1,3000)
S08=Trim(BicubicResize(V08,64,64),1,3000)
S09=Trim(BicubicResize(V09,64,64),1,3000)
S10=Trim(BicubicResize(V10,64,64),1,3000)
# We take 298 frames (3000/10-2 frames, since fade in/fade out will
# append a black frame each) and resize for the larger version
V01=Trim(BicubicResize(V01,144,144),1,298)
V02=Trim(BicubicResize(V02,144,144),1,298)
V03=Trim(BicubicResize(V03,144,144),1,298)
V04=Trim(BicubicResize(V04,144,144),1,298)
V05=Trim(BicubicResize(V05,144,144),1,298)
V06=Trim(BicubicResize(V06,144,144),1,298)
V07=Trim(BicubicResize(V07,144,144),1,298)
V08=Trim(BicubicResize(V08,144,144),1,298)
V09=Trim(BicubicResize(V09,144,144),1,298)
V10=Trim(BicubicResize(V10,144,144),1,298)
# Adding the fade in/fade out
V01=Reverse(FadeOut(Reverse(FadeOut(V01,60)),60))
V02=Reverse(FadeOut(Reverse(FadeOut(V02,60)),60))
V03=Reverse(FadeOut(Reverse(FadeOut(V03,60)),60))
V04=Reverse(FadeOut(Reverse(FadeOut(V04,60)),60))
V05=Reverse(FadeOut(Reverse(FadeOut(V05,60)),60))
V06=Reverse(FadeOut(Reverse(FadeOut(V06,60)),60))
V07=Reverse(FadeOut(Reverse(FadeOut(V07,60)),60))
V08=Reverse(FadeOut(Reverse(FadeOut(V08,60)),60))
V09=Reverse(FadeOut(Reverse(FadeOut(V09,60)),60))
V10=Reverse(FadeOut(Reverse(FadeOut(V10,60)),60))
# Now we compose the upper strip, adding borders and
# separations for a 480x168 stream
S01=AddBorders(S01,40,40,0,64)
S02=AddBorders(S02,20,40,0,64)
S03=AddBorders(S03,20,40,0,64)
S04=AddBorders(S04,20,40,0,64)
S05=AddBorders(S05,20,40,40,64)
Superior=StackHorizontal(S01,S02,S03,S04,S05)
# Middle strip, 480x208.
# It contains the larger, shorter streams concatenated
Middle=AddBorders(V01+V02+V03+V04+V05+V06+V07+V08+V09+V10,40,0,296,64)
# Lower strip, 480x104
S06=AddBorders(S06,40,0,0,40)
S07=AddBorders(S07,20,0,0,40)
S08=AddBorders(S08,20,0,0,40)
S09=AddBorders(S09,20,0,0,40)
S10=AddBorders(S10,20,0,40,40)
Inferior=StackHorizontal(S06,S07,S08,S09,S10)
# And the final composition, 168+208+104=480 so it is 480x480
StackVertical(Superior,Middle,Inferior)
After this, there are the logo stuff that adds bitmaps, animations, titles, etc., these are really complex, so I do not put them here (I will if you want)
And I've found a bug in Donald Graft's logo plugin when you use animation... I hope he get his problems resolved and comes back soon, he is a great guy!
The .avs rendition is terribly slow and (when using 60+ times the plugin, directly and with "animate") it hungs Virtual Dub (CCE compresses it OK, though). With 20 plugins, it does not hung but makes some weird things
For the audio, I simply audiodub() the stream whith their corresponding WAV, take just the "middle" section (with their fade in/fade out) and so the audio is synchronized correctly, and with their corresponding fadein/fadeouts. Looks simply GREAT on TV.
But now I've found that the "multi default" option of SVCDs does not work well in WinDVD nor my stand alone, so the menu has not some of the functionality I intended :-(
matrix
24th April 2002, 15:45
First of all, I've got the script working and looking good. Thanks everybody for your help.
As for your script pko, thanks and I will try it. There's this question I have thow. As I understand looking at the script, the whole screen is filled up with the thumbnails, is that right?
I belive it looks good on the TV.
On my script (I forgot to mention) the background is a motion one. Is not just a static background that I have to design before, in fact is part of the movie, usually the beginning, same lenght as the thumbnails. And because of that, in order to have the names and numbers of the chapters, I have to use Donald's logo filter in VirtualDub. I try using it before, when I encode the thumbnails, but to use the filter, I have to do a full processing mode, and then tmpg refuses to take the script. As for the CCE, it crashes every time I try to load one of these scripts. So I have to do a direct stream copy of each chapter, do the script with tmpg then go back to VD and applying the filters.
Now, I was wondering is there a way to add text over the video, positioning it where you want it, and then do the encode so you can do a direct stream copy, and have the text too, without using the logo filter?
Mabe there are ways, but since my knolege of avisynth is still in its infancy, I don't now how to do it.
Anyway, thanks everybody for the help, and I'd appreciate if there is any ideas on this new problem.
Thanks
Matrix
Pko
24th April 2002, 20:03
As for your script pko, thanks and I will try it. There's this question I have thow. As I understand looking at the script, the whole screen is filled up with the thumbnails, is that right?
I belive it looks good on the TV.
It looks great :-) (when complete, in that script there is no static images; I add then -in a section not posted- with "logo" plugin. I've posted another section of the script (the part that shows the "selection box" moving across the small thumbnails) in another thread in this same board). The thumbnails DO NOT fill the screen, there are some spaces (that appear as black in the posted version) and a box highlights each thumbnail for 10 seconds and then moves to the next. The highlighted thumbnail is show in the bigger box at the same time, and also the title (that is draw in a BMP and show also with the "logo" plugin) moves and fades in to the empty space at the right of the bigger thumbnail.
This goes to a menu in a SVCD; using the "multi default" option and "chapters" of 10 seconds (each video is highlighted for 10 seconds), the intended way to access each video is to press "play" when it is highlighted, so it jumps and displays the corresponding video.
It works OK in a Daewoo 8000K player, but unfortunately not in my Cyberhome nor in WinDVD :mad:
If you want, I can post the whole script and the needed BMPs (converted to PNG and zipped takes 136K, I do not know if it is too big for the forum), and also the needed SVCD.XML file for VCDImager. I made it for a musical videos compilation; the result is very nice.
*ALL* processing is made in avisynth; you cannot even see the complete .avs in Virtual Dub because with around 60 instances of the "logo" plugin it hangs, and with 30 or so, does not work well (does some weird things). But compressing it with CCE works (it took more than 4:30 hours in my Athlon 2900+, and remember it is 100 seconds long... :D )
matrix
28th April 2002, 22:01
Hi Pko, and sorry for the delay.
I've been busy at work, so there's hardly any time left for fun.
There are some things I don't understand. You said that everything is done in avisynth. But what do you have to do in preparation, before you put the script to work?(thumbnails, pictures...etc)
I don't know if I'll be able to do it, but I would like to see the whole script, and everything else you have.
For the way you say it looks, I'd really like to try it.
Thanks.
Pko
29th April 2002, 12:43
Originally posted by matrix
But what do you have to do in preparation, before you put the script to work?(thumbnails, pictures...etc)
I don't know if I'll be able to do it, but I would like to see the whole script, and everything else you have.
Of course, the BMPs you want to use, you must make them with any utility you have at hand (paint or whatever)
Well, step by step, this is what I do:
1) Decide what you want to do; in my case, I had 10 video clips for around 750MB, so I had aroun 40MB free if I burn to 80' CDs. I opted to make just one menu to try the "multidefault" option of SVCDs. Then, I did a rough draft on paper of the menu structure: two rows with 5 small "windows" showing the videos, and between them, a larger one. The larger one will show each of the 10 videos in sequence, the user will press "play" when his/her video of choice is showing and it will jump to show that video.
The videos where all of them MPEG2 (SVCD compatible), some of the PAL, some of them NTSC, some progressive, some interlaced. I did a DVD2AVI project of each one and extracted the audio to WAV, so you can play them with VirtualDub using this .avs script:
AudioDub(MPEG2Source("V01.d2v"),WavSource("V01.wav"))
Of course, you MUST convert all of them to a single format (if NTSC or PAL, is your call, but all must be the same). To use PAL, simply open all NTSC videos with
AudioDub(ConvertFps(MPEG2Source("V01.d2v"),25),WavSource("V01.wav"))
If they are interlaced, use decomb(); if they are both NTSC AND interlaced, use both like here:
AudioDub(ConvertFps(Decomb(MPEG2Source("V01.d2v")),25),WavSource("V01.Wav"))
2) I made the main moving part; it showed just the 10 small "windows" and the larger one in the middle; I captured one frame to BMP and then opened it in Pain Shop Pro (you can use anything, including The Gimp if you want 100% free open source software -not counting Windows, of course-). With that as a "template", I did the "background art" marking the areas that should be transparent (the videos will appear through that areas) with a colour not used anywhere else in the "background art" (I choose RGB $00FF00). Also, this "art" will label each video with a number (1 to 10) because each video can be selected pressing the corresponding number.
3) I then decided what additional "moving" parts will appear: a small square "marks" the small window corresponding to the "now playing" video that is showing in the bigger window in the middle; during the fade from video to video, the square moves from window to window. Also, the artist and title of each video is shown also in synch; I make a BMP of the corresponding size (and with the background at RGB=$000000, so that colour is marked as "transparent") and display it from the left of the screen to their definitive position with transparency gropwing from 10 (almost invisible) to 255 (totally opaque). it "crosses" over the bigger window with a nice effect.
4) I try each of the effects I want to do separately with an .avs script over a blank clip (to speed up the testing) and, when satisfied, I make a complete script with everything. Also, for the audio, I take just the "middle" section and add the sound; I convert the audio to MP2 with TMPGEnc, but there are other ways.
5) Then, I compress the video with CCE (in my case, it takes a looooong time); when finished, I multiplex with TMPGEnc both audio and video; with this, the menu image is done, only the actual authoring is left.
6) I make (with VCDEasy) a initial XML I will then modify, I drop all the videos, the menu and any additional files I want, I make "chapters" in the menu at 10 seconds (10 chapters 10 seconds long, the menu is in total 100 seconds long). I also make in VCDEasy the navigation between the videos. I choose to save only the XML file, create it and then I edit it with any text editor (notepad, for example)
7) I create the main menu manually using "multidefault". It is simply the first entry in the <PBC> section; it plays three loops, with "multidefault numeric" activated and the 10 videos as jumping pints. So, since the menu has 10 chapters, if the user presses "play" during, say, chapter 3, the menu jumps to the third option specified (that is the video number 3, that is also what should be showing in the big middle window). Also, since the "numeric" option of multidefault is specified, the user can also press the corresponding number.
8) After creating the XML, again with VCDEasy, I build the SVCD image (bin + cue files) and then burn it to disk with anything you want, I used CDRDAO through VCDEasy. VCDEasy is a very nice frontend for a number of programs, very very usefull, I use it very often (although since it cannot access files through network mappings, sometimes I use the actual utilities directly from the command line... I hope a new version of VCDEasy will overcome this limitation, since the underlying programs can access network mappings flawessly)
And that is all, I think it is interesting enough to make a guide... I will post here (unfortunately the BMPs take some space... I hope the forum could host them), so everyone could see. Of course, I will not include the actual videos, each one should use their own. I will post everything soon, I do not have it at hand right now...
matrix
29th April 2002, 16:19
Well, step by step, this is what I do:
_____________________________________________________________
Thank you for the reply.(and the detailed instructions. I appreciate it very much)
I don't doubt for a minute that this will be an interesting guide. Many people right now are using tscv to author their menues. Well, it is a great program, but sometimes it just doesn't work. For me, the only alternative was this, and I enjoy doing it. I also use VCDEasy and CDRDAO to create and burn the image, it's a very good prg. and it gives many more options than others.
I know the command line is not as limited as the GUI, but I don't know how to use that. (learning to, is on my agenda)
So if you decided to post a guide, it won't be only interesting, but usefull too.
Thanks again for everything, and now that I have what I need, I'll try doing it.
Matrix
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.