a screencap from dashcam footage showing a geyser erupting from a parking lot in Yellowstone National Park For the past year I’ve been running a slow-tv art project. It’s comprised of an immense trove of my own dashcam footage, plus a custom chatbot to interact with the footage. I’m writing this to announce that I’ve made the source code to Tripbot publicly available.

To interact with the bot, simply enter commands in the chat box on the Twitch channel.

What can the bot do?

Here are some of the things you can ask of Tripbot:

  • !location will tell you all about where we are driving, including a Google Maps link
  • !timewarp will jump to a random moment in the 250+ hours of footage
  • !date tells you the day the footage was recorded
  • !guess gives viewers an opportunity to guess what state we’re in, e.g. !guess CA guesses that we’re in California
  • !miles are a way to earn points for watching the stream… !leaderboard shows the users who have the most miles.

Future commands include !map (to display a map on the stream) and !temperature (to get information about the weather at the time of filming).

General architecture

a technical diagram showing how services interact

The project is composed of two main components: a bot process and a custom VLC process. They are both written in Golang, and they talk to one another over HTTP. The bot might ask the VLC process what video is currently playing? or it might say play this specific video.

Running alongside VLC is Open Broadcaster Software, or OBS. It’s an open-source, cross-platform streaming tool that has been a joy to use. Though getting OBS to work with my old graphics card on Linux consumed many hours of my life!

Also present (though not included in the diagram above) is a music server using MPD. You can think of it like a headless iTunes, through which the bot can control the currently-playing audio.

With these pieces in place we can begin to control the stream.

An example command flow

When a user types !location in chat, the flow looks something like this:

  1. Tripbot listens for messages in Twitch’s modified IRC channel
  2. He sees the user’s message and recognizes it as a command
  3. He fires off the function for that command, which:
    • asks the VLC server what video is currently playing
    • looks up that video in a SQL database
    • pulls out the GPS coordinates If the video isn’t in the DB, Tripbot will use OCR to read the coordinates off the corner of the video
  4. With the coordinates in hand, Tripbot replies to the user in Twitch chat


Thanks for visiting! I hope that gives you more context about how Tripbot works.

If you’re interested in learning more about the project, I wrote another article about the channel origins. If you’d like to help support the project, please consider subscribing for free with Twitch Prime.

Onward!

-Dana