View Full Version : Picture(PNG) import into the movie of using Avisynth?


YY1020
17th October 2004, 09:39
HI Everybody,

I have produced the picture(Format : PNG) of using After Effects.
Now,i would like to import the picture into the movie of using Avisynth,but i don't know how can do this.Could someone tell me about the method to import the picture into the chip using the avs?

Note : Method means using which avs plugins needed and describe the script in avs and the procedures.

Thanh you very much for all people in doom9 forum!!

Manao
17th October 2004, 10:15
Use ImageReader, it's bundled with avisynth, and look at the documentation to see how to load several images.

YY1020
17th October 2004, 10:25
Originally posted by Manao
Use ImageReader, it's bundled with avisynth, and look at the documentation to see how to load several images.
Thank you.Then,how can load the effect in the movie??

Manao
17th October 2004, 10:33
Well, supposing that you want to insert your effect just after the frame n in your clip, you would do something like that : clip_without_effect = whateversource("foo.bar") # load your movie, with avisource for example
clip_before_effect = clip_without_effect.trim(0,n) # extract the beginning of the clip
clip_after_effect = clip_cithout_effect.trim(n+1,0) # extract the end of the clip
effect = imagereader(...) # load the effect
clip_with_effect = clip_before_effect + effect + clip_after_effect # paste the three parts together
return clip_with_effect # return the final clip with the effect

YY1020
17th October 2004, 10:39
Originally posted by Manao
Well, supposing that you want to insert your effect just after the frame n in your clip, you would do something like that : clip_without_effect = whateversource("foo.bar") # load your movie, with avisource for example
clip_before_effect = clip_without_effect.trim(0,n) # extract the beginning of the clip
clip_after_effect = clip_cithout_effect.trim(n+1,0) # extract the end of the clip
effect = imagereader(...) # load the effect
clip_with_effect = clip_before_effect + effect + clip_after_effect # paste the three parts together
return clip_with_effect # return the final clip with the effect

Oh,I see.Thank you very much~

kingmob
17th October 2004, 11:01
If you want to keep the sound from falling out i'd use n-1 instead of n and at the end dub the sound back in.

YY1020
17th October 2004, 13:47
I tried to do it,but it said that "Splice : Frame sizes don't match"
Why?

Manao
17th October 2004, 17:09
Because your effect's resolution isn't the same as your clip's resolution : you have to resize it. Moreover, before you ask, you also have to convert it to the right colorspace.

YY1020
18th October 2004, 02:42
Originally posted by Manao
Because your effect's resolution isn't the same as your clip's resolution : you have to resize it. Moreover, before you ask, you also have to convert it to the right colorspace.

R = AVISource("C:\Ready\V.avi") # load your movie, with avisource for example
I = R.Trim(0,1974) # extract the beginning of the clip
O = R.Trim(2079+1,0) # extract the end of the clip
E = ImageReader("C:\Documents and Settings\LYU\Desktop\AE\Untitled Project.aep") # load the effect
V = I + E + O # paste the three parts together
return V # return the final clip with the effect

Is it right?

Manao
18th October 2004, 05:41
I don't see any resize nor color conversion. Pictures through imagereader often are loaded as RGB32, while AVI gives YUY2 or YV12, so you'll need a color conversion.

ImageReader can't read aep files, you have to configure after effect in order to output one different picture file for each frame. You also have to force him to index the pictures, it'll be easier to load them afterwards into avisynth.

YY1020
18th October 2004, 12:27
Originally posted by Manao
I don't see any resize nor color conversion. Pictures through imagereader often are loaded as RGB32, while AVI gives YUY2 or YV12, so you'll need a color conversion.

ImageReader can't read aep files, you have to configure after effect in order to output one different picture file for each frame. You also have to force him to index the pictures, it'll be easier to load them afterwards into avisynth.
I see.First, i have to convert a colourspace.Second,i have to change the different kind of picture file outputing from After Effects,right?But,which kinds of picture format can support into avisynth?

Manao
18th October 2004, 12:41
Once more, read the avisynth's documentation. You'll find there all the answer to your questions.

YY1020
18th October 2004, 14:22
Originally posted by Manao
Once more, read the avisynth's documentation. You'll find there all the answer to your questions.
Ok.Thank you very much.

Wilbert
18th October 2004, 15:10
AVISource("C:\Ready\V.avi").info

post color format + size.

ImageReader("C:\Documents and Settings\LYU\Desktop\AE\Untitled Project.png").info
# or whatever picture

post color format + size.

Your final script will be something like

c1 = AVISource("C:\Ready\V.avi")
c2 = ImageReader("C:\Documents and Settings\LYU\Desktop\AE\Untitled Project.png").ConvertToYV12.BicubicResize( ... )
c1 + c2

YY1020
18th October 2004, 15:32
Originally posted by Wilbert
AVISource("C:\Ready\V.avi").info

post color format + size.

ImageReader("C:\Documents and Settings\LYU\Desktop\AE\Untitled Project.png").info
# or whatever picture

post color format + size.

Your final script will be something like

c1 = AVISource("C:\Ready\V.avi")
c2 = ImageReader("C:\Documents and Settings\LYU\Desktop\AE\Untitled Project.png").ConvertToYV12.BicubicResize( ... )
c1 + c2
OK.Thank you Wilbert.I would try it!