encode-avatar

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Command encode-avatar pre-encodes an image as H.264 for use as a static avatar.

This tool converts PNG/JPEG images to H.264 keyframes that can be used by the voice agent without requiring CGO at runtime.

Usage:

# Basic encoding (uses original image dimensions)
go run ./cmd/encode-avatar -input avatar.png -output avatar.h264

# Resize to specific dimensions
go run ./cmd/encode-avatar -input avatar.png -output avatar.h264 -width 320 -height 320

# Embed in 16:9 canvas (recommended for LiveKit)
go run ./cmd/encode-avatar -input avatar.png -output avatar.h264 -canvas h360
go run ./cmd/encode-avatar -input avatar.png -output avatar.h264 -canvas 640x360 -bg black

Canvas presets (16:9 aspect ratio):

h180  = 320x180
h360  = 640x360   (recommended)
h540  = 960x540
h720  = 1280x720

The output .h264 file can be committed to your repository and loaded at runtime without any encoding dependencies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL