VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. Hi,
    I'm using a script to make a PIP (Picture in Picture).
    This script is OK, but the source video 2 starts at the same time that the source video 1.
    I want to make that thw source video 2 starts only after 8 seconds than the source video 1.

    someone help me?

    It' is the script:

    Code:
    ==========================
    # www.hitthebongo.co.uk
    # Picture in picture effect - pip displayed in top right corner with border
    # "DirectshowSource" paramater allows wmv videos to be used. It may be possible for other video types to be used if the relevant DS filters are installed...
    # ... If windows media player can play a file then you probably have the relevant DS filter. Therefore the file type might work in this script
    # Audio is only associated with the first rendered clip  which will be the main clip
    
    ###########USER SETTINGS##############
    
    MainVideo= "C:\video1.mpg" # This is the main source video
    PipVideo= "C:\video2.mpg" # This is the pip video source
    PipWidthPercentage=35 # This sets the pip width, expressed as a percentage of the MAIN VIDEO/screen width. 50 results in a pip which is half the width of the MainVideo
    PipHeightPercentage=40 # Same as above , but for Height
    PipTopPercentage=5 # Expressed as a percentage of MainVideo Height # Read NOTES below
    PipLeftPercentage=55 #Expressed as a percentage of MainVideo Width # Read NOTES below
    BorderThickness=2 # Expressed as a percentage of the PIP video width
    BorderColour=$FFFFFF # Visit http://en.wikipedia.org/wiki/List_of_colors for more Hex Triplet Colour Codes
    
    #NOTES
    # The Width and Height and placement co-ordinates of a pip video are usually expressed in pixels. I have instead opted for percentage values of the original...
    #... MainVideo as I believe this approach is more intuitive.  
    #The top left hand corner of the pip video is placed somewhere from the left of the screen and a somewhere below the top. 
    
    ##########END OF USER SETTINGS##############
    
    main=DirectShowSource( MainVideo ).ConvertToYUY2()
    mainW=Width(main)
    mainH=Height(main)
    PipWidth=int(mainW*PipWidthPercentage/100)
    PipHeight=int(mainH*PipHeightPercentage/100)
    piptop=int(mainH*PipTopPercentage/100)
    pipleft=int(mainW*PipLeftPercentage/100)
    PipWidth=int(PipWidth-PipWidth%2)
    PipHeight=int(PipHeight-PipHeight%2)
    BorderThickness=int(BorderThickness*PipWidth/100)
    
    PipVideo=DirectShowSource( PipVideo ).bicubicresize(PipWidth,PipHeight).AddBorders(BorderThickness,BorderThickness,BorderThickness,BorderThickness, BorderColour).bicubicresize(PipWidth,PipHeight).ConvertToYUY2()
    
    Layer(main,PipVideo,"add",255,pipleft,piptop)
    ==========================
    Quote Quote  
  2. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    If you want the PIP window to appear but for the contained video to wait 8 seconds before starting, then add an 8 second blankclip() to the beginning of the video in the PIP window. If you want the first video to begin and then after eight seconds to have the PIP window appear and start the second video, then you'll need to break the main video into sections using the trim() function. The first section 8 seconds long and the other the rest of the video. Then apply the Layer() line only to the second section, then recombine the initial 8 second video to the now PIP clip.
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  



Similar Threads

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