Wolin Labs :: fun toys for your iThingy & Droid

Articles

Don't Lose your Garmin GPS!

Cron Job with Random Start Delay

Git Submodule with Local Changes Example

Using Caltopo Maps on your Garmin GPS

Waffle Reuben

Copying a Single File with a Yocto Recipe

Semihosting Debugging on STM32F4

Realtime Audio DSP with the STM32F4

Tuning the Moog Etherwave Theremin

STM32 Discovery Development on Linux

STM32F4 USB Virtual COM Port (VCP)

Editing GoPro Hero2 Video with Cinelerra

Code Browsing with Emacs, GLOBAL, and Speedbar

Use a PC Power Supply as a Bench Supply the Easy Way

Android Activity Bar Framework

Generating an Audio Sine Wave with Java

Android Simple Yes/No MessageBox

Fox Talas 32 Oil/Seal Change Checklist

Creating a Bootloader Environment (Freescale ColdFire Example)

Pentomino Smackdown: Names That Didn't Make the Cut

Editing GoPro Hero2 Video w/ Cinelerra

Ross Wolin - 2012.07.17


I recently got a GoPro Hero2 for making videos of mtn biking, kayaking, and other fun stuff. To date, it's been an awesome video camera, easy to use and well worth the price.

For many years I have been using Cinelerra, Heroine Virtual Ltd's advanced, non-linear, free video editor for Linux. When I tried opening the Hero2 video directly in Cinelerra, I had problems with the video skipping, having a really low frame rate, etc.

I was able to recode the video using ffmpeg to get it into a format Cinelerra liked better. Assuming your video is 1920x1080 resolution, to recode a single file named input.MP4, use this command line:

ffmpeg -i input.MP4 -b 20M -s 1920x1080 -acodec libvo_aacenc output.mp4

This takes the video and recodes at roughly the same bitrate (20Mb/s) as the original Hero2 video. Opening output.mp4 in Cinelerra will work a lot better than the original file.

If you wish to recode all the files in a directory, you could use this script:

#!/bin/bash

for file in GOPR*.MP4
do
   base="${file%.*}"

   # Strip audio, recode video only
   # ffmpeg -i $file -b 20M -s 1920x1080 -an $base.recode.mp4 &
   # or recode the video and audio
   ffmpeg -i $file -b 20M -s 1920x1080 -acodec libvo_aacenc $base.recode.mp4 &
done

The video recoding jobs will all run in the background, you can tell when they have completed when

ps ax | grep "ffmpeg" | wc -l

returns 1. If you wish to delete the original Hero2 files at this point, you could do so with:

rm GOPR*.MP4

Additional Tip: I've never liked the fisheye distortion from the GoPros when the field of view (FOV) is set to the default 170 degrees. There is an option on the Hero2 to set the FOV to 127 degrees (medium) or 90 degrees (narrow): I have been using both of these settings, IMHO this shoots much more realistic looking video. Currently the option to change the FOV to 90 or 127 degrees is only available when the camera is in 1080p mode, consult Hero2 manual for more details.




Please send comments, questions, money in large denominations, etc to android at wolinlabs.com



If you enjoyed this article, please consider buying my products ...

ATX PS Adapter Ultimate Serial Port
ATX PS Adapter

Use an ATX PC power supply as a 5V, 3.3V, and +12V/-12V bench supply the easy way, without cutting the case or mounting external connectors, resistors, LEDs, switches, and fuses.

Provides visual indication when supply is plugged in and turned on, also fuses the power voltage outputs for safety. Run USB powered development boards via the USB connectors on the 5V line.

Ultimate Serial Port (Debug Buddy)

USB serial port with standard, 5V and 3V RS232, plus integrated null modem and gender changer. Implements TX/RX and RTS#/CTS# for optional hardware handshake.

Also includes 3.3V<->5V level shifters, debug LEDs, and 13 clock sources. Valuable tool for hands on problem solving and hacking