VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    I'm getting "Avisynth message: invoke environment error - pass 1"

    My script is like so:

    video000 = AVISource("path/blah/blah")
    video001 = AVISource("path/blah/blah1")
    #etc to video 0038

    Dissolve(video000, video001, ...etc)
    FadeIO2(15)
    ConvertToYV12()


    Now, there are 39 avi's, totalling a few dozen frames over 10,000. This bombs with all 39, but if I remove two or three from the Dissolve, it doesn't bomb. It is NOT any particular avi, I have tried basically a binary search to find the culprit, there isn't one. It appears to be a avi source file or array-size limitation, because yanking any two or three fixes it. Sometimes just two, sometimes three. It just so happens that in every case that works, the frame number goes under 10,000. But I tried taking out just the one largest avi I have, that put it under 10,000, still bombed. So that appears to be coincidence.

    This same exact full 39-file .avs script plays fine in vdub. It encodes fine with ffmpeg. But the error returned by HC indicates that it is an error returned by Avisynth.

    I'm tearing my hair out here, dumping a couple of clips just isn't the way to go. Can anybody shed some light on this?

    Avisynth 2.5.6
    HCenc_019.exe, file version 0.19.0.1


    When it fails with 38 or 39 clips, the log is pretty sparse, as follows:

    ==================================================
    ==================================================
    *** Avisynth message: invoke environment error - pass 1 ***
    *** HCenc message: aborting, can't start pass 1 ***



    When it works, it's something like this:
    ==================================================
    ==================================================

    -----------------------------------------
    | HCenc - MPEG2 encoder - rel. 0.19.0.0 |
    -----------------------------------------

    input: g:\all_northside\2006\dvd\avs\test.avs
    output: G:\All_Northside\2006\DVD\avs\02.m2v

    --------------------
    | encoder settings |
    --------------------

    profile: NORMAL
    frames: 0 9903
    framerate: 29.97
    aspect ratio: 4:3
    bitrate Kb/s: 4000
    max. bitrate Kb/s: 8000
    pulldown: no
    closed gops: no
    VBV check: yes
    scene change det.: yes
    interlaced: no
    goplen,B-pic: AUTO
    dc_precision: 9
    scan method: ZIGZAG
    bias: 0
    chapter frames: 0
    time code: 0 0 0 0
    CPU: SSE3
    matrix: MPEG

    --------------------
    | source stats |
    --------------------

    nr. of frames in source: 9904
    width*height: 720*480
    fps: 29.97
    nr. of frames to encode: 9904
    frames to encode: 0 - 9903

    ---------------------
    | encoding - pass 1 |
    ---------------------
    Quote Quote  
  2. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    Before running an avisynth script through your encoder is is always worth opening it in virtualdub (or mod or mpeg2) first. If there is an error in the script, you will get an error message and line number to start looking at.
    Read my blog here.
    Quote Quote  
  3. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Thanks, but as I said, this same exact full 39-file .avs script plays fine in vdub. There is no error message, it works fine there. That's what's so weird about this.
    Quote Quote  
  4. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    "Environment error" possibly is program environment; the memory used to store variables.
    There may be some old DOS-style problems.

    First, paths should use \ not /, though maybe it works anyway.

    Maybe making the list of filenames smaller would help.

    Try putting all the video files. and the AVS, into the same folder,
    then instead of
    video000 = AVISource("path/blah/blah")
    just use
    video000 = AVISource("blah")

    and/or rename all the video files to have very short names.
    Quote Quote  
  5. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    You're running out of RAM. Do a

    Setmemorymax(512)


    or, 50% of whatever your total memory is
    Quote Quote  
  6. Member
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    I had this same error ("invoke environment") and eventually determined that it was actually due to the audio not being 48 kHz as required for the dvd standard. So I'd recommend to anyone who stumbles upon this topic hoping to solve their problems to verify that both the audio and video for the source are in an allowed dvd format.
    Quote Quote  



Similar Threads

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