I've been searching around and couldn't find something on this on Avisynth website. Perhaps someone on this website would know how to combine an image and video into one video. This is basically my code:
A0 = ImageSource("1-1.png", start=0, end=90, fps=30, use_DevIL=true)
A1 = Crop(A0,0, 76, 0, -82)
video = AddBorders(A1,0, 76, 0, 82)
audio = DirectShowSource("song.mp3")
A = AudioDub(video, audio)
B = AviSource("1-1.avi")
UnalignedSplice(A,B)
I have tried it using this as well:
A0 = ImageSource("1-1.png", start=0, end=90, fps=30, use_DevIL=true)
A1 = Crop(A0,0, 76, 0, -82)
A = AddBorders(A1,0, 76, 0, 82)
B = AviSource("1-1.avi")
UnalignedSplice(A,B)
Neither of them work. The first one gives me an error about not having the same file format. The second one gives me an error about audio. Is there a way to do this using Avisynth? It seems like a powerful enough tool to do something this simple.
+ Reply to Thread
Results 1 to 5 of 5
-
-
Probably because the colorspace doesn't match . The image will most likely be rgb, the avi most likely yv12. Convert one or the other to match. e.g. ConvertToYV12()
A0 = ImageSource("1-1.png", start=0, end=90, fps=30, use_DevIL=true).ConvertToYV12()
In the 2nd example, you also have to add blank audio to the still image (same sampling rate, channels, as the avi audio). Also in the 1st example, the audio has to match
What are the dimensions of your png and video? What are the audio characteristics of the video or mp3?
Use mediainfo (view=>text) copy & paste info back here -
I was able to solve it. I didn't know so many parameters had to match. Your post was very helpful.
n = 90
v = DirectShowSource("1-1.avi")
A0 = ImageSource("1-1.png", end=n-1)
A1 = Crop(A0,0, 76, 0, -82)
A4 = AddBorders(A1,0, 76, 0, 82)
A6 = Spline36Resize(A4,v.width, v.height)
A7 = AssumeFPS(A6,v)
A8 = ConvertToYV12(A7)
A9 = AudioDub(A8,BlankClip(v, length=n))
A9 ++ v -
I'm glad you figured it out.
I'm far from a coding expert, but you could probably simplify your code - you don' t need to introduce a new named variable for each line or command - since they all reference the imagesource source filter and are applied sequentially. For example , A0-A9 could have been represented by 1 variable. Unless you were going to use that particular variable later for something specific ?
n = 90
v = DirectShowSource("1-1.avi")
Imagesource()
Crop()
SomeCommand()
Etc..()
A=last
A ++ v
Here "last" refers to everything above.Last edited by poisondeathray; 5th Aug 2010 at 19:39.
Similar Threads
-
Combining video and audio files
By lbblock in forum Newbie / General discussionsReplies: 1Last Post: 10th Jan 2010, 10:17 -
Combining video and subtitles...
By jpresto in forum Newbie / General discussionsReplies: 1Last Post: 28th Jan 2009, 18:43 -
Combining Powerpoint and Video
By gurot in forum EditingReplies: 3Last Post: 16th Dec 2008, 19:38 -
Audio and Video not combining
By adeleander in forum ffmpegX general discussionReplies: 9Last Post: 23rd Sep 2008, 15:52 -
Vegas - add image to video (DVD(mpg)) and moving image around
By psxiso in forum EditingReplies: 4Last Post: 11th Jul 2007, 04:29