Skip to content
Rollberry
Docs

Capturing Multiple Pages

Learn how to capture multiple web pages into a single video file or organize them into separate captures using batch workflows.

Overview#

Rollberry supports capturing multiple URLs in two ways:

  1. Native stitching: Provide multiple URLs to a single command to create one continuous video.
  2. Batch scripts: Use shell scripting to capture many pages as separate video files.

Native multi-page capture#

You can provide multiple URLs as positional arguments. Rollberry will capture them sequentially and stitch them into a single MP4 file:

rollberry capture \
  https://example.com \
  https://example.com/about \
  https://example.com/pricing \
  --out documentation.mp4

Adding pauses between pages#

Use the --page-gap option to add a static pause (in seconds) between each page capture. The video will hold on the last frame of the previous page before transitioning to the next:

# Add a 1.5-second pause between each URL
rollberry capture \
  https://site.com/page1 \
  https://site.com/page2 \
  --page-gap 1.5

Batch captures (separate files)#

If you need each page as an individual video file, use a shell script to invoke Rollberry multiple times.

Basic sequential captures#

rollberry capture https://example.com --out ./homepage.mp4
rollberry capture https://example.com/about --out ./about.mp4
rollberry capture https://example.com/pricing --out ./pricing.mp4

Loop-based batch capture#

For many pages, use a loop in a shell script:

#!/bin/bash
# capture-all.sh
 
BASE_URL="https://example.com"
PAGES=(
  "/"
  "/about"
  "/pricing"
  "/blog"
)
 
for page in "${PAGES[@]}"; do
  # Create a safe file name from the path
  file_name=$(echo "$page" | sed 's/\//-/g' | sed 's/^-//' | sed 's/-$//')
  file_name=${file_name:-"homepage"}
 
  echo "Capturing: ${BASE_URL}${page}"
  rollberry capture "${BASE_URL}${page}" \
    --viewport "1920x1080" \
    --out "./captures/${file_name}.mp4"
done

Multi-viewport captures#

A common use case is capturing the same page at different viewport sizes for responsive design review:

#!/bin/bash
# capture-responsive.sh
 
URL="$1"
if [ -z "$URL" ]; then
  echo "Usage: ./capture-responsive.sh <url>"
  exit 1
fi
 
declare -A VIEWPORTS=(
  ["desktop"]="1440x900"
  ["tablet"]="768x1024"
  ["mobile"]="390x844"
)
 
for name in "${!VIEWPORTS[@]}"; do
  size="${VIEWPORTS[$name]}"
  echo "Capturing ${name} (${size})..."
  rollberry capture "$URL" \
    --viewport "$size" \
    --out "./responsive/${name}.mp4"
done

Parallel captures#

If you need to capture many pages quickly, you can run captures in parallel. Keep in mind that each Rollberry instance launches its own browser, consuming memory and CPU.

#!/bin/bash
# capture-parallel.sh — Run up to 3 captures in parallel
 
MAX_PARALLEL=3
URLS=(
  "https://site.com/1"
  "https://site.com/2"
  "https://site.com/3"
  "https://site.com/4"
)
 
running=0
for url in "${URLS[@]}"; do
  # Background the command
  rollberry capture "$url" --out "./video-$(date +%s%N).mp4" &
  running=$((running + 1))
 
  if [ $running -ge $MAX_PARALLEL ]; then
    wait -n
    running=$((running - 1))
  fi
done
 
wait
echo "All parallel captures complete."

Keep in mind that each Rollberry instance launches its own browser, so parallel captures consume more memory. A limit of 3-4 concurrent captures is a reasonable starting point for most machines.