= watch 2
watch2 is a command line video player that uses the 'full block' unicode character colored by ansi sequences as pixels.
watch2 is the successor to my program watch that used the same basic principle.
It uses a go binding of the ffmpeg api, instead of starting ffmpeg as a child process.
This does not (at least on my machine) enable watch2 to play at higher resolutions or framerates, since printing to the terminal is still the slowest part, but I managed to vastly improve frame timing.
This means that watch2 can now play at least moderately long videos without loosing sync with the audio.
== Installation
In order to compile this program, you need to have link:https://golang.org/[Go] set up
. Let go download the source with `go get gitlab.com/0xDiddi/watch2`
. Navigate to the program directory (`$GOPATH/src/gitlab.com/0xDiddi/watch2`)
. Install the dependencies with `go get ./...`
. Checkout my fork of the go ffmpeg bindings
.. Navigate to the repository `$GOPATH/src/github.com/giorgisio/goav`
.. Add my fork as a remote `git remote add fork git@github.com:0xDiddi/goav.git`
.. Checkout the branch with my additions `git checkout misc-audio-bindings`
.. Navigate back to the watch2 repository
. Either:
.. Run directly with `go run main.go [options]`
.. Build in current directory with `go build main.go`
.. Have go 'install' it at `$GOPATH/bin` with `go install`
== Running it
watch2 takes a number of command line options:
`-i PATH`:: The path to the input video file.
This is required
`-a`:: Enables audio playback, default: false
`-w WIDTH`:: The output width, default 64
`-h HEIGHT`:: The output height, default 36
`-r RATE`:: The output framerate, default 15, must be equal or less than source video framerate
The default values for resolution and framerate are chosen based on the maximum I can run in my terminal (iTerm2 on macOS).
I encourage you to try and push these values in whatever terminal you are using.
== License
This program is published under the GNU GPL 3.0 License.