VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    May 2014
    Location
    Washington, USA
    Search Comp PM
    I have the following assets:
    • An MP3 file 23 seconds long.
    • A video loop (with no audio).
    • A couple images (title.jpg, credits.jpg) with same dimensions as the video loop.

    I want to create a video with the following:
    • video: 150 frames of title.jpg, audio: no audio
    • video: 690 frames of video.jpg, audio: MP3 file
    • video: 150 frames of credits.jpg, audio: no audio

    Sorry, I can't figure out how to do this in AviSynth.
    Quote Quote  
  2. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    ImageSource("title.jpg", 0, 149) ++ ?? ++ ImageSource("credits.jpg", 0, 149)

    I have no idea what you mean by 'video.jpg' so I left that blank. Is it just a still image?

    I'd need to use BlankClip to get blank audio in the titles and credits but...

    Is Video.jpg supposed to be a still image with music in the background or did you get the extension wrong?
    Quote Quote  
  3. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Code:
    A1="audio.mp3"
    I1="title.jpg"
    I2="video.jpg"
    I3="credits.jpg"
    
    V2 = AudioDubEx(ImageSource(I2, 0, 689, 30).AssumeFPS("ntsc_video").ConvertToYV12(interlaced=true), DirectShowSource(A1))
    B1 = BlankClip(V2, 150)
    V1 = AudioDubEX(ImageSource(I1, 0, 149, 30).AssumeFPS("ntsc_video").ConvertToYV12(interlaced=true), B1)
    V3 = AudioDubEX(ImageSource(I3, 0, 149, 30).AssumeFPS("ntsc_video").ConvertToYV12(interlaced=true), B1)
    V1++V2++V3
    I THINK that should work, I can't test it of course. I made some assumptions about the frame-rate and interlacing but you didn't give much info.
    Quote Quote  
  4. Member
    Join Date
    May 2014
    Location
    Washington, USA
    Search Comp PM
    Thanks everyone. Despite my garbled and incomplete description, your help allowed me to get it working!

    Code:
    # Constants
    TitleLengthInSeconds = 5
    FramesPerSecond = 30
    TitleLength = TitleLengthInSeconds * FramesPerSecond
    
    # Input files
    AudioFile = "C:\Users\Edward\Desktop\Assets\Audio.mp3"
    StartTitleFile = "C:\Users\Edward\Desktop\Assets\FrontTitle.png"
    BackgroundVideoFile = "C:\Users\Edward\Desktop\Assets\LoopedBackground.mp4"
    EndTitleFile = "C:\Users\Edward\Desktop\Assets\BackTitle.png"
    
    # Load the audio
    AudioSource = DirectShowSource(AudioFile, FramesPerSecond).AssumeFPS(FramesPerSecond)
    
    # Get the length of the audio track
    AudioSourceLengthInFrames = (AudioLength(AudioSource) * FramesPerSecond) / AudioRate(AudioSource)
    
    # Load the video background
    dVideoBackground = DirectShowSource(BackgroundVideoFile, FramesPerSecond).Trim(0, AudioSourceLengthInFrames - 1).AssumeFPS(FramesPerSecond)
    
    # Load the title and credits
    Title = ImageSource(StartTitleFile, 0, TitleLength - 1, FramesPerSecond).AssumeFPS(FramesPerSecond).ConvertToYV12()
    Credits = ImageSource(EndTitleFile, 0, TitleLength - 1, FramesPerSecond).AssumeFPS(FramesPerSecond).ConvertToYV12()
    
    # Create the blank clip
    Blank = BlankClip(Title, TitleLength)
    
    # Create the video
    V2 = AudioDubEx(VideoBackground, AudioSource)
    B1 = BlankClip(V2, TitleLength)
    V1 = AudioDubEX(Title, B1)
    V3 = AudioDubEX(Credits, B1)
    V1++V2++V3
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!