GoMontage is a programmatic video editing framework for Go. Instead of reaching for a GUI editor, you describe your edit in code — trim clips, arrange tracks, layer audio, apply effects — and GoMontage compiles it into an FFmpeg command and renders it. If you can write Go, you can automate video production.
GoMontage has four layers that take your code all the way to a rendered video file:
- Clips — Load media with
clip.NewVideo(),clip.NewAudio(), etc. Clips are immutable; every transform (.Trim(),.WithVolume()) returns a new instance. - Timeline — Add clips to named video and audio tracks using
tl.AddVideoTrack(). Positioning is explicit:timeline.At(5 * time.Second)places a clip at the 5-second mark. - Compiler — When you call
tl.Export(), the Compiler walks the timeline and builds an FFmpeg filter graph — handling scaling, mixing, sequencing, and effects automatically. - Engine — The filter graph is handed to the Engine, which constructs the final FFmpeg command and runs it.
You write Go. GoMontage handles the FFmpeg.
- Go 1.25+
- FFmpeg & ffprobe installed and available in
PATH
go install github.com/ahmedhodiani/gomontage/cmd/gomontage@latestgomontage init my-video
cd my-videoThis creates the project structure with a starter main.go, config file, and folders for your media files.
Drop video, audio, and image files into resources/video/, resources/audio/, etc.
package main
import (
"time"
"github.com/ahmedhodiani/gomontage/clip"
"github.com/ahmedhodiani/gomontage/export"
"github.com/ahmedhodiani/gomontage/timeline"
)
func main() {
tl := timeline.New(timeline.Config{
Width: 1920,
Height: 1080,
FPS: 30,
})
video := clip.NewVideo("resources/video/footage.mp4")
trimmed := video.Trim(0, 30*time.Second)
main := tl.AddVideoTrack("main")
main.Add(trimmed, timeline.At(0))
tl.Export(export.YouTube1080p(), "output/final.mp4")
}gomontage run| Command | Description |
|---|---|
gomontage init <name> |
Scaffold a new project |
gomontage run |
Run main.go to render the video |
gomontage probe <file> |
Inspect media file metadata |
gomontage validate |
Validate the project config |
gomontage docs |
Generate API documentation into docs/ |
gomontage docsWrites a full markdown API reference and guides into the docs/ directory.
