Skip to content
Anthony Amanse edited this page Sep 19, 2017 · 7 revisions

Short Name

Implement computer vision for PlayerUnkown’s Battlegrounds Live Streams

Short Description

Build a web application that uses Optical Character Recognition on the popular live streaming video platform Twitch.

Offering Type

Cloud

Introduction

PUBG Red Zone features an “always exciting” video stream of a player in the extremely popular multiplayer video game PlayerUnkown’s Battlegrounds. It performs optical character recognition on the live streams found in twitch.tv to identify which is the most exciting stream to watch.

Author

Spencer Krum, Cullen Taylor

Code

https://github.com/IBM/pubgredzone

Demo

Video

Overview

On twitch.tv and other websites, professional and regular computer players stream a live feed of their play. Hundreds and sometimes even thousands of people tune in to these streams live. At any given time, thousands of people are streaming on twitch.tv and hundreds of thousands of viewers are watching their streams.

Player Unknown's Battlegrounds is a first person or third person shooter game. 100 players spawn on an island, searching for loot and killing other players’ characters. No respawns. Only one player or team can win. Think hunger games meets call of duty. The problem is that part of this game is relatively boring.

Watching a steamer when they are close to winning (25 people or less alive) is very exciting. But watching a streamer when there are 90 or 80 or even 50 people alive is much less exciting. This journey shows you one of the many ways to implement computer vision to derive data from a video. You will learn how to set up this application locally or in containers. You will also dive into deployment in Kubernetes, a container orchestration platform.

PUBG Red Zone watches all the streams available on twitch.tv and switches between streams, showing the streams that are the most exciting. This webpage can be left on a second monitor, or on at TV in a lobby or sports bar.

Using computers to watch the entire streaming space for a game is a new thing only PUBG Red Zone does right now. Using algorithms to switch between the streams like a "virtual director" is another innovative step.

Flow

architecture-diagram

  1. The main application uses Twitch API to fetch the list of PlayerUnkown’s Battlegrounds streams. Livestreamer, an open source project, takes a short recording of each of those streams.
  2. FFmpeg is used to take a clip out of that short recording.
  3. That clip is then cropped with ImageMagick so that the image would only contain the number of players alive.
  4. The final image is then pushed to the OCR service which uses Tesseract, an open source Optical Character Recognition engine. This service will read the number on image.
  5. The translated data will be in a json block and received by the main application. The application will fetch another list of streams every 15 seconds.
  6. The user will see the current stream that has the least number of people alive. The front end is served by the main Node.js application. The user’s client will check every 15 seconds and switch if another stream is found to have a lesser number of players.

Included components

  • Kubernetes Clusters : Create and manage your own cloud infrastructure and use Kubernetes as your container orchestration engine.

Featured technologies

  • Container Orchestration : Automating the deployment, scaling and management of containerized applications.
  • Microservices : Collection of fine-grained, loosely coupled services using a lightweight protocol to provide building blocks in modern application composition in the cloud.
  • Node.js : An open-source JavaScript run-time environment for executing server-side JavaScript code.

Blog

Links

  • PlayerUnknown’s Battlegrounds Official Game Site: PlayerUnknown’s Battlegrounds is a multiplayer online battle royale video game developed by Bluehole
  • Tesseract OCR: Tesseract is an open source Optical Character Recognition engine.
  • PUBG Red Zone: The web application made by IBM Developer Advocates that shows the most exciting PlayerUnknown’s Battlegrounds streams from Twitch.