VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. I have a collection of more than 400 .mpg files and I made AviSynth scripts with trim, crop, and resize.

    I already have the videos encoded but now I need to work on extract audio from source, trim and mux. The hardest part is the extracting audio and then cut the desired parts based on the AVS scripts trim I already have ready.

    Don't misunderstand me, I know how to extract audio from multiple videos just by using a GUI that uses FFmpeg like Pazera but I don't just need the audio to be extracted, the filename should contain data such as delay, a number necessary so that when cut audio everything goes well and there are no desync problems.

    Normally I would use DGindex to save a D2V project and use extracted audio with the delay, but this time I didn't and there are too many files to do it after working on the AVS scripts. Furthermore, many of the AVS scripts are actually fragments of same video, I mean, for each mpg file source, there are 2 o more AVS scripts that open the same mpg source but have trims in different parts. Of course, each AVS script has its own defined name and it's expected that the audios that were extracted and cut also have exactly the same name in order for the batch script that will mux video and audio to work properly.


    As an example I put the content of an AVS script.

    Code:
    0938.avs
    
    LWLibavVideoSource("M:\[encode]\ivid\(20170722_095000_T001_171710).mpg", cachefile="M:\[encode]\avsf\(20170722_095000_T001_171710).mpg.lwi")
    ######################################################################
    #EP 0938    
    Trim(2232,21710).TFM().TDecimate().Spline36Resize(640,480, 94,0,-94,-0)
    #EP 0939    Trim(21711,41190).TFM().TDecimate().Spline36Resize(640,480, 92,0,-98,-0)
    ######################################################################
    The structure is basically the same in all scripts, only the trim line changes which does not have a # so it can be read by x264. Also, the reason why TFM, TDecimate and Spline are together on the same line It's because I was copying and pasting the trim lines to other lines further down the script so to make a return that would bring all the desired parts together into a single video in case I needed it that way.

    For the audio trims, I use a VBS script (made by Tebesuna) that open a single file using drag and drop, and when the source FPS number and trim are set, the VBS script converts the input data to language interpreted by MKVmerge and creates a .bat file that runs MKVmerge and cut audio taking the previously provided info including delay (if specified in the filename).

    As you may have noticed, the process used to extract and cut audio, besides being manual, it only works with a single file. Is there a way to automate the audio extract and cut process for many files?
    Quote Quote  
  2. It's been a few days and no one has responded yet but for now I already achieved part of what I need although I'm not sure if it will work properly.

    I changed the MPG container to MKV and extracted the audio files. The audio files have delay number in filename but I wonder if that delay data from MKVExtract is correct because I compared some audio files extracted with DGIndex and it have slightly different delay numbers.

    Anyway, I still need to trim the audio files using a batch script to automate process.
    Quote Quote  



Similar Threads

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