index.html

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.



Google+ Youtube 360Cities

regulation-internal


ASCII images and video with jp2a.




Jp2a video:



http://youtu.be/7t9YCcd6DR4




Top of Page


HowTo.



Top of Page


Script - version 1.

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

Might it work out of the box? (...)


  # 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 .

  vid="ascii-train.mp4" ;

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

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

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

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

          if (( $Jp2A == "0000001" ))
          then
                  echo -n $line ;
                  jp2a --width=200 --height=84 --background=light --colors --html-fontsize=10 $Jp2A.jpg --html > _$Jp2A.html ;
                  cat _$Jp2A.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 65\%;\"/g' > $Jp2A.html ;
                  rm _$Jp2A.html ;
                  xvfb-run --server-args="-screen 0, 1680x1200x24" ./webkit2png.py -o $Jp2A.JPG $Jp2A.html ;

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

          if (( $nipe == "0" ))
          then
                  echo -n $line ;
                  jp2a --width=200 --height=84 --background=light --colors --html-fontsize=10 $Jp2A.jpg --html > _$Jp2A.html ;
                  cat _$Jp2A.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 65\%;\"/g' > $Jp2A.html ;
                  rm _$Jp2A.html ;
                  xvfb-run --server-args="-screen 0, 1680x1200x24" ./webkit2png.py -o $Jp2A.JPG $Jp2A.html ;

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

          if (( $nipe == "5" ))
          then
                  echo -n $line ;
                  jp2a --width=200 --height=84 --background=light --colors --html-fontsize=10 $Jp2A.jpg --html > _$Jp2A.html ;
                  cat _$Jp2A.html | sed '1,$ s/body/body style=\"font-size: 100\%;line-height: 65\%;\"/g' > $Jp2A.html ;
                  rm _$Jp2A.html ;
                  xvfb-run --server-args="-screen 0, 1680x1200x24" ./webkit2png.py -o $Jp2A.JPG $Jp2A.html ;

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

  done

  mencoder mf://*.JPG -mf fps=25:type=JPG -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, I'm sure about ...

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


  # 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 .

  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 ;
                  jp2a --width=128 --height=64 --background=light --colors --grayscale --html-fontsize=10 $ascii.jpg --html > _$ascii.html ;
                  cat _$ascii.html | sed '1,$ s/body/body style=\"font-size: 130\%;line-height: 60\%;\"/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 ;
                  jp2a --width=128 --height=64 --background=light --colors --grayscale --html-fontsize=10 $ascii.jpg --html > _$ascii.html ;
                  cat _$ascii.html | sed '1,$ s/body/body style=\"font-size: 130\%;line-height: 60\%;\"/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