clip my clips
October 14, 2009 6:40 AM   Subscribe

Possibly NSFW links. I need to make preview clips of a LOT of video files. What can I do to take existing WMV and/or MPG files and chop out say 10 seconds for a preview...Automatically.

I have about 500 video files ranging in time length from one minute to 30 minutes.

Ideally, I'd like to take the 2 seconds of each file from the 20% mark, 40% mark, 50% mark, 60% mark and 80% mark so I have a 10 second "preview" clip of the entire clip.

Anyone know a program that can do this or something similar automatically? I'd even go for something that would let me pick any 10 second linear chunk in the video.

One other thing, all of these clips are adult in nature and total several dozen GB, so uploading them to an online service is not feasible.

TIA
posted by sandra_s to Media & Arts (5 answers total) 1 user marked this as a favorite
 
mencoder. You can easily use an ls to get the list of files and have a script process each in turn. ffmpeg -i $filename gives you the duration of each file if you want to calculate the 20% etc mark of each.
posted by a robot made out of meat at 7:06 AM on October 14, 2009


It sounds like you need to do some scripting - with the volume of files you are talking about, I don't think you would want to look at a GUI solution.

I suggest you look up ffmpeg, though I don't know to what extent it can handle WMV files. You can use the -ss and -dframes options to make it chop some specific number of frames from selected points in each file, but you will need some scripting glue to run this and collate everything into your preview video. Since your files are of variable length, you will also need some logic in your script to figure out how many clips to take out of each file, and at what framerate.
posted by Dr Dracator at 7:09 AM on October 14, 2009


If you're handy with scripting, you could cook up a way to first slice up the videos and then glue the small clips together with ffmpeg.
posted by mkb at 7:09 AM on October 14, 2009


Response by poster: Anyone have any GUI solutions? I dont have the firs idea about "scripting" Sorry :-(
posted by sandra_s at 4:53 PM on October 14, 2009


Let me put it this way: if you'd posted it as a job, someone would probably have done the scripting for $20. I did a fair amount of it because I wanted to remember how native regular expressions worked in bash.
posted by a robot made out of meat at 1:08 PM on October 15, 2009


« Older Where can I find a list of Postgraduate...   |   I need a crash course in the current best-practice... Newer »
This thread is closed to new comments.