# Process video with Python

Use the rendobar package to call Rendobar's FFmpeg API, Compose API and every other job type from Python 3.10 or later, sync or asyncio. It waits for the output and verifies webhook signatures.

Official, built by Rendobar · v0.1.0 · MIT · Python 3.10+, sync and asyncio

Page: https://rendobar.com/integrations/python-sdk/ · View on PyPI: https://pypi.org/project/rendobar/ · Read the docs: https://rendobar.com/docs/quickstart

```
pip install rendobar
```

- Type: Python SDK
- Built by: Rendobar
- Package: `rendobar` on PyPI
- Version: 0.1.0, MIT licence
- Runs on: Python 3.10 to 3.13, sync and asyncio
- Pricing: Free
- Category: Code

## Overview

Install rendobar and every Rendobar job becomes a typed call from Python: [FFmpeg commands](https://rendobar.com/ffmpeg/), [timeline videos](https://rendobar.com/compose/), captions and AI images. `rb.jobs.run` submits a job and waits until it completes, fails or is cancelled, following the job's own time limit from your plan. A retried submit never creates a second job, because each `jobs.create` call carries one idempotency key across its retries. Errors are typed, from `NotFoundError` to `RateLimitError`, and each carries the request id support asks for. `AsyncRendobar` has the same methods for asyncio, and `rendobar.webhooks.verify` checks a delivery's signature.

## transcode.py

```python
from rendobar import Rendobar

with Rendobar() as rb:  # reads RENDOBAR_API_KEY
    # Each input name is a file the command reads with -i.
    job = rb.jobs.run({
        "type": "ffmpeg",
        "inputs": {"source.mp4": "https://cdn.rendobar.com/assets/examples/sample.mp4"},
        "params": {"command": "ffmpeg -i source.mp4 -vf scale=1280:-2 -c:v libx264 -crf 23 out.mp4"},
    })

# run() raises JobFailedError if the job fails, so this is a JobComplete.
print(job.output.files[0].url)  # signed URL of out.mp4
```

## Set up

1. **Install.** Add the package and put a [new API key](https://app.rendobar.com/api-keys?create=1&name=SDK) in `RENDOBAR_API_KEY`.

```bash
pip install rendobar
```

2. **Create a client.** Make one client and reuse it. It reads RENDOBAR_API_KEY and retries 429 and 5xx responses twice.

```python
rb = Rendobar()
```

3. **Run a job.** `rb.jobs.run` submits the job and returns it once it ends. It raises JobFailedError if the job fails.

```python
job = rb.jobs.run({"type": "ffprobe", "params": {"command": "https://cdn.rendobar.com/assets/examples/sample.mp4"}})
```


## Reference

### Package

- rendobar 0.1.0, MIT
- Python 3.10 to 3.13
- Sync Rendobar and asyncio AsyncRendobar

### Client

- Rendobar(api_key=None, base_url, timeout=30.0, max_retries=2, app, on_deprecation)
- api_key defaults to RENDOBAR_API_KEY

### Jobs

- rb.jobs.create(type, params, inputs, idempotency_key=...)
- rb.jobs.wait(job_id, timeout, on_progress, throw_on_failure)
- rb.jobs.run(type, params, inputs): create plus wait, raises on failure
- rb.jobs.get, list, list_all, cancel, download, types

### Errors

- RendobarError: code, status_code, request_id, details
- NotFoundError, RateLimitError, InsufficientCreditsError and more
- JobFailedError, WaitTimeoutError

### Also

- rendobar.webhooks.verify(body, headers, secret)
- UnknownJob for a status newer than the installed SDK

## Questions

### Which Python versions does the rendobar package support?

Python 3.10 to 3.13, each tested in CI. A version is dropped only after its end of life.

### Does the Python SDK support asyncio?

Yes. AsyncRendobar has the same methods as Rendobar, awaited, including jobs.run, jobs.wait and jobs.list_all as an async iterator.

### What happens when a submit is retried?

The SDK sends the same idempotency key on every retry of one jobs.create call, so the API returns the job the first attempt created instead of starting a second one.

### How do I verify a Rendobar webhook in Python?

Call `rendobar.webhooks.verify` with the raw body, the headers and your secret. It rejects deliveries older than 5 minutes and accepts the previous secret during a rotation.

## Resources

- [PyPI](https://pypi.org/project/rendobar/): rendobar, the published package and its version history.
- [GitHub](https://github.com/rendobar/rendobar-python): Source, issues and the conformance tests the SDK runs.
- [OpenAPI spec](https://api.rendobar.com/openapi.json): The OpenAPI 3.1 contract the SDK is generated from.

## More

- [FFmpeg recipes](https://rendobar.com/ffmpeg/recipes/)
- [The TypeScript SDK](https://rendobar.com/integrations/typescript-sdk/)