index.html

DIY 360 degree video


About my DIY 360 degree camcorder

Video rig and related stitching problems

360 video recording and synchronisation

Audio.

Auto vs Manual White Balance.

360 degree video assembling.

Preparing series of images.

Geometric template.

Shrinking images.

Stitching images to 360 video frames.

RAM disk as a working directory.

Coverting frames to a 360 video and publishing.

Multiblend on my Linux box

Software



Google+ Youtube 360Cities





Scripts for resizing images and adding transparent borders.




 # cd to a Rxx (it is R04 here ...) dir and remove all 1080x1920 .png images
    
  cd ~/home_/500_dir/R04
    
  oo@chip:~/home_/500_dir/R04$ pwd
  /home/oo/home_/500_dir
  
  rm ./*.png

  oo@chip:~/home_/500_dir$ ls
  R04.mp4
    
  # shrink while extracting frames, for example to 1072x1894, avconv

  avconv -i R04.mp4 -filter:v 'transpose=1' -s 1072x1894 -compression_level 0 ime_%d.png
  
  # or using the ffmpeg

  ffmpeg -i R04.mp4 -filter:v 'transpose=1' -s 1072x1894 -compression_level 0 ime_%d.png

  # add transparent borders
  
  for line in $( ls *.png ) ; do mv $line _$line ; convert _$line -background none -gravity center -extent 1080x1920 $line ; rm _$line  ; done
  
  # after a log time ...
  
  oo@chip:~/home_/500_dir$ ls
  R04.mp4 ime_1.png ime_2.png ... ime_2500.png ...
  
    



 # cd to a Rxx (it is R04 here ...) dir and remove all 1080x1920 .png images
    
  cd ~/home_/500_dir/R04
    
  oo@chip:~/home_/500_dir/R04$ pwd
  /home/oo/home_/500_dir
  
  rm ./*.png

  oo@chip:~/home_/500_dir$ ls
  R04.mp4
    
  # shrink while extracting frames, for example to 1072x1894, avconv

  avconv -i R04.mp4 -filter:v 'transpose=1' -s 1072x1894 -compression_level 0 ime_%d.png
  
  # or using the ffmpeg

  ffmpeg -i R04.mp4 -filter:v 'transpose=1' -s 1072x1894 -compression_level 0 ime_%d.png

  # add transparent borders
  
  for i in $( ls ime_*0.png ) ; do echo $i ;  mv $i _$i ; convert _$i -background none -gravity center -extent 1080x1920 $i ; rm _$i ; done &
  for j in $( ls ime_*1.png ) ; do echo $j ;  mv $j _$j ; convert _$j -background none -gravity center -extent 1080x1920 $j ; rm _$j ; done &
  for k in $( ls ime_*2.png ) ; do echo $k ;  mv $k _$k ; convert _$k -background none -gravity center -extent 1080x1920 $k ; rm _$k ; done &
  for l in $( ls ime_*3.png ) ; do echo $l ;  mv $l _$l ; convert _$l -background none -gravity center -extent 1080x1920 $l ; rm _$l ; done &
  for m in $( ls ime_*4.png ) ; do echo $m ;  mv $m _$m ; convert _$m -background none -gravity center -extent 1080x1920 $m ; rm _$m ; done &
  for n in $( ls ime_*5.png ) ; do echo $n ;  mv $n _$n ; convert _$n -background none -gravity center -extent 1080x1920 $n ; rm _$n ; done &
  for o in $( ls ime_*6.png ) ; do echo $o ;  mv $o _$o ; convert _$o -background none -gravity center -extent 1080x1920 $o ; rm _$o ; done &
  for p in $( ls ime_*7.png ) ; do echo $p ;  mv $p _$p ; convert _$p -background none -gravity center -extent 1080x1920 $p ; rm _$p ; done &
  for r in $( ls ime_*8.png ) ; do echo $r ;  mv $r _$r ; convert _$r -background none -gravity center -extent 1080x1920 $r ; rm _$r ; done &
  for s in $( ls ime_*9.png ) ; do echo $s ;  mv $s _$s ; convert _$s -background none -gravity center -extent 1080x1920 $s ; rm _$s ; done &
  
  # after some time ...
  
  oo@chip:~/home_/500_dir$ ls
  R04.mp4 ime_1.png ime_2.png ... ime_2500.png ...
  
    



  # it can be saved to a file, named 'www' f.e. 
    
  # execute this file on the directory with .png images
  # ksh ./www
  
  for i in $( ls ime_*0.png ) ; do echo $i ;  mv $i _$i ; convert _$i -background none -gravity center -extent 1080x1920 $i ; rm _$i ; done &
  for j in $( ls ime_*1.png ) ; do echo $j ;  mv $j _$j ; convert _$j -background none -gravity center -extent 1080x1920 $j ; rm _$j ; done &
  for k in $( ls ime_*2.png ) ; do echo $k ;  mv $k _$k ; convert _$k -background none -gravity center -extent 1080x1920 $k ; rm _$k ; done &
  for l in $( ls ime_*3.png ) ; do echo $l ;  mv $l _$l ; convert _$l -background none -gravity center -extent 1080x1920 $l ; rm _$l ; done &
  for m in $( ls ime_*4.png ) ; do echo $m ;  mv $m _$m ; convert _$m -background none -gravity center -extent 1080x1920 $m ; rm _$m ; done &
  for n in $( ls ime_*5.png ) ; do echo $n ;  mv $n _$n ; convert _$n -background none -gravity center -extent 1080x1920 $n ; rm _$n ; done &
  for o in $( ls ime_*6.png ) ; do echo $o ;  mv $o _$o ; convert _$o -background none -gravity center -extent 1080x1920 $o ; rm _$o ; done &
  for p in $( ls ime_*7.png ) ; do echo $p ;  mv $p _$p ; convert _$p -background none -gravity center -extent 1080x1920 $p ; rm _$p ; done &
  for r in $( ls ime_*8.png ) ; do echo $r ;  mv $r _$r ; convert _$r -background none -gravity center -extent 1080x1920 $r ; rm _$r ; done &
  for s in $( ls ime_*9.png ) ; do echo $s ;  mv $s _$s ; convert _$s -background none -gravity center -extent 1080x1920 $s ; rm _$s ; done &
  
    


Top of Page