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

ASCII video and panorama


Jp2a video

AAlib video

Libcaca video

360 ASCII panorama

Software


Other ...


Hero4 black fisheye correction using kdenlive.

Linux to cifs/smb share rsync.

AMDGPU-PRO and Vega 56 setup on my Ubuntu 16.04.



Google+ Youtube 360Cities



ASCII images and video with libcaca.




Libcaca video:



http://youtu.be/2C7tGsTA5Og



HowTo.


Script - version 1.

5 or 6 fps. Simplified encoding without cropping and audio.

Could work out of the box ...

Important - Shell cripts are prepared for the Konsole, the default KDE terminal!


regulation-internal
  # This script is free software, and can be used, modified and
  # distributed under the terms of the GPL License: http://www.gnu.org/licenses/gpl.html .

  # name of video
  vid="ascii-train.mp4" ;

  aud=$( echo $vid | sed '1,$ s/^\(.*\)\.\(.*\)$/\1/' ) ;
  rm *.tga *.svg *.png *.html *.jpg *.tga *.log *.jpeg *.xwd ;

  ffmpeg -i $vid -r 25 -f image2 %7d.jpg ;

  for line in $( ls *.jpg )
  do
          #echo $line ;
          LibCaca=$( echo $line | sed '1,$ s/\.jpg//' ) ;

          nipe=$( echo $LibCaca | sed '1,$ s/......\(.\)/\1/' ) ;
          nipe1=$( echo $LibCaca | sed '1,$ s/\(......\)./\1/' ) ;

          if (( $LibCaca == "0000001" ))
          then
                  echo -n $line ;
                  img2txt -W 180 -H 54 -x 3 -y 5 $LibCaca.jpg -f html > _$LibCaca.html ;
                  cat _$LibCaca.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 120\%;\"/g' > $LibCaca.html ;
                  rm _$LibCaca.html ;
                  xvfb-run --server-args="-screen 0, 1280x1024x24" ./webkit2png.py -o $LibCaca.png $LibCaca.html ;

                  i=2 ;
                  while (( i < 5 ))
                  do
                          echo -n " "$i ;
                          cp $LibCaca.png $nipe1$i.png ;
                          echo -n " ... $nipe1$i" ;
                          i=$(( $i + 1 )) ;
                  done
          fi

          if (( $nipe == "0" ))
          then
                  echo -n $line ;
                  img2txt -W 180 -H 54 -x 3 -y 5 $LibCaca.jpg -f html > _$LibCaca.html ;
                  cat _$LibCaca.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 120\%;\"/g' > $LibCaca.html ;
                  rm _$LibCaca.html ;
                  xvfb-run --server-args="-screen 0, 1280x1024x24" ./webkit2png.py -o $LibCaca.png $LibCaca.html ;

                  i=1 ;
                  while (( $i < 5 )) ;
                  do
                          echo -n " "$i ;
                          cp $LibCaca.png $nipe1$i.png ;
                          echo -n " ... $nipe1$i" ;
                          i=$(( $i + 1 )) ;
                  done
                  echo "" ;
          fi

          if (( $nipe == "5" ))
          then
                  echo -n $line ;
                  img2txt -W 180 -H 54 -x 3 -y 5 $LibCaca.jpg -f html > _$LibCaca.html ;
                  cat _$LibCaca.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 120\%;\"/g' > $LibCaca.html ;
                  rm _$LibCaca.html ;
                  xvfb-run --server-args="-screen 0, 1280x1024x24" ./webkit2png.py -o $LibCaca.png $LibCaca.html ;

                  i=6 ;
                  while (( $i < 10 )) ;
                  do
                          echo -n " "$i ;
                          cp $LibCaca.png $nipe1$i.png ;
                          echo -n " ... $nipe1$i" ;
                          i=$(( $i + 1 )) ;
                  done
                  echo "" ;
          fi

  done

  mencoder mf://*.png -mf fps=25:type=png -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:vmax_b_frames=2:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2 -oac copy -o "$aud".avi
    



Top of Page


Script - version 2.

2.5 or 3 fps. Encoding with cropping and audio.

Final encoding will not work out of the box!

Please adjust parameter '-vf crop=1024:768:8:13' and prepare .mp3 audio (must have name as video file)!


  # This script is free software, and can be used, modified and
  # distributed under the terms of the GPL License: http://www.gnu.org/licenses/gpl.html .

  # name of video, audio file must be pre-prepared!
  vid="Small_marble_machine.flv" ;

  aud=$( echo $vid | sed '1,$ s/^\(.*\)\.\(.*\)$/\1/' ) ;
  rm *.tga *.svg *.png *.html *.jpg *.tga *.log *.jpeg *.xwd ;

  ffmpeg -i $vid -r 30 -s vga -f image2 %7d.jpg ;

  for line in $( ls *.jpg )
  do
          #echo $line ;
          ascii=$( echo $line | sed '1,$ s/\.jpg//' ) ;

          nipe=$( echo $ascii | sed '1,$ s/......\(.\)/\1/' ) ;
          nipe1=$( echo $ascii | sed '1,$ s/\(......\)./\1/' ) ;

          if (( $ascii == "0000001" ))
          then
                  echo -n $line ;
                  img2txt -W 128 -H 36 -x 3 -y 5 $ascii.jpg -f html > _$ascii.html ;
                  cat _$ascii.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 70\%;\"/g' > $ascii.html ;
                  rm _$ascii.html ;
                  xvfb-run --server-args="-screen 0, 1280x1024x24" ./webkit2png.py -o $ascii.png $ascii.html ;

                  i=2 ;
                  while (( i < 10 ))
                  do
                          cp $ascii.png $nipe1$i.png ;
                          echo -n " ... $nipe1$i" ;
                          i=$(( $i + 1 )) ;
                  done
          fi

          if (( $nipe == "0" ))
          then
                  echo -n $line ;
                  img2txt -W 128 -H 36 -x 3 -y 5 $ascii.jpg -f html > _$ascii.html ;
                  cat _$ascii.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 70\%;\"/g' > $ascii.html ;
                  rm _$ascii.html ;
                  xvfb-run --server-args="-screen 0, 1280x1024x24" ./webkit2png.py -o $ascii.png $ascii.html ;

                  i=1 ;
                  while (( $i < 10 )) ;
                  do
                          cp $ascii.png $nipe1$i.png ;
                          echo -n " ... $nipe1$i" ;
                          i=$(( $i + 1 )) ;
                  done
                  echo "" ;
          fi
  done

  mencoder -audiofile "$aud".mp3 mf://*.png -mf w=1024:h=768:fps=30:type=png -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:vmax_b_frames=2:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2 -vf crop=1024:768:8:13 -oac copy -o "$aud".avi
    


Top of Page