avutil

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package avutil is a wrapper around FFmpeg/release6.1. See: https://github.com/FFmpeg/FFmpeg/tree/release/6.1

Index

Constants

View Source
const (
	// EAGAIN Resource temporarily unavailable
	EAGAIN = -11
	// EOF End of file
	EOF = int(C.AVERROR_EOF)
	// Success no errors
	Success = 0
)

Variables

This section is empty.

Functions

func ErrorFromCode

func ErrorFromCode(code int) error

ErrorFromCode returns an error from the given code

func FrameMakeWritable

func FrameMakeWritable(f *Frame) int

FrameMakeWritable Ensure that the frame data is writable, avoiding data copy if possible.

Do nothing if the frame is writable, allocate new buffers and copy the data if it is not. Non-refcounted frames behave as non-writable, i.e. a copy is always made.

@return 0 on success, a negative AVERROR on error.

@see av_frame_is_writable(), av_buffer_is_writable(), av_buffer_make_writable()

func FrameUnref

func FrameUnref(f *Frame)

FrameUnref Unreference all the buffers referenced by frame and reset the frame fields.

func SetFrame

func SetFrame(f *Frame, w, h, pixFmt int) error

SetFrame sets the given frame from the given width (w), height (h), and pixel format (pixFmt)

Types

type Frame

type Frame C.struct_AVFrame

Frame an AVFrame

func FrameAlloc

func FrameAlloc() *Frame

FrameAlloc Allocate an AVFrame and set its fields to default values. The resulting struct must be freed using av_frame_free().

@return An AVFrame filled with default values or NULL on failure.

@note this only allocates the AVFrame itself, not the data buffers. Those must be allocated through other means, e.g. with av_frame_get_buffer() or manually.

func (*Frame) SetFrameFromImg

func (f *Frame) SetFrameFromImg(img *image.YCbCr)

SetFrameFromImg sets the frame from the given image.YCbCr

func (*Frame) SetFrameFromImgMacroAlign added in v0.20.0

func (f *Frame) SetFrameFromImgMacroAlign(img *image.YCbCr, boundary int)

SetFrameFromImgMacroAlign sets the frame from the given image.YCbCr adding line padding to the image to ensure that the data is aligned to the given boundary. For example see alignment requirements for the Raspberry Pi GPU codec: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c#L174

func (*Frame) SetFramePTS

func (f *Frame) SetFramePTS(pts int64)

SetFramePTS sets the presentation time stamp (PTS)

Jump to

Keyboard shortcuts

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