Skip to content

Instantly share code, notes, and snippets.

@swinman
Forked from KonradIT/readme.md
Last active August 29, 2015 14:17
Show Gist options
  • Save swinman/941d0829bde33d37b85b to your computer and use it in GitHub Desktop.
Save swinman/941d0829bde33d37b85b to your computer and use it in GitHub Desktop.

####GoPro Protune correction, timelapse assembling, fisheye removal, slow motion, 4:3 to 16:9 and motion blur in Linux OS - GoPro Studio for Linux - KDEnlive, FFMPEG, ImageMagick, Mencoder and Python!

GoPro Studio has been tremendously useful for GoPro users, but not all GoPro users can enjoy the tool, there is no GoPro Studio for Linux. So some users made their ways to emulate GoPro Studio on Linux.

This guide is more than GoPro Studio, is a must read guide for Linux and GoPro users.

The main features of GoPro Studio are:

  • Convert and edit Protune footage and apply Protune effect.
  • Convert 4:3 footage to 16:9
  • Slow motion
  • Image control.
  • fisheye removal.
  • Assemble pictures for timelapse, and include all the settings such as resolution, frame rate, motion blur and remove fisheye.

Here you will find markdown files explaining how to do all of the GoPro studio Windows/mac features... in Linux!

#####Other

Use VLC to play the rad footage. VLC is an open source and free multimedia player software for all platforms, including linux.

To install it, just run:

sudo apt-get install vlc

#Convert multiple MP4 files to MOV for easy post processing.

####Replace YOUR_GOPRO_FOLDER by your GoPro XXXGOPRO folder

cd YOUR_GOPRO_FOLDER
for i in *.MP4;
  do name=`echo $i | cut -d'.' -f1`;
  echo $name;
  ffmpeg -i $i -sameq -vcodec mpeg4 $name.mov;
done
import sys
import cv
import numpy as np
if __name__ == '__main__' :
vidFile = cv.CaptureFromFile( '/media/user/8765-4321//DCIM/XXXGOPRO/GOPRXXXX.MP4' )
nframes = int (cv.GetCaptureProperty (vidFile, cv.CV_CAP_PROP_FRAME_COUNT))
fps = cv.GetCaptureProperty (vidFile, cv.CV_CAP_PROP_FPS)
waitPerFrameInMillisec = int ( 1 / fps * 1000 / 1 )
width = int (cv.GetCaptureProperty (vidFile, cv.CV_CAP_PROP_FRAME_WIDTH))
height = int (cv.GetCaptureProperty (vidFile, cv.CV_CAP_PROP_FRAME_HEIGHT))
print 'Num Frames = ' , nframes
print 'Frame rate =' , fps, 'frames per sec'
# Camera data for GoPro Hero2
camera_matrix = cv.CreateMat ( 3 , 3 , cv.CV_32FC1)
cv.SetReal2D (camera_matrix, 0 , 0 , 469.96 )
cv.SetReal2D (camera_matrix, 0 , 1 , 0.0 )
cv.SetReal2D (camera_matrix, 0 , 2 , 640 )
cv.SetReal2D (camera_matrix, 1 , 0 , 0.0 )
cv.SetReal2D (camera_matrix, 1 , 1 , 467.68 )
cv.SetReal2D (camera_matrix, 1 , 2 , 360 )
cv.SetReal2D (camera_matrix, 2 , 0 , 0.0 )
cv.SetReal2D (camera_matrix, 2 , 1 , 0.0 )
cv.SetReal2D (camera_matrix, 2 , 2 , 1.0 )
dist_coeffs = cv.CreateMat ( 1 , 5 , cv.CV_32FC1)
cv.SetReal2D (dist_coeffs, 0 , 0 , - 0.18957 )
cv.SetReal2D (dist_coeffs, 0 , 1 , 0.037319 )
cv.SetReal2D (dist_coeffs, 0 , 2 , 0.0 )
cv.SetReal2D (dist_coeffs, 0 , 3 , 0.0 )
cv.SetReal2D (dist_coeffs, 0 , 4 , - 0.00337 )
# Prepare for new movie
writer = cv.CreateVideoWriter (
filename = "output.avi" ,
# = Cv.CV_FOURCC fourcc ('M', 'J', 'P', 'G'),
fourcc = - 1 , #with # -1 is selected in Windows
fps = fps,
frame_size = (width, height),
is_color = 1 )
map1 = cv.CreateImage ((width, height), cv.IPL_DEPTH_32F, 1 )
map2 = cv.CreateImage ((width, height), cv.IPL_DEPTH_32F, 1 )
cv.InitUndistortMap (camera_matrix, dist_coeffs, map1, map2)
for f in xrange (nframes):
frameImg = cv.QueryFrame (vidFile)
if frameImg is None :
print "no frame", f, "flawed. Cancel"
break
undistimage = cv.CloneImage (frameImg)
cv.Remap (frameImg, undistimage, map1, map2)
cv.ShowImage ( "Video" , undistimage)
cv.WriteFrame (writer, undistimage)
cv.WaitKey (waitPerFrameInMillisec)
# Progress Bar
percent = f * 100 / nframes
print percent, "%"
k = cv.WaitKey ( 1 )
if k % 0x100 == 27 :
# User has press the ESC key, then exit
break
cv.DestroyWindow ( "Video" )
del writer

#Fisheye correction using Python / KDEnlive.

###Python You can find a file called fisheye-video.py, this is for correcting gopro fisheye footage using Python. In line 7, replace XXX by the folder, XXXX by the video ID and user by the user where is the SD connected.

###KDEnlive There is an effect called Lens Corrector in KDEnlive which corrects the fisheye.


The presets I use for correcting the fisheye are: #####HERO2:

  • Horizontal center: 450
  • Vertical center: 619
  • Center correction: 288
  • Edges correction: 456
  • Brightness: 562

#####HERO3:

  • Horizontal center: 378
  • Vertical center: 619
  • Center correction: 230
  • Edges correction: 300
  • Brightness: 562

#####HERO3+Black SuperView:

  • Horizontal center: 430
  • Vertical center: 619
  • Center correction: 270
  • Edges correction: 456
  • Brightness: 562

The presets result may vaty between resolutions, adjust the lens corrector for the perfect video correction.

##For photos

There is nothing worse than getting a fisheye picture with a GoPro that ruined your shot. Instead of cropping, use ImageMagick: Note: It does not make sense to correct the photos of a timelapse, makes sense to correct the timelapse video instead! First, you will need to make the AAAGOPRO folder your work directory Replace user by the linux user and AAAGOPRO by the folder of the GoPro.

cd /media/user/8765-4321/DCIM/AAAGOPRO/

In your AAAGOPRO folder you should have photos in .JPG, use ImageMagick MOGRIFY:

mogrify -distort barrel "0 0 -0.3" *.JPG

It overwites all the .JPG files and correct them! #####Here is a demo, click image to enlarge!:

Fisheye corrected image GoPro Unedited image

#4:3 to 16:9 video conversion

If you record in 1440 or 960 video resolution to have more FOV in the top and the bottom, when you edit the footage you will have black bars at the sides, to convert the footage to 16:9 like in GoPro Studio, we need FFMPEG.

Here is the command to convert 4:3 to 16:9: First, you will need to make the AAAGOPRO folder your work directory Replace user by the linux user and AAAGOPRO by the folder of the GoPro.

cd /media/user/8765-4321/DCIM/AAAGOPRO/

Replace XXXX by the gopro video number

 ffmpeg -i GOPRXXXX.MP4 -sameq -vcodec mpeg4 -acodec ac3 -aspect 16:9 -strict experimental gopro-16-9.MP4
<effectgroup type="custom" id="GoTune dark" name="GoTune dark">
<effect tag="frei0r.hqdn3d" kdenlive_info="1/-1/GoTune dark" id="frei0r.hqdn3d" disable="0">
<name>Denoiser</name>
<description>High quality 3D denoiser</description>
<author>Marko Cebokli, Daniel Moreno</author>
<parameter default="40" type="simplekeyframe" value="40" intimeline="1" min="0" name="Spatial" max="1000" factor="1000" keyframes="0=300;">
<name>Spatial</name>
<comment>Amount of spatial filtering</comment>
</parameter>
<parameter default="60" type="simplekeyframe" value="60" min="0" name="Temporal" max="1000" factor="1000" keyframes="0=52;">
<name>Temporal</name>
<comment>Amount of temporal filtering</comment>
</parameter>
<version>0.1</version>
<version>0.1</version>
<version>0.1</version>
<version>0.1</version>
<version>0.1</version>
</effect>
<effect tag="frei0r.sharpness" kdenlive_info="1/-1/GoTune dark" id="frei0r.sharpness" disable="0">
<name>Sharpen</name>
<description>Unsharp masking (port from Mplayer)</description>
<author>Marko Cebokli, Remi Guyomarch</author>
<parameter default="300" type="simplekeyframe" value="300" intimeline="1" min="0" name="Amount" max="1000" factor="1000" keyframes="0=333;">
<name>Amount</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Size" max="1000" factor="1000" keyframes="0=190;">
<name>Size</name>
</parameter>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
</effect>
<effect version="0.2" tag="frei0r.sopsat" kdenlive_info="1/-1/GoTune dark" LC_NUMERIC="C" id="frei0r.sopsat" disable="0">
<name>SOP/Sat</name>
<description>Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List).</description>
<author>Simon A. Eugster (Granjow)</author>
<parameter default="100" type="simplekeyframe" value="100" intimeline="1" min="0" name="rSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Red</name>
<comment><![CDATA[Changing the slope means multiplying the pixel value with a constant value. Black pixels will remain black, whileas brighter ones will be changed.<br/>
All effects can be observed well when applied on a greyscale gradient and looking at the RGB Parade monitor.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="gSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="bSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="aSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Alpha</name>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="rOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Red</name>
<comment>Changing the offset lifts (or lowers) the brightness of each pixel by the given value.</comment>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="gOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Green</name>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="bOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Blue</name>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="aOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="rPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Red</name>
<comment><![CDATA[Changes the Gamma value for the selected channel. Black and white pixel values will not be affected, but everything between.<br/>
Mathematically, what happens is an exponentiation of the pixel brightness on <code>[0,1]</code> by the gamma value.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="gPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="bPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="aPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="saturation" max="500" factor="1000" keyframes="0=134;">
<name>Overall Saturation</name>
<comment>The overall saturation will be changed in the last step of this filter.</comment>
</parameter>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
</effect>
<effect tag="frei0r.contrast0r" kdenlive_info="1/-1/GoTune dark" id="frei0r.contrast0r" disable="1">
<name>Contrast</name>
<description>Adjusts the contrast of a source image</description>
<author>Jean-Sebastien Senecal</author>
<parameter default="250" type="simplekeyframe" value="250" intimeline="1" min="0" name="Contrast" max="1000" factor="500" keyframes="0=220;">
<name>Contrast</name>
</parameter>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
</effect>
<effect version="0.2" tag="frei0r.levels" kdenlive_info="1/-1/GoTune dark" LC_NUMERIC="C" id="frei0r.levels" disable="0">
<name>Levels</name>
<description>Adjust levels</description>
<author>Maksim Golovkin</author>
<parameter default="0.3" type="list" value="0.3" name="Channel" paramlist="0;0.1;0.2;0.3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" intimeline="1" min="0" name="Input black level" max="1000" factor="1000" keyframes="0=69;">
<name>Input black level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="Input white level" max="1000" factor="1000" keyframes="0=1000;">
<name>Input white level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="10" name="Gamma" max="4000" factor="4000" keyframes="0=1000">
<name>Gamma</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Black output" max="1000" factor="1000" keyframes="0=0;">
<name>Black output</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="White output" max="1000" factor="1000" keyframes="0=1000;">
<name>White output</name>
</parameter>
<parameter default="0" type="bool" value="0" name="Show histogram">
<name>Show histogram</name>
</parameter>
<parameter default="0.3" type="list" value="0.3" name="Histogram position" paramlist="0;0.1;0.2;0.3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Histogram position</name>
</parameter>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
</effect>
<effect version="0.3" tag="frei0r.balanc0r" kdenlive_info="1/-1/GoTune dark" LC_NUMERIC="C" id="frei0r.balanc0r" disable="0">
<name>White Balance</name>
<description>Adjust the white balance / color temperature</description>
<author>Dan Dennedy</author>
<parameter default="0xffffffff" type="color" value="0xeeeeeeff" name="Neutral Color">
<name>Neutral Color</name>
</parameter>
<parameter default="1333" type="simplekeyframe" value="1333" intimeline="1" min="0" name="Green Tint" max="10000" factor="10000" keyframes="0=1180;">
<name>Green Tint</name>
</parameter>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
</effect>
</effectgroup>
<effectgroup type="custom" id="GoProProtuneIndoor" name="GoProProtuneIndoor">
<effect tag="frei0r.hqdn3d" kdenlive_info="3/-1/GoProProtuneIndoor" id="frei0r.hqdn3d">
<name>Denoiser</name>
<description>High quality 3D denoiser</description>
<author>Marko Cebokli, Daniel Moreno</author>
<parameter default="40" type="simplekeyframe" value="40" intimeline="1" min="0" name="Spatial" max="1000" factor="1000" keyframes="0:241">
<name>Spatial</name>
<comment>Amount of spatial filtering</comment>
</parameter>
<parameter default="60" type="simplekeyframe" value="60" min="0" name="Temporal" max="1000" factor="1000" keyframes="0:221">
<name>Temporal</name>
<comment>Amount of temporal filtering</comment>
</parameter>
<version>0.1</version>
</effect>
<effect tag="frei0r.sharpness" kdenlive_info="1/-1/Protune indoor" id="frei0r.sharpness">
<name>Sharpen</name>
<description>Unsharp masking (port from Mplayer)</description>
<author>Marko Cebokli, Remi Guyomarch</author>
<parameter default="300" type="simplekeyframe" value="300" intimeline="1" min="0" name="Amount" max="1000" factor="1000" keyframes="0:1000">
<name>Amount</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Size" max="1000" factor="1000" keyframes="0:1000">
<name>Size</name>
</parameter>
<version>0.1</version>
</effect>
<effect tag="frei0r.levels" kdenlive_info="0/-1/Protune indoor" id="frei0r.levels">
<name>Levels</name>
<description>Adjust levels</description>
<author>Maksim Golovkin</author>
<parameter default="3" type="list" value="3" name="Channel" paramlist="0;1;2;3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" intimeline="1" min="0" name="Input black level" max="1000" factor="1000" keyframes="0:78">
<name>Input black level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="Input white level" max="1000" factor="1000" keyframes="0:899">
<name>Input white level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="10" name="Gamma" max="4000" factor="4000" keyframes="0:1000">
<name>Gamma</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Black output" max="1000" factor="1000" keyframes="0:56">
<name>Black output</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="White output" max="1000" factor="1000" keyframes="0:1000">
<name>White output</name>
</parameter>
<parameter default="0" type="bool" value="0" name="Show histogram">
<name>Show histogram</name>
</parameter>
<parameter default="3" type="list" value="3" name="Histogram position" paramlist="0;1;2;3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Histogram position</name>
</parameter>
<version>0.1</version>
</effect>
<effect tag="frei0r.balanc0r" kdenlive_info="0/-1/Protune indoor" id="frei0r.balanc0r">
<name>White Balance</name>
<description>Adjust the white balance / color temperature</description>
<author>Dan Dennedy</author>
<parameter default="0xFFFFFF" type="color" value="0xd2d2feff" name="Neutral Color">
<name>Neutral Color</name>
</parameter>
<parameter default="1200" type="simplekeyframe" value="1200" intimeline="1" min="0" name="Green Tint" max="2500" factor="1000" keyframes="0:1100;">
<name>Green Tint</name>
</parameter>
<version>0.2</version>
</effect>
<effect tag="frei0r.sopsat" kdenlive_info="1/-1/Protune indoor" id="frei0r.sopsat" disable="0">
<name>SOP/Sat</name>
<description>Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List).</description>
<author>Simon A. Eugster (Granjow)</author>
<parameter default="100" type="simplekeyframe" value="100" intimeline="1" min="0" name="rSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Red</name>
<comment><![CDATA[Changing the slope means multiplying the pixel value with a constant value. Black pixels will remain black, whileas brighter ones will be changed.<br/>
All effects can be observed well when applied on a greyscale gradient and looking at the RGB Parade monitor.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="gSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="bSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="aSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Alpha</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="rOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Red</name>
<comment>Changing the offset lifts (or lowers) the brightness of each pixel by the given value.</comment>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="gOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Green</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="bOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Blue</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="aOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="rPower" max="1000" factor="100" keyframes="0:100">
<name>Power Red</name>
<comment><![CDATA[Changes the Gamma value for the selected channel. Black and white pixel values will not be affected, but everything between.<br/>
Mathematically, what happens is an exponentiation of the pixel brightness on <code>[0,1]</code> by the gamma value.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="gPower" max="1000" factor="100" keyframes="0:100">
<name>Power Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="bPower" max="1000" factor="100" keyframes="0:100">
<name>Power Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="aPower" max="1000" factor="100" keyframes="0:100">
<name>Power Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="saturation" max="500" factor="100" keyframes="0:152;">
<name>Overall Saturation</name>
<comment>The overall saturation will be changed in the last step of this filter.</comment>
</parameter>
<version>0.1</version>
</effect>
</effectgroup>
<effectgroup type="custom" id="GoProProtuneOutdoor" name="GoProProtuneOutdoor">
<effect tag="frei0r.hqdn3d" kdenlive_info="1/-1/GoProProtuneOutdoor" id="frei0r.hqdn3d">
<name>Denoiser</name>
<description>High quality 3D denoiser</description>
<author>Marko Cebokli, Daniel Moreno</author>
<parameter default="40" type="simplekeyframe" value="40" intimeline="1" min="0" name="Spatial" max="1000" factor="1000" keyframes="0:111">
<name>Spatial</name>
<comment>Amount of spatial filtering</comment>
</parameter>
<parameter default="60" type="simplekeyframe" value="60" min="0" name="Temporal" max="1000" factor="1000" keyframes="0:117">
<name>Temporal</name>
<comment>Amount of temporal filtering</comment>
</parameter>
<version>0.1</version>
</effect>
<effect tag="frei0r.levels" kdenlive_info="1/-1/Protune outdoor" id="frei0r.levels">
<name>Levels</name>
<description>Adjust levels</description>
<author>Maksim Golovkin</author>
<parameter default="3" type="list" value="3" name="Channel" paramlist="0;1;2;3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" intimeline="1" min="0" name="Input black level" max="1000" factor="1000" keyframes="0:0">
<name>Input black level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="Input white level" max="1000" factor="1000" keyframes="0:1000">
<name>Input white level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="10" name="Gamma" max="4000" factor="4000" keyframes="0:1316;">
<name>Gamma</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Black output" max="1000" factor="1000" keyframes="0:0;">
<name>Black output</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="White output" max="1000" factor="1000" keyframes="0:1000;">
<name>White output</name>
</parameter>
<parameter default="0" type="bool" value="0" name="Show histogram">
<name>Show histogram</name>
</parameter>
<parameter default="3" type="list" value="3" name="Histogram position" paramlist="0;1;2;3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Histogram position</name>
</parameter>
<version>0.1</version>
</effect>
<effect tag="frei0r.sharpness" kdenlive_info="1/-1/Protune outdoor" id="frei0r.sharpness">
<name>Sharpen</name>
<description>Unsharp masking (port from Mplayer)</description>
<author>Marko Cebokli, Remi Guyomarch</author>
<parameter default="300" type="simplekeyframe" value="300" intimeline="1" min="0" name="Amount" max="1000" factor="1000" keyframes="0:1000">
<name>Amount</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Size" max="1000" factor="1000" keyframes="0:1000">
<name>Size</name>
</parameter>
<version>0.1</version>
</effect>
<effect tag="frei0r.balanc0r" kdenlive_info="1/-1/Protune outdoor" id="frei0r.balanc0r" disable="0">
<name>White Balance</name>
<description>Adjust the white balance / color temperature</description>
<author>Dan Dennedy</author>
<parameter default="0xFFFFFF" type="color" value="0x77766aff" name="Neutral Color">
<name>Neutral Color</name>
</parameter>
<parameter default="1200" type="simplekeyframe" value="1200" intimeline="1" min="0" name="Green Tint" max="2500" factor="1000" keyframes="0:1275;">
<name>Green Tint</name>
</parameter>
<version>0.2</version>
</effect>
<effect tag="frei0r.sopsat" kdenlive_info="1/-1/Protune outdoor" id="frei0r.sopsat" disable="0">
<name>SOP/Sat</name>
<description>Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List).</description>
<author>Simon A. Eugster (Granjow)</author>
<parameter default="100" type="simplekeyframe" value="100" intimeline="1" min="0" name="rSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Red</name>
<comment><![CDATA[Changing the slope means multiplying the pixel value with a constant value. Black pixels will remain black, whileas brighter ones will be changed.<br/>
All effects can be observed well when applied on a greyscale gradient and looking at the RGB Parade monitor.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="gSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="bSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="aSlope" max="1000" factor="100" keyframes="0:100">
<name>Slope Alpha</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="rOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Red</name>
<comment>Changing the offset lifts (or lowers) the brightness of each pixel by the given value.</comment>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="gOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Green</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="bOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Blue</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="-1024" name="aOffset" max="1024" factor="256" keyframes="0:0">
<name>Offset Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="rPower" max="1000" factor="100" keyframes="0:100">
<name>Power Red</name>
<comment><![CDATA[Changes the Gamma value for the selected channel. Black and white pixel values will not be affected, but everything between.<br/>
Mathematically, what happens is an exponentiation of the pixel brightness on <code>[0,1]</code> by the gamma value.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="gPower" max="1000" factor="100" keyframes="0:100">
<name>Power Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="bPower" max="1000" factor="100" keyframes="0:100">
<name>Power Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="aPower" max="1000" factor="100" keyframes="0:100">
<name>Power Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="saturation" max="500" factor="100" keyframes="0:153;">
<name>Overall Saturation</name>
<comment>The overall saturation will be changed in the last step of this filter.</comment>
</parameter>
<version>0.1</version>
</effect>
</effectgroup>
<effectgroup type="custom" id="GoTune underwater" name="GoTune underwater">
<effect tag="frei0r.hqdn3d" kdenlive_info="1/-1/GoTune underwater" id="frei0r.hqdn3d" disable="0">
<name>Denoiser</name>
<description>High quality 3D denoiser</description>
<author>Marko Cebokli, Daniel Moreno</author>
<parameter default="40" type="simplekeyframe" value="40" intimeline="1" min="0" name="Spatial" max="1000" factor="1000" keyframes="0=137;">
<name>Spatial</name>
<comment>Amount of spatial filtering</comment>
</parameter>
<parameter default="60" type="simplekeyframe" value="60" min="0" name="Temporal" max="1000" factor="1000" keyframes="0=19;">
<name>Temporal</name>
<comment>Amount of temporal filtering</comment>
</parameter>
<version>0.1</version>
<version>0.1</version>
<version>0.1</version>
</effect>
<effect tag="frei0r.sharpness" kdenlive_info="1/-1/GoTune underwater" id="frei0r.sharpness" disable="0">
<name>Sharpen</name>
<description>Unsharp masking (port from Mplayer)</description>
<author>Marko Cebokli, Remi Guyomarch</author>
<parameter default="300" type="simplekeyframe" value="300" intimeline="1" min="0" name="Amount" max="1000" factor="1000" keyframes="0=769;">
<name>Amount</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Size" max="1000" factor="1000" keyframes="0=347;">
<name>Size</name>
</parameter>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
</effect>
<effect version="0.2" tag="frei0r.sopsat" kdenlive_info="1/-1/GoTune underwater" LC_NUMERIC="C" id="frei0r.sopsat" disable="0">
<name>SOP/Sat</name>
<description>Changes Slope, Offset, and Power of the color components, and the overall Saturation, according to the ASC CDL (Color Decision List).</description>
<author>Simon A. Eugster (Granjow)</author>
<parameter default="100" type="simplekeyframe" value="100" intimeline="1" min="0" name="rSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Red</name>
<comment><![CDATA[Changing the slope means multiplying the pixel value with a constant value. Black pixels will remain black, whileas brighter ones will be changed.<br/>
All effects can be observed well when applied on a greyscale gradient and looking at the RGB Parade monitor.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="gSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="bSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="aSlope" max="1000" factor="2000" keyframes="0=100">
<name>Slope Alpha</name>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="rOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Red</name>
<comment>Changing the offset lifts (or lowers) the brightness of each pixel by the given value.</comment>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="gOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Green</name>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="bOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Blue</name>
</parameter>
<parameter offset="-1024" default="0" type="simplekeyframe" value="0" min="-1024" name="aOffset" max="1024" factor="2048" keyframes="0=0">
<name>Offset Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="rPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Red</name>
<comment><![CDATA[Changes the Gamma value for the selected channel. Black and white pixel values will not be affected, but everything between.<br/>
Mathematically, what happens is an exponentiation of the pixel brightness on <code>[0,1]</code> by the gamma value.]]></comment>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="gPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Green</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="bPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Blue</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="1" name="aPower" max="1000" factor="2000" keyframes="0=100">
<name>Power Alpha</name>
</parameter>
<parameter default="100" type="simplekeyframe" value="100" min="0" name="saturation" max="500" factor="1000" keyframes="0=160;">
<name>Overall Saturation</name>
<comment>The overall saturation will be changed in the last step of this filter.</comment>
</parameter>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
</effect>
<effect tag="frei0r.contrast0r" kdenlive_info="1/-1/GoTune underwater" id="frei0r.contrast0r" disable="1">
<name>Contrast</name>
<description>Adjusts the contrast of a source image</description>
<author>Jean-Sebastien Senecal</author>
<parameter default="250" type="simplekeyframe" value="250" intimeline="1" min="0" name="Contrast" max="1000" factor="500" keyframes="0=220;">
<name>Contrast</name>
</parameter>
<version>0.2</version>
<version>0.2</version>
<version>0.2</version>
</effect>
<effect version="0.2" tag="frei0r.levels" kdenlive_info="1/-1/GoTune underwater" LC_NUMERIC="C" id="frei0r.levels" disable="0">
<name>Levels</name>
<description>Adjust levels</description>
<author>Maksim Golovkin</author>
<parameter default="0.3" type="list" value="0.3" name="Channel" paramlist="0;0.1;0.2;0.3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" intimeline="1" min="0" name="Input black level" max="1000" factor="1000" keyframes="0=275;">
<name>Input black level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="Input white level" max="1000" factor="1000" keyframes="0=882;">
<name>Input white level</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="10" name="Gamma" max="4000" factor="4000" keyframes="0=1000">
<name>Gamma</name>
</parameter>
<parameter default="0" type="simplekeyframe" value="0" min="0" name="Black output" max="1000" factor="1000" keyframes="0=0;">
<name>Black output</name>
</parameter>
<parameter default="1000" type="simplekeyframe" value="1000" min="0" name="White output" max="1000" factor="1000" keyframes="0=1000;">
<name>White output</name>
</parameter>
<parameter default="0" type="bool" value="0" name="Show histogram">
<name>Show histogram</name>
</parameter>
<parameter default="0.3" type="list" value="0.3" name="Histogram position" paramlist="0;0.1;0.2;0.3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Histogram position</name>
</parameter>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
</effect>
<effect version="0.3" tag="frei0r.balanc0r" kdenlive_info="0/-1/GoTune underwater" LC_NUMERIC="C" id="frei0r.balanc0r" disable="0">
<name>White Balance</name>
<description>Adjust the white balance / color temperature</description>
<author>Dan Dennedy</author>
<parameter default="0xffffffff" type="color" value="0xa4fdd4ff" name="Neutral Color">
<name>Neutral Color</name>
</parameter>
<parameter default="1333" type="simplekeyframe" value="1333" intimeline="1" min="0" name="Green Tint" max="10000" factor="10000" keyframes="0=169;">
<name>Green Tint</name>
</parameter>
<version>0.3</version>
<version>0.3</version>
<version>0.3</version>
</effect>
</effectgroup>

#KDEnlive Protune filters for GoPro video

KDEnlive is an opensource and free non-linear video editing platform for Linux. A Linux and GoPro user Hajo shared a way to edit and convert GoPro Protune footage with KDEnlive, the alternative for GoPro Studio (which is only available for macosx and windows). He coded a XML preset which you can install in your KDEnlive effect bundle. Below are two files:

See a demo video

###Installation

######to install the presets, download this gist, unzip it, and copy the two XML presets to your desktop or somewhere where you can remember the path. You will need to move the two XML files to ~/.kde/share/apps/kdenlive/effects/. Below there is a UNIX mv command to move the files to the KDEnlive directory, remember to replace 'path/to/preset' by the path to the XML preset.

mv path/to/preset/gopro-protune-indoor-kdenlive.xml ~/.kde/share/apps/kdenlive/effects/

mv path/to/preset/gopro-protune-outdoor-kdenlive.xml ~/.kde/share/apps/kdenlive/effects/

####MenCoder as a GoPro timelapse assembler and ImageMagick as a Motion blur tool for timelapse

Another of the useful features of GoPro Studio is that it assembles the pictures shot with your gopro in a movie file at a certain frame rate. This can be achieved using the opensource free tool mencoder. (And previously FFMPEG!) And motion blur for timelapse using ImageMagick First, you will need to install MenCoder. If you want to add motion blur, download ImageMagick Or, use the command line to install MenCoder: #####Ubuntu:

sudo apt-get install mencoder

Then, connect your GoPro via USB or connect the microsd to the computer. You will need to list the commands, but first, go to the XXXGOPRO folder. Replace user by your linux username and XXX by the gopro folder number

cd /media/user/8765-4321/DCIM/XXXGOPRO

Then, generate the list:

ls -1tr > gopro.txt

Then you can assemble the timelapse, fps=20 indicates the fps of the timelapse:

mencoder -nosound -ovc lavc -lavcopts \
vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 \
-vf scale=1920:1080 -mf type=jpeg:fps=20 \
mf://@gopro.txt -o gopro.mp4

####Motion Blur If you want to apply motion blur:

Use ImageMagick, run this command BEFORE Mencoder.

Replace user by your linux username and XXX by the gopro folder number

convert /media/user/8765-4321/DCIM/XXXGOPRO/*.JPG -delay 10 -morph 5 [port]/DCIM/XXXGOPRO/motionblur%05d.jpg

It will take some minutes to convert the pics...

#Slow motion using FFMPEG

One of the killer features of GoPro studio is the ability to slow down 60fps/120fps/240fps GoPro footage. To do so in Linux you will need FFMPEG. Installation of FFMPEG already explained in other files.

###How-to:

Lets see, you have shot a 720p 120 fps video, you can slow it down to 20% maximum, more % will result a crappy footage.

  • 120fps is 9.6/1
  • 240fps is 5/1

So, replace /media/konrad/8765-4321/DCIM/143GOPRO/GOPR2687.MP4 by the GoPro MP4 footage location, for instance the SD card (hint: drag and drop the video to firefox, then copy the url but delete the file:/// protocol :) ), the output slowmotion file will be generated in your desktop.

ffmpeg -i /media/konrad/8765-4321/DCIM/143GOPRO/GOPR2687.MP4 -r 25 -vf "setpts=(9.6/1)*PTS" -sameq -vcodec libx264 ~/Desktop/slowmotion1.MP4

Now you got a long clip which is slowed down, its time to trim it into a shorter one for easy post processing:

-ss indicates the start (HH=hour, MM=minute, SS=second) and -t indicates the total duration of the video, not the end.

ffmpeg -i ~/Desktop/slowmotion1.MP4 -ss HH:MM:SS -t HH:MM:SS -sameq -vcodec libx264 /media/konrad/8765-4321/DCIM/143GOPRO/slowmotion-1.MP4
rm ~/Desktop/slowmotion1.MP4

It deletes the old long video too!

#Thanks and authors I would like to give a big hi5 to the following heros:

  • Hajo
  • Rayjan Wilson
  • The ffmpeg team
  • The ImageMagick team
  • The VideoLAN team
  • The Python team
  • And of course... Linus Torvalds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment