Log in

View Full Version : Newbie question


noob2011
8th November 2011, 03:44
Hello

I am trying to edit the output of a video camera (mp4 format) with the following objective:

1a) Take the first 5 out of every 100 frames (removing the other 95); and/or
1b) Take the first frames out of every 100 frames repeated 5 times (removing the other 99)
2) in each case, from a long list of files; and
3) catenate the output (from the multiple files) in a new file (mp4, avi, or whatever).

I wasn't able to figure out how to get the looping control structures to work at all.

The files are video only, no sound.

Could someone help?

Thanks

vampiredom
8th November 2011, 03:58
If variables v1, v2, and v3 represent different videos of the same format, such as:

# DirectShowSource() is only an example
# use whatever you want/need to import the video instead
v1 = DirectShowSource("file1.mp4")
v2 = DirectShowSource("file2.mp4")
v3 = DirectShowSource("file3.mp4")
# etc.

Using step 1a)

v1 = v1.SelectEvery(100, 0,1,2,3,4)
v2 = v2.SelectEvery(100, 0,1,2,3,4)
v3 = v3.SelectEvery(100, 0,1,2,3,4)

v1 + v2 + v3

...Or, step 2b)

v1 = v1.SelectEvery(100, 0).Loop(5)
v2 = v2.SelectEvery(100, 0).Loop(5)
v3 = v3.SelectEvery(100, 0).Loop(5)

v1 + v2 + v3

Is that what you are looking for?

noob2011
8th November 2011, 04:09
Thanks. That's great. Any way to (a) run it from the command line with the different files (and/or an arbitrary number of files)?

Also, any way to save the output as a file instead of just play it?

Many thanks in advance.

vampiredom
8th November 2011, 04:13
I don't know of any way to automate sourcing of multiple files (though I, personally, might write a Perl script if I had to do something like this with a large number of files).

If you want to save the output, I suggest opening it with VirtualDub and compressing it to a lossless AVI (like Lagarith or Ut) to make a "master" and then using whatever other encoding tools you'd like to output to whatever particular delivery format you'd like.