Log in

View Full Version : Unalignedsplice( foreach *.avi , directory =SomeDirectory , sort = NameOrOtherAttrib)


leonhard
13th January 2004, 10:17
As one always tries to avoid handwork I am looking for a good way to splice all avis of one directory. Although one can of course generate a lot for example with Pearl or C/C++, there may be a direct way within Avisynth as well?

Olaf

leonhard
16th January 2004, 09:11
Can't believe, that nobody has to comment something on this topic! How, folks, are you avoiding this tedious work to simply assembling sequences?
I wpuld suspect this to be a common hassle.

Olaf

stickboy
16th January 2004, 11:52
Sadly, I think the majority of AviSynth users currently use it for processing DVD rips or captured television shows rather than for video editing. As a consequence, I would guess that most people rarely assemble more than a handful of clips.

On the few occasions where I've had to assemble many clips, I usually do something like this at the command prompt:for /f "usebackq tokens=*" %x in (`dir /on /b *.avi`) do @echo.AVISource("%x") ++ \ >> foo.avsAnd then I remove the extra "++ \" on the last line.

Depending on how your files are named/numbered, you might want to look into the SegmentedAVISource/SegmentedDirectShowSource functions.

leonhard
17th January 2004, 09:48
So, as I code usually in Unix enviroment I think I got the meaning. You append line by line into a file, But just to avoid any misunderstanding, You refer to command line in Windows and consequently it is a dos command? As the foreach syntax is diffenrent or each shell in Unix and I am only really familiar with tcsh, just to play safe:

/f <-- for all??

"usebackq" <-- name to which to refer? So the meaning is in the end : All avi with the name "usebackq" and the extension avi?

what about the @, does one write to identify commands?

Thanks for your help, Olaf

As it looks that there is really not direct way to accomplish this taskdirectly i am going to suugest this feature in the developer section.Perhaps somebody likes to build it.

Olaf

stickboy
17th January 2004, 12:28
The /f enables Windows 2000/XP alternate behaviors for the for command. One of them is usebackq, which enables the use of Unix-like backquotes to specify the file set. (Type for /? for help.)

The @ disables echoing a single command.

leonhard
17th January 2004, 14:09
So thanks again, as i somehow like to handcode, can you recommend a good source to read about thoose essentials? I mean, something in a nutshell or so?

leonhard
14th September 2005, 07:11
So stickboy, coming back to this point after years :
After using sceanalyzer for example one may end up with a file name structur like
"scene'20000219 06.24.42.avi". Playing around with your wonderful for command, one gets the desired file, but unfortunately the filenames are not complete, they just display as "scene'20000219". So as it looks, they are broken when a blankspace occurs. Sofar in the help file I dicovered that one has to need double quotes for the filename in case of blank space, but playing around I didn manage to make it. Perhaps you know how?
Olaf

stickboy
14th September 2005, 09:10
Whoops. I didn't make 'for' tokenize the 'dir' output properly.

Okay, I've fixed the script from comment #3 to handle spaces by adding "tokens=*".

leonhard
14th September 2005, 09:40
Nice now it works fine. Just tu understand it, as the help file says tokens are line refering, that means content refering. In this case it is only used on the directory level? Is it a workaround one should remember or what is the structure?

On the other hand trying to be sure about the meaning of
"dir /on /b *.avi"

could as well written as dir /onb *avi, as a collection of options? So Bare, new long list format and sorted?
Not as some selfexplaining meaning a directory on Drive B.

Thanks for your help

stickboy
14th September 2005, 18:46
Nice now it works fine. Just tu understand it, as the help file says tokens are line refering, that means content refering. In this case it is only used on the directory level? Is it a workaround one should remember or what is the structure?Without the the "tokens=*", "for" took the output from "dir /on /b" and separated it by words (and I guess by default used only the first word on each line). With the "tokens=*", it reads in each full line.
On the other hand trying to be sure about the meaning of
"dir /on /b *.avi"

could as well written as dir /onb *avi, as a collection of options?In general, Windows commands aren't designed like Unix ones where you can combine options like that. If you try "dir /onb *.avi" you'll get an error.

movax
14th September 2005, 19:01
Most helpful commandline reference I've read in awhile. Thanks. :)