Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gnychis

macrumors 6502
Original poster
May 24, 2009
399
0
It's been a while since I've tried to edit any sort of videos, and I'm new to Mac OS so I'm even less familiar with the software or tools available for it. But I kind of have a "special" request.

I have somewhere around 1000 videos that I've captured over the past 10 years of my life, some small clips (10 seconds), some longer (20 minutes). I want to do something "simple" like take the first 2 seconds of each video (for simplicity) and then merge them all together.

Of course, these videos are in all sorts of different formats and resolutions. So I'd like to be able to define the video to be the resolution of the highest resolution video, and just fit the others in with black backgrounds or something.

If anyone has any suggests on where to even start with this (e.g., trimming) I'd greatly appreciate it. Thanks a bunch!
 

floh

macrumors 6502
Nov 28, 2011
460
2
Stuttgart, Germany
That's the first thing that came to mind for me as well. I am sure you can automate such a process with other tools, but I know for a fact that it can be done with ffmpeg, and that it can handle a huge amount of video formats.

So, the questions really is if you are okay with working in the Terminal or if you would like to have a graphical user interface to work with.
 

gnychis

macrumors 6502
Original poster
May 24, 2009
399
0
for sure, I am comfortable with the command line. I will look up some details of ffmpeg and keep you updated if I have any issues. Thanks a bunch for the guidance!
 

floh

macrumors 6502
Nov 28, 2011
460
2
Stuttgart, Germany
I guess for this case, the most important options for you will be:

-ss <position> (start at position)
-t <duration> (where duration is in seconds or "hh:mm:ss[.xxx]" format)
-i concat:"file1.mov|file2.mov|file3.mov" (concatenate several files)

So, this could mean something like this script as an example:

Code:
#!/bin/bash

# make temporary files directory
mkdir tempfiles

# take seconds 1 through 3 from each .mov file in current directory
for file in *.mov; do
ffmpeg -i "$file" -ss "00:00:01" -t "00:00:02" -f mpegts -c copy -bsf:v h264_mp4toannexb "tempfiles/$file.mpeg.ts"
allfiles="$allfiles|tempfiles/$file.mpeg.ts"
done

# take away starting pipe from filenames variable
allfiles=${allfiles#\|}

# concatenate all files
ffmpeg -isync -i "concat:$allfiles" -c copy output.mp4

# remove temporary folder
rm -rf tempfiles

This will probably work, but only for files with some kind of mpeg codec, and if they have the same codec. If they have different codecs, you will have to re-encode them first, and add something like "-codec:v libx264 -b:v 5000k -codec:a mp3 -b:a 192k" to the options of the first ffmpeg-line.

You can download the newest version ffmpeg here. Just pick the newest zip file (currently 1.0.1, I think).
 

jonjiv

macrumors newbie
May 29, 2012
11
0
An alternative solution if the terminal one doesn't work and you have Final Cut Pro compatible media:

Download the Final Cut X 30 day trial: http://www.apple.com/finalcutpro/trial/

1. Go to File: Import Media
2. Import all your media into a new event. (You can uncheck all the boxes that come up in the new event box)
3. Go to File: New Project
4. Select all media you imported in the Event Library.
5. Hit the "E" Key to insert the clips into your project (or drag them over).
6. Select all the clips in the project
7. Right click on selected clips and select "Change Duration"
8. Type 200 (for 2:00 seconds) and hit enter. All clips should resize to the first two seconds
9. Go to File: Share and select your preferred export format.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.