VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Mar 2021
    Location
    USA
    Search Comp PM
    I am trying to make gifs but when I try to encode video I get this error. not sure if I'm missing a plugin or something.

    Failed to evaluate the script:
    Python exception: lsmas: failed to construct index.

    Traceback (most recent call last):
    File "src/cython/vapoursynth.pyx", line 2244, in vapoursynth.vpy_evaluateScript
    File "src/cython/vapoursynth.pyx", line 2245, in vapoursynth.vpy_evaluateScript
    File "", line 19, in
    File "src/cython/vapoursynth.pyx", line 2069, in vapoursynth.Function.__call__
    vapoursynth.Error: lsmas: failed to construct index.
    Quote Quote  
  2. Post your script

    Possibly lsmash cannot read your source. What is your source ?

    You can try another lsmash build , or another source filter such as ffms2
    Quote Quote  
  3. Member
    Join Date
    Mar 2021
    Location
    USA
    Search Comp PM
    import vapoursynth as vs
    core = vs.get_core()
    import os
    import vapoursynth as vs
    import havsfunc as haf
    import G41Fun as fun
    import mvsfunc as mvs
    import descale as descale
    import kagefunc as kage
    core = vs.get_core()

    #core.max_cache_size = 1000 #Use this command to limit the RAM usage. 1000 or 2000 is fine.

    script_dir = os.path.dirname(__file__)
    rel_path = "video_cut/cut.mkv"
    abs_file_path=os.path.join(script_dir, rel_path)


    video = core.lsmas.LWLibavSource(source=abs_file_path)

    #Trim returns a clip with only the frames between the arguments first and last, or a clip of length frames, starting at first. a = first frame, b = last frame
    #video = core.std.Trim(video, a, b)

    #Resizer content goes here


    video = haf.QTGMC(video, Preset="Slower", TFF=True)

    video = core.fmtc.resample(video, css="444")
    video = descale.Debilinear(video, 272,483)

    video = core.knlm.KNLMeansCL(video, 0, 6, 4, 4.39, channels="YUV")

    video = fun.FineSharp(video, sstr=1.23)

    video = core.std.CropRel(video, left=38, top=62, right=66, bottom=121)
    video.set_output()

    I just downloaded yesterday, but when you say source do you mean the video I am creating the gif from?
    Quote Quote  
  4. Originally Posted by IAAMM View Post
    when you say source do you mean the video I am creating the gif from?
    rel_path = "video_cut/cut.mkv"
    Yes - What is cut.mkv ? What type of video ? Use mediainfo (view=>text)

    And is the directory correct ? Is the folder location called "video_cut" ?
    Quote Quote  
  5. Member
    Join Date
    Mar 2021
    Location
    USA
    Search Comp PM
    ah, am I supposed to change that information? (the cut.mkv / directory / video_cut) that stuff was what I copy and pasted from the script.vpy document from the vapoursynth folder.

    the video is an mp4 downloaded from YouTube using 4k video downloader.
    Quote Quote  
  6. Yes, you need to enter the correct path and filename, otherwise it cannot find which video you're referring to

    You probably want to change the script and filters; for example, a video downloaded from youtube will be progressive, so you wouldn't use QTGMC
    Quote Quote  
  7. Member
    Join Date
    Mar 2021
    Location
    USA
    Search Comp PM
    ohhh, okay. Thank you so much!
    Quote Quote  
  8. Until you decide what you want to do (how to process the video, which filters to use), I would comment out all those filter lines, or delete them. Those crop values are for a different video and chances are you're not going to use the same filters. They were just meant as an example script

    #video = haf.QTGMC(video, Preset="Slower", TFF=True)

    #video = core.fmtc.resample(video, css="444")
    #video = descale.Debilinear(video, 272,483)

    #video = core.knlm.KNLMeansCL(video, 0, 6, 4, 4.39, channels="YUV")

    #video = fun.FineSharp(video, sstr=1.23)

    #video = core.std.CropRel(video, left=38, top=62, right=66, bottom=121)
    video.set_output()
    Quote Quote  



Similar Threads

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