Differences between revisions 5 and 6
Revision 5 as of 2012-05-24 08:30:50
Size: 1084
Editor: SamatJain
Comment: Switch to GraphicsMagick (much more performance); switch to chop instead of crop (slightly more performant)
Revision 6 as of 2012-10-03 20:42:31
Size: 1505
Editor: SamatJain
Comment: Add copy & pasteable batch commands for LDR tone mapping and encoding
Deletions are marked like this. Additions are marked like this.
Line 31: Line 31:
batch:

{{{
for i in $(ls); do (cd $i; parallel -u 'echo {}; ~/sys/tonemap/tonemapping ~/sys/tonemap/default.tnp {} {}.tonemapped && mv {}.tonemapped {}' ::: *.JPG); done;
}}}
Line 36: Line 42:

batch:

{{{
for i in $(ls); do (cd $i; mencoder mf://*.JPG -mf fps=15:type=jpg -ovc lavc -oac lavc -of lavf -lavfopts format=webm -lavcopts threads=4:acodec=vorbis:vcodec=libvpx -ffourcc VP80 -o $(basename $(pwd)).webm); done;
}}}

Rotate

If the camera was recording in "upside down" mode:

parallel -u 'echo {}; jpegtran -rotate 180 -perfect -copy all -outfile {}.tran {} && mv {}.tran {}' ::: *.jpg

Resize & crop

   1 # Crop top
   2 find . -name '*JPG' -print0 | xargs -0 -P2 -n8 gm mogrify -chop 0x486 -resize 1920x1080
   3 # or Crop bottom
   4 find . -name '*JPG' -print0 | xargs -0 -P2 -n8 gm mogrify -gravity South -chop 0x486 -resize 1920x1080

For the GoPro HD Hero 2:

   1 # Crop top
   2 find . -name '*JPG' -print0 | xargs -0 -P2 -n8 mogrify -crop 3840x2880+0+720 -resize 1920x1080

LDR tone mapping

parallel -u 'echo {}; ~/sys/tonemap/tonemapping ~/sys/tonemap/default.tnp {} {}.tonemapped && mv {}.tonemapped {}' ::: *.JPG

batch:

for i in $(ls); do (cd $i; parallel -u 'echo {}; ~/sys/tonemap/tonemapping ~/sys/tonemap/default.tnp {} {}.tonemapped && mv {}.tonemapped {}' ::: *.JPG); done;

Encode to WebM

mencoder mf://*.JPG -mf fps=15:type=jpg -ovc lavc -oac lavc -of lavf -lavfopts format=webm -lavcopts threads=4:acodec=vorbis:vcodec=libvpx -ffourcc VP80 -o $(basename $(pwd)).webm

batch:

for i in $(ls); do (cd $i; mencoder mf://*.JPG -mf fps=15:type=jpg -ovc lavc -oac lavc -of lavf -lavfopts format=webm -lavcopts threads=4:acodec=vorbis:vcodec=libvpx -ffourcc VP80 -o $(basename $(pwd)).webm); done;

SamatsWiki: GoPro (last edited 2017-04-14 09:43:49 by SamatJain)