Thursday, August 16, 2012: Playing with mplayer and caca

I’m giving my friend a JavaScript and Node.js crash course through Skype, using ttycast to stream my live terminal session through to friend. Then I talked to him about what command-line apps can do: browsing the web, installing software, chatting, and watching movies right inside a Terminal!

I’m giving my friend a JavaScript and Node.js crash course through Skype, using ttycast to stream my live terminal session through to friend.

After teaching, I talked to him about what Terminal apps can do, such as:

  • Using find to convert all .wav files in current and subdirectory to .ogg file and delete the original wav files.
  • Using brew to quickly install software.
  • Browsing the web with elinks.
  • Chatting on Facebook using finch.
  • Playing music using mplayer (he hears it through Skype)

And finally, playing movies on a Terminal!

Sintel © copyright Blender Foundation | www.sintel.org

First, rebuild mplayer with libcaca.

brew unlink mplayer
brew uninstall mplayer
brew install libcaca
brew install mplayer

And then, stream the movie (thanks to this post)

CACA_DRIVER=ncurses mplayer \
    -vf framestep=10 -vo caca -quiet \
    sintel-2048-surround.mp4

-vf framestep=10 tells mplayer to update every 10 frames so the movie doesn’t flicker too much. -vo caca tells mplayer to output as a colored ASCII art. Finally, -quiet tells mplayer not to display the current playing stats every frame, which interferes with the terminal output.


Last but not least, I opened up VLC and streamed from iSight through network, and then told mplayer to stream from it: