Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 17th March 2015, 10:42   #1  |  Link
Registered User
Join Date: Feb 2012
Posts: 72
Quick slideshow

I am trying to write a script that will create a very simple and quick slideshow.
I came across two scripts that almost did what I require.
The script I require needs to dissolve between each image, and be able to set both the duration and the dissolve length (same settings for all images) and handle images of different sizes. As well it needs to be able to output different sizes.

Script 1 does all that is required quite well, except handle images of different sizes.
My problem is, not all images have been taken the same way (landscape) some have been taken as portrait which means they are a different size.
I really do not want to have to manually resize them, it would just takes too long and time consuming for the benefit.
Script 2 does overcome the different image size problem with overlay.

Script 1
anim = ImageSource("D:\Avisynth Testing\Slideshow\Base Photos\image%03d.JPG", 1,100)
anim.AssumeFPS(1).ChangeFPS(45) #repeat each frame 45 times (1 sec + 0.5 sec overlap)
vid = Trim(15, -30) # first second
for (f=45, Framecount-45, 45) {
next = Trim(f, -45) # next second, incl overlap
vid = Dissolve(vid, next, 15)
return vid.AssumeFPS("pal_video")

Script 2
function Image2Clip( clip c, int ScrWidth, int ScrHeight)

B= KillAudio( BlankClip( 100, ScrWidth, ScrHeight, color=$001144, pixel_type="RGB24"))
ImgIsWide = float(C.Width)/C.Height >= float(ScrWidth)/ScrHeight
Fact= ImgIsWide ? 1.0 *ScrWidth/C.Width : 1.0 *ScrHeight/C.Height
NewWidth= Round( Fact* C.Width)
NewHeight= Round( Fact* C.Height)
O= C.BilinearResize( NewWidth, NewHeight)
return B.Overlay( O, (ScrWidth-NewWidth)/2, (ScrHeight-NewHeight)/2)
However I have not had any luck in combining these scripts into one that does it all in one operation.
Any suggestions as to how these scripts may be combined or is there a better method?
I do know there is software outside Avisynth, that will do all this, however they generally do not allow other filters to be added if required.
Thanks and hope you can help.
goorawin is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 03:18.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.