VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. 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.
    Quote Quote  
  2. 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
    Quote Quote  
  3. 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
    Quote Quote  
  4. 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.
    Quote Quote  
  5. Thank you for your help. I think I understand it a bit more.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!