VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Hi. Just as I think I'm really getting to grips with avisynth, I find myself stuck again. I have an mp4(AVC,AAC) that I'd like to use the Trim function on. I can open the video in MeGUI with this script:
    LoadPlugin("E:\MeGUI\tools\lsmash\LSMASHSource.dll ")
    LSMASHVideoSource("E:\NLsans.mp4")

    but when I add a third line:
    LoadPlugin("E:\MeGUI\tools\lsmash\LSMASHSource.dll ")
    LSMASHVideoSource("E:\NLsans.mp4")
    LSMASHAudioSource("E:\NLsans.mp4")

    it'll only load the audio. AvsPmod doesn't like it either – 'No Video' is the error message. Although virtualdub will play it fine. I don't understand it. Have you any suggestions? Thanks.
    Quote Quote  
  2. Originally Posted by pooksahib View Post
    Hi. Just as I think I'm really getting to grips with avisynth, I find myself stuck again. I have an mp4(AVC,AAC) that I'd like to use the Trim function on. I can open the video in MeGUI with this script:
    LoadPlugin("E:\MeGUI\tools\lsmash\LSMASHSource.dll")
    LSMASHVideoSource("E:\NLsans.mp4")

    but when I add a third line:
    LoadPlugin("E:\MeGUI\tools\lsmash\LSMASHSource.dll ")
    LSMASHVideoSource("E:\NLsans.mp4")
    LSMASHAudioSource("E:\NLsans.mp4")

    it'll only load the audio. AvsPmod doesn't like it either – 'No Video' is the error message. Although virtualdub will play it fine. I don't understand it. Have you any suggestions? Thanks.
    You need to use audiodub()

    Code:
    LoadPlugin("E:\MeGUI\tools\lsmash\LSMASHSource.dll")
    vid=LSMASHVideoSource("E:\NLsans.mp4")
    aud=LSMASHAudioSource("E:\NLsans.mp4")
    AudioDub(vid,aud)
    Quote Quote  
  3. Excellent. Should have known that, though. Thanks, poisondeathray.
    Quote Quote  
  4. http://avisynth.nl/index.php/LSMASHSource

    Copy the following, edit and uncomment the first line to load LSMASHSource.dll if you'd prefer (or just copy LSMASHSource.dll from where-ever MeGUI keeps it to the Avisynth plugins folder so it'll auto-load) save it as a script with an avsi extension (calling it LSmashSource2.avsi seems appropriate) and stick it in the Avisynth plugins folder.
    I'm referring to putting the script and dll in the installed Avisynth plugins folder and not the folder where MeGUI keeps the plugins it uses.

    #LoadPlugin("LSMASHSource.dll")
    ##################################
    ## @ atrack - audio track number. Default auto. If -2, ignore audio.
    ## @ fpsnum, fpsden - framerate. Default auto.
    ## @ stacked - if true, return Stack16 format.
    ## (note, stacked=true requires a 16-bit color format)
    ## @ format - force specified output pixel format. Default auto.
    ## (see documentation for valid color formats)
    ## (if stacked = true, default "YUV420P16")
    ##
    function LSmashSource2(string path, int "atrack",
    \ int "fpsnum", int "fpsden",
    \ string "format", bool "stacked")
    {
    atrack = Default(atrack, 0)
    fpsnum = Default(fpsnum, 0)
    fpsden = Default(fpsden, 1)
    stacked = Default(stacked, false)

    format = Default(format, "")
    format = (format=="" && stacked==true) ? "YUV420P16" : ""

    video = LSMASHVideoSource(path,
    \ fpsnum=fpsnum, fpsden=fpsden,
    \ format=format, stacked=stacked)
    return (atrack==-2) ? video: AudioDub(video,
    \ LSMASHAudioSource(path, track=atrack))
    }
    You should now be able to open both audio and video like this:

    LSMASHSource2("E:\NLsans.mp4")

    You can do the same thing yourself with AudioDub but the script above automates it a little. There's a similar script on the page I linked to for combining LWLibavVideoSource + LWLibavAudioSource when opening other file types.
    Quote Quote  
  5. Great stuff as always. Thanks.
    Quote Quote  
  6. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Nice adaption from FFmpegSource2
    Quote Quote  
  7. Yeah it does seem pretty familiar, although FFmpegSource2 isn't a script any more. The function's now provided by ffms2.dll.
    Same for FFImageSource, if I remember correctly.
    Quote Quote  



Similar Threads

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