View Full Version : ImageSource
NkRowdz
25th March 2011, 22:43
Hello everybody,
I can't understand how ImageSource filter works ??
I'm trying to put in the begining of a movie a logo.png, but i don't find a good tutorial or explication of how i can do this.
Can you help me, please ?
And can we put a display time, like the logo remains displayed 3-5 secondes ?
Thank you, very much ;)
Ps : sorry for my english !
IanB
26th March 2011, 23:56
ImageSource imports the specified image file or collection of image files into an Avisynth clip.
The default attributes of the clip are RGB24, 24 FPS, 1001 frames, height and width as per the source image file.
In order to merge the clip with other Avisynth clips, i.e. your movie, you need to reformat the image clip to match the movie clip.
First make the pixel format the same as the movie, use ConvertToYV12() or ConvertToYUY2() as appropriate.
To make the height and width match use a resizer, i.e. Spline16Resize().
But the pixel aspect ratio (PAR) of the 2 clips may not be the same, so you may need AddBorders() and/or Crop() to letterbox or pillar-box your image clip.
Also the framerate won't be right, so use AssumeFPS().
And the image clip won't have any audio, use AudioDub(Image, Blankclip(Movie)) to clone a silent audio track.
And of course the length won't be as you want, so use Trim().
So you need something like this :-Movie = ...Source("Movie.avi")
ImageSource("logo.png", end=1233) # 1234 frame clip
ConvertToYV12(Matrix="Rec709") # Match Movie's colorimetry
Crop(0, 8, 0, -8) # 8 pixels off top and bottom
Spline16Resize(Width(Movie)-84, Height(Movie)) # same size height as movie, width to suit PAR
AddBorders(42, 0, 42, 0) # 42 pixel side pillar-box, size now same as movie
AssumeFPS(Movie) # Make fps same as Movie clip
AudioDub(Last, Blankclip(Movie)) # clone silent audio
Trim(0, 234) # 10 seconds worth
Last ++ Movie # Append the movie.
....
ImageSource("cache/frame-%07d_*.png", fps=60, end=47864,use_DevIL=true, info=false, pixel_type="RGB64")
Is it possible to use a replacement string in the ImageReader function (in the example above, instead of *, which obviously doesn't work).
I want it to load images with names like:
"frame-0000001_any_string.png"
StainlessS
22nd July 2025, 11:05
Have you tried, [EDIT: I have not (seems an odd requirement)]
ImageSource("cache/frame-%07d_any_string.png", fps=60, end=47864,use_DevIL=true, info=false, pixel_type="RGB64")
wonkey_monkey
22nd July 2025, 11:58
I think rgr is asking for a wildcard, not literally "any_string"...
StainlessS
22nd July 2025, 13:31
OK, I guess you are right.
Still, is odd requirement.
How would it work if multiple file lists match in the wildcard ?
(pick one at random ??? {wildcard there dont make any sense, probably the reason I initially discounted wildcard as the requirement})
Emulgator
22nd July 2025, 18:08
Well, I use ReNamer to make sequences fit, but maybe it helps someone to have a comment added which does not disturb the sorting order.
Like
00000.bmp
00001.bmp
00002-retouched.bmp
00003.bmp
OK, I guess you are right.
Still, is odd requirement.
How would it work if multiple file lists match in the wildcard ?
(pick one at random ??? {wildcard there dont make any sense, probably the reason I initially discounted wildcard as the requirement})
Something like the post above.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.