# Recoverable video encoding with Cloudflare Containers — Rill

Source: https://userill.dev/blog/cloudflare-containers-video-encoding

November 7, 2026 · The Rill Team

An eight-minute browser recording took about fifteen minutes to upload. Then the encoder ran out of disk space.

We had 16,791 images and the captured browser diagnostics. We still couldn’t watch the recording.

Rill records browser flows with console messages and request details so a teammate or coding agent can inspect what happened. When the video never becomes playable, part of that evidence is missing.

The failure led us to move remote video encoding off our shared browser-runner VM and into a three-slot Cloudflare Container pool. We also changed how we save progress. To test it, we killed an encoder during an upload.

## Two copies of the frames on one shared disk

Chrome had used Rill’s JPEG fallback. It captured images that our remote encoder would assemble into a video with FFmpeg.

The encoder ran on the same exe.dev VM as our browser runner. It downloaded the images as a bundle, then unpacked them into individual files. Both copies stayed on disk during unpacking.

About 716 MB of uploaded images needed roughly 1.43 GB for those two copies alone, before the encoded video and other work on the machine. The runner logged `ENOSPC` while writing the images. After cleanup, the disk was still 95% full.

We recovered the frames from Chrome and made a separate playable copy locally. It runs 8:14, with evenly spaced frames approximating the timing. The diagnostics remain with the original recording.

That recovered the footage. It also exposed a boundary we needed to change: browser execution and video assembly were competing for the same machine’s resources.

## Give encoding its own resources and save its progress

We moved the remote JPEG encoding used by Chrome’s fallback and the CLI into isolated Cloudflare Containers. The browser runner remains separate. Cloudflare Stream still prepares and serves the final video for playback.

The pipeline now works like this:

```
Chrome or CLI uploads images → private R2 storage
Job queue assigns an encoder → FFmpeg assembles the video
Finished video is saved in R2 → resumable upload to Stream → playback
```

Each encoder has two vCPUs, 8 GiB of memory, and 16 GB of temporary disk. We start it when there is work and stop it when idle. Our existing R2 storage and job database gave us somewhere to keep the recording outside that temporary environment. [Container specifications](https://developers.cloudflare.com/containers/platform/limits/)

The encoder saves the finished video in R2 before uploading it to Stream. If it dies during publication, a replacement can load the same video and continue the existing upload.

An upload checkpoint describes progress through a particular file. Saving the file alongside that progress lets another process resume it. A crash before the encoded video is saved can still require another FFmpeg run.

## Kill the encoder during an upload

We tested five jobs, then ten, in staging using synthetic captures and separate recording credentials. The ten-job burst spanned four test workspaces so it followed the normal admission limits.

Three jobs could run at once. The rest waited in the queue.

During the larger burst, we killed one encoder after Stream acknowledged exactly 16 MiB. The other slots finished nine recordings while the interrupted job waited for its ownership deadline to expire.

The replacement picked up the same recording, restored the saved video, and resumed the same Stream upload at that acknowledged offset. It did no additional FFmpeg encoding.

All ten recordings became playable. We opened them in Chrome and sought near the end to check that frames actually decoded. Captured diagnostics remained available, and uploaded source parts were cleaned up after success.

These were short synthetic captures whose uploads were already complete. The burst tested queue behavior and recovery after an encoder stopped.

We separately ran an incident-sized 716 MB capture and a ten-minute capture just below the 1 GiB source limit. Both reached playback on their first attempts. The larger capture also showed where the wait still was.

## More encoders do not make the upload smaller

The near-limit capture took 18 minutes and 34 seconds to upload, followed by 7 minutes and 51 seconds to reach playback. Reading the images from R2 took longer than FFmpeg encoding them.

Separating the encoders gives us a resource budget and room to process several jobs. It does not remove the cost of moving a large set of images.

Chrome already has a compressed WebM path that produces video during capture and bypasses this FFmpeg pool. Making that path reliable in the chat connection flow is separate work. A missing Chrome capture grant is our leading explanation for the fallback in the original take; that take did not retain the startup error.

## What is running in production

On November 7, we verified the VM rollback path, then checked Chrome’s JPEG fallback and the CLI recorder/upload path against the production pool. Both pool recordings reached private playback on their first attempts, with diagnostics and seekable video.

The Chrome check used the released extension. The CLI check exercised its shipping capture and upload functions through a verification harness that created a private test draft.

We opened the pool to eligible production jobs with three slots and the existing recording and workspace limits. Across eligible workspaces, five accepted jobs can mean three working and two waiting. Within one workspace, the separate admission limit still bounds pending work.

Running Containers on demand also gives us a cost we can measure per job. At current overage rates, ten awake minutes on this instance costs roughly 2.5–3.7 cents in compute, assuming one to two continuously active vCPUs. That is before included allowances and excludes R2, transfer, and Stream. Awake time includes more than FFmpeg and is different from footage duration. [Container pricing](https://developers.cloudflare.com/containers/platform/pricing/)

On November 19 we also moved the hosted browser runner and turned off the old VM services. We measured the wait for a fresh browser and its first image in [How we moved Rill’s hosted browsers from exe.dev to Cloudflare](https://userill.dev/blog/hosted-browsers-on-cloudflare).

If you use recordings to explain a browser bug or review a change, [record a short flow in your app with Rill for Chrome](https://userill.dev/chrome). Open the video, inspect the captured console messages and request details, then share it with the person investigating. Chrome recordings start private, so you can review before sharing.
