h264

package
v0.1.4721 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 4 Imported by: 0 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

Package h264 makes small H.264 videos of screen pictures, in pure Go: Constrained Baseline, every changed macroblock coded Intra 16x16 with CAVLC, every unchanged one skipped. It is built for a series of screenshots shown a second each, where most of a picture stays as it was, not for camera video.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

An Encoder takes pictures of one size, each with how long it is shown, and makes them a video.

func NewEncoder

func NewEncoder(w, h, qp int) (*Encoder, error)

NewEncoder is an encoder of w×h pictures at quantiser qp (0–51; lower is sharper and bigger).

func (*Encoder) Add

func (e *Encoder) Add(img image.Image, ms int)

Add encodes img, shown for ms milliseconds. A picture of another size is cut or padded at its right and bottom.

func (*Encoder) MP4

func (e *Encoder) MP4() []byte

MP4 is the pictures added so far as an MP4 file, its index first so a player can start before the whole file is read.

Jump to

Keyboard shortcuts

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