Best way to combine overlapping video clips?
October 6, 2016 12:30 PM Subscribe
I'm trying to find a good way to combine multiple video clips that overlap (shared frames between the videos)-- ideally something can be run on Windows, but I'm interested in good solutions on toher platforms, as well. This is for H.264 Quicktime MOV files (1080p 12-15fps) that are captured as the live part of iPhone Live Photos.
If you take multiple Live Photos in relatively quick succession, you end-up with what is essentially a single video stream chopped into separate 3 second files centered around when the photo was taken. There are plenty of times where I've taken a bunch of photos, and after the fact realized that I have a 20-30 second, continuous video I can piece together from the 3 second .mov files that are saved as part of the live photo (if trim duplicate frames).
I've stitched some together using Premiere Pro, and that definitely works, but it feels like a little bit of overkill, is a little cumbersome, and I'm not really keen on paying $29.99/month. Is there a good/easy solution I'm overlooking? If this really does come down to just using a video editing program to combine these, is there a cheaper/better program I should be looking at for this limited use-case?
If you take multiple Live Photos in relatively quick succession, you end-up with what is essentially a single video stream chopped into separate 3 second files centered around when the photo was taken. There are plenty of times where I've taken a bunch of photos, and after the fact realized that I have a 20-30 second, continuous video I can piece together from the 3 second .mov files that are saved as part of the live photo (if trim duplicate frames).
I've stitched some together using Premiere Pro, and that definitely works, but it feels like a little bit of overkill, is a little cumbersome, and I'm not really keen on paying $29.99/month. Is there a good/easy solution I'm overlooking? If this really does come down to just using a video editing program to combine these, is there a cheaper/better program I should be looking at for this limited use-case?
I used Open Shot non-linear Video Editor on Ubuntu to edit some vacation video. If you have access to Linux you might want to give it a try. I would think within a half hour of working with it (perhaps less) you would discover if it was sufficient to your needs.
I suspect there might also be something you could do with ffmpeg or avconv from the Linux command line, specifying multiple input files, but I've only used those tools for simpler tasks.
posted by forthright at 7:37 PM on October 6, 2016
I suspect there might also be something you could do with ffmpeg or avconv from the Linux command line, specifying multiple input files, but I've only used those tools for simpler tasks.
posted by forthright at 7:37 PM on October 6, 2016
This is a little goofy, but here's what I would use. FFmpeg and IrfanView. Go ahead an install both of these tools.
Open the command line, and navigate to the folder with your MOV files. Use FFMPEG to break the files up into images:
ffmpeg -i input-video-1.mov -q:v 1 1-video-%04d.jpg
Run a second time on your second video:
ffmpeg -i input-video-2.mov -q:v 1 2-video-%04d.jpg
And a third time for the last video:
ffmpeg -i input-video-3.mov -q:v 1 3-video-%04d.jpg
This will create a bunch of files named things like 1-video-0001.jpg, 1-video-0002.jpg for the first video, 2-video-0001.jpg, 2-video-0002.jpg, and so on.
Now, open that folder with Windows Explorer, and change the view to thumbnail and delete the overlapping frames.
Now, open up IrfanView, and click File -> Batch Conversion/Rename. In the top lefthand corner make sure 'Batch rename' is selected. In the name pattern box on the left, add four hashtags '####'. Browse to the folder with your JPGs, and click 'Add all'. Make sure that the filenames are in the right order. In the bottom lefthand corner, click 'Start batch'.
This should give you a folder of JPGs that are numbered 0001.jpg, 0002.jpg, 0003.jpg.....
Now jump back to the command line, and use a command like this to create a video out of the jpgs:
ffmpeg -i %04d.jpg -q:v 1 final-video.mov
posted by gregr at 8:16 PM on October 6, 2016
Open the command line, and navigate to the folder with your MOV files. Use FFMPEG to break the files up into images:
ffmpeg -i input-video-1.mov -q:v 1 1-video-%04d.jpg
Run a second time on your second video:
ffmpeg -i input-video-2.mov -q:v 1 2-video-%04d.jpg
And a third time for the last video:
ffmpeg -i input-video-3.mov -q:v 1 3-video-%04d.jpg
This will create a bunch of files named things like 1-video-0001.jpg, 1-video-0002.jpg for the first video, 2-video-0001.jpg, 2-video-0002.jpg, and so on.
Now, open that folder with Windows Explorer, and change the view to thumbnail and delete the overlapping frames.
Now, open up IrfanView, and click File -> Batch Conversion/Rename. In the top lefthand corner make sure 'Batch rename' is selected. In the name pattern box on the left, add four hashtags '####'. Browse to the folder with your JPGs, and click 'Add all'. Make sure that the filenames are in the right order. In the bottom lefthand corner, click 'Start batch'.
This should give you a folder of JPGs that are numbered 0001.jpg, 0002.jpg, 0003.jpg.....
Now jump back to the command line, and use a command like this to create a video out of the jpgs:
ffmpeg -i %04d.jpg -q:v 1 final-video.mov
posted by gregr at 8:16 PM on October 6, 2016
Response by poster: Thanks all!
gregr-- I like that approach, and will give it a shot. The only issue is it's not going to preserve audio, and the most common scenario for this is when I've snapped a bunch of blurry photos at a concert and after the fact realize that I've incidentally recorded a chunk of the show in 3 second blocks.
KateViolet-- I don't know why I hadn't even considered giving Movie Maker a shot before shelling-out for a month of Premiere Pro-- definitely worth a try.
forthright-- I don't have a Linux install, right now, but if I decide to play with it again, I'll keep this in mind.
posted by cosmonaught at 8:48 PM on October 6, 2016
gregr-- I like that approach, and will give it a shot. The only issue is it's not going to preserve audio, and the most common scenario for this is when I've snapped a bunch of blurry photos at a concert and after the fact realize that I've incidentally recorded a chunk of the show in 3 second blocks.
KateViolet-- I don't know why I hadn't even considered giving Movie Maker a shot before shelling-out for a month of Premiere Pro-- definitely worth a try.
forthright-- I don't have a Linux install, right now, but if I decide to play with it again, I'll keep this in mind.
posted by cosmonaught at 8:48 PM on October 6, 2016
Hmm, Yeah the audio is more painful. This is goofy too, but you could try it. Count the number of frames you delete and then shorten the audio by that much. This will probably make awkward gaps.
I don't know what the framerate of your videos is, but let's say it's 15FPS and that the video is 3 seconds long. If you trim three frames, that's 3/15 seconds or 0.2 seconds, so 3 seconds minus 0.2 is 2.8 seconds:
ffmpeg -i video-1.mov -t 00:00:02.8 video1.wav
The second video you trim 7 frames from the end (7/15 = 0.46 seconds, 3 seconds minus .46 is 2.54):
ffmpeg -i video-2.mov -t 00:00:02.54 video2.wav
And so on.
Then this command will squish all that audio back together:
ffmpeg -i "concat:video1.wav|video2.wav|video3.wav" combined-audio.wav
Then to add the audio to the video:
ffmpeg -i "%04d.jpg" -i "combined-audio.wav" -shortest audio-and-video.mp4
posted by gregr at 9:35 PM on October 6, 2016
I don't know what the framerate of your videos is, but let's say it's 15FPS and that the video is 3 seconds long. If you trim three frames, that's 3/15 seconds or 0.2 seconds, so 3 seconds minus 0.2 is 2.8 seconds:
ffmpeg -i video-1.mov -t 00:00:02.8 video1.wav
The second video you trim 7 frames from the end (7/15 = 0.46 seconds, 3 seconds minus .46 is 2.54):
ffmpeg -i video-2.mov -t 00:00:02.54 video2.wav
And so on.
Then this command will squish all that audio back together:
ffmpeg -i "concat:video1.wav|video2.wav|video3.wav" combined-audio.wav
Then to add the audio to the video:
ffmpeg -i "%04d.jpg" -i "combined-audio.wav" -shortest audio-and-video.mp4
posted by gregr at 9:35 PM on October 6, 2016
Camtasia is relatively inexpensive (US$299) compared to Premiere Pro and is fairly easy to learn. You would just import all your media clips into one project and place them onto multiple tracks. Why not go for the free 30 day trial and see if it's worth the investment?
posted by maudlin at 10:41 PM on October 6, 2016
posted by maudlin at 10:41 PM on October 6, 2016
This thread is closed to new comments.
posted by KateViolet at 12:53 PM on October 6, 2016