index.html
AAlib
Libcaca
Jp2a
ASCII panorama
CCD sensor 1080 video

* This site does not use cookies and scripts. Continue with a visit if you agree.



ASCII images and video with AAlib.








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

  v ;

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

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

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

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

          if (( $AaLib == "0000001" ))
          then
                  echo -n $line ;
                  AaLib=$( echo $line | sed '1,$ s/\.jpg//' ) ;
                  asciiview $AaLib.jpg &
                  sleep 1 ;
                  wmctrl -r "aa for X" -e 0,0,0,1664,936 ;
                  sleep 1 ;
                  afx="" ;
                  afx=$(xwininfo -tree -root | grep "aa for X" | sed '1,$ s/\( *\)\(.\)x\(.*\) "\(.*\)$/\2x\3/' ) ;
                  xwd -id $afx -out $AaLib.xwd ;
                  convert $( echo $AaLib".xwd" ) $( echo $AaLib".JPG" ) ;
                  kill -9 $( ps -C aview -o pid= ) > /dev/null 2>&1 ;

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

          if (( $nipe == "0" ))
          then
                  echo -n $line ;
                  AaLib=$( echo $line | sed '1,$ s/\.jpg//' ) ;
                  asciiview $AaLib.jpg &
                  sleep 1 ;
                  wmctrl -r "aa for X" -e 0,0,0,1664,936 ;
                  sleep 1 ;
                  afx="" ;
                  afx=$(xwininfo -tree -root | grep "aa for X" | sed '1,$ s/\( *\)\(.\)x\(.*\) "\(.*\)$/\2x\3/' ) ;
                  xwd -id $afx -out $AaLib.xwd ;
                  convert $( echo $AaLib".xwd" ) $( echo $AaLib".JPG" ) ;
                  kill -9 $( ps -C aview -o pid= ) > /dev/null 2>&1 ;

                  i=1 ;
                  while (( $i < 5 )) ;
                  do
                          echo -n " "$i ;
                          cp $AaLib.JPG $nipe1$i.JPG ;
                          echo -n " ... $nipe1$i" ;
                          i=$(( $i + 1 )) ;
                  done
                  echo "" ;
          fi
          
          if (( $nipe == "5" ))
          then
                  echo -n $line ;
                  AaLib=$( echo $line | sed '1,$ s/\.jpg//' ) ;
                  asciiview $AaLib.jpg &
                  sleep 1 ;
                  wmctrl -r "aa for X" -e 0,0,0,1664,936 ;
                  sleep 1 ;
                  afx="" ;
                  afx=$(xwininfo -tree -root | grep "aa for X" | sed '1,$ s/\( *\)\(.\)x\(.*\) "\(.*\)$/\2x\3/' ) ;
                  xwd -id $afx -out $AaLib.xwd ;
                  convert $( echo $AaLib".xwd" ) $( echo $AaLib".JPG" ) ;
                  kill -9 $( ps -C aview -o pid= ) > /dev/null 2>&1 ;

                  i=6 ;
                  while (( $i < 10 )) ;
                  do
                          echo -n " "$i ;
                          cp $AaLib.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  

          



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

  v ;

  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 ;
                  asciiview $ascii.jpg &
                  sleep 1 ;
                  wmctrl -r "aa for X" -e 0,0,0,1024,768 ;
                  sleep 1 ;
                  afx="" ;
                  afx=$(xwininfo -tree -root | grep "aa for X" | sed '1,$ s/\( *\)\(.\)x\(.*\) "\(.*\)$/\2x\3/' ) ;
                  xwd -id $afx -out $ascii.xwd ;
                  convert $( echo $ascii".xwd" ) $( echo $ascii".png" ) ;
                  kill -9 $( ps -C aview -o pid= ) ;

                  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 ;
                  asciiview $ascii.jpg &
                  sleep 1 ;
                  wmctrl -r "aa for X" -e 0,0,0,1024,768 ;
                  sleep 1 ;
                  afx="" ;
                  afx=$(xwininfo -tree -root | grep "aa for X" | sed '1,$ s/\( *\)\(.\)x\(.*\) "\(.*\)$/\2x\3/' ) ;
                  xwd -id $afx -out $ascii.xwd ;
                  convert $( echo $ascii".xwd" ) $( echo $ascii".png" ) ;
                  kill -9 $( ps -C aview -o pid= ) ;

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

  killall aview ;

  mencoder -audiofile "$aud".mp3 mf://*.png -mf w=1024:h=768:fps=30:type=xvd -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