Process video with Go
Use the rendobar-go module to call Rendobar's FFmpeg API, Compose API and every other job type from Go. It waits for the output and verifies webhook signatures.
rb := rendobar.New() // reads RENDOBAR_API_KEY
// Each input name is a file the command reads with -i.job, err := rb.Jobs.Run(ctx, rendobar.CreateParams{ Params: rendobar.FfmpegParams{Command: "ffmpeg -i source.mp4 -vf scale=1280:-2 out.mp4"}, Inputs: map[string]rendobar.Input{"source.mp4": rendobar.URL("https://cdn.rendobar.com/assets/examples/sample.mp4")},}, nil)if err != nil { return err // a failed job is a *rendobar.JobFailedError}fmt.Println(job.Complete.Output.File.URL) // signed URL of out.mp4Overview
rendobar-go makes every Rendobar job a call from Go: FFmpeg commands, timeline videos, captions and AI images. Jobs.Run submits a job and waits until it ends, following the job's own time limit from your plan. A retried submit never creates a second job, because each Jobs.Create call sends one idempotency key on every retry. Errors are *rendobar.Error with the code, status and the request id support asks for, and Jobs.All ranges over every job with Go's iterators. The webhooks package checks a delivery's signature with the standard library only.
Set up
Install
Add the module and put a new API key in
RENDOBAR_API_KEY.go get github.com/rendobar/rendobar-goCreate a client
Make one client and reuse it across goroutines. It retries 429 and 5xx responses twice, honouring Retry-After.
rb := rendobar.New()Run a job
Jobs.Runreturns the finished job. A failed job comes back as*rendobar.JobFailedErrorwith the job attached.job, err := rb.Jobs.Run(ctx, rendobar.CreateParams{Params: rendobar.FfprobeParams{Command: url}}, nil)
Questions
Which Go versions does rendobar-go support?
The two newest Go releases, the same window Go itself supports. CI runs on both.
How do I tell a missing job from other errors in Go?
Use rendobar.IsNotFound(err), or errors.As(err, &apiErr) with a *rendobar.Error to read its code, status and request id.
How do I verify a Rendobar webhook in Go?
Read the raw body and call webhooks.Verify(body, r.Header, secret). It rejects deliveries older than 5 minutes and accepts the previous secret during a rotation.
Related
- TypeScript SDK Submit any job and await the finished file with one typed call.
- Python SDK Run any job from Python, sync or asyncio, with typed errors.
- NestJS Inject a Rendobar client and guard your webhook routes.
