MovieGo's Sequence (used for crossfades) enforces that all clips sharing a
transition have identical pixel dimensions:
composite/transition.go:81
if a.Size() != b.Size() { return ErrTransitionSize }
Our resize logic computes newW = srcW * targetH / srcH per image. Different
source aspect ratios produce slightly different integer widths (1613–1620px),
which causes crossfades to fail at runtime.
After resizing to target height, pad narrower images to exact target width
with black bars so every output image is exactly targetW × targetH.
// After BiLinear.Scale(...)
if newW < targetW {
padded := image.NewRGBA(image.Rect(0, 0, targetW, targetH))
draw.Draw(padded, padded.Bounds(), &image.Uniform{color.Black}, image.Point{}, draw.Src)
draw.Draw(padded, dst.Bounds(), dst, image.Point{}, draw.Src)
dst = padded
}Also add "image/color" back to imports for color.Black.
| # | Action | Detail |
|---|---|---|
| 1 | Install ffmpeg | sudo apt-get install -y ffmpeg |
| 2 | Clean stale resized | rm -rf /home/chaschel/Documents/go/teaser/resized |
| 3 | Fix main.go |
Add padding step + "image/color" import |
| 4 | Build | go build -o teaser . |
| 5 | Run encode | ./teaser -src /home/chaschel/Documents/odyssey -step 4 |
| 6 | Verify | Check teaser.mp4 duration and file size |
- MovieGo source:
/home/chaschel/Documents/go/moviego-main - Transition size constraint:
composite/transition.go:81 ConcatComposehandles mixed sizes by centering on max canvas (composite/concat.go)- But
Sequence→ConcatChainrequires same-size clips for transitions