VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. I am preparing a workflow of post-production for a theater troupe. The videos should include a poster of the show at the beginning. I made one and ensured that the resolution matched that of the video, then used this thread to include the poster:

    Code:
    ImageSource("C:\Path\To\Picture.jpg", FPS=25, End=250)
    Can AviSynth+ deal with posters that don't have the same resolution by resampling the image and padding the borders, e.g. a portrait poster in a landscape video?
    Quote Quote  
  2. Speak a little more about your overall workflow and what tools you're using.

    You can certainly prepare stills with avisynth, but most editing software will allow you to simply import them.

    Given some of the questions you've been asking here, you may want to think about using a real NLE -- even a freebie like hitfilm or resolve to get your work done. Again, there's nothing wrong with learning avisynth if that's your goal.
    Last edited by smrpix; 22nd Feb 2020 at 06:48.
    Quote Quote  
  3. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Also know that avisynth doesn't automatically do much - it is scripted, and has to be explicitly told to do whatever you were wanting it to do.
    And if you plan on doing overlays, you will need to exactly match dimensions of your sources, else they will not line up properly, or the software will may add padding to the result (making it oddly dimensioned), or some other nonsense.

    NLEs are a better alternative, but compositing apps such as After Effects may be better still (for the stated purpose).

    Scott
    Quote Quote  
  4. Originally Posted by miguelmorin View Post
    I am preparing a workflow of post-production for a theater troupe. The videos should include a poster of the show at the beginning. I made one and ensured that the resolution matched that of the video, then used this thread to include the poster:

    Code:
    ImageSource("C:\Path\To\Picture.jpg", FPS=25, End=250)
    Can AviSynth+ deal with posters that don't have the same resolution by resampling the image and padding the borders, e.g. a portrait poster in a landscape video?
    Something like:

    Code:
    main = WhateverSource()
    still = ImageSource("C:\Path\To\Picture.jpg", FPS=25, End=250).Spline36Resize(width,height).AddBorders(left,top,right,bottom).ConvertToYV12()
    still++main
    Quote Quote  
  5. Originally Posted by smrpix View Post
    Speak a little more about your overall workflow and what tools you're using.
    smrpix: some members of the theater troupe make the poster in the software they like the most, e.g. Photoshop, GIMP, CorelDraw, etc. Their objective is something that serves for A1. Then other members of the troupe (currently me), include that poster with footage from the show. I know enough to take source files, edit them, and export them to the right resolution for videos, but other people may not be so savvy. So I am looking for a way to include stills to make it easier for future members in charge of videos.

    Originally Posted by smrpix View Post
    Given some of the questions you've been asking here, you may want to think about using a real NLE -- even a freebie like hitfilm or resolve to get your work done. Again, there's nothing wrong with learning avisynth if that's your goal.
    smrpix: I had been using a "real NLE" such as iMovie and Final Cut Pro, but grew frustrated of the difficulty of fine-tuning and version control of the source files. I found AviSynth+ through a question on StackExchange, have been using it for a few months, and it is exactly what I am looking for. I looked quickly at Hitfilm and Resolve and neither seem scripted like AviSynth+, but correct me if I'm wrong.

    The code by Jagabo seems to do what I want. I'll add some code to find the right image size and padding.
    Quote Quote  
  6. Originally Posted by miguelmorin View Post
    The code by Jagabo seems to do what I want. I'll add some code to find the right image size and padding.
    With a little work it can be made into a function that automatically generates all the right values. You'll also need to change the frame rate.

    <edit>

    I had a little time so I wrote a function that will create a still image of a specified length that matches the parameters of a specified video.

    Code:
    ##########################################################################
    #
    # Create a video of a specified length (seconds) from a still image.
    # Match the properties to those of a specified video.
    # The still image is automatically resized and letter/pillar boxed to
    # retain its aspect ratio.  It is assumed the source video and the image
    # are square pixel.
    #
    ##########################################################################
    
    function MatchStillToVideo(clip v, string image, float seconds)
    {
        # get the still image as an RGB video with the same framerate as the video, and specified running time
        still = ImageSource(image, fps=v.framerate, end=Int(v.framerate*seconds))
    
        vidAR = v.width / v.height  # 1.777
        stillAR = still.width / still.height # 1.333
    
        # if vid aspect ratio > still aspect ratio: resize still to vid height, scale the width proportionally
        # else: resize still to vid width, scale height proportionally
        vidAR > stillAR ? still.Spline36Resize(still.width*v.height/still.height, v.height) : \
                    still.Spline36Resize(v.width, still.height*v.width/still.width)
    
        # add borders to match the still frame to the video frame
        AddBorders((v.width-last.width)/2, (v.height-last.height)/2, v.width-last.width-((v.width-last.width)/2), v.height-last.height-((v.height-last.height)/2))
    
        #colorspace conversion
        v.IsYV12() ? ConvertToYV12() : last
        v.IsYUY2() ? ConvertToYUY2() : last
    }
    
    ##########################################################################
    
    video = LSmashVideoSource("source.mp4")
    still = MatchStillToVideo(video, "image.jpg", 3.5)
    
    still++video # append video to still video
    Last edited by jagabo; 22nd Feb 2020 at 20:42.
    Quote Quote  
  7. Thank you for the explanation. Glad you found a solution that works for you.
    Quote Quote  



Similar Threads