Opus Motion ★ Star on GitHub

Camera · auto-frame-camera

Auto-frame camera

Self-framing camera for build-up diagrams: as blocks are added the isometric scene pans and zooms (0.7 s easeInOutCubic) so the current assembly always fills the viewport with a constant margin, while the header and readouts never move. Dashed guides show the margin box and the content bounds.

A free, MIT-licensed camera effect from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

Auto-frame camera: three frames of the camera effect, start, middle and end
Auto-frame camera — start, middle and end of the 8.0-second motion.

What Auto-frame camera is for

Keeps any multi-step build-up diagram readable without hand-keyed cameras; the same `fitCamera` / `autoFrameAt` helpers (src/core/r2-x58-kit.tsx) drive any step-based motion.

  • camera
  • auto-frame
  • framing
  • zoom
  • pan
  • isometric
  • diagram
  • build-up
  • architecture
  • steps
  • bounding-box
  • margin
  • explainer
  • helper

Details

Category
Camera moves & lens effects
Length
8.0 s (240 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
no
Seamless loop
no
Text props
—
Colour props
background palette
Mood
3d
Roles
subject

Use Auto-frame camera in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add auto-frame-camera --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render auto-frame-camera --props '{"background":"#F4ECDB","palette":["#4D588A","#21A69A","#E5A24C","#C56E60","#3F64B5","#7A8FC6","#6FB36F"]}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export auto-frame-camera --as mp4 --props '{"background":"#F4ECDB","palette":["#4D588A","#21A69A","#E5A24C","#C56E60","#3F64B5","#7A8FC6","#6FB36F"]}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="auto-frame-camera"
  props={{
    background: '#F4ECDB',
    palette: [
      '#4D588A',
      '#21A69A',
      '#E5A24C',
      '#C56E60',
      '#3F64B5',
      '#7A8FC6',
      '#6FB36F',
    ],
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="auto-frame-camera"
  props='{"background":"#F4ECDB","palette":["#4D588A","#21A69A","#E5A24C","#C56E60","#3F64B5","#7A8FC6","#6FB36F"]}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "auto-frame-camera",
      "props": {
        "background": "#F4ECDB",
        "palette": [
          "#4D588A",
          "#21A69A",
          "#E5A24C",
          "#C56E60",
          "#3F64B5",
          "#7A8FC6",
          "#6FB36F"
        ]
      }
    }
  ]
}

Auto-frame camera props

14 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
steps[{"title":"One client","blocks":[{"id":"client","label":"Client","x":0,"y":0,"w":3,"d":…array of {title, blocks:[{id,label,x,y,w,d,h,color}], links:[{from,to}]}; blocks are diffed by id between steps
stepAt[0,55,110,170]start frame of each step (the camera starts moving here)
margin0.08margin around the content as a fraction of the viewport
frames21re-frame duration in frames (0.6-0.8 s)
minScale0.4smallest zoom
maxScale3largest zoom
guidestrueshow the dashed margin box and content bounds
zoomReadouttrueshow the live zoom pill
header"Auto frame"top bar word
background"#F4ECDB"paper colour
palette["#4D588A","#21A69A","#E5A24C","#C56E60","#3F64B5","#7A8FC6","#6FB36F"]block colours
zoomLabel"ZOOM"word before the zoom value in the readout pill
marginLabel"margin box"legend text for the orange margin guide ("- - " is prefixed)
boundsLabel"content bounds"legend text for the teal content-bounds guide ("- - " is prefixed)

Notes & credits

Technique sources:

  • video x8 0:01.0-0:01.8, 0:54.3-0:54.75