encode-avatar

command
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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