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.
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.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) ######################################################################
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?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 2 of 2
Thread
-
-
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.
Similar Threads
-
Batch / Script
By PSXman_uk in forum Video Streaming DownloadingReplies: 3Last Post: 13th Feb 2024, 08:40 -
Looking for Batch MP4 Normalization Script of existing script
By VideoFanatic in forum Video ConversionReplies: 6Last Post: 31st Jul 2021, 19:50 -
Movie thumbnailer Batch script help
By iKron in forum Newbie / General discussionsReplies: 2Last Post: 22nd Jul 2021, 23:57 -
Merging of multiple sources in AVS script
By KenshinX in forum Newbie / General discussionsReplies: 3Last Post: 27th Jul 2020, 16:01 -
Need Batch script help to prevent it asking for a language
By VideoFanatic in forum Video ConversionReplies: 0Last Post: 20th Dec 2019, 19:45