VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    Hi

    I use AviSynth and ffmpeg (ffmpegsource2) to open almost all formats with VirtualDub. Because of I am editing hundrets of Videos a week, I need a quick, comfortable way to create AviSynth scripts for VDub.

    At moment, I created a button for my commander (Directory Opus), which creates through the windows shell .avs-files for all marked videos. This is the batch command I use with the button:

    C:\windows\system32\cmd.exe /C echo ffmpegsource2("{file$}", atrack=-1) > "{sourcepath}\{file$|noext}.avs"
    With this command I get script files looking like this:

    ffmpegsource2("example.wmv", atrack=-1)
    This is quite comfortable. But it's not dynamic enough. When I try to open an automatically created .avs file of an video without an audio stream, I get following message from VirtualDub:



    Avisynth open failure:
    FFAudioSource: No Audio track found
    (FFMS2.avsi, line 38)
    (C:\example.avs, line1)
    Then I open the video with the direct show plugin.

    Could you help me a little find a way how to detect videos without sound to automatically adjust the AviSynth scripts for them? Possibly with MediaInfo or something? Or do you have complete other ideas how I could open up non-avi files in VDub with maximum comfort?

    The batch script above is simple and I was able to create it, but I have no clue how to use it with MediaInfo or something to detect audio streams and adjust the output script.
    Last edited by klischee; 28th Oct 2010 at 16:54.
    Quote Quote  
  2. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    You could alter your script to use the Avisynth try/catch construct.
    Something like
    Code:
    try {
      ffmpegsource2("example.wmv", atrack=-1)
    }
    catch (err) {
      DirectShowSource("example.wmv")
    }
    Quote Quote  
  3. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    Good and simple idea! But DirectShow source has also problems with files without audio streams. But I can open it with ffmpeg too, when I don't use the atrack parameter.

    This is now my batch script (with variables (grey) given from Directory Opus):
    C:\windows\system32\cmd.exe /C echo try { ffmpegsource2("{file$}", atrack=-1) } catch (err) { ffmpegsource2("{file$}") } > "{sourcepath}\{file$|noext}.avs"
    Nice. Thank you - I will use this. But if someone see's this thread and have a good idea doing it even better, I'm open for all ideas
    Last edited by klischee; 28th Oct 2010 at 16:56.
    Quote Quote  
  4. I use a bunch of batch files in my Send To folder. That way I can just right click on a file and select Send To... For example AVS_AviSource.bat contains:

    echo AviSource("%~d1%~p1%~n1%~x1") > "%~d1%~p1%~n1.avs"
    That creates an AVS script with the same filename the video but with .AVS as the extension. Then I open and edit the file if necessary. I also have scripts for DirectShowSource and Mpeg2Source. And batch files for x264 encoding with different presets.
    Quote Quote  
  5. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    Originally Posted by jagabo View Post
    I use a bunch of batch files in my Send To folder. That way I can just right click on a file and select Send To...
    Sounds like the same I already do (with a button of my Commander tool). What I am interested in is to create those avs completely dynamic, to prevent errors. But the if/else string is quite cool, I have to look more into the syntax of avisynth it seems.

    Originally Posted by jagabo View Post
    echo AviSource("%~d1%~p1%~n1%~x1") > "%~d1%~p1%~n1.avs"
    From what are these variables?
    Quote Quote  
  6. Originally Posted by klischee View Post
    Originally Posted by jagabo View Post
    echo AviSource("%~d1%~p1%~n1%~x1") > "%~d1%~p1%~n1.avs"
    From what are these variables?
    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx

    Same as your {file$} and {file$|noext}.avs
    Quote Quote  
  7. OOPS Sorry
    Quote Quote  
  8. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    Originally Posted by jagabo View Post
    Ah, interesting - thanks!
    Quote Quote  



Similar Threads

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