Post subject: Batch importing in AviSynth?
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
I want to merge 116 AVI files using an AVS script, since the total size is about 200 GB and I only have 50 GB left in my hard drive, and I don't want to copy-paste and change the numbers in the filename. Each file is named "sm64.XXX.avi" where Xes are digits, but there can be 2 instead of 3. Is there any plugin/script/command I can do to import them all in a shot and to save time? Or do I have to spend my whole evening on it?
Publisher
Joined: 4/23/2009
Posts: 1283
BTW, Avisynth has a limit of loading 70-80 AVIs simal, before it cramps out. Not really an Avisynth limit, but more a VfW limit. Your 116 AVIs is not going to help this. What I usually do is open and append all AVIs in VDub and then save that to a new super AVI. Due to your lack of space though, this won't help you much...
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
How about processing the video in two halves and stitching the resulting MP4 files together? Yes, this post is serious.
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Flygon wrote:
How about processing the video in two halves and stitching the resulting MP4 files together? Yes, this post is serious.
This will still be long and tedious to append 58 AVI files together manually.
Aktan wrote:
BTW, Avisynth has a limit of loading 70-80 AVIs simal, before it cramps out.
It's time to clean 150 GB out of my hard drive then.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Mister Epic wrote:
Flygon wrote:
How about processing the video in two halves and stitching the resulting MP4 files together? Yes, this post is serious.
This will still be long and tedious to append 58 AVI files together manually.
It's also the most sensible way of getting this to work without deleting chunks of your hard drive. Believe me, I also hate stitching together AVI files, but what is to be done must be done.
Post subject: Re: Batch importing in AviSynth?
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Mister Epic wrote:
Each file is named "sm64.XXX.avi" where Xes are digits, but there can be 2 instead of 3.
Renamer or a similar tool could convert the filenames. Instead of AVISource you could try DirectShowSource. As for generating the script, I'd open Excel and write something like
DirectShowSource("sm64. | 1 | .avi") +\
DirectShowSource("sm64. | 2 | .avi") +\
..., select these six cells and drag the lower right corner down until there are 116 lines. Then select all, copy&paste it into a text editor and replace the tabulator characters with nothing. Then remove the last "+\". Result
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Why didn't I wait for such a solution...
Publisher
Joined: 4/23/2009
Posts: 1283
That's not a good solution because DirectShowSource is not frame accurate. I would advice against using that.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
If the video is encoded with a "simple" codec like CamStudio then it should be frame-accurate. Otherwise you could use DSS2: Get the Haali Media Splitter, create a file named "DSS2.avsi" in your AviSynth's "plugins" directory and enter this function:
function DSS2(string infile, float "fps")  {
        LoadPlugin("C:\Programme\Haali\MatroskaSplitter\avss.dll")    # adjust path
        avss_DSS2(infile, fps)
}
The disadvantage is that it only loads the video. The AVIs could be concatenated in VirtualDub(Mod) and the audio could be dumped from there.
Publisher
Joined: 4/23/2009
Posts: 1283
Another option is use FFmpegSource2. This can also read MP4s/MKVs
Player (36)
Joined: 9/11/2004
Posts: 2623
mencoder can stitch the files together, if you don't need to keep your sources you can setup a for loop to combine the files 10 at a time, delete the sources and repeat. This is bash scripting (does not work in zsh or plain sh) and it assumes mencoder is in your path, if you need batch scripting then let me know and I'll try to work it out. mencoder -oac copy -ovc copy -o sm64.batch.0.avi sm64.{01..10}.avi; rm sm64.{01..10}.avi; for file in {1..9}; do mencoder -oac copy -ovc copy -o sm64.batch.${file}.avi sm64.$[(10*$file)+{1..10}].avi; rm sm64.$[(10*$file)+{1..10}].avi; done mencoder -oac copy -ovc copy -o sm64.batch.10.avi sm64.{111..116}.avi; rm sm64.{111..116}.avi; Obviously, I have no way of testing this script, so please review it first to make sure it work.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.