Log in

View Full Version : How to dissolve more than 59 pictures?


honzakov
25th October 2004, 12:18
Hello, i want create free app similar to MemoriesOnTV for generating mpg streams from jpg images. I have simple gui done - it generate avs script and call FreeEnc (or QuEnc) for converting avs to mpv and avs2wav+besweet for creating audiotrack. But if i experimentig with betaversion and trying if avs scripts are ok i found problem with Dissolve - there can not be more than 60 parameters. Please, is here someone who can help me slove this problem?

Sorry for my bad english :-(

Sample of my avs script is here:

# Fuctions

function DVDSize(image, int SafeW, int SafeH, int fps,int len)
{
bl = BlankClip(len,safew,safeh)
killaudio(bl)
a = ImageReader(image,0,len,fps,false)
h = int(Height(a) * (float(SafeW)/float(Width(a))))
a = (Width(a) > SafeW) ? a.LanczosResize(SafeW,h): a
w = int(width(a)* (float(SafeH)/float(Height(a))))
a = (Height(a) > SafeH) ? a.LanczosResize(w,SafeH): a
res=overlay(bl,a,safew/2-a.width/2,safeh/2-a.height/2)
return res
}

# Loading some needed plugins

LoadPlugin("c:\diko\avisynth\plugins\zoom.dll")
LoadPlugin("C:\DIKO\avisynth plugins\avsmon25a.dll")
LoadPlugin("C:\diko\avisynth\plugins\mpasource.dll")

# Start of adding pictures

pic0=Zoom(srcx="360-n*0.106",srcy="288+n*0.140",factor="1.4-n*0.00133",DVDSize("C:\Fuji\20041017\DSCF1885.JPG",720,576,25,200))
pic1=Zoom(srcx="360-n*0.132",srcy="288-n*0.185",factor="1.4-n*0.00123",DVDSize("C:\Fuji\20041017\DSCF1886.JPG",720,576,25,200))
pic2=Zoom(srcx="360-n*0.268",srcy="288-n*0.158",factor="1.1+n*0.00118",DVDSize("C:\Fuji\20041017\DSCF1887.JPG",720,576,25,200))
pic3=Zoom(srcx="360+n*0.165",srcy="288+n*0.268",factor="1.1+n*0.00115",DVDSize("C:\Fuji\20041017\DSCF1888.JPG",720,576,25,200))
pic4=Zoom(srcx="360-n*0.165",srcy="288-n*0.149",factor="1.1+n*0.00113",DVDSize("C:\Fuji\20041017\DSCF1889.JPG",720,576,25,200))
pic5=Zoom(srcx="360-n*0.129",srcy="288+n*0.157",factor="1.1+n*0.00148",DVDSize("C:\Fuji\20041017\DSCF1890.JPG",720,576,25,200))
pic6=Zoom(srcx="360-n*0.277",srcy="288+n*0.104",factor="1.4-n*0.00107",DVDSize("C:\Fuji\20041017\DSCF1891.JPG",720,576,25,200))
pic7=Zoom(srcx="360+n*0.104",srcy="288+n*0.101",factor="1.1+n*0.00132",DVDSize("C:\Fuji\20041017\DSCF1892.JPG",720,576,25,200))
pic8=Zoom(srcx="360+n*0.241",srcy="288+n*0.141",factor="1.1+n*0.00129",DVDSize("C:\Fuji\20041017\DSCF1893.JPG",720,576,25,200))
pic9=Zoom(srcx="360+n*0.228",srcy="288+n*0.148",factor="1.1+n*0.00114",DVDSize("C:\Fuji\20041017\DSCF1894.JPG",720,576,25,200))
pic10=Zoom(srcx="360-n*0.254",srcy="288-n*0.276",factor="1.1+n*0.00128",DVDSize("C:\Fuji\20041017\DSCF1895.JPG",720,576,25,200))
pic11=Zoom(srcx="360+n*0.236",srcy="288-n*0.101",factor="1.1+n*0.00149",DVDSize("C:\Fuji\20041017\DSCF1896.JPG",720,576,25,200))
pic12=Zoom(srcx="360+n*0.249",srcy="288-n*0.128",factor="1.1+n*0.00139",DVDSize("C:\Fuji\20041017\DSCF1897.JPG",720,576,25,200))
pic13=Zoom(srcx="360+n*0.272",srcy="288+n*0.157",factor="1.4-n*0.00131",DVDSize("C:\Fuji\20041017\DSCF1898.JPG",720,576,25,200))
pic14=Zoom(srcx="360-n*0.275",srcy="288-n*0.154",factor="1.1+n*0.00148",DVDSize("C:\Fuji\20041017\DSCF1899.JPG",720,576,25,200))
pic15=Zoom(srcx="360-n*0.131",srcy="288-n*0.135",factor="1.1+n*0.00124",DVDSize("C:\Fuji\20041017\DSCF1899ps.jpg",720,576,25,200))
pic16=Zoom(srcx="360-n*0.131",srcy="288+n*0.247",factor="1.1+n*0.00104",DVDSize("C:\Fuji\20041017\DSCF1900.JPG",720,576,25,200))
pic17=Zoom(srcx="360-n*0.111",srcy="288-n*0.259",factor="1.1+n*0.00119",DVDSize("C:\Fuji\20041017\DSCF1900ps.jpg",720,576,25,200))
pic18=Zoom(srcx="360+n*0.187",srcy="288+n*0.198",factor="1.4-n*0.00140",DVDSize("C:\Fuji\20041017\DSCF1901.JPG",720,576,25,200))
pic19=Zoom(srcx="360+n*0.128",srcy="288-n*0.113",factor="1.4-n*0.00109",DVDSize("C:\Fuji\20041017\DSCF1902.JPG",720,576,25,200))
pic20=Zoom(srcx="360+n*0.145",srcy="288+n*0.150",factor="1.4-n*0.00141",DVDSize("C:\Fuji\20041017\DSCF1903.JPG",720,576,25,200))
pic21=Zoom(srcx="360-n*0.162",srcy="288+n*0.238",factor="1.1+n*0.00115",DVDSize("C:\Fuji\20041017\DSCF1904.JPG",720,576,25,200))
pic22=Zoom(srcx="360-n*0.159",srcy="288+n*0.248",factor="1.1+n*0.00136",DVDSize("C:\Fuji\20041017\DSCF1905.JPG",720,576,25,200))
pic23=Zoom(srcx="360-n*0.208",srcy="288+n*0.276",factor="1.1+n*0.00105",DVDSize("C:\Fuji\20041017\DSCF1906.JPG",720,576,25,200))
pic24=Zoom(srcx="360-n*0.180",srcy="288-n*0.110",factor="1.1+n*0.00133",DVDSize("C:\Fuji\20041017\DSCF1907.JPG",720,576,25,200))
pic25=Zoom(srcx="360-n*0.284",srcy="288+n*0.236",factor="1.1+n*0.00113",DVDSize("C:\Fuji\20041017\DSCF1908.JPG",720,576,25,200))
pic26=Zoom(srcx="360+n*0.246",srcy="288-n*0.232",factor="1.4-n*0.00111",DVDSize("C:\Fuji\20041017\DSCF1909.JPG",720,576,25,200))
pic27=Zoom(srcx="360+n*0.172",srcy="288-n*0.297",factor="1.4-n*0.00102",DVDSize("C:\Fuji\20041017\DSCF1910.JPG",720,576,25,200))
pic28=Zoom(srcx="360-n*0.273",srcy="288+n*0.239",factor="1.4-n*0.00133",DVDSize("C:\Fuji\20041017\DSCF1911.JPG",720,576,25,200))
pic29=Zoom(srcx="360-n*0.161",srcy="288+n*0.207",factor="1.4-n*0.00122",DVDSize("C:\Fuji\20041017\DSCF1912.JPG",720,576,25,200))
pic30=Zoom(srcx="360+n*0.169",srcy="288-n*0.197",factor="1.4-n*0.00142",DVDSize("C:\Fuji\20041017\DSCF1913.JPG",720,576,25,200))
pic31=Zoom(srcx="360+n*0.136",srcy="288+n*0.198",factor="1.4-n*0.00144",DVDSize("C:\Fuji\20041017\DSCF1914.JPG",720,576,25,200))
pic32=Zoom(srcx="360-n*0.141",srcy="288+n*0.217",factor="1.4-n*0.00131",DVDSize("C:\Fuji\20041017\DSCF1914ps.jpg",720,576,25,200))
pic33=Zoom(srcx="360+n*0.208",srcy="288-n*0.189",factor="1.4-n*0.00109",DVDSize("C:\Fuji\20041017\DSCF1915.JPG",720,576,25,200))

videotrack=Dissolve(pic0,pic1,pic2,pic3,pic4,pic5,pic6,pic7,pic8,pic9,pic10,pic11,pic12,pic13,pic14,pic15,pic16,pic17,pic18,pic19,pic20,pic21,pic22,pic23,pic24,pic25,pic26,pic27,pic28,pic29,pic30,pic31,pic32,pic33,50)

audiotrack=mpasource("D:\Vyberovka-MyTOP100-ENG-GAiNed\Evanescence - Bring me to life.mp3")+mpasource("D:\Vyberovka-MyTOP100-ENG-GAiNed\No Vacancy - Heal me, I'm Heartsick.mp3")

videotrack = videotrack.Trim(1, audiotrack.FrameCount())

result=AudioDub(videotrack,audiotrack)
FadeIO(result,50)
AssumeFPS(25,true)
ResampleAudio(48000)
MonitorFilter
#
ConvertToYV12

Manao
25th October 2004, 12:33
Dissolve(a,b,c,d,10) is exactly the same as Dissolve(Dissolve(a,b,10), Dissolve(c,d,10),10)

honzakov
25th October 2004, 12:43
Originally posted by Manao
Dissolve(a,b,c,d,10) is exactly the same as Dissolve(Dissolve(a,b,10), Dissolve(c,d,10),10)

Thank you, good idea.. i try rewrite my gui for generating something like this..

Guest
25th October 2004, 14:05
Maybe check out this code:
Tin2tin

# Slideshow4DVD (using avisynth)
# With safearea scaling, dissolve and export chapters to txtfile.
# To use for dvd authoring.
# Included code by dividee, tsp and tin2tin
# Collected and arranged by tin2tin.
# Special thanks to the Doom9 forum and the avisynth people.


# DEFINITIONS
# Import of stills with a 001...00x ending. The stills must have the same sizes.
fname="C:\teststills%.3d.jpg"
n=10 # numbers of stills
SafeH = 500 # resizing stills within width and height
SafeW = 680

# Import of background image - the proportions of this will be the proportions of the final film.
bname = "c:\Backgroundtester.jpg"
SafebH = 576 # resizing background within width and height
SafebW = 720

# Import of audiotrack to be faded out with last still
audiotrack = "C:\musictester.wav"

# Values for the dissolves between stills.
exposition=100 # Should be even. Includes overlap.
overlap=20 # Frames of dissolve.
rate=25 # Framerate.

# The filename and location of the exported txt file with chapter values for each still.
chapfile = "C:\chaptertester.txt"



# PROGRAM
Imagereader(fname,1,n,rate)
imagef = SafeSize (n,SafeW,SafeH,rate)
imageb = Imagereader(bname,1,1,rate)
imageb = loop(imageb,n)
imageb = SafeSize (imageb,n,SafebW,SafebH,rate)
addback (imagef, imageb, n)
DUP_FRAMES(exposition)
AssumeFPS(rate)
trim(0,exposition*n)
TRANSITION(0,exposition,overlap)
trim(overlap,exposition*n)
AudioDub(last,wavSource(audiotrack))

fadeout2(overlap)
p = chapters("", 0,n,rate, exposition, overlap)
writefilestart(chapfile,"string(p)")
ConvertToYV12()


# FUNCTIONS
# code by tin2tin
Function chapters (string s, int stop, int n,int rate, int exposition, int overlap)
{
pak = convert2smpte(((exposition-overlap)*stop),rate)+ chr(10)
return (stop == n) ? s : pak + chapters(s,stop+1,n,rate, exposition, overlap)
}

function AddBack(clip imagef, clip imageb, int dur)
{
b = imageB
f = imageF
x = (width(b)/2)-(width(f)/2)
y = (height(b)/2)-(height(f)/2)
c= overlay(b,f,x,y)
return c
}

function SafeSize(image, int n, int SafeW, int SafeH, int fps)
{
a = image
h = int(Height(a) * (float(SafeW)/float(Width(a))))
a = (Width(a) > SafeW) ? a.LanczosResize(SafeW,h): a
w = int(width(a)* (float(SafeH)/float(Height(a))))
a = (Height(a) > SafeH) ? a.LanczosResize(w,SafeH): a
return a
}

#code by tsp - cf=current_frame,fr=framerate
function convert2smpte(int cf,float fr)
{
hh=int(cf/3600/fr)
mm=int((cf-hh*3600*fr)/60/fr)
ss=int((cf-hh*3600*fr-mm*60*fr)/fr)
ff=int((cf-hh*3600*fr-mm*60*fr-ss*fr))
smpte=string(hh,"%02.0f")+":"+string(mm,"%02.0f")+":"+string(ss,"%02.0f")+"."+string(ff,"%02.0f")
return smpte
}


# code by dividee:
function DUP_FRAMES(clip clip, int count)
{
clip + BlankClip(clip,length=clip.framecount*(count-1)-(count/2))
ChangeFPS(framerate*count)
Trim(0,(count/2-1)) + last
return last
}

function TRANSITION(clip clip, int start, int expo, int overlap)
{
return ( start >= clip.framecount-expo ?
\ Trim(clip,start,0) :
\ Dissolve(Trim(clip,start,start+expo-1),
\ TRANSITION(clip,start+expo,expo,overlap),
\ overlap))
}

stickboy
26th October 2004, 04:08
If you merely want to join a bunch of images together and fade in from one to the next, you can use something like:
TemporalSoften(blurRadius, 255, 255, scenechange=255)