Skip to main content

The ggindex video showcase

Making of the video showcasing the ggindex R package.
R
ggplot2
extensions
quarto
ffmpeg
video
Author
Published

2026-11-16

I figured it would be possible to turn a presentation to video so that the package highlight can be condensed in short watching. The documentation already had all the examples. Thus it was mostly stitching all things together: starting with a quarto revealjs file, ending with a video that even has music.

Overview

ggindex-showcase.qmd
  │  quarto render
  ▼
ggindex-showcase.html      revealjs deck
  │  chromium --headless --print-to-pdf  (?print-pdf&pdfSeparateFragments=true)
  ▼
deck.pdf                   one page per step
  │  pdftoppm
  ▼
frame-01.png …             1920×1080 images
  │  ffmpeg  (crossfades, fades, music)
  ▼
ggindex-showcase.mp4

The Video

The steps explained

All of this runs on Linux. I am not sure if it would run on Windows, MacOS is probably fine.

1. Render the deck

quarto render runs the R code and writes ggindex-showcase.html.

  • The slides are 1920×1080, the size of the video.
  • output-location: column-fragment in the yaml header puts the code and its plot side by side and shows them in two steps.
  • plot-first.html is a small JavaScript snippet that swaps the order, so the plot is shown first and the code appears next to it. The plot then stays on screen for both steps.

3. Turn PDF pages into images

pdftoppm writes each page as a 1920×1080 PNG.

4. Build the video

ffmpeg does the rest in a single filter graph:

  • Frames. Each PNG is shown for the given seconds per step.
  • Crossfades. Consecutive frames blend over 0.5 s (xfade).
  • Fades. The video fades in from white over 0.8 s and out to white over 1 s.
  • Music (optional):
    • The track is repeated as often as needed to cover the video. The copies are joined with a 1 s crossfade (acrossfade), so the restart is smooth.
    • It is cut to the video length, starting at the given start time (atrim).
    • It fades in over 1 s and out over the last 2 s.
  • Encoding. H.264 video and AAC audio in an MP4.

The music adapts to whatever length results.

The whole pipeline lives in github.com/discindo/ggindex-showcase/


See mode about ggindex on its website: discindo.github.io/ggindex/