---
title: "Speech Bubble Experiment | Scott Havird"
description: "Innovating on closed captions with AR-enhanced speech bubbles using React, AWS, and computer vision for a more engaging video viewing experience."
image: "https://scotthavird.com/img/og-image.png"
---

# Speech Bubble Experiment

April 6, 2020 · 3 min read

[![Scott Havird](https://avatars2.githubusercontent.com/u/4729905?s=400&u=4c11b0def5e57ac834638dfcc83451ecd35d008b&v=4)](/blog/authors/scott/)

[Scott Havird](/blog/authors/scott/)

Engineer at Georgia-Pacific · ex-WarnerMedia Innovation Lab (ContentAI) · decade shipping AI-powered platforms

[GitHub](https://github.com/scotthavird) [LinkedIn](https://www.linkedin.com/in/scott-havird-281a8ba/) [X](https://x.com/scotthavird) 

## Why

Closed captions have been around for awhile its time to try to innovate on them.

TL;DR

Experiment replacing traditional closed captions with AR-style speech bubbles anchored to the speaker. Built on React, AWS, and a computer-vision speaker-detection step — part of exploring more engaging and more accessible video captions.

## What

Speech bubbles are an experimental way to display what is commonly known as captions or subtitles. Using results from multiple AI services we can programmatically add speech bubbles to videos. This is a super rough poc where the intent is to just display what is possible.

## Video

  

_todo: The bubble jerkiness can be fixed, a smooth elastic like bubble movement would be ideal_

## How

Taking the results from ContentAI extractors aws\_transcribe, aws\_closed\_captions and aws\_faces and run them through the Box2d [physics engine](https://box2d.org/documentation/).

### ContentAI Extractors

-   **[aws\_transcribe](https://docs.aws.amazon.com/transcribe/latest/dg/what-is.html)**: Converts speech to text.
-   **aws\_closed\_captions(experiment)**: Takes the results from the aws\_transcribe extractor and creates .srt closed caption file.
-   **[aws\_faces](https://docs.aws.amazon.com/rekognition/latest/dg/faces.html)**: Detect bounding box, attributes, emotions, landmarks, quality, and the pose for each face.

### Box2d

Attach physics objects to characters faces.

-   **Face Body** - attach face body to characters face. Five frames a second, we take the position from `aws_faces` and update our physics face body.
-   **Speech Bubble Body** - we render the caption text onto the bubble body
-   **Fixed Revolute Joint** - we are connecting the face and speech bubble bodies with a joint. There are various types of Box2D joints, but for this poc will try to keep the two bodies equal distance apart using a revolute joint. As we update the position of the face body with the results from ContentAI the speech bubble bodies position is updated by the physics engine.

![Box2D physics diagram showing face body, speech bubble body, and revolute joint connection](/blog/speech-bubble-box2d-bodies.png)

## Future Ideas

-   **Customize bubble** - give brands and franchises the ability to customize their bubbles.
-   **Multiple language support** - our extractors can translate up to 32 different languages for global reach.
-   **Modify text size** - based on the characters emotion we can alter the text/font of individual words.
-   **Highlight spoken word** - with the millisecond granularity we can highlight words in the speech bubble as they are spoken.
-   **Typewriter effect** - with the millisecond granularity we can append the next word to the end of the line as it's being spoken.
-   **Multiple speaker support** - the experiment only supports one face.
-   **Enhance bubble movement** - the current bubble is limited in movement and is jerky. We can improve all current shortcomings.

## Use Cases

-   **Social media clips** - viewers tend to scroll past stuff within 3-5 seconds and typically have the audio turned off, speech bubbles could help grab their attention.
-   **Top Player Support** - we own the video player our customer facing products use, we could add speech bubbles to our player.

* * *

## Related Posts

-   [React Video Player and Konva](/blog/react-video-player-and-konva/) — Interactive video annotation and bounding box visualization
-   [Building Scalable Video Generation with Remotion and Docker](/blog/remotion-docker-template/) — Programmatic video generation pipelines

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "@id": "https://scotthavird.com/blog/speech-bubble-experiment",
  "mainEntityOfPage": "https://scotthavird.com/blog/speech-bubble-experiment",
  "url": "https://scotthavird.com/blog/speech-bubble-experiment",
  "headline": "Speech Bubble Experiment",
  "name": "Speech Bubble Experiment",
  "description": "Innovating on closed captions with AR-enhanced speech bubbles using React, AWS, and computer vision for a more engaging video viewing experience.",
  "datePublished": "2020-04-06T00:00:00.000Z",
  "author": {
    "@type": "Person",
    "name": "Scott Havird",
    "description": "Engineer at Georgia-Pacific · ex-WarnerMedia Innovation Lab (ContentAI) · decade shipping AI-powered platforms",
    "url": "https://scotthavird.com",
    "image": "https://avatars2.githubusercontent.com/u/4729905?s=400&u=4c11b0def5e57ac834638dfcc83451ecd35d008b&v=4"
  },
  "keywords": [
    "speech bubbles",
    "augmented reality",
    "closed captions",
    "computer vision",
    "React",
    "AWS",
    "video processing"
  ],
  "isPartOf": {
    "@type": "Blog",
    "@id": "https://scotthavird.com/blog",
    "name": "Scott Havird's Blog - AI & Technology Insights"
  }
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "@id": "https://scotthavird.com/blog/speech-bubble-experiment#article",
  "headline": "Speech Bubble Experiment",
  "description": "Innovating on closed captions with AR-enhanced speech bubbles using React, AWS, and computer vision for a more engaging video viewing experience.",
  "url": "https://scotthavird.com/blog/speech-bubble-experiment",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://scotthavird.com/blog/speech-bubble-experiment"
  },
  "author": {
    "@id": "https://scotthavird.com/#person"
  },
  "publisher": {
    "@id": "https://scotthavird.com/#person"
  },
  "datePublished": "2020-04-06T00:00:00.000Z",
  "dateModified": "2020-04-06T00:00:00.000Z",
  "image": "https://scotthavird.com/img/logo.svg",
  "keywords": "react, aws, computer vision, ar, launch, entrepreneur, story-telling",
  "articleSection": "react",
  "inLanguage": "en-US",
  "speakable": {
    "@type": "SpeakableSpecification",
    "cssSelector": [
      "h1",
      "h2",
      ".theme-admonition-tip"
    ]
  },
  "isPartOf": {
    "@type": "Blog",
    "name": "Scott Havird's Blog - AI & Technology Insights",
    "url": "https://scotthavird.com/blog"
  }
}
```
