VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
+ Reply to Thread
Results 1 to 6 of 6
  1. Hi.

    I am trying to re-encode a video file that has
    MKV={H.264 720p, DTS, subtitles}
    into a
    AVI={Xvid 480p, AC3}

    (BTW, nothing illegal here, these are my own source materials. I'm just trying to learn new tools.)

    Problem is, xvid_encraw can't seem to understand the AVS input file. I'll walk through the steps from the beginning, hopefully somebody can spot something I'm doing wrong.

    First, I created the AVS file using MeGUI's "AVS script creator". I just set it to resize the video frames from 1200*500 down to 640*272. The directshow source preview shows the resulting video perfectly. Here's my AVS file:

    ----Begin AVS file----
    LoadPlugin("C:\MeGUI\tools\avs\directshowsource.dl l")
    DirectShowSource("c:\MyVideo.mkv", fps=23.976, audio=false, convertfps=true).AssumeFPS(24000,1001)
    LanczosResize(640,272) # Lanczos (Sharp)
    ----End AVS file----

    Actually I did try using the "One click encoder" that came with MeGUI and it always:
    - completed generating a DQA file
    - completed auto-deinterlacing
    - failed at the first pass of Xvid encoding.
    which is what led me to examine xvid_encraw's behavior.

    Second, I tried running the command:
    xvid_encraw.exe -i MyVideo.avs -type 2 -w 640 -h 272 -avi MyVideo.avi -pass1 MyVideo.pass1 -turbo -threads 4

    And it always fails with message:
    xvid [error]: Can't open avi/avs file MyVideo.avs

    And yes, I quintuple-checked, the AVS file is there, readable, writable, etc. Same for the DLL file referenced inside the AVS.

    I then tried several variations of the command, such as:

    xvid_encraw.exe -type 2 -i MyVideo.avs -w 640 -h 272 -avi MyVideo.avi -pass1 MyVideo.pass1 -turbo -threads 4

    xvid_encraw.exe -type 2 -w 640 -h 272 -avi MyVideo.avi -pass1 MyVideo.pass1 -turbo -threads 4 < MyVideo.avs

    None of the above worked; I guess it must be something about my AVS file.

    Could there be an incompatibility between the "directshowsource.dll" that came with MeGUI, and the frame-serving API expected by xvid_encraw?
    Quote Quote  
  2. I can't think of any obvious reason, but I did just try a quick DirectShowSource/xvid encode using MeGUI and it worked fine (I loaded the script into the video section and added it to the job queue and ran it that way).

    Which version of MeGUI are you using? If it's not the latest, I'd try going into settings, switching the the development update server if need be, restart MeGUI and let it update itself.

    By the looks of it MegUI has been using the same Xvid version for quite a while, but after updating, it might pay to check the tools/xvid_encraw folder to make sure all the required files are there. I don't really know much about xvid_encraw, but my folder looks like this:

    Click image for larger version

Name:	Clipboard01.gif
Views:	746
Size:	7.3 KB
ID:	22601

    Do you have Avisynth installed?
    MeGUI uses the portable version of Avisynth+ these days. You can switch between using it or the installed Avisynth version in MeGUI's settings (the recent MeGUI versions, at least).

    directshowsource.dll, in the tools\avs folder won't work with Avisynth 2.5.8, so be aware if MeGUI creates a script while it's set to use Avisynth+, the script won't work with other programs if the installed version of Avisynth is 2.5.8 (ie if you save the MeGUI script and try to open it with a program such as MPC-HC). You can fix that simply by deleting this entire line from the script:
    LoadPlugin("C:\MeGUI\tools\avs\directshowsource.dl l")
    The installed version of Avisynth will autoload the old version of directshowsource.dll from the Avisynth plugins folder so the script will still work. MeGUI will add the above line to the script, or not, depending on which version of Avisynth it's set to use. The old directshowsource.dll in the Avisynth 2.5.8 plugins folder will still work with newer versions of Avisynth.

    Whether the "wrong" directshowsource.dll could cause a problem when encoding via the command line, I'm not sure. If you don't have Avisynth "installed", then that won't be the problem.

    If updating MeGUI doesn't fix it, try loading the script into the video section and adding it to the queue. When/if the encoding process fails, copy the entire MeGUI log file and paste it here (including what's listed under "versions"). With any luck it'll provide a clue.

    PS. I assume this line from your script is a typo?
    LoadPlugin("C:\MeGUI\tools\avs\directshowsource.dl l")
    Yeah, I guess it is. The forum seems to be doing something odd. It did the same thing in this post earlier (the line highlighted in brown) and I tried editing it to fix it but the space keeps re-appearing.
    Last edited by hello_hello; 7th Jan 2014 at 02:28.
    Quote Quote  
  3. Member Budman1's Avatar
    Join Date
    Jul 2012
    Search Comp PM
    My experience has been, if it says it can't open it, it's usually something with spelling, syntax, or path. You might try putting the complete path for the AVS with quotes. I know it shouldn't have to but sometimes it helps. If there was actually something wrong within the AVS, it usually says some other message not that it can't open it.
    Quote Quote  
  4. And it didn't occur to me to ask before, but what about other Avisynth scripts aside from DirectShowSource? Do they work?
    Instead of opening the MKV with MeGUI and DirectShowSource, use the File Indexer. For MKV it'll probably default to a FFVideoSource script.
    Quote Quote  
  5. Member Budman1's Avatar
    Join Date
    Jul 2012
    Search Comp PM
    Just to add another 2 cents worth... I have about a dozen Directshowsource.dll floating around my computer and the only one I know opens all the files, especially the ones that play but you can't do anything else with like convert,etc, is the one dated Wednesday, ‎January ‎27, ‎2010, ‏‎20:10:04. I got it from The others gave me errors on various files but this one seems to work great.

    Quote Quote  
  6. Hello,

    Thanks to both of you for the very helpful suggestions. (Sorry for the delay in responding, I've been trying out several versions of the tools.) I've dug in to the logs of MeGUI, and found a few interesting messages:

    --[Warning] [2014-01-12 18:46:41] Haali Matroska Splitter not installed properly.
    --[Warning] [2014-01-12 18:46:41] Therefore DSS2() and certain functions of FFVideoSource() and the HD Streams Extractor may also not work.
    --[Warning] [2014-01-12 18:46:41] Please download and install it from
    --[Warning] [2014-01-12 18:46:41] Haali DSS2: not installed

    And now I remember I never installed Haali. I am using the LAV splitter since it also decodes some audio/video formats I'm interested in. I'm going to try adding Haali.
    Do any of you guys have thoughts on whether the two MKV (among other containers) splitters can coexist?
    Will I need to uninstall LAV before adding Haali?
    If not, is there a utility to let me select which one should have higher priority?

    Thanks again!
    Quote Quote  

Similar Threads