Showing preview only (2,289K chars total). Download the full file or copy to clipboard to get everything.
Repository: asticode/go-astiav
Branch: master
Commit: 3a5456442686
Files: 197
Total size: 28.3 MB
Directory structure:
gitextract_kmu419_u/
├── .devcontainer/
│ ├── Dockerfile
│ └── devcontainer.json
├── .github/
│ └── workflows/
│ ├── Makefile
│ ├── test.yml
│ └── windows.patch
├── .gitignore
├── .vscode/
│ ├── .gitignore
│ └── c_cpp_properties.json
├── BREAKING_CHANGES.md
├── LICENSE
├── README.md
├── astiav.go
├── astiav_test.go
├── atomic.c
├── atomic.h
├── audio_fifo.go
├── audio_fifo_test.go
├── bit_stream_filter.go
├── bit_stream_filter_context.go
├── bit_stream_filter_context_test.go
├── bit_stream_filter_test.go
├── buffersink_filter_context.go
├── buffersink_flag.go
├── buffersrc_filter_context.go
├── buffersrc_filter_context_parameters.go
├── buffersrc_filter_context_parameters_test.go
├── buffersrc_filter_context_test.go
├── buffersrc_flag.go
├── bytes.go
├── bytes_test.go
├── channel_layout.go
├── channel_layout.h
├── channel_layout_test.go
├── chroma_location.go
├── class.c
├── class.go
├── class.h
├── class_category.go
├── class_test.go
├── codec.go
├── codec_context.c
├── codec_context.go
├── codec_context.h
├── codec_context_flag.go
├── codec_context_test.go
├── codec_hardware_config.go
├── codec_hardware_config_method_flag.go
├── codec_id.go
├── codec_id_test.go
├── codec_parameters.go
├── codec_parameters_test.go
├── codec_tag.go
├── codec_test.go
├── color_primaries.go
├── color_range.go
├── color_range_test.go
├── color_space.go
├── color_space_test.go
├── color_transfer_characteristic.go
├── device.go
├── device_test.go
├── dictionary.go
├── dictionary_entry.go
├── dictionary_flag.go
├── dictionary_test.go
├── discard.go
├── display_matrix.go
├── display_matrix_test.go
├── disposition_flag.go
├── error.go
├── error_recognition_flag.go
├── error_test.go
├── examples/
│ ├── bit_stream_filtering/
│ │ └── main.go
│ ├── custom_io_demuxing/
│ │ └── main.go
│ ├── custom_io_muxing/
│ │ └── main.go
│ ├── demuxing_decoding/
│ │ └── main.go
│ ├── filtering/
│ │ └── main.go
│ ├── frame_data_manipulation/
│ │ └── main.go
│ ├── hardware_decoding_filtering/
│ │ └── main.go
│ ├── hardware_encoding/
│ │ └── main.go
│ ├── remuxing/
│ │ └── main.go
│ ├── resampling_audio/
│ │ └── main.go
│ ├── scaling_video/
│ │ └── main.go
│ └── transcoding/
│ └── main.go
├── filter.go
├── filter_chain.go
├── filter_command_flag.go
├── filter_context.go
├── filter_flag.go
├── filter_graph.go
├── filter_graph_segment.go
├── filter_graph_test.go
├── filter_in_out.go
├── filter_pad.go
├── filter_params.go
├── filter_test.go
├── flags.go
├── flags_test.go
├── format_context.go
├── format_context_ctx_flag.go
├── format_context_flag.go
├── format_context_test.go
├── format_event_flag.go
├── frame.c
├── frame.go
├── frame.h
├── frame_data.go
├── frame_data_test.go
├── frame_flag.go
├── frame_side_data.c
├── frame_side_data.go
├── frame_side_data.h
├── frame_side_data_test.go
├── frame_test.go
├── go.mod
├── go.sum
├── hardware_device_context.go
├── hardware_device_type.go
├── hardware_device_type_test.go
├── hardware_frames_constraints.go
├── hardware_frames_context.go
├── input_format.go
├── input_format_test.go
├── internal/
│ └── cmd/
│ └── flags/
│ └── main.go
├── io_context.c
├── io_context.go
├── io_context.h
├── io_context_flag.go
├── io_context_test.go
├── io_format_flag.go
├── io_interrupter.c
├── io_interrupter.go
├── io_interrupter.h
├── io_interrupter_test.go
├── level.go
├── log.c
├── log.go
├── log.h
├── log_test.go
├── macros.c
├── macros.h
├── mathematics.go
├── mathematics_test.go
├── media_type.go
├── media_type_test.go
├── option.c
├── option.go
├── option.h
├── option_search_flag.go
├── option_test.go
├── output_format.go
├── output_format_test.go
├── packet.go
├── packet_flag.go
├── packet_side_data.go
├── packet_side_data_test.go
├── packet_test.go
├── picture_type.go
├── picture_type_test.go
├── pixel_format.go
├── pixel_format_descriptor.go
├── pixel_format_descriptor_flag.go
├── pixel_format_descriptor_test.go
├── pixel_format_test.go
├── private_data.go
├── profile.go
├── program.go
├── program_test.go
├── rational.go
├── rational_test.go
├── region_of_interest.go
├── rounding.go
├── sample_format.go
├── sample_format_test.go
├── seek_flag.go
├── skip_samples.go
├── skip_samples_test.go
├── software_resample_context.go
├── software_resample_context_test.go
├── software_scale_context.go
├── software_scale_context_flag.go
├── software_scale_context_test.go
├── stream.go
├── stream_event_flag.go
├── stream_test.go
├── strict_std_compliance.go
├── testdata/
│ ├── audio-s16le-bytes
│ ├── audio-s16le.pcm
│ ├── image-rgba-bytes
│ ├── image-rgba-struct
│ ├── image-rgba-upscaled-bytes
│ ├── video-yuv420p-bytes
│ ├── video-yuv420p-struct
│ └── video-yuv420p.h264
├── thread_type.go
├── time.go
└── time_test.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .devcontainer/Dockerfile
================================================
FROM debian:latest
RUN apt-get update
##
# git
##
RUN apt-get install -y git nano
##
# ffmpeg
##
ARG FFMPEG_VERSION
RUN apt-get install -y \
build-essential \
nasm \
pkg-config \
libx264-dev \
libpng-dev
RUN mkdir -p /opt/ffmpeg \
&& git clone https://github.com/FFmpeg/FFmpeg /opt/ffmpeg/src \
&& cd /opt/ffmpeg/src \
&& git checkout ${FFMPEG_VERSION}
RUN cd /opt/ffmpeg/src \
&& ./configure --prefix=.. --enable-libx264 --enable-gpl \
&& make \
&& make install
##
# go
##
ARG GO_VERSION
RUN apt-get install -y wget
RUN <<_EOF_ sh
arch=$(dpkg --print-architecture)
goArch="amd64"
case \${arch} in
arm64) goArch="arm64" ;;
esac
wget -O /tmp/go.tar.gz https://dl.google.com/go/go${GO_VERSION}.linux-\${goArch}.tar.gz
tar -C /opt -xzf /tmp/go.tar.gz
_EOF_
ENV PATH="$PATH:/opt/go/bin"
================================================
FILE: .devcontainer/devcontainer.json
================================================
{
"build": {
"args": {
"FFMPEG_VERSION": "n8.0",
"GO_VERSION": "1.25.5"
},
"dockerfile": "Dockerfile"
},
"containerEnv": {
"CGO_LDFLAGS": "-L/opt/ffmpeg/lib/",
"CGO_CFLAGS": "-I/opt/ffmpeg/include/",
"PKG_CONFIG_PATH": "/opt/ffmpeg/lib/pkgconfig"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack",
"golang.go"
],
"settings": {
"remote.autoForwardPorts": false
}
}
},
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/root/.ssh,readonly,type=bind"
],
"name": "asticode/go-astiav"
}
================================================
FILE: .github/workflows/Makefile
================================================
version=
srcPath=
patchPath=
install-ffmpeg:
rm -rf $(srcPath)
mkdir -p $(srcPath)
cd $(srcPath) && git clone https://github.com/FFmpeg/FFmpeg .
cd $(srcPath) && git checkout $(version)
ifneq "" "$(patchPath)"
cd $(srcPath) && git apply $(patchPath)
endif
cd $(srcPath) && ./configure --prefix=..
cd $(srcPath) && make
cd $(srcPath) && make install
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on:
push:
branches: [ "master", "test-github-actions" ]
pull_request:
branches: [ "master" ]
jobs:
test-cpu:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
FFMPEG_VERSION: n8.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- if: ${{ runner.os == 'Windows' }}
name: Prepare windows
run: |
echo "FFMPEG_PATH=$(cygpath -u $(cd ~ && pwd))/ffmpeg" >> $env:GITHUB_ENV
choco install --allow-empty-checksums pkgconfiglite
- if: ${{ runner.os != 'Windows' }}
name: Prepare non windows
run: |
echo "FFMPEG_PATH=$(echo ~)/ffmpeg" >> $GITHUB_ENV
- if: ${{ runner.os == 'Windows' }}
name: Set windows ffmpeg cache path
run: |
echo "FFMPEG_CACHE_PATH=$(cygpath -w ${{ env.FFMPEG_PATH }})" >> $env:GITHUB_ENV
- if: ${{ runner.os != 'Windows' }}
name: Set non-windows ffmpeg cache path
run: |
echo "FFMPEG_CACHE_PATH=${{ env.FFMPEG_PATH }}" >> $GITHUB_ENV
- name: Load ffmpeg cache
id: load-ffmpeg-cache
uses: actions/cache@v4
with:
path: ${{ env.FFMPEG_CACHE_PATH }}
key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ runner.os }}
- if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' && runner.os == 'Linux' }}
name: Prepare linux ffmpeg install
run: |
sudo apt-get install nasm
- if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' && runner.os == 'macOS' }}
name: Prepare macos ffmpeg install
run: |
brew install nasm
- if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' && runner.os == 'Windows' }}
name: Prepare windows ffmpeg install
run: |
choco install make
choco install nasm
echo "FFMPEG_PATCH_PATH='$(cygpath -u ${{ github.WORKSPACE }})/.github/workflows/windows.patch'" >> $env:GITHUB_ENV
- if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' }}
name: Install ffmpeg
run: |
cd .github/workflows
make install-ffmpeg srcPath=${{ env.FFMPEG_PATH }}/src version=${{ env.FFMPEG_VERSION }} patchPath=${{ env.FFMPEG_PATCH_PATH }}
- if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' }}
name: Save ffmpeg cache
uses: actions/cache/save@v4
with:
path: ${{ env.FFMPEG_CACHE_PATH }}
key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ runner.os }}
- if: ${{ runner.os == 'Windows' }}
name: Set windows environment variables
run: |
echo "CGO_LDFLAGS=-L${{ env.FFMPEG_PATH }}/lib/" >> $env:GITHUB_ENV
echo "CGO_CFLAGS=-I${{ env.FFMPEG_PATH }}/include/" >> $env:GITHUB_ENV
echo "PKG_CONFIG_PATH=$(cygpath -w ${{ env.FFMPEG_PATH }}/lib/pkgconfig)" >> $env:GITHUB_ENV
- if: ${{ runner.os != 'Windows' }}
name: Set non-windows environment variables
run: |
echo "CGO_LDFLAGS=-L${{ env.FFMPEG_PATH }}/lib/" >> $GITHUB_ENV
echo "CGO_CFLAGS=-I${{ env.FFMPEG_PATH }}/include/" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=${{ env.FFMPEG_PATH }}/lib/pkgconfig" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install dependencies
run: go mod download
- if: ${{ runner.os == 'macOS' }}
name: Fix MacOS libx11 bug (remove when unecessary)
run: |
ln -s /opt/homebrew/Cellar/libx11/1.8.11 /opt/homebrew/Cellar/libx11/1.8.10
- name: Run tests
run: |
go test -v -race -covermode atomic -coverprofile=covprofile ./...
- if: github.event_name != 'pull_request'
name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
go install github.com/mattn/goveralls@latest
goveralls -coverprofile=covprofile -service=github
================================================
FILE: .github/workflows/windows.patch
================================================
# https://trac.ffmpeg.org/ticket/6620
diff --git a/ffbuild/library.mak b/ffbuild/library.mak
--- a/ffbuild/library.mak
+++ b/ffbuild/library.mak
@@ -36,8 +36,8 @@ $(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS)
$(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS)
$(RM) $@
ifeq ($(RESPONSE_FILES),yes)
- $(Q)echo $^ > $@.objs
+ $(file >$@.objs,$^)
$(AR) $(ARFLAGS) $(AR_O) @$@.objs
else
$(AR) $(ARFLAGS) $(AR_O) $^
endif
@@ -73,8 +73,8 @@ $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD)
ifeq ($(RESPONSE_FILES),yes)
- $(Q)echo $$(filter %.o,$$^) > $$@.objs
+ $(file >$$@.objs,$$(filter %.o,$$^))
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) @$$@.objs $(FFEXTRALIBS)
else
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
endif
================================================
FILE: .gitignore
================================================
.DS_Store
coverage.out
.idea
================================================
FILE: .vscode/.gitignore
================================================
settings.json
================================================
FILE: .vscode/c_cpp_properties.json
================================================
{
"configurations": [
{
"includePath": [
"${workspaceFolder}/**",
"/opt/ffmpeg/include"
]
}
],
"version": 4
}
================================================
FILE: BREAKING_CHANGES.md
================================================
# v0.40.0
- `Codec`.`ChannelLayouts`, `Codec`.`PixelFormats` and `Codec`.`SampleFormats` have been renamed to `Codec`.`SupportedChannelLayouts`, `Codec`.`SupportedPixelFormats` and `Codec`.`SupportedSampleFormats`
- `Frame`.`KeyFrame` and `Frame`.`SetKeyFrame` have been removed. Use `Frame`.`Flags` and `Frame`.`SetFlags` instead
# v0.31.0
- removed `AllocImage` and `AllocSamples` that are considered useless using CGO until proven otherwise
# v0.30.0
- `HardwareFrameContext` has been renamed to `HardwareFramesContext`
# v0.29.0
- `NewFilterContext` has been removed, use `NewBuffersinkFilterContext` or `NewBuffersrcFilterContext` instead
- `args` has been removed from `NewBuffersinkFilterContext` and `NewBuffersrcFilterContext`. Instead, after calling `NewBuffersrcFilterContext`, you need to use `BuffersrcFilterContext`.`SetParameters` then `BuffersrcFilterContext`.`Initialize`. You don't need to use anything else after calling `NewBuffersinkFilterContext`
# v0.27.0
- make sure to call the `IOInterrupter`.`Free` method after using `NewIOInterrupter`
# v0.25.0
- `CodecParameters`.`CodecType` and `CodecParameters`.`SetCodecType` have been removed, use `CodecParameters`.`MediaType` and `CodecParameters`.`SetMediaType` instead
- `HardwareFrameContext`.`SetPixelFormat` has been replaced with `HardwareFrameContext`.`SetHardwarePixelFormat`
- `FormatContext`.`SetInterruptCallback` has been replaced with `FormatContext`.`SetIOInterrupter`
# v0.24.0
- use `FilterGraph`.`NewBuffersinkFilterContext` and `FilterGraph`.`NewBuffersrcFilterContext` instead of `FilterGraph`.`NewFilterContext` when creating `buffersink` and `buffersrc` filter contexts and use `BuffersinkFilterContext`.`GetFrame` and `BuffersrcFilterContext`.`AddFrame` to manipulate them. Use `BuffersinkFilterContext`.`FilterContext` and `BuffersrcFilterContext`.`FilterContext` in `FilterInOut`.`SetFilterContext`.
- `FilterLink` has been removed and methods like `BuffersinkFilterContext`.`ChannelLayout` have been added instead
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2022 Quentin Renard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
[](http://goreportcard.com/report/github.com/asticode/go-astiav)
[](https://godoc.org/github.com/asticode/go-astiav)
[](https://github.com/asticode/go-astiav/actions/workflows/test.yml)
[](https://coveralls.io/github/asticode/go-astiav)
`astiav` is a Golang library providing C bindings for [ffmpeg](https://github.com/FFmpeg/FFmpeg)
It's only compatible with `ffmpeg` `n8.0`.
Its main goals are to:
- [x] provide a better GO idiomatic API
- standard error pattern
- typed constants and flags
- struct-based functions
- ...
- [x] provide the GO version of [ffmpeg examples](https://github.com/FFmpeg/FFmpeg/tree/n8.0/doc/examples)
- [x] be fully tested
:warning: breaking changes will be introduced in `go-astiav` **without** using the `v2` golang pattern. You can see the list of breaking changes [here](BREAKING_CHANGES.md).
# Examples
Examples are located in the [examples](examples) directory and mirror as much as possible the [ffmpeg examples](https://github.com/FFmpeg/FFmpeg/tree/n8.0/doc/examples).
|name|astiav|ffmpeg|
|---|---|---|
|BitStream Filtering|[see](examples/bit_stream_filtering/main.go)|X
|Custom IO Demuxing|[see](examples/custom_io_demuxing/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/avio_read_callback.c)
|Custom IO Muxing|[see](examples/custom_io_muxing/main.go)|X
|Demuxing/Decoding|[see](examples/demuxing_decoding/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/demux_decode.c)
|Filtering|[see](examples/filtering/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/decode_filter_video.c)
|Frame data manipulation|[see](examples/frame_data_manipulation/main.go)|X
|Hardware Decoding/Filtering|[see](examples/hardware_decoding_filtering/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/hw_decode.c)
|Hardware Encoding|[see](examples/hardware_encoding/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/vaapi_encode.c)
|Remuxing|[see](examples/remuxing/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/remux.c)
|Resampling audio|[see](examples/resampling_audio/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/resample_audio.c)
|Scaling video|[see](examples/scaling_video/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/scale_video.c)
|Transcoding|[see](examples/transcoding/main.go)|[see](https://github.com/FFmpeg/FFmpeg/blob/n8.0/doc/examples/transcode.c)
*Tip: you can use the video sample located in the `testdata` directory for your tests*
# Patterns
*NB: errors are not checked below for readibility purposes, however you should!*
First off, all use cases are different and it's impossible to provide patterns that work in every situation. That's why `ffmpeg`'s doc or source code should be your ultimate source of truth regarding how to use this library. That's why all methods of this library have been documented with a link referencing the documentation of the C function they use.
However it's possible to give rules of thumb and patterns that fit most use cases and can kickstart most people. Here's a few of them:
## When to call `Alloc()`, `.Unref()` and `.Free()`
Let's take the `FormatContext.ReadFrame()` pattern as an example. The pattern is similar with frames.
```go
// You can allocate the packet once and reuse the same object in the for loop below
pkt := astiav.AllocPacket()
// However, once you're done using the packet, you need to make sure to free it
defer pkt.Free()
// Loop
for {
// We'll use a closure to ease unreferencing the packet
func() {
// Read frame using the same packet every time
formatContext.ReadFrame(pkt)
// However make sure to unreference the packet once you're done with what
// have been "injected" by the .ReadFrame() method
defer pkt.Unref()
// Here you can do whatever you feel like with your packet
}()
}
```
# Install ffmpeg from source
Check out the `ffmpeg` section in the [Devcontainer Dockerfile](.devcontainer/Dockerfile) to see how to install ffmpeg from source.
For your GO code to pick up `ffmpeg` dependency automatically, you'll need to update the following environment variables :
(don't forget to replace `{{ path to your ffmpeg directory }}` with the absolute path to your ffmpeg directory)
```sh
export CGO_CFLAGS="-I{{ path to your ffmpeg directory }}/include/",
export CGO_LDFLAGS="-L{{ path to your ffmpeg directory }}/lib/",
export PKG_CONFIG_PATH="{{ path to your ffmpeg directory }}/lib/pkgconfig",
```
## Building on Windows
Building on Windows requires msys2 / mingw64 gcc toolchain. Read the [Quickstart guide](https://www.msys2.org) to install Msys2.
Once complete run the Mingw64 shell from the installation folder, run the below commands:
```shell
# Update Packages
pacman -Syu
# Install Requirements to Build
pacman -S --noconfirm --needed git diffutils mingw-w64-x86_64-toolchain pkg-config make nasm
# Clone the repository using git
git clone https://github.com/asticode/go-astiav
cd go-astiav
```
Then once you clone this repository, follow along the build instructions above.
> **Notes:**
> For `pkg-config` use `pkgconfiglite` from choco.
> Remember to set `CGO` and `PKG_CONFIG` env vars properly to point to the folder where ffmpeg was built.
# Why astiav?
After maintaining for several years the most starred [fork](https://github.com/asticode/goav) of [goav](https://github.com/giorgisio/goav), I've decided to write from scratch my own C bindings to fix most of the problems I still encountered using `goav`.
================================================
FILE: astiav.go
================================================
package astiav
//#cgo pkg-config: libavcodec libavdevice libavfilter libavformat libswresample libswscale libavutil
import "C"
================================================
FILE: astiav_test.go
================================================
package astiav
import (
"errors"
"fmt"
"os"
"sync"
"testing"
"github.com/asticode/go-astikit"
)
var globalHelper = newHelper()
func TestMain(m *testing.M) {
// Make sure to exit with the proper code
var code int
defer func(code *int) {
os.Exit(*code)
}(&code)
// Make sure to close global helper
defer globalHelper.close()
// Run
code = m.Run()
}
type helper struct {
closer *astikit.Closer
inputs map[string]*helperInput
m *sync.Mutex // Locks inputs
}
func newHelper() *helper {
return &helper{
closer: astikit.NewCloser(),
inputs: make(map[string]*helperInput),
m: &sync.Mutex{},
}
}
func (h *helper) close() {
h.closer.Close()
}
type helperInput struct {
firstPkt *Packet
formatContext *FormatContext
lastFrames map[MediaType]*Frame
}
func newHelperInput() *helperInput {
return &helperInput{lastFrames: make(map[MediaType]*Frame)}
}
func (h *helper) inputFormatContext(name string, ifmt *InputFormat) (fc *FormatContext, err error) {
h.m.Lock()
i, ok := h.inputs[name]
if ok && i.formatContext != nil {
h.m.Unlock()
return i.formatContext, nil
}
h.m.Unlock()
if fc = AllocFormatContext(); fc == nil {
err = errors.New("astiav_test: allocated format context is nil")
return
}
h.closer.Add(fc.Free)
if err = fc.OpenInput("testdata/"+name, ifmt, nil); err != nil {
err = fmt.Errorf("astiav_test: opening input failed: %w", err)
return
}
h.closer.Add(fc.CloseInput)
if err = fc.FindStreamInfo(nil); err != nil {
err = fmt.Errorf("astiav_test: finding stream info failed: %w", err)
return
}
h.m.Lock()
if _, ok := h.inputs[name]; !ok {
h.inputs[name] = newHelperInput()
}
h.inputs[name].formatContext = fc
h.m.Unlock()
return
}
func (h *helper) inputFirstPacket(name string) (pkt *Packet, err error) {
h.m.Lock()
i, ok := h.inputs[name]
if ok && i.firstPkt != nil {
h.m.Unlock()
return i.firstPkt, nil
}
h.m.Unlock()
var fc *FormatContext
if fc, err = h.inputFormatContext(name, nil); err != nil {
err = fmt.Errorf("astiav_test: getting input format context failed")
return
}
pkt = AllocPacket()
if pkt == nil {
err = errors.New("astiav_test: pkt is nil")
return
}
h.closer.Add(pkt.Free)
if err = fc.ReadFrame(pkt); err != nil {
err = fmt.Errorf("astiav_test: reading frame failed: %w", err)
return
}
h.m.Lock()
h.inputs[name].firstPkt = pkt
h.m.Unlock()
return
}
func (h *helper) inputLastFrame(name string, mediaType MediaType, ifmt *InputFormat) (*Frame, error) {
h.m.Lock()
if i, ok := h.inputs[name]; ok {
if len(i.lastFrames) > 0 {
f, ok := i.lastFrames[mediaType]
h.m.Unlock()
if ok {
return f, nil
}
return nil, fmt.Errorf("astiav_test: no last frame for media type %s", mediaType)
}
}
h.m.Unlock()
fc, err := h.inputFormatContext(name, ifmt)
if err != nil {
return nil, fmt.Errorf("astiav_test: getting input format context failed: %w", err)
}
type stream struct {
cc *CodecContext
s *Stream
}
streams := make(map[int]*stream)
mediaTypeFound := false
for _, v := range fc.Streams() {
s := &stream{s: v}
streams[v.Index()] = s
c := FindDecoder(v.CodecParameters().CodecID())
if c == nil {
return nil, fmt.Errorf("astiav_test: no decoder found for %s", v.CodecParameters().CodecID())
}
s.cc = AllocCodecContext(c)
if s.cc == nil {
return nil, errors.New("astiav_test: no codec context")
}
h.closer.Add(s.cc.Free)
if err = s.s.CodecParameters().ToCodecContext(s.cc); err != nil {
return nil, fmt.Errorf("astiav_test: updating codec context failed: %w", err)
}
if err = s.cc.Open(c, nil); err != nil {
return nil, fmt.Errorf("astiav_test: opening codec context failed: %w", err)
}
if _, ok := h.inputs[name].lastFrames[s.cc.MediaType()]; !ok {
h.inputs[name].lastFrames[s.cc.MediaType()] = AllocFrame()
h.closer.Add(h.inputs[name].lastFrames[s.cc.MediaType()].Free)
}
if s.cc.MediaType() == mediaType {
mediaTypeFound = true
}
}
if !mediaTypeFound {
return nil, fmt.Errorf("astiav_test: no stream for media type %s", mediaType)
}
var pkt1 *Packet
if pkt1, err = h.inputFirstPacket(name); err != nil {
return nil, fmt.Errorf("astiav_test: getting input first packet failed: %w", err)
}
pkt2 := AllocPacket()
h.closer.Add(pkt2.Free)
f := AllocFrame()
h.closer.Add(f.Free)
pkts := []*Packet{pkt1}
for {
if err = fc.ReadFrame(pkt2); err != nil {
if errors.Is(err, ErrEof) || errors.Is(err, ErrEagain) {
if len(pkts) == 0 {
err = nil
break
}
} else {
return nil, fmt.Errorf("astiav_test: reading frame failed: %w", err)
}
} else {
pkts = append(pkts, pkt2)
}
for _, pkt := range pkts {
s, ok := streams[pkt.StreamIndex()]
if !ok {
continue
}
if err = s.cc.SendPacket(pkt); err != nil {
return nil, fmt.Errorf("astiav_test: sending packet failed: %w", err)
}
for {
if err = s.cc.ReceiveFrame(f); err != nil {
if errors.Is(err, ErrEof) || errors.Is(err, ErrEagain) {
err = nil
break
}
return nil, fmt.Errorf("astiav_test: receiving frame failed: %w", err)
}
h.m.Lock()
h.inputs[name].lastFrames[s.cc.MediaType()].Unref()
err = h.inputs[name].lastFrames[s.cc.MediaType()].Ref(f)
h.m.Unlock()
if err != nil {
return nil, fmt.Errorf("astiav_test: refing frame failed: %w", err)
}
}
}
pkts = []*Packet{}
}
return h.inputs[name].lastFrames[mediaType], nil
}
================================================
FILE: atomic.c
================================================
#include <stdatomic.h>
int astiavAtomicLoadInt(atomic_int* i)
{
return atomic_load(i);
}
void astiavAtomicStoreInt(atomic_int* i, int v)
{
return atomic_store(i, v);
}
================================================
FILE: atomic.h
================================================
#include <stdatomic.h>
int astiavAtomicLoadInt(atomic_int* i);
void astiavAtomicStoreInt(atomic_int* i, int v);
================================================
FILE: audio_fifo.go
================================================
package astiav
//#include <libavutil/audio_fifo.h>
import "C"
import "unsafe"
// https://ffmpeg.org/doxygen/8.0/structAVAudioFifo.html
type AudioFifo struct {
c *C.AVAudioFifo
}
func newAudioFifoFromC(c *C.AVAudioFifo) *AudioFifo {
if c == nil {
return nil
}
return &AudioFifo{c: c}
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audiofifo.html#ga9d792394f0615a329aec47847f8f8784
func AllocAudioFifo(sampleFmt SampleFormat, channels int, nbSamples int) *AudioFifo {
return newAudioFifoFromC(C.av_audio_fifo_alloc(C.enum_AVSampleFormat(sampleFmt), C.int(channels), C.int(nbSamples)))
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audiofifo.html#ga27c1e16e5f09940d6016b1971c0b5742
func (a *AudioFifo) Realloc(nbSamples int) error {
return newError(C.av_audio_fifo_realloc(a.c, C.int(nbSamples)))
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audiofifo.html#gaa0a4742ecac52a999e8b4478d27f3b9b
func (a *AudioFifo) Size() int {
return int(C.av_audio_fifo_size(a.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audiofifo.html#ga2bed2f01fe34228ee8a73617b3177d00
func (a *AudioFifo) Space() int {
return int(C.av_audio_fifo_space(a.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audiofifo.html#ga51d81a165872919bbfdee3f00f6d6530
func (a *AudioFifo) Write(f *Frame) (int, error) {
ret := C.av_audio_fifo_write(a.c, (*unsafe.Pointer)(unsafe.Pointer(&f.c.data[0])), C.int(f.NbSamples()))
if err := newError(ret); err != nil {
return 0, err
}
return int(ret), nil
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audiofifo.html#ga5e2c87bbeefba0d229b4109b4b755529
func (a *AudioFifo) Read(f *Frame) (int, error) {
ret := C.av_audio_fifo_read(a.c, (*unsafe.Pointer)(unsafe.Pointer(&f.c.data[0])), C.int(f.NbSamples()))
if err := newError(ret); err != nil {
return 0, err
}
return int(ret), nil
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audiofifo.html#ga74e029e47f7aa99217ad1f315c434875
func (a *AudioFifo) Free() {
if a.c != nil {
C.av_audio_fifo_free(a.c)
a.c = nil
}
}
================================================
FILE: audio_fifo_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestAudioFIFO(t *testing.T) {
afn := 2000
af := AllocAudioFifo(SampleFormatFltp, 2, afn)
defer af.Free()
wn := 1024
wf := AllocFrame()
wf.SetNbSamples(wn)
wf.SetChannelLayout(ChannelLayoutStereo)
wf.SetSampleFormat(SampleFormatFltp)
wf.SetSampleRate(48000)
wf.AllocBuffer(0)
rn := 120
rf := AllocFrame()
rf.SetNbSamples(rn)
rf.SetChannelLayout(ChannelLayoutStereo)
rf.SetSampleFormat(SampleFormatFltp)
rf.SetSampleRate(48000)
rf.AllocBuffer(0)
w, err := af.Write(wf)
require.NoError(t, err)
require.Equal(t, wn, w)
r, err := af.Read(rf)
require.NoError(t, err)
require.Equal(t, rn, r)
require.Equal(t, wn-rn, af.Size())
require.Equal(t, afn-af.Size(), af.Space())
afn = 3000
require.NoError(t, af.Realloc(afn))
require.Equal(t, wn-rn, af.Size())
require.Equal(t, afn-af.Size(), af.Space())
}
================================================
FILE: bit_stream_filter.go
================================================
package astiav
//#include <libavcodec/bsf.h>
//#include <stdlib.h>
import "C"
import (
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/structAVBitStreamFilter.html
type BitStreamFilter struct {
c *C.AVBitStreamFilter
}
func newBitStreamFilterFromC(c *C.AVBitStreamFilter) *BitStreamFilter {
if c == nil {
return nil
}
return &BitStreamFilter{c: c}
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__bsf.html#gae491493190b45698ebd43db28c4e8fe9
func FindBitStreamFilterByName(n string) *BitStreamFilter {
cn := C.CString(n)
defer C.free(unsafe.Pointer(cn))
return newBitStreamFilterFromC(C.av_bsf_get_by_name(cn))
}
// https://ffmpeg.org/doxygen/8.0/structAVBitStreamFilter.html#a33c3cb51bd13060da35481655b41e4e5
func (bsf *BitStreamFilter) Name() string {
return C.GoString(bsf.c.name)
}
func (bsf *BitStreamFilter) String() string {
return bsf.Name()
}
================================================
FILE: bit_stream_filter_context.go
================================================
package astiav
//#include <libavcodec/bsf.h>
import "C"
import (
"errors"
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/structAVBSFContext.html
type BitStreamFilterContext struct {
c *C.AVBSFContext
}
func newBSFContextFromC(c *C.AVBSFContext) *BitStreamFilterContext {
if c == nil {
return nil
}
bsfc := &BitStreamFilterContext{c: c}
classers.set(bsfc)
return bsfc
}
var _ Classer = (*BitStreamFilterContext)(nil)
// https://ffmpeg.org/doxygen/8.0/group__lavc__bsf.html#ga7da65af303e20c9546e15ec266b182c1
func AllocBitStreamFilterContext(f *BitStreamFilter) (*BitStreamFilterContext, error) {
if f == nil {
return nil, errors.New("astiav: bit stream filter must not be nil")
}
var bsfc *C.AVBSFContext
if err := newError(C.av_bsf_alloc(f.c, &bsfc)); err != nil {
return nil, err
}
return newBSFContextFromC(bsfc), nil
}
// https://ffmpeg.org/doxygen/8.0/structAVBSFContext.html#aa5d5018816daac804414c459ec8a1c5c
func (bsfc *BitStreamFilterContext) Class() *Class {
if bsfc.c == nil {
return nil
}
return newClassFromC(unsafe.Pointer(bsfc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__bsf.html#ga242529d54013acf87e94273d298a5ff2
func (bsfc *BitStreamFilterContext) Initialize() error {
return newError(C.av_bsf_init(bsfc.c))
}
// https://ffmpeg.org/doxygen/8.0/structAVBSFContext.html#a5c799e50f572340b69d4c79cda8f2de9
func (bsfc *BitStreamFilterContext) PrivateData() *PrivateData {
return newPrivateDataFromC(bsfc.c.priv_data)
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__bsf.html#gaada9ea8f08d3dcf23c14564dbc88992c
func (bsfc *BitStreamFilterContext) SendPacket(p *Packet) error {
var pc *C.AVPacket
if p != nil {
pc = p.c
}
return newError(C.av_bsf_send_packet(bsfc.c, pc))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__bsf.html#ga7fffb6c87b91250956e7a2367af56b38
func (bsfc *BitStreamFilterContext) ReceivePacket(p *Packet) error {
if p == nil {
return errors.New("astiav: packet must not be nil")
}
return newError(C.av_bsf_receive_packet(bsfc.c, p.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__bsf.html#ga08d53431e76355f88e27763b1940df4f
func (bsfc *BitStreamFilterContext) Free() {
if bsfc.c != nil {
// Make sure to clone the classer before freeing the object since
// the C free method may reset the pointer
c := newClonedClasser(bsfc)
C.av_bsf_free(&bsfc.c)
// Make sure to remove from classers after freeing the object since
// the C free method may use methods needing the classer
if c != nil {
classers.del(c)
}
}
}
// https://ffmpeg.org/doxygen/8.0/structAVBSFContext.html#ad75adf988c00f89202099c87ea39f0db
func (bsfc *BitStreamFilterContext) InputTimeBase() Rational {
return newRationalFromC(bsfc.c.time_base_in)
}
// https://ffmpeg.org/doxygen/8.0/structAVBSFContext.html#ad75adf988c00f89202099c87ea39f0db
func (bsfc *BitStreamFilterContext) SetInputTimeBase(r Rational) {
bsfc.c.time_base_in = r.c
}
// https://ffmpeg.org/doxygen/8.0/structAVBSFContext.html#a702ace639b8193475cf0a12ebdebd738
func (bsfc *BitStreamFilterContext) InputCodecParameters() *CodecParameters {
return newCodecParametersFromC(bsfc.c.par_in)
}
// https://ffmpeg.org/doxygen/8.0/structAVBSFContext.html#ab58f8c37eec197e0f30d17d60959a60d
func (bsfc *BitStreamFilterContext) OutputCodecParameters() *CodecParameters {
return newCodecParametersFromC(bsfc.c.par_out)
}
================================================
FILE: bit_stream_filter_context_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestBitStreamFilterContext(t *testing.T) {
bsf := FindBitStreamFilterByName("h264_metadata")
require.NotNil(t, bsf)
bsfc, err := AllocBitStreamFilterContext(bsf)
require.NotNil(t, bsfc)
require.NoError(t, err)
defer bsfc.Free()
require.NotNil(t, bsfc.PrivateData())
cl := bsfc.Class()
require.NotNil(t, cl)
require.Equal(t, "AVBSFContext", cl.Name())
bsfc.SetInputTimeBase(NewRational(15, 1))
require.Equal(t, NewRational(15, 1), bsfc.InputTimeBase())
cp1 := AllocCodecParameters()
require.NotNil(t, cp1)
defer cp1.Free()
cp1.SetCodecID(CodecIDH264)
require.NoError(t, cp1.Copy(bsfc.InputCodecParameters()))
require.Equal(t, CodecIDH264, bsfc.InputCodecParameters().CodecID())
require.Equal(t, CodecIDNone, bsfc.OutputCodecParameters().CodecID())
require.NoError(t, bsfc.Initialize())
require.Equal(t, CodecIDH264, bsfc.OutputCodecParameters().CodecID())
// TODO Test SendPacket
// TODO Test ReceivePacket
}
================================================
FILE: bit_stream_filter_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestBitStreamFilter(t *testing.T) {
fn := "null"
f := FindBitStreamFilterByName(fn)
require.NotNil(t, f)
require.Equal(t, f.Name(), fn)
require.Equal(t, f.String(), fn)
f = FindBitStreamFilterByName("foobar_non_existing_bsf")
require.Nil(t, f)
}
================================================
FILE: buffersink_filter_context.go
================================================
package astiav
//#include <libavfilter/buffersink.h>
import "C"
type BuffersinkFilterContext struct {
fc *FilterContext
}
func newBuffersinkFilterContext(fc *FilterContext) *BuffersinkFilterContext {
return &BuffersinkFilterContext{fc: fc}
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#gaad918036937648701c09f9612f42706e
func (bfc *BuffersinkFilterContext) ChannelLayout() ChannelLayout {
var cl C.AVChannelLayout
C.av_buffersink_get_ch_layout(bfc.fc.c, &cl)
return newChannelLayoutFromC(&cl)
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#gab80976e506ab88d23d94bb6d7a4051bd
func (bfc *BuffersinkFilterContext) ColorRange() ColorRange {
return ColorRange(C.av_buffersink_get_color_range(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#gaad817cdcf5493c385126e8e17c5717f2
func (bfc *BuffersinkFilterContext) ColorSpace() ColorSpace {
return ColorSpace(C.av_buffersink_get_colorspace(bfc.fc.c))
}
func (bfc *BuffersinkFilterContext) FilterContext() *FilterContext {
return bfc.fc
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#ga55614fd28de2fa05b04f427390061d5b
func (bfc *BuffersinkFilterContext) FrameRate() Rational {
return newRationalFromC(C.av_buffersink_get_frame_rate(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink.html#ga71ae9c529c8da51681e12faa37d1a395
func (bfc *BuffersinkFilterContext) GetFrame(f *Frame, fs BuffersinkFlags) error {
var cf *C.AVFrame
if f != nil {
cf = f.c
}
return newError(C.av_buffersink_get_frame_flags(bfc.fc.c, cf, C.int(fs)))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#ga955ecf3680e71e10429d7500343be25c
func (bfc *BuffersinkFilterContext) Height() int {
return int(C.av_buffersink_get_h(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#ga1eb8bbf583ffb7cc29aaa1944b1e699c
func (bfc *BuffersinkFilterContext) MediaType() MediaType {
return MediaType(C.av_buffersink_get_type(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#ga402ddbef6f7347869725696846ac81eb
func (bfc *BuffersinkFilterContext) PixelFormat() PixelFormat {
return PixelFormat(C.av_buffersink_get_format(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#gaa38ee33e1c7f6f7cb190bd2330e5f848
func (bfc *BuffersinkFilterContext) SampleAspectRatio() Rational {
return newRationalFromC(C.av_buffersink_get_sample_aspect_ratio(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#ga402ddbef6f7347869725696846ac81eb
func (bfc *BuffersinkFilterContext) SampleFormat() SampleFormat {
return SampleFormat(C.av_buffersink_get_format(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#ga2af714e82f48759551acdbc4488ded4a
func (bfc *BuffersinkFilterContext) SampleRate() int {
return int(C.av_buffersink_get_sample_rate(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#gabc82f65ec7f4fa47c5216260639258a1
func (bfc *BuffersinkFilterContext) TimeBase() Rational {
return newRationalFromC(C.av_buffersink_get_time_base(bfc.fc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink__accessors.html#gac8c86515d2ef56090395dfd74854c835
func (bfc *BuffersinkFilterContext) Width() int {
return int(C.av_buffersink_get_w(bfc.fc.c))
}
================================================
FILE: buffersink_flag.go
================================================
package astiav
//#include <libavfilter/buffersink.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersink.html#ga9453fc0e81d30237080b51575da0f0d8
type BuffersinkFlag int64
const (
BuffersinkFlagPeek = BuffersinkFlag(C.AV_BUFFERSINK_FLAG_PEEK)
BuffersinkFlagNoRequest = BuffersinkFlag(C.AV_BUFFERSINK_FLAG_NO_REQUEST)
)
================================================
FILE: buffersrc_filter_context.go
================================================
package astiav
//#include <libavfilter/buffersrc.h>
import "C"
type BuffersrcFilterContext struct {
fc *FilterContext
}
func newBuffersrcFilterContext(fc *FilterContext) *BuffersrcFilterContext {
return &BuffersrcFilterContext{fc: fc}
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersrc.html#ga73ed90c3c3407f36e54d65f91faaaed9
func (bfc *BuffersrcFilterContext) AddFrame(f *Frame, fs BuffersrcFlags) error {
var cf *C.AVFrame
if f != nil {
cf = f.c
}
return newError(C.av_buffersrc_add_frame_flags(bfc.fc.c, cf, C.int(fs)))
}
func (bfc *BuffersrcFilterContext) FilterContext() *FilterContext {
return bfc.fc
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi.html#ga8c15af28902395399fe455f6f8236848
func (bfc *BuffersrcFilterContext) Initialize(d *Dictionary) error {
var dc **C.AVDictionary
if d != nil {
dc = &d.c
}
return newError(C.avfilter_init_dict(bfc.fc.c, dc))
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersrc.html#ga398cd2a84f8b4a588197ab9d90135048
func (bfc *BuffersrcFilterContext) SetParameters(bfcp *BuffersrcFilterContextParameters) error {
return newError(C.av_buffersrc_parameters_set(bfc.fc.c, bfcp.c))
}
================================================
FILE: buffersrc_filter_context_parameters.go
================================================
package astiav
//#include <libavfilter/buffersrc.h>
import "C"
import "unsafe"
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html
type BuffersrcFilterContextParameters struct {
c *C.AVBufferSrcParameters
}
func newBuffersrcFilterContextParametersFromC(c *C.AVBufferSrcParameters) *BuffersrcFilterContextParameters {
if c == nil {
return nil
}
return &BuffersrcFilterContextParameters{c: c}
}
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersrc.html#gaae82d4f8a69757ce01421dd3167861a5
func AllocBuffersrcFilterContextParameters() *BuffersrcFilterContextParameters {
return newBuffersrcFilterContextParametersFromC(C.av_buffersrc_parameters_alloc())
}
func (bfcp *BuffersrcFilterContextParameters) Free() {
if bfcp.c != nil {
if bfcp.c.hw_frames_ctx != nil {
C.av_buffer_unref(&bfcp.c.hw_frames_ctx)
}
C.av_freep(unsafe.Pointer(&bfcp.c))
}
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a5267368bf88b4f2a65a5e06ac3f9ecd4
func (bfcp *BuffersrcFilterContextParameters) ChannelLayout() ChannelLayout {
l, _ := newChannelLayoutFromC(&bfcp.c.ch_layout).clone()
return l
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a5267368bf88b4f2a65a5e06ac3f9ecd4
func (bfcp *BuffersrcFilterContextParameters) SetChannelLayout(l ChannelLayout) {
l.copy(&bfcp.c.ch_layout) //nolint: errcheck
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a442add2b039f416dd7c92ccf1ccd0d3b
func (bfcp *BuffersrcFilterContextParameters) ColorRange() ColorRange {
return ColorRange(bfcp.c.color_range)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a442add2b039f416dd7c92ccf1ccd0d3b
func (bfcp *BuffersrcFilterContextParameters) SetColorRange(r ColorRange) {
bfcp.c.color_range = C.enum_AVColorRange(r)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a700226626af70f787c930d7506554757
func (bfcp *BuffersrcFilterContextParameters) ColorSpace() ColorSpace {
return ColorSpace(bfcp.c.color_space)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a700226626af70f787c930d7506554757
func (bfcp *BuffersrcFilterContextParameters) SetColorSpace(s ColorSpace) {
bfcp.c.color_space = C.enum_AVColorSpace(s)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a032a202496206e18449c66233058647a
func (bfcp *BuffersrcFilterContextParameters) Framerate() Rational {
return newRationalFromC(bfcp.c.frame_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a032a202496206e18449c66233058647a
func (bfcp *BuffersrcFilterContextParameters) SetFramerate(f Rational) {
bfcp.c.frame_rate = f.c
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a86c49b4202433037c9e2b0b6ae541534
func (bfcp *BuffersrcFilterContextParameters) SetHardwareFramesContext(hfc *HardwareFramesContext) {
if bfcp.c.hw_frames_ctx != nil {
C.av_buffer_unref(&bfcp.c.hw_frames_ctx)
}
if hfc != nil {
bfcp.c.hw_frames_ctx = C.av_buffer_ref(hfc.c)
} else {
bfcp.c.hw_frames_ctx = nil
}
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a89783d603b84908fb1998bbbea981b70
func (bfcp *BuffersrcFilterContextParameters) Height() int {
return int(bfcp.c.height)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a89783d603b84908fb1998bbbea981b70
func (bfcp *BuffersrcFilterContextParameters) SetHeight(height int) {
bfcp.c.height = C.int(height)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a56f28f81f1a86cecc39a8d61674912b8
func (bfcp *BuffersrcFilterContextParameters) PixelFormat() PixelFormat {
return PixelFormat(bfcp.c.format)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a56f28f81f1a86cecc39a8d61674912b8
func (bfcp *BuffersrcFilterContextParameters) SetPixelFormat(f PixelFormat) {
bfcp.c.format = C.int(f)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#ae47c141ea7a7770351613242229f951a
func (bfcp *BuffersrcFilterContextParameters) SampleAspectRatio() Rational {
return newRationalFromC(bfcp.c.sample_aspect_ratio)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#ae47c141ea7a7770351613242229f951a
func (bfcp *BuffersrcFilterContextParameters) SetSampleAspectRatio(r Rational) {
bfcp.c.sample_aspect_ratio = r.c
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a56f28f81f1a86cecc39a8d61674912b8
func (bfcp *BuffersrcFilterContextParameters) SampleFormat() SampleFormat {
return SampleFormat(bfcp.c.format)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a56f28f81f1a86cecc39a8d61674912b8
func (bfcp *BuffersrcFilterContextParameters) SetSampleFormat(f SampleFormat) {
bfcp.c.format = C.int(f)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a34a1613f1e80f8520c159fac59e29834
func (bfcp *BuffersrcFilterContextParameters) SampleRate() int {
return int(bfcp.c.sample_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a34a1613f1e80f8520c159fac59e29834
func (bfcp *BuffersrcFilterContextParameters) SetSampleRate(sampleRate int) {
bfcp.c.sample_rate = C.int(sampleRate)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a7767325c1259942a33586f05c90e38b0
func (bfcp *BuffersrcFilterContextParameters) TimeBase() Rational {
return newRationalFromC(bfcp.c.time_base)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a7767325c1259942a33586f05c90e38b0
func (bfcp *BuffersrcFilterContextParameters) SetTimeBase(r Rational) {
bfcp.c.time_base = r.c
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a6c6f3d9ed8b427070e9055e7ac61263f
func (bfcp *BuffersrcFilterContextParameters) Width() int {
return int(bfcp.c.width)
}
// https://ffmpeg.org/doxygen/8.0/structAVBufferSrcParameters.html#a6c6f3d9ed8b427070e9055e7ac61263f
func (bfcp *BuffersrcFilterContextParameters) SetWidth(width int) {
bfcp.c.width = C.int(width)
}
================================================
FILE: buffersrc_filter_context_parameters_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestBuffersrcFilterContextParameters(t *testing.T) {
p := AllocBuffersrcFilterContextParameters()
defer p.Free()
p.SetChannelLayout(ChannelLayoutStereo)
require.Equal(t, ChannelLayoutStereo, p.ChannelLayout())
p.SetColorRange(ColorRangeMpeg)
require.Equal(t, ColorRangeMpeg, p.ColorRange())
p.SetColorSpace(ColorSpaceBt470Bg)
require.Equal(t, ColorSpaceBt470Bg, p.ColorSpace())
p.SetFramerate(NewRational(1, 2))
require.Equal(t, NewRational(1, 2), p.Framerate())
p.SetHeight(1)
require.Equal(t, 1, p.Height())
p.SetPixelFormat(PixelFormatRgba)
require.Equal(t, PixelFormatRgba, p.PixelFormat())
p.SetSampleAspectRatio(NewRational(3, 4))
require.Equal(t, NewRational(3, 4), p.SampleAspectRatio())
p.SetSampleFormat(SampleFormatDblp)
require.Equal(t, SampleFormatDblp, p.SampleFormat())
p.SetSampleRate(2)
require.Equal(t, 2, p.SampleRate())
p.SetTimeBase(NewRational(5, 6))
require.Equal(t, NewRational(5, 6), p.TimeBase())
p.SetWidth(3)
require.Equal(t, 3, p.Width())
}
================================================
FILE: buffersrc_filter_context_test.go
================================================
package astiav
import (
"github.com/stretchr/testify/require"
"testing"
)
func TestBuffersrcFilterContext(t *testing.T) {
fg := AllocFilterGraph()
filter := FindFilterByName("movie")
bufferSrcCtx, err := fg.NewBuffersrcFilterContext(filter, "movie")
require.NoError(t, err)
d := NewDictionary()
require.NoError(t, d.Set("filename", "testdata/video.mp4", 0))
require.NoError(t, bufferSrcCtx.Initialize(d))
}
================================================
FILE: buffersrc_flag.go
================================================
package astiav
//#include <libavfilter/buffersrc.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffersrc.html#gga7c35be1de655e733eaac059ccd76f796a6efcf61145ec6d60d3a773fcd0797872
type BuffersrcFlag int64
const (
BuffersrcFlagNoCheckFormat = BuffersrcFlag(C.AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT)
BuffersrcFlagPush = BuffersrcFlag(C.AV_BUFFERSRC_FLAG_PUSH)
BuffersrcFlagKeepRef = BuffersrcFlag(C.AV_BUFFERSRC_FLAG_KEEP_REF)
)
================================================
FILE: bytes.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
//#include <stdlib.h>
//#include <stdint.h>
import "C"
import (
"errors"
"fmt"
"unsafe"
)
func stringFromC(len int, fn func(buf *C.char, size C.size_t) error) (string, error) {
size := C.size_t(len)
buf := (*C.char)(C.av_malloc(size))
if buf == nil {
return "", errors.New("astiav: buf is nil")
}
defer C.av_free(unsafe.Pointer(buf))
if err := fn(buf, size); err != nil {
return "", err
}
return C.GoString(buf), nil
}
func bytesFromC(fn func(size *C.size_t) *C.uint8_t) []byte {
var size uint64
r := fn((*C.size_t)(unsafe.Pointer(&size)))
return C.GoBytes(unsafe.Pointer(r), C.int(size))
}
func bytesToC(b []byte, fn func(b *C.uint8_t, size C.size_t) error) error {
var ptr *C.uint8_t
if b != nil {
c := make([]byte, len(b))
copy(c, b)
ptr = (*C.uint8_t)(unsafe.Pointer(&c[0]))
}
return fn(ptr, C.size_t(len(b)))
}
// TODO Rename?
func setBytesWithIntSizeInC(b []byte, d **C.uint8_t, size *C.int) error {
if len(b) == 0 {
return nil
}
if *d != nil {
C.av_freep(unsafe.Pointer(d))
*size = 0
}
if *d = (*C.uint8_t)(C.av_mallocz(C.size_t(len(b) + C.AV_INPUT_BUFFER_PADDING_SIZE))); *d == nil {
return fmt.Errorf("astiav: allocation is nil")
}
C.memcpy(unsafe.Pointer(*d), unsafe.Pointer(&b[0]), C.size_t(len(b)))
*size = C.int(len(b))
return nil
}
================================================
FILE: bytes_test.go
================================================
package astiav
import "testing"
func TestBytes(t *testing.T) {
// TODO Test stringFromC
// TODO Test bytesFromC
// TODO Test bytesToC
}
================================================
FILE: channel_layout.go
================================================
package astiav
//#include "channel_layout.h"
import "C"
import (
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/group__lavu__audio__channels.html#ga855bb7dede67971e95bd09d8fcca7293
var (
ChannelLayoutMono = newChannelLayoutFromC(C.astiavChannelLayoutMono)
ChannelLayoutStereo = newChannelLayoutFromC(C.astiavChannelLayoutStereo)
ChannelLayout2Point1 = newChannelLayoutFromC(C.astiavChannelLayout2Point1)
ChannelLayout21 = newChannelLayoutFromC(C.astiavChannelLayout21)
ChannelLayoutSurround = newChannelLayoutFromC(C.astiavChannelLayoutSurround)
ChannelLayout3Point1 = newChannelLayoutFromC(C.astiavChannelLayout3Point1)
ChannelLayout4Point0 = newChannelLayoutFromC(C.astiavChannelLayout4Point0)
ChannelLayout4Point1 = newChannelLayoutFromC(C.astiavChannelLayout4Point1)
ChannelLayout22 = newChannelLayoutFromC(C.astiavChannelLayout22)
ChannelLayoutQuad = newChannelLayoutFromC(C.astiavChannelLayoutQuad)
ChannelLayout5Point0 = newChannelLayoutFromC(C.astiavChannelLayout5Point0)
ChannelLayout5Point1 = newChannelLayoutFromC(C.astiavChannelLayout5Point1)
ChannelLayout5Point0Back = newChannelLayoutFromC(C.astiavChannelLayout5Point0Back)
ChannelLayout5Point1Back = newChannelLayoutFromC(C.astiavChannelLayout5Point1Back)
ChannelLayout6Point0 = newChannelLayoutFromC(C.astiavChannelLayout6Point0)
ChannelLayout6Point0Front = newChannelLayoutFromC(C.astiavChannelLayout6Point0Front)
ChannelLayoutHexagonal = newChannelLayoutFromC(C.astiavChannelLayoutHexagonal)
ChannelLayout3Point1Point2 = newChannelLayoutFromC(C.astiavChannelLayout3Point1Point2)
ChannelLayout6Point1 = newChannelLayoutFromC(C.astiavChannelLayout6Point1)
ChannelLayout6Point1Back = newChannelLayoutFromC(C.astiavChannelLayout6Point1Back)
ChannelLayout6Point1Front = newChannelLayoutFromC(C.astiavChannelLayout6Point1Front)
ChannelLayout7Point0 = newChannelLayoutFromC(C.astiavChannelLayout7Point0)
ChannelLayout7Point0Front = newChannelLayoutFromC(C.astiavChannelLayout7Point0Front)
ChannelLayout7Point1 = newChannelLayoutFromC(C.astiavChannelLayout7Point1)
ChannelLayout7Point1Wide = newChannelLayoutFromC(C.astiavChannelLayout7Point1Wide)
ChannelLayout7Point1WideBack = newChannelLayoutFromC(C.astiavChannelLayout7Point1WideBack)
ChannelLayout5Point1Point2Back = newChannelLayoutFromC(C.astiavChannelLayout5Point1Point2Back)
ChannelLayoutOctagonal = newChannelLayoutFromC(C.astiavChannelLayoutOctagonal)
ChannelLayoutCube = newChannelLayoutFromC(C.astiavChannelLayoutCube)
ChannelLayout5Point1Point4Back = newChannelLayoutFromC(C.astiavChannelLayout5Point1Point4Back)
ChannelLayout7Point1Point2 = newChannelLayoutFromC(C.astiavChannelLayout7Point1Point2)
ChannelLayout7Point1Point4Back = newChannelLayoutFromC(C.astiavChannelLayout7Point1Point4Back)
ChannelLayoutHexadecagonal = newChannelLayoutFromC(C.astiavChannelLayoutHexadecagonal)
ChannelLayoutStereoDownmix = newChannelLayoutFromC(C.astiavChannelLayoutStereoDownmix)
ChannelLayout22Point2 = newChannelLayoutFromC(C.astiavChannelLayout22Point2)
ChannelLayout7Point1TopBack = newChannelLayoutFromC(C.astiavChannelLayout7Point1TopBack)
)
// https://ffmpeg.org/doxygen/8.0/structAVChannelLayout.html
type ChannelLayout struct {
c *C.AVChannelLayout
}
func newChannelLayoutFromC(c *C.AVChannelLayout) ChannelLayout {
return ChannelLayout{c: c}
}
// https://ffmpeg.org/doxygen/8.0/structAVChannelLayout.html#adfd3f460a8ea1575baa32852d9248d3c
func (l ChannelLayout) Channels() int {
if l.c == nil {
return 0
}
return int(l.c.nb_channels)
}
func (l ChannelLayout) String() string {
b := make([]byte, 1024)
n, err := l.Describe(b)
if err != nil {
return ""
}
return string(b[:n])
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audio__channels.html#gacc7d7d1a280248aafb8f9196c9d4e24f
func (l ChannelLayout) Describe(b []byte) (int, error) {
if l.c == nil {
return 0, nil
}
ret := C.av_channel_layout_describe(l.c, (*C.char)(unsafe.Pointer(&b[0])), C.size_t(len(b)))
if err := newError(ret); err != nil {
return 0, err
}
if ret > 0 && b[ret-1] == '\x00' {
ret -= 1
}
return int(ret), nil
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audio__channels.html#gad15a6bf80ee8551ee4a4789d970ccbea
func (l ChannelLayout) Valid() bool {
if l.c == nil {
return false
}
return C.av_channel_layout_check(l.c) > 0
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audio__channels.html#ga5da99475fc07b778522974a2e0a1f58c
func (l ChannelLayout) Compare(l2 ChannelLayout) (equal bool, err error) {
if l.c == nil || l2.c == nil {
return l.c == nil && l2.c == nil, nil
}
ret := C.av_channel_layout_compare(l.c, l2.c)
if err := newError(ret); err != nil {
return false, err
}
return ret == 0, nil
}
func (l ChannelLayout) Equal(l2 ChannelLayout) bool {
v, _ := l.Compare(l2)
return v
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__audio__channels.html#gad36be43b2a1b14b66492b8025b82f886
func (l ChannelLayout) copy(dst *C.AVChannelLayout) error {
return newError(C.av_channel_layout_copy(dst, l.c))
}
func (l ChannelLayout) clone() (ChannelLayout, error) {
var cl C.AVChannelLayout
err := l.copy(&cl)
dst := newChannelLayoutFromC(&cl)
return dst, err
}
================================================
FILE: channel_layout.h
================================================
#include <libavutil/channel_layout.h>
// Calling C.AV_CHANNEL_LAYOUT_* in Go gives a "could not determine kind of name for X" error
// therefore we need to bridge the channel layout values
AVChannelLayout *astiavChannelLayoutMono = &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
AVChannelLayout *astiavChannelLayoutStereo = &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
AVChannelLayout *astiavChannelLayout2Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2POINT1;
AVChannelLayout *astiavChannelLayout21 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2_1;
AVChannelLayout *astiavChannelLayoutSurround = &(AVChannelLayout)AV_CHANNEL_LAYOUT_SURROUND;
AVChannelLayout *astiavChannelLayout3Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_3POINT1;
AVChannelLayout *astiavChannelLayout4Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT0;
AVChannelLayout *astiavChannelLayout4Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT1;
AVChannelLayout *astiavChannelLayout22 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2_2;
AVChannelLayout *astiavChannelLayoutQuad = &(AVChannelLayout)AV_CHANNEL_LAYOUT_QUAD;
AVChannelLayout *astiavChannelLayout5Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0;
AVChannelLayout *astiavChannelLayout5Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1;
AVChannelLayout *astiavChannelLayout5Point0Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0_BACK;
AVChannelLayout *astiavChannelLayout5Point1Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1_BACK;
AVChannelLayout *astiavChannelLayout6Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT0;
AVChannelLayout *astiavChannelLayout6Point0Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT0_FRONT;
AVChannelLayout *astiavChannelLayoutHexagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_HEXAGONAL;
AVChannelLayout *astiavChannelLayout3Point1Point2 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_3POINT1POINT2;
AVChannelLayout *astiavChannelLayout6Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1;
AVChannelLayout *astiavChannelLayout6Point1Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1_BACK;
AVChannelLayout *astiavChannelLayout6Point1Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1_FRONT;
AVChannelLayout *astiavChannelLayout7Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT0;
AVChannelLayout *astiavChannelLayout7Point0Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT0_FRONT;
AVChannelLayout *astiavChannelLayout7Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1;
AVChannelLayout *astiavChannelLayout7Point1Wide = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_WIDE;
AVChannelLayout *astiavChannelLayout7Point1WideBack = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK;
AVChannelLayout *astiavChannelLayout5Point1Point2Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK;
AVChannelLayout *astiavChannelLayoutOctagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_OCTAGONAL;
AVChannelLayout *astiavChannelLayoutCube = &(AVChannelLayout)AV_CHANNEL_LAYOUT_CUBE;
AVChannelLayout *astiavChannelLayout5Point1Point4Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK;
AVChannelLayout *astiavChannelLayout7Point1Point2 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1POINT2;
AVChannelLayout *astiavChannelLayout7Point1Point4Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK;
AVChannelLayout *astiavChannelLayoutHexadecagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_HEXADECAGONAL;
AVChannelLayout *astiavChannelLayoutStereoDownmix = &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO_DOWNMIX;
AVChannelLayout *astiavChannelLayout22Point2 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_22POINT2;
AVChannelLayout *astiavChannelLayout7Point1TopBack = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK;
================================================
FILE: channel_layout_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestChannelLayout(t *testing.T) {
cl1 := ChannelLayoutStereo
require.Equal(t, 2, cl1.Channels())
require.Equal(t, "stereo", cl1.String())
require.True(t, cl1.Valid())
require.True(t, cl1.Equal(ChannelLayoutStereo))
require.False(t, cl1.Equal(ChannelLayoutMono))
cl2 := ChannelLayout{}
require.Equal(t, 0, cl2.Channels())
require.False(t, cl2.Valid())
require.Equal(t, "", cl2.String())
require.False(t, cl1.Equal(cl2))
cl3 := ChannelLayout{}
require.True(t, cl2.Equal(cl3))
}
================================================
FILE: chroma_location.go
================================================
package astiav
//#include <libavutil/pixfmt.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#a1f86ed1b6a420faccacf77c98db6c1ff
type ChromaLocation C.enum_AVChromaLocation
const (
ChromaLocationUnspecified = ChromaLocation(C.AVCHROMA_LOC_UNSPECIFIED)
ChromaLocationLeft = ChromaLocation(C.AVCHROMA_LOC_LEFT)
ChromaLocationCenter = ChromaLocation(C.AVCHROMA_LOC_CENTER)
ChromaLocationTopleft = ChromaLocation(C.AVCHROMA_LOC_TOPLEFT)
ChromaLocationTop = ChromaLocation(C.AVCHROMA_LOC_TOP)
ChromaLocationBottomleft = ChromaLocation(C.AVCHROMA_LOC_BOTTOMLEFT)
ChromaLocationBottom = ChromaLocation(C.AVCHROMA_LOC_BOTTOM)
ChromaLocationNb = ChromaLocation(C.AVCHROMA_LOC_NB)
)
================================================
FILE: class.c
================================================
#include <libavutil/log.h>
#include <stdint.h>
#include <stdlib.h>
char* astiavClassItemName(AVClass* c, void* ptr) {
return (char*)c->item_name(ptr);
}
AVClassCategory astiavClassCategory(AVClass* c, void* ptr) {
if (c->get_category) return c->get_category(ptr);
return c->category;
}
AVClass** astiavClassParent(AVClass* c, void* ptr) {
if (c->parent_log_context_offset) {
AVClass** parent = *(AVClass ***) (((uint8_t *) ptr) + c->parent_log_context_offset);
if (parent && *parent) {
return parent;
}
}
return NULL;
}
================================================
FILE: class.go
================================================
package astiav
//#include "class.h"
import "C"
import (
"fmt"
"sync"
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/structAVClass.html
type Class struct {
c *C.AVClass
ptr unsafe.Pointer
}
func newClassFromC(ptr unsafe.Pointer) *Class {
if ptr == nil {
return nil
}
c := (**C.AVClass)(ptr)
if c == nil {
return nil
}
return &Class{
c: *c,
ptr: ptr,
}
}
// https://ffmpeg.org/doxygen/8.0/structAVClass.html#a5fc161d93a0d65a608819da20b7203ba
func (c *Class) Category() ClassCategory {
return ClassCategory(C.astiavClassCategory(c.c, c.ptr))
}
// https://ffmpeg.org/doxygen/8.0/structAVClass.html#ad763b2e6a0846234a165e74574a550bd
func (c *Class) ItemName() string {
return C.GoString(C.astiavClassItemName(c.c, c.ptr))
}
// https://ffmpeg.org/doxygen/8.0/structAVClass.html#aa8883e113a3f2965abd008f7667db7eb
func (c *Class) Name() string {
return C.GoString(c.c.class_name)
}
// https://ffmpeg.org/doxygen/8.0/structAVClass.html#a88948c8a7c6515181771615a54a808bf
func (c *Class) Parent() *Class {
return newClassFromC(unsafe.Pointer(C.astiavClassParent(c.c, c.ptr)))
}
func (c *Class) String() string {
return fmt.Sprintf("%s [%s] @ %p", c.ItemName(), c.Name(), c.ptr)
}
type Classer interface {
Class() *Class
}
var _ Classer = (*UnknownClasser)(nil)
type UnknownClasser struct {
c *Class
}
func newUnknownClasser(ptr unsafe.Pointer) *UnknownClasser {
return &UnknownClasser{c: newClassFromC(ptr)}
}
func (c *UnknownClasser) Class() *Class {
return c.c
}
var _ Classer = (*ClonedClasser)(nil)
type ClonedClasser struct {
c *Class
}
func newClonedClasser(c Classer) *ClonedClasser {
cl := c.Class()
if cl == nil {
return nil
}
return &ClonedClasser{c: newClassFromC(cl.ptr)}
}
func (c *ClonedClasser) Class() *Class {
return c.c
}
var classers = newClasserPool()
type classerPool struct {
m sync.Mutex
p map[unsafe.Pointer]Classer
}
func newClasserPool() *classerPool {
return &classerPool{p: make(map[unsafe.Pointer]Classer)}
}
func (p *classerPool) unsafePointer(c Classer) unsafe.Pointer {
if c == nil {
return nil
}
cl := c.Class()
if cl == nil {
return nil
}
return cl.ptr
}
func (p *classerPool) set(c Classer) {
p.m.Lock()
defer p.m.Unlock()
if ptr := p.unsafePointer(c); ptr != nil {
p.p[ptr] = c
}
}
func (p *classerPool) del(c Classer) {
p.m.Lock()
defer p.m.Unlock()
if ptr := p.unsafePointer(c); ptr != nil {
delete(p.p, ptr)
}
}
func (p *classerPool) get(ptr unsafe.Pointer) (Classer, bool) {
p.m.Lock()
defer p.m.Unlock()
c, ok := p.p[ptr]
return c, ok
}
================================================
FILE: class.h
================================================
#include <libavutil/log.h>
char* astiavClassItemName(AVClass* c, void* ptr);
AVClassCategory astiavClassCategory(AVClass* c, void* ptr);
AVClass** astiavClassParent(AVClass* c, void* ptr);
================================================
FILE: class_category.go
================================================
package astiav
//#include <libavutil/log.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/log_8h.html#aeb1c06cc3e47a029ca6afeac782ac8f9
type ClassCategory C.AVClassCategory
const (
ClassCategoryBitstreamFilter = ClassCategory(C.AV_CLASS_CATEGORY_BITSTREAM_FILTER)
ClassCategoryDecoder = ClassCategory(C.AV_CLASS_CATEGORY_DECODER)
ClassCategoryDemuxer = ClassCategory(C.AV_CLASS_CATEGORY_DEMUXER)
ClassCategoryDeviceAudioInput = ClassCategory(C.AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT)
ClassCategoryDeviceAudioOutput = ClassCategory(C.AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT)
ClassCategoryDeviceInput = ClassCategory(C.AV_CLASS_CATEGORY_DEVICE_INPUT)
ClassCategoryDeviceOutput = ClassCategory(C.AV_CLASS_CATEGORY_DEVICE_OUTPUT)
ClassCategoryDeviceVideoInput = ClassCategory(C.AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT)
ClassCategoryDeviceVideoOutput = ClassCategory(C.AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT)
ClassCategoryEncoder = ClassCategory(C.AV_CLASS_CATEGORY_ENCODER)
ClassCategoryFilter = ClassCategory(C.AV_CLASS_CATEGORY_FILTER)
ClassCategoryInput = ClassCategory(C.AV_CLASS_CATEGORY_INPUT)
ClassCategoryMuxer = ClassCategory(C.AV_CLASS_CATEGORY_MUXER)
ClassCategoryNa = ClassCategory(C.AV_CLASS_CATEGORY_NA)
ClassCategoryNb = ClassCategory(C.AV_CLASS_CATEGORY_NB)
ClassCategoryOutput = ClassCategory(C.AV_CLASS_CATEGORY_OUTPUT)
ClassCategorySwresampler = ClassCategory(C.AV_CLASS_CATEGORY_SWRESAMPLER)
ClassCategorySwscaler = ClassCategory(C.AV_CLASS_CATEGORY_SWSCALER)
)
================================================
FILE: class_test.go
================================================
package astiav
import (
"fmt"
"os"
"path/filepath"
"testing"
"unsafe"
"github.com/stretchr/testify/require"
)
func TestClass(t *testing.T) {
c := FindDecoder(CodecIDMjpeg)
require.NotNil(t, c)
cc := AllocCodecContext(c)
require.NotNil(t, cc)
defer cc.Free()
cl := cc.Class()
require.NotNil(t, cl)
require.Equal(t, ClassCategoryDecoder, cl.Category())
require.Equal(t, "mjpeg", cl.ItemName())
require.Equal(t, "AVCodecContext", cl.Name())
require.Equal(t, fmt.Sprintf("mjpeg [AVCodecContext] @ %p", cc.c), cl.String())
// TODO Test parent
}
func TestClassers(t *testing.T) {
cl := len(classers.p)
f1 := AllocFilterGraph()
f2 := AllocFilterGraph()
c := FindDecoder(CodecIDMjpeg)
require.NotNil(t, c)
bf := FindBitStreamFilterByName("null")
require.NotNil(t, bf)
bfc, err := AllocBitStreamFilterContext(bf)
require.NoError(t, err)
cc := AllocCodecContext(c)
require.NotNil(t, cc)
bufferSink := FindFilterByName("buffersink")
require.NotNil(t, bufferSink)
bfc1, err := f1.NewBuffersinkFilterContext(bufferSink, "filter_out")
require.NoError(t, err)
_, err = f2.NewBuffersinkFilterContext(bufferSink, "filter_out")
require.NoError(t, err)
fmc1 := AllocFormatContext()
fmc2 := AllocFormatContext()
require.NoError(t, fmc2.OpenInput("testdata/video.mp4", nil, nil))
path := filepath.Join(t.TempDir(), "iocontext.txt")
ic1, err := OpenIOContext(path, NewIOContextFlags(IOContextFlagWrite), nil, nil)
require.NoError(t, err)
defer os.RemoveAll(path)
ic2, err := AllocIOContext(1, true, nil, nil, nil)
require.NoError(t, err)
src := AllocSoftwareResampleContext()
ssc, err := CreateSoftwareScaleContext(1, 1, PixelFormatRgba, 2, 2, PixelFormatRgba, NewSoftwareScaleContextFlags())
require.NoError(t, err)
require.Equal(t, cl+13, len(classers.p))
v, ok := classers.get(unsafe.Pointer(f1.c))
require.True(t, ok)
require.Equal(t, f1, v)
bfc.Free()
cc.Free()
bfc1.FilterContext().Free()
f1.Free()
f2.Free()
fmc1.Free()
fmc2.CloseInput()
require.NoError(t, ic1.Close())
ic2.Free()
src.Free()
ssc.Free()
require.Equal(t, cl, len(classers.p))
}
================================================
FILE: codec.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
//#include <libavutil/channel_layout.h>
import "C"
import (
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/structAVCodec.html
type Codec struct {
c *C.AVCodec
}
func newCodecFromC(c *C.AVCodec) *Codec {
if c == nil {
return nil
}
return &Codec{c: c}
}
// https://ffmpeg.org/doxygen/8.0/structAVCodec.html#ad3daa3e729850b573c139a83be8938ca
func (c *Codec) Name() string {
return C.GoString(c.c.name)
}
func (c *Codec) String() string {
return c.Name()
}
// https://ffmpeg.org/doxygen/8.0/structAVCodec.html#a01a53d07936f4c7ee280444793b6967b
func (c *Codec) ID() CodecID {
return CodecID(c.c.id)
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga6dc18eef1afca3610644a52565cf8a31
func (c *Codec) IsDecoder() bool {
return int(C.av_codec_is_decoder(c.c)) != 0
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga2b665824e4d9144f8d4f6c01e3e85aa3
func (c *Codec) IsEncoder() bool {
return int(C.av_codec_is_encoder(c.c)) != 0
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#gadd58e6b0bbca99fdbc547efbaa6b0ef1
func (c *Codec) supportedConfig(config C.enum_AVCodecConfig, fn func(ptr unsafe.Pointer), size C.size_t) {
var outConfigs unsafe.Pointer
var outNumConfigs C.int
ret := C.avcodec_get_supported_config(nil, c.c, config, 0, &outConfigs, &outNumConfigs)
if ret >= 0 && outConfigs != nil {
numConfigs := uintptr(outNumConfigs)
for i := uintptr(0); i < numConfigs; i++ {
fn(unsafe.Pointer(uintptr(outConfigs) + i*uintptr(size)))
}
}
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9abe043ed40f3c270dff77235fcfcd0b
func (c *Codec) SupportedChannelLayouts() (o []ChannelLayout) {
c.supportedConfig(C.AV_CODEC_CONFIG_CHANNEL_LAYOUT, func(ptr unsafe.Pointer) {
v, _ := newChannelLayoutFromC((*C.AVChannelLayout)(ptr)).clone()
o = append(o, v)
}, C.sizeof_AVChannelLayout)
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9abe043ed40f3c270dff77235fcfcd0b
func (c *Codec) SupportedColorRanges() (o []ColorRange) {
c.supportedConfig(C.AV_CODEC_CONFIG_COLOR_RANGE, func(ptr unsafe.Pointer) {
o = append(o, ColorRange(*(*C.enum_AVColorRange)(ptr)))
}, C.sizeof_enum_AVColorRange)
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9abe043ed40f3c270dff77235fcfcd0b
func (c *Codec) SupportedColorSpaces() (o []ColorSpace) {
c.supportedConfig(C.AV_CODEC_CONFIG_COLOR_SPACE, func(ptr unsafe.Pointer) {
o = append(o, ColorSpace(*(*C.enum_AVColorSpace)(ptr)))
}, C.sizeof_enum_AVColorSpace)
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9abe043ed40f3c270dff77235fcfcd0b
func (c *Codec) SupportedPixelFormats() (o []PixelFormat) {
c.supportedConfig(C.AV_CODEC_CONFIG_PIX_FORMAT, func(ptr unsafe.Pointer) {
o = append(o, PixelFormat(*(*C.enum_AVPixelFormat)(ptr)))
}, C.sizeof_enum_AVPixelFormat)
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9abe043ed40f3c270dff77235fcfcd0b
func (c *Codec) SupportedSampleFormats() (o []SampleFormat) {
c.supportedConfig(C.AV_CODEC_CONFIG_SAMPLE_FORMAT, func(ptr unsafe.Pointer) {
o = append(o, SampleFormat(*(*C.enum_AVSampleFormat)(ptr)))
}, C.sizeof_enum_AVSampleFormat)
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9abe043ed40f3c270dff77235fcfcd0b
func (c *Codec) SupportedFrameRates() (o []Rational) {
c.supportedConfig(C.AV_CODEC_CONFIG_FRAME_RATE, func(ptr unsafe.Pointer) {
o = append(o, newRationalFromC(*(*C.AVRational)(ptr)))
}, C.sizeof_AVRational)
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9abe043ed40f3c270dff77235fcfcd0b
func (c *Codec) SupportedSampleRates() (o []int) {
c.supportedConfig(C.AV_CODEC_CONFIG_SAMPLE_RATE, func(ptr unsafe.Pointer) {
o = append(o, int(*(*C.int)(ptr)))
}, C.sizeof_int)
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga51e35d01da2b3833b3afa839212c58fa
func FindDecoder(id CodecID) *Codec {
return newCodecFromC(C.avcodec_find_decoder((C.enum_AVCodecID)(id)))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#gad4e08a758f3560006145db074d16cb47
func FindDecoderByName(n string) *Codec {
cn := C.CString(n)
defer C.free(unsafe.Pointer(cn))
return newCodecFromC(C.avcodec_find_decoder_by_name(cn))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga68e4b5f31de5e5fc25d5781a1be22331
func FindEncoder(id CodecID) *Codec {
return newCodecFromC(C.avcodec_find_encoder((C.enum_AVCodecID)(id)))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga9fa02c1eae54a2ec67beb789c2688d6e
func FindEncoderByName(n string) *Codec {
cn := C.CString(n)
defer C.free(unsafe.Pointer(cn))
return newCodecFromC(C.avcodec_find_encoder_by_name(cn))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga4f80582a2ea9c0e141de5d6f6152008f
func (c *Codec) HardwareConfigs() (configs []CodecHardwareConfig) {
var i int
for {
config := C.avcodec_get_hw_config(c.c, C.int(i))
if config == nil {
break
}
configs = append(configs, newCodecHardwareConfigFromC(config))
i++
}
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga7cd040fcc147340186deb0c54dc996b0
func Codecs() (cs []*Codec) {
var opq *C.void = nil
for {
c := C.av_codec_iterate((*unsafe.Pointer)(unsafe.Pointer(&opq)))
if c == nil {
break
}
cs = append(cs, newCodecFromC(c))
}
return
}
================================================
FILE: codec_context.c
================================================
#include "codec_context.h"
#include <libavcodec/avcodec.h>
#include <stdlib.h>
enum AVPixelFormat astiavCodecContextGetFormat(AVCodecContext *ctx, const enum AVPixelFormat *pix_fmts)
{
int pix_fmts_size = 0;
while (*pix_fmts != AV_PIX_FMT_NONE) {
pix_fmts_size++;
pix_fmts++;
}
pix_fmts -= pix_fmts_size;
return goAstiavCodecContextGetFormat(ctx, (enum AVPixelFormat*)(pix_fmts), pix_fmts_size);
}
void astiavSetCodecContextGetFormat(AVCodecContext *ctx)
{
ctx->get_format = astiavCodecContextGetFormat;
}
void astiavResetCodecContextGetFormat(AVCodecContext *ctx)
{
ctx->get_format = NULL;
}
================================================
FILE: codec_context.go
================================================
package astiav
//#include "codec_context.h"
import "C"
import (
"sync"
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html
type CodecContext struct {
c *C.AVCodecContext
}
func newCodecContextFromC(c *C.AVCodecContext) *CodecContext {
if c == nil {
return nil
}
cc := &CodecContext{c: c}
classers.set(cc)
return cc
}
var _ Classer = (*CodecContext)(nil)
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#gae80afec6f26df6607eaacf39b561c315
func AllocCodecContext(c *Codec) *CodecContext {
var cc *C.AVCodec
if c != nil {
cc = c.c
}
return newCodecContextFromC(C.avcodec_alloc_context3(cc))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#gaf869d0829ed607cec3a4a02a1c7026b3
func (cc *CodecContext) Free() {
if cc.c != nil {
if cc.c.hw_device_ctx != nil {
C.av_buffer_unref(&cc.c.hw_device_ctx)
}
if cc.c.hw_frames_ctx != nil {
C.av_buffer_unref(&cc.c.hw_frames_ctx)
}
// Make sure to clone the classer before freeing the object since
// the C free method may reset the pointer
c := newClonedClasser(cc)
C.avcodec_free_context(&cc.c)
// Make sure to remove from classers after freeing the object since
// the C free method may use methods needing the classer
if c != nil {
classers.del(c)
}
}
}
func (cc *CodecContext) String() string {
s, _ := stringFromC(255, func(buf *C.char, size C.size_t) error {
C.avcodec_string(buf, C.int(size), cc.c, C.int(0))
return nil
})
return s
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a6b53fda85ad61baa345edbd96cb8a33c
func (cc *CodecContext) BitRate() int64 {
return int64(cc.c.bit_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a6b53fda85ad61baa345edbd96cb8a33c
func (cc *CodecContext) SetBitRate(bitRate int64) {
cc.c.bit_rate = C.int64_t(bitRate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a167ff73c67960acf2d5ca73d93e13f64
func (cc *CodecContext) ChannelLayout() ChannelLayout {
l, _ := newChannelLayoutFromC(&cc.c.ch_layout).clone()
return l
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a167ff73c67960acf2d5ca73d93e13f64
func (cc *CodecContext) SetChannelLayout(l ChannelLayout) {
l.copy(&cc.c.ch_layout) //nolint: errcheck
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ac60a0209642b5d74068cab0ac35a78b2
func (cc *CodecContext) ChromaLocation() ChromaLocation {
return ChromaLocation(cc.c.chroma_sample_location)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a90622d3af2a9abba986a1c9f7ca21b16
func (cc *CodecContext) Class() *Class {
if cc.c == nil {
return nil
}
return newClassFromC(unsafe.Pointer(cc.c))
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#adc5f65d6099fd8339c1580c091777223
func (cc *CodecContext) CodecID() CodecID {
return CodecID(cc.c.codec_id)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3a41b3e5bde23b877799f6e72dac8ef3
func (cc *CodecContext) ColorPrimaries() ColorPrimaries {
return ColorPrimaries(cc.c.color_primaries)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3a41b3e5bde23b877799f6e72dac8ef3
func (cc *CodecContext) SetColorPrimaries(p ColorPrimaries) {
cc.c.color_primaries = C.enum_AVColorPrimaries(p)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a255bf7100a4ba6dcb6ee5d87740a4f35
func (cc *CodecContext) ColorRange() ColorRange {
return ColorRange(cc.c.color_range)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a255bf7100a4ba6dcb6ee5d87740a4f35
func (cc *CodecContext) SetColorRange(r ColorRange) {
cc.c.color_range = C.enum_AVColorRange(r)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a8cd8caa7d40319324ce3d879a2edbd9f
func (cc *CodecContext) ColorSpace() ColorSpace {
return ColorSpace(cc.c.colorspace)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a8cd8caa7d40319324ce3d879a2edbd9f
func (cc *CodecContext) SetColorSpace(s ColorSpace) {
cc.c.colorspace = C.enum_AVColorSpace(s)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ab649e8c599f5a0e2a30448e67a36deb6
func (cc *CodecContext) ColorTransferCharacteristic() ColorTransferCharacteristic {
return ColorTransferCharacteristic(cc.c.color_trc)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ab649e8c599f5a0e2a30448e67a36deb6
func (cc *CodecContext) SetColorTransferCharacteristic(tc ColorTransferCharacteristic) {
cc.c.color_trc = C.enum_AVColorTransferCharacteristic(tc)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#af9978d9bd6ac80a494ef1b78fe1d004f
func (cc *CodecContext) ErrorRecognitionFlags() ErrorRecognitionFlags {
return ErrorRecognitionFlags(cc.c.err_recognition)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#af9978d9bd6ac80a494ef1b78fe1d004f
func (cc *CodecContext) SetErrorRecognitionFlags(fs ErrorRecognitionFlags) {
cc.c.err_recognition = C.int(fs)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#abe964316aaaa61967b012efdcced79c4
func (cc *CodecContext) ExtraData() []byte {
return bytesFromC(func(size *C.size_t) *C.uint8_t {
*size = C.size_t(cc.c.extradata_size)
return cc.c.extradata
})
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#abe964316aaaa61967b012efdcced79c4
func (cc *CodecContext) SetExtraData(b []byte) error {
return setBytesWithIntSizeInC(b, &cc.c.extradata, &cc.c.extradata_size)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#abb01e291550fa3fb96188af4d494587e
func (cc *CodecContext) Flags() CodecContextFlags {
return CodecContextFlags(cc.c.flags)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#abb01e291550fa3fb96188af4d494587e
func (cc *CodecContext) SetFlags(fs CodecContextFlags) {
cc.c.flags = C.int(fs)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a1944f9a4f8f2e123c087e1fe7613d571
func (cc *CodecContext) Flags2() CodecContextFlags2 {
return CodecContextFlags2(cc.c.flags2)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a1944f9a4f8f2e123c087e1fe7613d571
func (cc *CodecContext) SetFlags2(fs CodecContextFlags2) {
cc.c.flags2 = C.int(fs)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a4d08b297e97eefd66c714df4fff493c8
func (cc *CodecContext) Framerate() Rational {
return newRationalFromC(cc.c.framerate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a4d08b297e97eefd66c714df4fff493c8
func (cc *CodecContext) SetFramerate(f Rational) {
cc.c.framerate = f.c
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#aec57f0d859a6df8b479cd93ca3a44a33
func (cc *CodecContext) FrameSize() int {
return int(cc.c.frame_size)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a9b6b3f1fcbdcc2ad9f4dbb4370496e38
func (cc *CodecContext) GopSize() int {
return int(cc.c.gop_size)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a9b6b3f1fcbdcc2ad9f4dbb4370496e38
func (cc *CodecContext) SetGopSize(gopSize int) {
cc.c.gop_size = C.int(gopSize)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a0449afd803eb107bd4dbc8b5ea22e363
func (cc *CodecContext) Height() int {
return int(cc.c.height)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a0449afd803eb107bd4dbc8b5ea22e363
func (cc *CodecContext) SetHeight(height int) {
cc.c.height = C.int(height)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a6927dc652ae6241f1dfdbad4e12d3a40
func (cc *CodecContext) Level() Level {
return Level(cc.c.level)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a6927dc652ae6241f1dfdbad4e12d3a40
func (cc *CodecContext) SetLevel(l Level) {
cc.c.level = C.int(l)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3f99ca3115c44e6d7772c9384faf15e6
func (cc *CodecContext) MediaType() MediaType {
return MediaType(cc.c.codec_type)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a0425c77b3d06d71e5db88b1d7e1b37f2
func (cc *CodecContext) PixelFormat() PixelFormat {
return PixelFormat(cc.c.pix_fmt)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a0425c77b3d06d71e5db88b1d7e1b37f2
func (cc *CodecContext) SetPixelFormat(pixFmt PixelFormat) {
cc.c.pix_fmt = C.enum_AVPixelFormat(pixFmt)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#af3379123060ad8cc9c321c29af4f8360
func (cc *CodecContext) PrivateData() *PrivateData {
return newPrivateDataFromC(cc.c.priv_data)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a7abe7095de73df98df4895bf9e25fc6b
func (cc *CodecContext) Profile() Profile {
return Profile(cc.c.profile)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a7abe7095de73df98df4895bf9e25fc6b
func (cc *CodecContext) SetProfile(p Profile) {
cc.c.profile = C.int(p)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3f63bc9141e25bf7f1cda0cef7cd4a60
func (cc *CodecContext) Qmin() int {
return int(cc.c.qmin)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3f63bc9141e25bf7f1cda0cef7cd4a60
func (cc *CodecContext) SetQmin(qmin int) {
cc.c.qmin = C.int(qmin)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a5252d34fbce300228d4dbda19a8c3293
func (cc *CodecContext) SampleAspectRatio() Rational {
return newRationalFromC(cc.c.sample_aspect_ratio)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a5252d34fbce300228d4dbda19a8c3293
func (cc *CodecContext) SetSampleAspectRatio(r Rational) {
cc.c.sample_aspect_ratio = r.c
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a1bdba69ea111e2a9d03fdaa7a46a4c45
func (cc *CodecContext) SampleFormat() SampleFormat {
return SampleFormat(cc.c.sample_fmt)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a1bdba69ea111e2a9d03fdaa7a46a4c45
func (cc *CodecContext) SetSampleFormat(f SampleFormat) {
cc.c.sample_fmt = C.enum_AVSampleFormat(f)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a8ff0b000c463361e234af48d03aadfc0
func (cc *CodecContext) SampleRate() int {
return int(cc.c.sample_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a8ff0b000c463361e234af48d03aadfc0
func (cc *CodecContext) SetSampleRate(sampleRate int) {
cc.c.sample_rate = C.int(sampleRate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3090804569341ca235e3adbdc03318d2
func (cc *CodecContext) StrictStdCompliance() StrictStdCompliance {
return StrictStdCompliance(cc.c.strict_std_compliance)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3090804569341ca235e3adbdc03318d2
func (cc *CodecContext) SetStrictStdCompliance(c StrictStdCompliance) {
cc.c.strict_std_compliance = C.int(c)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ab7bfeb9fa5840aac090e2b0bd0ef7589
func (cc *CodecContext) TimeBase() Rational {
return newRationalFromC(cc.c.time_base)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ab7bfeb9fa5840aac090e2b0bd0ef7589
func (cc *CodecContext) SetTimeBase(r Rational) {
cc.c.time_base = r.c
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#aa852b6227d0778b62e9cc4034ad3720c
func (cc *CodecContext) ThreadCount() int {
return int(cc.c.thread_count)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#aa852b6227d0778b62e9cc4034ad3720c
func (cc *CodecContext) SetThreadCount(threadCount int) {
cc.c.thread_count = C.int(threadCount)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a7651614f4309122981d70e06a4b42fcb
func (cc *CodecContext) ThreadType() ThreadType {
return ThreadType(cc.c.thread_type)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a7651614f4309122981d70e06a4b42fcb
func (cc *CodecContext) SetThreadType(t ThreadType) {
cc.c.thread_type = C.int(t)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a0d8f46461754e8abea0847dcbc41b956
func (cc *CodecContext) Width() int {
return int(cc.c.width)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a0d8f46461754e8abea0847dcbc41b956
func (cc *CodecContext) SetWidth(width int) {
cc.c.width = C.int(width)
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga11f785a188d7d9df71621001465b0f1d
func (cc *CodecContext) Open(c *Codec, d *Dictionary) error {
var dc **C.AVDictionary
if d != nil {
dc = &d.c
}
return newError(C.avcodec_open2(cc.c, c.c, dc))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga5b8eff59cf259747cf0b31563e38ded6
func (cc *CodecContext) ReceivePacket(p *Packet) error {
var pc *C.AVPacket
if p != nil {
pc = p.c
}
return newError(C.avcodec_receive_packet(cc.c, pc))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga58bc4bf1e0ac59e27362597e467efff3
func (cc *CodecContext) SendPacket(p *Packet) error {
var pc *C.AVPacket
if p != nil {
pc = p.c
}
return newError(C.avcodec_send_packet(cc.c, pc))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga11e6542c4e66d3028668788a1a74217c
func (cc *CodecContext) ReceiveFrame(f *Frame) error {
var fc *C.AVFrame
if f != nil {
fc = f.c
}
return newError(C.avcodec_receive_frame(cc.c, fc))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga9395cb802a5febf1f00df31497779169
func (cc *CodecContext) SendFrame(f *Frame) error {
var fc *C.AVFrame
if f != nil {
fc = f.c
}
return newError(C.avcodec_send_frame(cc.c, fc))
}
func (cc *CodecContext) ToCodecParameters(cp *CodecParameters) error {
return cp.FromCodecContext(cc)
}
func (cc *CodecContext) FromCodecParameters(cp *CodecParameters) error {
return cp.ToCodecContext(cc)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#acf8113e490f9e7b57465e65af9c0c75c
func (cc *CodecContext) SetHardwareDeviceContext(hdc *HardwareDeviceContext) {
if cc.c.hw_device_ctx != nil {
C.av_buffer_unref(&cc.c.hw_device_ctx)
}
if hdc != nil {
cc.c.hw_device_ctx = C.av_buffer_ref(hdc.c)
} else {
cc.c.hw_device_ctx = nil
}
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3bac44bb0b016ab838780cc19ac277d6
func (cc *CodecContext) HardwareFramesContext() *HardwareFramesContext {
return newHardwareFramesContextFromC(cc.c.hw_frames_ctx)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3bac44bb0b016ab838780cc19ac277d6
func (cc *CodecContext) SetHardwareFramesContext(hfc *HardwareFramesContext) {
if cc.c.hw_frames_ctx != nil {
C.av_buffer_unref(&cc.c.hw_frames_ctx)
}
if hfc != nil {
cc.c.hw_frames_ctx = C.av_buffer_ref(hfc.c)
} else {
cc.c.hw_frames_ctx = nil
}
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ad2f772bd948d8f3be4d674a3a52ee00e
func (cc *CodecContext) ExtraHardwareFrames() int {
return int(cc.c.extra_hw_frames)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ad2f772bd948d8f3be4d674a3a52ee00e
func (cc *CodecContext) SetExtraHardwareFrames(n int) {
cc.c.extra_hw_frames = C.int(n)
}
func (cc *CodecContext) UnsafePointer() unsafe.Pointer {
return unsafe.Pointer(cc.c)
}
type CodecContextPixelFormatCallback func(pfs []PixelFormat) PixelFormat
var (
codecContextPixelFormatCallbacks = make(map[*C.AVCodecContext]CodecContextPixelFormatCallback)
codecContextPixelFormatCallbacksMutex = &sync.Mutex{}
)
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a360a2b8508a67c4234d97f4c13ba1bb5
func (cc *CodecContext) SetPixelFormatCallback(c CodecContextPixelFormatCallback) {
// Lock
codecContextPixelFormatCallbacksMutex.Lock()
defer codecContextPixelFormatCallbacksMutex.Unlock()
// Update callback
if c == nil {
C.astiavResetCodecContextGetFormat(cc.c)
delete(codecContextPixelFormatCallbacks, cc.c)
} else {
C.astiavSetCodecContextGetFormat(cc.c)
codecContextPixelFormatCallbacks[cc.c] = c
}
}
//export goAstiavCodecContextGetFormat
func goAstiavCodecContextGetFormat(cc *C.AVCodecContext, pfsCPtr *C.enum_AVPixelFormat, pfsCSize C.int) C.enum_AVPixelFormat {
// Lock
codecContextPixelFormatCallbacksMutex.Lock()
defer codecContextPixelFormatCallbacksMutex.Unlock()
// Get callback
c, ok := codecContextPixelFormatCallbacks[cc]
if !ok {
return C.enum_AVPixelFormat(PixelFormatNone)
}
// Get pixel formats
var pfs []PixelFormat
for _, v := range unsafe.Slice(pfsCPtr, pfsCSize) {
pfs = append(pfs, PixelFormat(v))
}
// Callback
return C.enum_AVPixelFormat(c(pfs))
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3e5334a611a3e2a6a653805bb9e2d4d4
func (cc *CodecContext) MaxBFrames() int {
return int(cc.c.max_b_frames)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a3e5334a611a3e2a6a653805bb9e2d4d4
func (cc *CodecContext) SetMaxBFrames(n int) {
cc.c.max_b_frames = C.int(n)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#aa2b5582f1a360534310b686cc3f7c668
func (cc *CodecContext) RateControlMaxRate() int64 {
return int64(cc.c.rc_max_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#aa2b5582f1a360534310b686cc3f7c668
func (cc *CodecContext) SetRateControlMaxRate(n int64) {
cc.c.rc_max_rate = C.int64_t(n)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ac265c70b89e87455ec05eb2978def81b
func (cc *CodecContext) RateControlMinRate() int64 {
return int64(cc.c.rc_min_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#ac265c70b89e87455ec05eb2978def81b
func (cc *CodecContext) SetRateControlMinRate(n int64) {
cc.c.rc_min_rate = C.int64_t(n)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a15000607a7e2371162348bb35b0184c1
func (cc *CodecContext) RateControlBufferSize() int {
return int(cc.c.rc_buffer_size)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecContext.html#a15000607a7e2371162348bb35b0184c1
func (cc *CodecContext) SetRateControlBufferSize(n int) {
cc.c.rc_buffer_size = C.int(n)
}
================================================
FILE: codec_context.h
================================================
#include <libavcodec/avcodec.h>
extern enum AVPixelFormat goAstiavCodecContextGetFormat(AVCodecContext *ctx, enum AVPixelFormat *pix_fmts, int pix_fmts_size);
enum AVPixelFormat astiavCodecContextGetFormat(AVCodecContext *ctx, const enum AVPixelFormat *pix_fmts);
void astiavSetCodecContextGetFormat(AVCodecContext *ctx);
void astiavResetCodecContextGetFormat(AVCodecContext *ctx);
================================================
FILE: codec_context_flag.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#gaa52d62f5dbfc4529388f0454ae671359
type CodecContextFlag int64
const (
CodecContextFlagUnaligned = CodecContextFlag(C.AV_CODEC_FLAG_UNALIGNED)
CodecContextFlagQscale = CodecContextFlag(C.AV_CODEC_FLAG_QSCALE)
CodecContextFlag4Mv = CodecContextFlag(C.AV_CODEC_FLAG_4MV)
CodecContextFlagOutputCorrupt = CodecContextFlag(C.AV_CODEC_FLAG_OUTPUT_CORRUPT)
CodecContextFlagQpel = CodecContextFlag(C.AV_CODEC_FLAG_QPEL)
CodecContextFlagPass1 = CodecContextFlag(C.AV_CODEC_FLAG_PASS1)
CodecContextFlagPass2 = CodecContextFlag(C.AV_CODEC_FLAG_PASS2)
CodecContextFlagLoopFilter = CodecContextFlag(C.AV_CODEC_FLAG_LOOP_FILTER)
CodecContextFlagGray = CodecContextFlag(C.AV_CODEC_FLAG_GRAY)
CodecContextFlagPsnr = CodecContextFlag(C.AV_CODEC_FLAG_PSNR)
CodecContextFlagInterlacedDct = CodecContextFlag(C.AV_CODEC_FLAG_INTERLACED_DCT)
CodecContextFlagLowDelay = CodecContextFlag(C.AV_CODEC_FLAG_LOW_DELAY)
CodecContextFlagGlobalHeader = CodecContextFlag(C.AV_CODEC_FLAG_GLOBAL_HEADER)
CodecContextFlagBitexact = CodecContextFlag(C.AV_CODEC_FLAG_BITEXACT)
CodecContextFlagAcPred = CodecContextFlag(C.AV_CODEC_FLAG_AC_PRED)
CodecContextFlagInterlacedMe = CodecContextFlag(C.AV_CODEC_FLAG_INTERLACED_ME)
CodecContextFlagClosedGop = CodecContextFlag(C.AV_CODEC_FLAG_CLOSED_GOP)
)
type CodecContextFlag2 int64
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga1a6a486e686ab6c581ffffcb88cb31b3
const (
CodecFlag2Fast = CodecContextFlag2(C.AV_CODEC_FLAG2_FAST)
CodecFlag2NoOutput = CodecContextFlag2(C.AV_CODEC_FLAG2_NO_OUTPUT)
CodecFlag2LocalHeader = CodecContextFlag2(C.AV_CODEC_FLAG2_LOCAL_HEADER)
CodecFlag2Chunks = CodecContextFlag2(C.AV_CODEC_FLAG2_CHUNKS)
CodecFlag2IgnoreCrop = CodecContextFlag2(C.AV_CODEC_FLAG2_IGNORE_CROP)
CodecFlag2ShowAll = CodecContextFlag2(C.AV_CODEC_FLAG2_SHOW_ALL)
CodecFlag2ExportMvs = CodecContextFlag2(C.AV_CODEC_FLAG2_EXPORT_MVS)
CodecFlag2SkipManual = CodecContextFlag2(C.AV_CODEC_FLAG2_SKIP_MANUAL)
CodecFlag2RoFlushNoop = CodecContextFlag2(C.AV_CODEC_FLAG2_RO_FLUSH_NOOP)
CodecFlag2IccProfiles = CodecContextFlag2(C.AV_CODEC_FLAG2_ICC_PROFILES)
)
================================================
FILE: codec_context_test.go
================================================
package astiav
import (
"testing"
"unsafe"
"github.com/stretchr/testify/require"
)
func TestCodecContext(t *testing.T) {
fc, err := globalHelper.inputFormatContext("video.mp4", nil)
require.NoError(t, err)
ss := fc.Streams()
require.Len(t, ss, 2)
s1 := ss[0]
s2 := ss[1]
c1 := FindDecoder(s1.CodecParameters().CodecID())
require.NotNil(t, c1)
cc1 := AllocCodecContext(c1)
require.NotNil(t, cc1)
defer cc1.Free()
err = s1.CodecParameters().ToCodecContext(cc1)
require.NoError(t, err)
require.Equal(t, "Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 320x180 [SAR 1:1 DAR 16:9], 441 kb/s", cc1.String())
require.Equal(t, int64(441324), cc1.BitRate())
require.Equal(t, ChromaLocationLeft, cc1.ChromaLocation())
require.Equal(t, CodecIDH264, cc1.CodecID())
require.Equal(t, ColorPrimariesUnspecified, cc1.ColorPrimaries())
require.Equal(t, ColorRangeUnspecified, cc1.ColorRange())
require.Equal(t, ColorSpaceUnspecified, cc1.ColorSpace())
require.Equal(t, ColorTransferCharacteristicUnspecified, cc1.ColorTransferCharacteristic())
require.Equal(t, 12, cc1.GopSize())
require.Equal(t, 180, cc1.Height())
require.Equal(t, Level(13), cc1.Level())
require.Equal(t, MediaTypeVideo, cc1.MediaType())
require.Equal(t, PixelFormatYuv420P, cc1.PixelFormat())
require.NotNil(t, cc1.PrivateData())
require.Equal(t, ProfileH264ConstrainedBaseline, cc1.Profile())
require.Equal(t, NewRational(1, 1), cc1.SampleAspectRatio())
require.Equal(t, StrictStdComplianceNormal, cc1.StrictStdCompliance())
require.Equal(t, 1, cc1.ThreadCount())
require.Equal(t, ThreadType(3), cc1.ThreadType())
require.Equal(t, 320, cc1.Width())
require.Equal(t, unsafe.Pointer(cc1.c), cc1.UnsafePointer())
cl := cc1.Class()
require.NotNil(t, cl)
require.Equal(t, "AVCodecContext", cl.Name())
c2 := FindDecoder(s2.CodecParameters().CodecID())
require.NotNil(t, c2)
cc2 := AllocCodecContext(c2)
require.NotNil(t, cc2)
defer cc2.Free()
err = s2.CodecParameters().ToCodecContext(cc2)
require.NoError(t, err)
require.Equal(t, "Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 161 kb/s", cc2.String())
require.Equal(t, int64(161052), cc2.BitRate())
require.True(t, cc2.ChannelLayout().Equal(ChannelLayoutStereo))
require.Equal(t, CodecIDAac, cc2.CodecID())
require.Equal(t, 1024, cc2.FrameSize())
require.Equal(t, MediaTypeAudio, cc2.MediaType())
require.Equal(t, SampleFormatFltp, cc2.SampleFormat())
require.Equal(t, 48000, cc2.SampleRate())
require.Equal(t, StrictStdComplianceNormal, cc2.StrictStdCompliance())
require.Equal(t, 1, cc2.ThreadCount())
require.Equal(t, ThreadType(3), cc2.ThreadType())
c3 := FindEncoder(CodecIDMjpeg)
require.NotNil(t, c3)
cc3 := AllocCodecContext(c3)
require.NotNil(t, cc3)
defer cc3.Free()
cc3.SetHeight(2)
cc3.SetPixelFormat(PixelFormatYuvj420P)
cc3.SetTimeBase(NewRational(1, 1))
cc3.SetWidth(3)
err = cc3.Open(c3, nil)
require.NoError(t, err)
cc4 := AllocCodecContext(nil)
require.NotNil(t, cc4)
defer cc4.Free()
cc4.SetBitRate(1)
cc4.SetChannelLayout(ChannelLayout21)
cc4.SetColorPrimaries(ColorPrimariesBt2020)
cc4.SetColorRange(ColorRangeJpeg)
cc4.SetColorSpace(ColorSpaceBt2020Cl)
cc4.SetColorTransferCharacteristic(ColorTransferCharacteristicAribStdB67)
cc4.SetErrorRecognitionFlags(NewErrorRecognitionFlags(ErrorRecognitionFlagAggressive))
cc4.SetFlags(NewCodecContextFlags(4))
cc4.SetFlags2(NewCodecContextFlags2(5))
cc4.SetFramerate(NewRational(6, 1))
cc4.SetGopSize(7)
cc4.SetHeight(8)
cc4.SetLevel(16)
cc4.SetProfile(ProfileH264Extended)
cc4.SetPixelFormat(PixelFormat0Bgr)
cc4.SetQmin(5)
cc4.SetSampleAspectRatio(NewRational(10, 1))
cc4.SetSampleFormat(SampleFormatDbl)
cc4.SetSampleRate(12)
cc4.SetStrictStdCompliance(StrictStdComplianceExperimental)
cc4.SetThreadCount(13)
cc4.SetThreadType(ThreadTypeSlice)
cc4.SetTimeBase(NewRational(15, 1))
cc4.SetWidth(16)
cc4.SetExtraHardwareFrames(4)
cc4.SetMaxBFrames(1)
cc4.SetRateControlMaxRate(1_500_000)
cc4.SetRateControlMinRate(1_500_000)
cc4.SetRateControlBufferSize(1_500_000)
require.Equal(t, int64(1), cc4.BitRate())
require.True(t, cc4.ChannelLayout().Equal(ChannelLayout21))
require.Equal(t, ColorPrimariesBt2020, cc4.ColorPrimaries())
require.Equal(t, ColorRangeJpeg, cc4.ColorRange())
require.Equal(t, ColorSpaceBt2020Cl, cc4.ColorSpace())
require.Equal(t, ColorTransferCharacteristicAribStdB67, cc4.ColorTransferCharacteristic())
require.True(t, cc4.ErrorRecognitionFlags().Has(ErrorRecognitionFlagAggressive))
require.Equal(t, NewCodecContextFlags(4), cc4.Flags())
require.Equal(t, NewCodecContextFlags2(5), cc4.Flags2())
require.Equal(t, NewRational(6, 1), cc4.Framerate())
require.Equal(t, 7, cc4.GopSize())
require.Equal(t, 8, cc4.Height())
require.Equal(t, Level(16), cc4.Level())
require.Equal(t, ProfileH264Extended, cc4.Profile())
require.Equal(t, PixelFormat0Bgr, cc4.PixelFormat())
require.Equal(t, 5, cc4.Qmin())
require.Equal(t, NewRational(10, 1), cc4.SampleAspectRatio())
require.Equal(t, SampleFormatDbl, cc4.SampleFormat())
require.Equal(t, 12, cc4.SampleRate())
require.Equal(t, StrictStdComplianceExperimental, cc4.StrictStdCompliance())
require.Equal(t, 13, cc4.ThreadCount())
require.Equal(t, ThreadTypeSlice, cc4.ThreadType())
require.Equal(t, NewRational(15, 1), cc4.TimeBase())
require.Equal(t, 16, cc4.Width())
require.Equal(t, 4, cc4.ExtraHardwareFrames())
require.Equal(t, 1, cc4.MaxBFrames())
require.Equal(t, int64(1_500_000), cc4.RateControlMaxRate())
require.Equal(t, int64(1_500_000), cc4.RateControlMinRate())
require.Equal(t, 1_500_000, cc4.RateControlBufferSize())
cc5 := AllocCodecContext(nil)
require.NotNil(t, cc5)
defer cc5.Free()
err = cc5.FromCodecParameters(s2.CodecParameters())
require.NoError(t, err)
require.Equal(t, s2.CodecParameters().CodecID(), cc5.CodecID())
cp1 := AllocCodecParameters()
require.NotNil(t, cp1)
defer cp1.Free()
err = cc5.ToCodecParameters(cp1)
require.NoError(t, err)
require.Equal(t, cc5.CodecID(), cp1.CodecID())
cc6 := AllocCodecContext(nil)
require.NotNil(t, cc6)
b := []byte("test")
require.NoError(t, cc6.SetExtraData(b))
require.Equal(t, b, cc6.ExtraData())
// TODO Test ReceivePacket
// TODO Test SendPacket
// TODO Test ReceiveFrame
// TODO Test SendFrame
}
================================================
FILE: codec_hardware_config.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/structAVCodecHWConfig.html
type CodecHardwareConfig struct {
c *C.AVCodecHWConfig
}
func newCodecHardwareConfigFromC(c *C.AVCodecHWConfig) CodecHardwareConfig {
return CodecHardwareConfig{c: c}
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecHWConfig.html#a1474cb73c1f41e377dc5070ae373ac40
func (chc CodecHardwareConfig) HardwareDeviceType() HardwareDeviceType {
return HardwareDeviceType(chc.c.device_type)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecHWConfig.html#a208c924c3f626b01bf2020eef9eb4905
func (chc CodecHardwareConfig) MethodFlags() CodecHardwareConfigMethodFlags {
return CodecHardwareConfigMethodFlags(chc.c.methods)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecHWConfig.html#a9352b11d6d6b315fe3c61b65447d5174
func (chc CodecHardwareConfig) PixelFormat() PixelFormat {
return PixelFormat(chc.c.pix_fmt)
}
================================================
FILE: codec_hardware_config_method_flag.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#gga26e1124d33b4acdb532c49f6498df549a680870b80f0ed65e9ba97ea0905eb2fa
type CodecHardwareConfigMethodFlag int64
const (
CodecHardwareConfigMethodFlagAdHoc = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_AD_HOC)
CodecHardwareConfigMethodFlagHwDeviceCtx = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX)
CodecHardwareConfigMethodFlagHwFramesCtx = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX)
CodecHardwareConfigMethodFlagInternal = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_INTERNAL)
)
================================================
FILE: codec_id.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
//#include <libavformat/avformat.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#gaadca229ad2c20e060a14fec08a5cc7ce
type CodecID C.enum_AVCodecID
const (
CodecID012V = CodecID(C.AV_CODEC_ID_012V)
CodecID4Gv = CodecID(C.AV_CODEC_ID_4GV)
CodecID4Xm = CodecID(C.AV_CODEC_ID_4XM)
CodecID8Bps = CodecID(C.AV_CODEC_ID_8BPS)
CodecID8SvxExp = CodecID(C.AV_CODEC_ID_8SVX_EXP)
CodecID8SvxFib = CodecID(C.AV_CODEC_ID_8SVX_FIB)
CodecIDA64Multi = CodecID(C.AV_CODEC_ID_A64_MULTI)
CodecIDA64Multi5 = CodecID(C.AV_CODEC_ID_A64_MULTI5)
CodecIDAac = CodecID(C.AV_CODEC_ID_AAC)
CodecIDAacLatm = CodecID(C.AV_CODEC_ID_AAC_LATM)
CodecIDAasc = CodecID(C.AV_CODEC_ID_AASC)
CodecIDAc3 = CodecID(C.AV_CODEC_ID_AC3)
CodecIDAc4 = CodecID(C.AV_CODEC_ID_AC4)
CodecIDAcelpKelvin = CodecID(C.AV_CODEC_ID_ACELP_KELVIN)
CodecIDAdpcm4Xm = CodecID(C.AV_CODEC_ID_ADPCM_4XM)
CodecIDAdpcmAdx = CodecID(C.AV_CODEC_ID_ADPCM_ADX)
CodecIDAdpcmAfc = CodecID(C.AV_CODEC_ID_ADPCM_AFC)
CodecIDAdpcmAgm = CodecID(C.AV_CODEC_ID_ADPCM_AGM)
CodecIDAdpcmAica = CodecID(C.AV_CODEC_ID_ADPCM_AICA)
CodecIDAdpcmArgo = CodecID(C.AV_CODEC_ID_ADPCM_ARGO)
CodecIDAdpcmCt = CodecID(C.AV_CODEC_ID_ADPCM_CT)
CodecIDAdpcmDtk = CodecID(C.AV_CODEC_ID_ADPCM_DTK)
CodecIDAdpcmEa = CodecID(C.AV_CODEC_ID_ADPCM_EA)
CodecIDAdpcmEaMaxisXa = CodecID(C.AV_CODEC_ID_ADPCM_EA_MAXIS_XA)
CodecIDAdpcmEaR1 = CodecID(C.AV_CODEC_ID_ADPCM_EA_R1)
CodecIDAdpcmEaR2 = CodecID(C.AV_CODEC_ID_ADPCM_EA_R2)
CodecIDAdpcmEaR3 = CodecID(C.AV_CODEC_ID_ADPCM_EA_R3)
CodecIDAdpcmEaXas = CodecID(C.AV_CODEC_ID_ADPCM_EA_XAS)
CodecIDAdpcmG722 = CodecID(C.AV_CODEC_ID_ADPCM_G722)
CodecIDAdpcmG726 = CodecID(C.AV_CODEC_ID_ADPCM_G726)
CodecIDAdpcmG726Le = CodecID(C.AV_CODEC_ID_ADPCM_G726LE)
CodecIDAdpcmImaAcorn = CodecID(C.AV_CODEC_ID_ADPCM_IMA_ACORN)
CodecIDAdpcmImaAlp = CodecID(C.AV_CODEC_ID_ADPCM_IMA_ALP)
CodecIDAdpcmImaAmv = CodecID(C.AV_CODEC_ID_ADPCM_IMA_AMV)
CodecIDAdpcmImaApc = CodecID(C.AV_CODEC_ID_ADPCM_IMA_APC)
CodecIDAdpcmImaApm = CodecID(C.AV_CODEC_ID_ADPCM_IMA_APM)
CodecIDAdpcmImaCunning = CodecID(C.AV_CODEC_ID_ADPCM_IMA_CUNNING)
CodecIDAdpcmImaDat4 = CodecID(C.AV_CODEC_ID_ADPCM_IMA_DAT4)
CodecIDAdpcmImaDk3 = CodecID(C.AV_CODEC_ID_ADPCM_IMA_DK3)
CodecIDAdpcmImaDk4 = CodecID(C.AV_CODEC_ID_ADPCM_IMA_DK4)
CodecIDAdpcmImaEaEacs = CodecID(C.AV_CODEC_ID_ADPCM_IMA_EA_EACS)
CodecIDAdpcmImaEaSead = CodecID(C.AV_CODEC_ID_ADPCM_IMA_EA_SEAD)
CodecIDAdpcmImaIss = CodecID(C.AV_CODEC_ID_ADPCM_IMA_ISS)
CodecIDAdpcmImaMoflex = CodecID(C.AV_CODEC_ID_ADPCM_IMA_MOFLEX)
CodecIDAdpcmImaMtf = CodecID(C.AV_CODEC_ID_ADPCM_IMA_MTF)
CodecIDAdpcmImaOki = CodecID(C.AV_CODEC_ID_ADPCM_IMA_OKI)
CodecIDAdpcmImaQt = CodecID(C.AV_CODEC_ID_ADPCM_IMA_QT)
CodecIDAdpcmImaRad = CodecID(C.AV_CODEC_ID_ADPCM_IMA_RAD)
CodecIDAdpcmImaSmjpeg = CodecID(C.AV_CODEC_ID_ADPCM_IMA_SMJPEG)
CodecIDAdpcmImaSsi = CodecID(C.AV_CODEC_ID_ADPCM_IMA_SSI)
CodecIDAdpcmImaWav = CodecID(C.AV_CODEC_ID_ADPCM_IMA_WAV)
CodecIDAdpcmImaWs = CodecID(C.AV_CODEC_ID_ADPCM_IMA_WS)
CodecIDAdpcmMs = CodecID(C.AV_CODEC_ID_ADPCM_MS)
CodecIDAdpcmMtaf = CodecID(C.AV_CODEC_ID_ADPCM_MTAF)
CodecIDAdpcmPsx = CodecID(C.AV_CODEC_ID_ADPCM_PSX)
CodecIDAdpcmSbpro2 = CodecID(C.AV_CODEC_ID_ADPCM_SBPRO_2)
CodecIDAdpcmSbpro3 = CodecID(C.AV_CODEC_ID_ADPCM_SBPRO_3)
CodecIDAdpcmSbpro4 = CodecID(C.AV_CODEC_ID_ADPCM_SBPRO_4)
CodecIDAdpcmSwf = CodecID(C.AV_CODEC_ID_ADPCM_SWF)
CodecIDAdpcmThp = CodecID(C.AV_CODEC_ID_ADPCM_THP)
CodecIDAdpcmThpLe = CodecID(C.AV_CODEC_ID_ADPCM_THP_LE)
CodecIDAdpcmVima = CodecID(C.AV_CODEC_ID_ADPCM_VIMA)
CodecIDAdpcmVimaDeprecated = CodecID(C.AV_CODEC_ID_ADPCM_VIMA)
CodecIDAdpcmXa = CodecID(C.AV_CODEC_ID_ADPCM_XA)
CodecIDAdpcmXmd = CodecID(C.AV_CODEC_ID_ADPCM_XMD)
CodecIDAdpcmYamaha = CodecID(C.AV_CODEC_ID_ADPCM_YAMAHA)
CodecIDAdpcmZork = CodecID(C.AV_CODEC_ID_ADPCM_ZORK)
CodecIDAgm = CodecID(C.AV_CODEC_ID_AGM)
CodecIDAic = CodecID(C.AV_CODEC_ID_AIC)
CodecIDAlac = CodecID(C.AV_CODEC_ID_ALAC)
CodecIDAliasPix = CodecID(C.AV_CODEC_ID_ALIAS_PIX)
CodecIDAmrNb = CodecID(C.AV_CODEC_ID_AMR_NB)
CodecIDAmrWb = CodecID(C.AV_CODEC_ID_AMR_WB)
CodecIDAmv = CodecID(C.AV_CODEC_ID_AMV)
CodecIDAnm = CodecID(C.AV_CODEC_ID_ANM)
CodecIDAnsi = CodecID(C.AV_CODEC_ID_ANSI)
CodecIDAnull = CodecID(C.AV_CODEC_ID_ANULL)
CodecIDApac = CodecID(C.AV_CODEC_ID_APAC)
CodecIDApe = CodecID(C.AV_CODEC_ID_APE)
CodecIDApng = CodecID(C.AV_CODEC_ID_APNG)
CodecIDAptx = CodecID(C.AV_CODEC_ID_APTX)
CodecIDAptxHd = CodecID(C.AV_CODEC_ID_APTX_HD)
CodecIDArbc = CodecID(C.AV_CODEC_ID_ARBC)
CodecIDArgo = CodecID(C.AV_CODEC_ID_ARGO)
CodecIDAribCaption = CodecID(C.AV_CODEC_ID_ARIB_CAPTION)
CodecIDAss = CodecID(C.AV_CODEC_ID_ASS)
CodecIDAsv1 = CodecID(C.AV_CODEC_ID_ASV1)
CodecIDAsv2 = CodecID(C.AV_CODEC_ID_ASV2)
CodecIDAtrac1 = CodecID(C.AV_CODEC_ID_ATRAC1)
CodecIDAtrac3 = CodecID(C.AV_CODEC_ID_ATRAC3)
CodecIDAtrac3Al = CodecID(C.AV_CODEC_ID_ATRAC3AL)
CodecIDAtrac3P = CodecID(C.AV_CODEC_ID_ATRAC3P)
CodecIDAtrac3Pal = CodecID(C.AV_CODEC_ID_ATRAC3PAL)
CodecIDAtrac9 = CodecID(C.AV_CODEC_ID_ATRAC9)
CodecIDAura = CodecID(C.AV_CODEC_ID_AURA)
CodecIDAura2 = CodecID(C.AV_CODEC_ID_AURA2)
CodecIDAv1 = CodecID(C.AV_CODEC_ID_AV1)
CodecIDAvrn = CodecID(C.AV_CODEC_ID_AVRN)
CodecIDAvrp = CodecID(C.AV_CODEC_ID_AVRP)
CodecIDAvs = CodecID(C.AV_CODEC_ID_AVS)
CodecIDAvs2 = CodecID(C.AV_CODEC_ID_AVS2)
CodecIDAvs3 = CodecID(C.AV_CODEC_ID_AVS3)
CodecIDAvui = CodecID(C.AV_CODEC_ID_AVUI)
CodecIDBCodecIDext = CodecID(C.AV_CODEC_ID_BINTEXT)
CodecIDBethsoftvid = CodecID(C.AV_CODEC_ID_BETHSOFTVID)
CodecIDBfi = CodecID(C.AV_CODEC_ID_BFI)
CodecIDBinData = CodecID(C.AV_CODEC_ID_BIN_DATA)
CodecIDBinkaudioDct = CodecID(C.AV_CODEC_ID_BINKAUDIO_DCT)
CodecIDBinkaudioRdft = CodecID(C.AV_CODEC_ID_BINKAUDIO_RDFT)
CodecIDBinkvideo = CodecID(C.AV_CODEC_ID_BINKVIDEO)
CodecIDBitpacked = CodecID(C.AV_CODEC_ID_BITPACKED)
CodecIDBmp = CodecID(C.AV_CODEC_ID_BMP)
CodecIDBmvAudio = CodecID(C.AV_CODEC_ID_BMV_AUDIO)
CodecIDBmvVideo = CodecID(C.AV_CODEC_ID_BMV_VIDEO)
CodecIDBonk = CodecID(C.AV_CODEC_ID_BONK)
CodecIDBrenderPix = CodecID(C.AV_CODEC_ID_BRENDER_PIX)
CodecIDBrenderPixDeprecated = CodecID(C.AV_CODEC_ID_BRENDER_PIX)
CodecIDC93 = CodecID(C.AV_CODEC_ID_C93)
CodecIDCavs = CodecID(C.AV_CODEC_ID_CAVS)
CodecIDCbd2Dpcm = CodecID(C.AV_CODEC_ID_CBD2_DPCM)
CodecIDCdgraphics = CodecID(C.AV_CODEC_ID_CDGRAPHICS)
CodecIDCdtoons = CodecID(C.AV_CODEC_ID_CDTOONS)
CodecIDCdxl = CodecID(C.AV_CODEC_ID_CDXL)
CodecIDCelt = CodecID(C.AV_CODEC_ID_CELT)
CodecIDCfhd = CodecID(C.AV_CODEC_ID_CFHD)
CodecIDCinepak = CodecID(C.AV_CODEC_ID_CINEPAK)
CodecIDClearvideo = CodecID(C.AV_CODEC_ID_CLEARVIDEO)
CodecIDCljr = CodecID(C.AV_CODEC_ID_CLJR)
CodecIDCllc = CodecID(C.AV_CODEC_ID_CLLC)
CodecIDCmv = CodecID(C.AV_CODEC_ID_CMV)
CodecIDCodec2 = CodecID(C.AV_CODEC_ID_CODEC2)
CodecIDComfortNoise = CodecID(C.AV_CODEC_ID_COMFORT_NOISE)
CodecIDCook = CodecID(C.AV_CODEC_ID_COOK)
CodecIDCpia = CodecID(C.AV_CODEC_ID_CPIA)
CodecIDCri = CodecID(C.AV_CODEC_ID_CRI)
CodecIDCscd = CodecID(C.AV_CODEC_ID_CSCD)
CodecIDCyuv = CodecID(C.AV_CODEC_ID_CYUV)
CodecIDDaala = CodecID(C.AV_CODEC_ID_DAALA)
CodecIDDds = CodecID(C.AV_CODEC_ID_DDS)
CodecIDDerfDpcm = CodecID(C.AV_CODEC_ID_DERF_DPCM)
CodecIDDfa = CodecID(C.AV_CODEC_ID_DFA)
CodecIDDfpwm = CodecID(C.AV_CODEC_ID_DFPWM)
CodecIDDirac = CodecID(C.AV_CODEC_ID_DIRAC)
CodecIDDnxhd = CodecID(C.AV_CODEC_ID_DNXHD)
CodecIDDolbyE = CodecID(C.AV_CODEC_ID_DOLBY_E)
CodecIDDpx = CodecID(C.AV_CODEC_ID_DPX)
CodecIDDsdLsbf = CodecID(C.AV_CODEC_ID_DSD_LSBF)
CodecIDDsdLsbfPlanar = CodecID(C.AV_CODEC_ID_DSD_LSBF_PLANAR)
CodecIDDsdMsbf = CodecID(C.AV_CODEC_ID_DSD_MSBF)
CodecIDDsdMsbfPlanar = CodecID(C.AV_CODEC_ID_DSD_MSBF_PLANAR)
CodecIDDsicinaudio = CodecID(C.AV_CODEC_ID_DSICINAUDIO)
CodecIDDsicinvideo = CodecID(C.AV_CODEC_ID_DSICINVIDEO)
CodecIDDssSp = CodecID(C.AV_CODEC_ID_DSS_SP)
CodecIDDst = CodecID(C.AV_CODEC_ID_DST)
CodecIDDts = CodecID(C.AV_CODEC_ID_DTS)
CodecIDDvaudio = CodecID(C.AV_CODEC_ID_DVAUDIO)
CodecIDDvbSubtitle = CodecID(C.AV_CODEC_ID_DVB_SUBTITLE)
CodecIDDvbTeletext = CodecID(C.AV_CODEC_ID_DVB_TELETEXT)
CodecIDDvdNav = CodecID(C.AV_CODEC_ID_DVD_NAV)
CodecIDDvdSubtitle = CodecID(C.AV_CODEC_ID_DVD_SUBTITLE)
CodecIDDvvideo = CodecID(C.AV_CODEC_ID_DVVIDEO)
CodecIDDxa = CodecID(C.AV_CODEC_ID_DXA)
CodecIDDxtory = CodecID(C.AV_CODEC_ID_DXTORY)
CodecIDDxv = CodecID(C.AV_CODEC_ID_DXV)
CodecIDEac3 = CodecID(C.AV_CODEC_ID_EAC3)
CodecIDEia608 = CodecID(C.AV_CODEC_ID_EIA_608)
CodecIDEpg = CodecID(C.AV_CODEC_ID_EPG)
CodecIDEscape124 = CodecID(C.AV_CODEC_ID_ESCAPE124)
CodecIDEscape130 = CodecID(C.AV_CODEC_ID_ESCAPE130)
CodecIDEscape130Deprecated = CodecID(C.AV_CODEC_ID_ESCAPE130)
CodecIDEvc = CodecID(C.AV_CODEC_ID_EVC)
CodecIDEvrc = CodecID(C.AV_CODEC_ID_EVRC)
CodecIDExr = CodecID(C.AV_CODEC_ID_EXR)
CodecIDExrDeprecated = CodecID(C.AV_CODEC_ID_EXR)
CodecIDFastaudio = CodecID(C.AV_CODEC_ID_FASTAUDIO)
CodecIDFfmetadata = CodecID(C.AV_CODEC_ID_FFMETADATA)
CodecIDFfv1 = CodecID(C.AV_CODEC_ID_FFV1)
CodecIDFfvhuff = CodecID(C.AV_CODEC_ID_FFVHUFF)
CodecIDFfwavesynth = CodecID(C.AV_CODEC_ID_FFWAVESYNTH)
CodecIDFic = CodecID(C.AV_CODEC_ID_FIC)
CodecIDFirstAudio = CodecID(C.AV_CODEC_ID_FIRST_AUDIO)
CodecIDFirstSubtitle = CodecID(C.AV_CODEC_ID_FIRST_SUBTITLE)
CodecIDFirstUnknown = CodecID(C.AV_CODEC_ID_FIRST_UNKNOWN)
CodecIDFits = CodecID(C.AV_CODEC_ID_FITS)
CodecIDFlac = CodecID(C.AV_CODEC_ID_FLAC)
CodecIDFlashsv = CodecID(C.AV_CODEC_ID_FLASHSV)
CodecIDFlashsv2 = CodecID(C.AV_CODEC_ID_FLASHSV2)
CodecIDFlic = CodecID(C.AV_CODEC_ID_FLIC)
CodecIDFlv1 = CodecID(C.AV_CODEC_ID_FLV1)
CodecIDFmvc = CodecID(C.AV_CODEC_ID_FMVC)
CodecIDFraps = CodecID(C.AV_CODEC_ID_FRAPS)
CodecIDFrwu = CodecID(C.AV_CODEC_ID_FRWU)
CodecIDFtr = CodecID(C.AV_CODEC_ID_FTR)
CodecIDG2M = CodecID(C.AV_CODEC_ID_G2M)
CodecIDG2MDeprecated = CodecID(C.AV_CODEC_ID_G2M)
CodecIDG7231 = CodecID(C.AV_CODEC_ID_G723_1)
CodecIDG729 = CodecID(C.AV_CODEC_ID_G729)
CodecIDGdv = CodecID(C.AV_CODEC_ID_GDV)
CodecIDGem = CodecID(C.AV_CODEC_ID_GEM)
CodecIDGif = CodecID(C.AV_CODEC_ID_GIF)
CodecIDGremlinDpcm = CodecID(C.AV_CODEC_ID_GREMLIN_DPCM)
CodecIDGsm = CodecID(C.AV_CODEC_ID_GSM)
CodecIDGsmMs = CodecID(C.AV_CODEC_ID_GSM_MS)
CodecIDH261 = CodecID(C.AV_CODEC_ID_H261)
CodecIDH263 = CodecID(C.AV_CODEC_ID_H263)
CodecIDH263I = CodecID(C.AV_CODEC_ID_H263I)
CodecIDH263P = CodecID(C.AV_CODEC_ID_H263P)
CodecIDH264 = CodecID(C.AV_CODEC_ID_H264)
CodecIDH265 = CodecID(C.AV_CODEC_ID_H265)
CodecIDH266 = CodecID(C.AV_CODEC_ID_H266)
CodecIDHap = CodecID(C.AV_CODEC_ID_HAP)
CodecIDHca = CodecID(C.AV_CODEC_ID_HCA)
CodecIDHcom = CodecID(C.AV_CODEC_ID_HCOM)
CodecIDHdmvPgsSubtitle = CodecID(C.AV_CODEC_ID_HDMV_PGS_SUBTITLE)
CodecIDHdmvTextSubtitle = CodecID(C.AV_CODEC_ID_HDMV_TEXT_SUBTITLE)
CodecIDHevc = CodecID(C.AV_CODEC_ID_HEVC)
CodecIDHevcDeprecated = CodecID(C.AV_CODEC_ID_HEVC)
CodecIDHnm4Video = CodecID(C.AV_CODEC_ID_HNM4_VIDEO)
CodecIDHqHqa = CodecID(C.AV_CODEC_ID_HQ_HQA)
CodecIDHqx = CodecID(C.AV_CODEC_ID_HQX)
CodecIDHuffyuv = CodecID(C.AV_CODEC_ID_HUFFYUV)
CodecIDHymt = CodecID(C.AV_CODEC_ID_HYMT)
CodecIDIac = CodecID(C.AV_CODEC_ID_IAC)
CodecIDIdcin = CodecID(C.AV_CODEC_ID_IDCIN)
CodecIDIdf = CodecID(C.AV_CODEC_ID_IDF)
CodecIDIffByterun1 = CodecID(C.AV_CODEC_ID_IFF_BYTERUN1)
CodecIDIffIlbm = CodecID(C.AV_CODEC_ID_IFF_ILBM)
CodecIDIlbc = CodecID(C.AV_CODEC_ID_ILBC)
CodecIDImc = CodecID(C.AV_CODEC_ID_IMC)
CodecIDImm4 = CodecID(C.AV_CODEC_ID_IMM4)
CodecIDImm5 = CodecID(C.AV_CODEC_ID_IMM5)
CodecIDIndeo2 = CodecID(C.AV_CODEC_ID_INDEO2)
CodecIDIndeo3 = CodecID(C.AV_CODEC_ID_INDEO3)
CodecIDIndeo4 = CodecID(C.AV_CODEC_ID_INDEO4)
CodecIDIndeo5 = CodecID(C.AV_CODEC_ID_INDEO5)
CodecIDInterplayAcm = CodecID(C.AV_CODEC_ID_INTERPLAY_ACM)
CodecIDInterplayDpcm = CodecID(C.AV_CODEC_ID_INTERPLAY_DPCM)
CodecIDInterplayVideo = CodecID(C.AV_CODEC_ID_INTERPLAY_VIDEO)
CodecIDIpu = CodecID(C.AV_CODEC_ID_IPU)
CodecIDIvtvVbi = CodecID(C.AV_CODEC_ID_IVTV_VBI)
CodecIDJacosub = CodecID(C.AV_CODEC_ID_JACOSUB)
CodecIDJpeg2000 = CodecID(C.AV_CODEC_ID_JPEG2000)
CodecIDJpegls = CodecID(C.AV_CODEC_ID_JPEGLS)
CodecIDJpegxl = CodecID(C.AV_CODEC_ID_JPEGXL)
CodecIDJpegxlAnim = CodecID(C.AV_CODEC_ID_JPEGXL_ANIM)
CodecIDJv = CodecID(C.AV_CODEC_ID_JV)
CodecIDKgv1 = CodecID(C.AV_CODEC_ID_KGV1)
CodecIDKmvc = CodecID(C.AV_CODEC_ID_KMVC)
CodecIDLagarith = CodecID(C.AV_CODEC_ID_LAGARITH)
CodecIDLc3 = CodecID(C.AV_CODEC_ID_LC3)
CodecIDLcevc = CodecID(C.AV_CODEC_ID_LCEVC)
CodecIDLead = CodecID(C.AV_CODEC_ID_LEAD)
CodecIDLjpeg = CodecID(C.AV_CODEC_ID_LJPEG)
CodecIDLoco = CodecID(C.AV_CODEC_ID_LOCO)
CodecIDLscr = CodecID(C.AV_CODEC_ID_LSCR)
CodecIDM101 = CodecID(C.AV_CODEC_ID_M101)
CodecIDMace3 = CodecID(C.AV_CODEC_ID_MACE3)
CodecIDMace6 = CodecID(C.AV_CODEC_ID_MACE6)
CodecIDMad = CodecID(C.AV_CODEC_ID_MAD)
CodecIDMagicyuv = CodecID(C.AV_CODEC_ID_MAGICYUV)
CodecIDMdec = CodecID(C.AV_CODEC_ID_MDEC)
CodecIDMedia100 = CodecID(C.AV_CODEC_ID_MEDIA100)
CodecIDMetasound = CodecID(C.AV_CODEC_ID_METASOUND)
CodecIDMicrodvd = CodecID(C.AV_CODEC_ID_MICRODVD)
CodecIDMimic = CodecID(C.AV_CODEC_ID_MIMIC)
CodecIDMisc4 = CodecID(C.AV_CODEC_ID_MISC4)
CodecIDMjpeg = CodecID(C.AV_CODEC_ID_MJPEG)
CodecIDMjpegb = CodecID(C.AV_CODEC_ID_MJPEGB)
CodecIDMlp = CodecID(C.AV_CODEC_ID_MLP)
CodecIDMmvideo = CodecID(C.AV_CODEC_ID_MMVIDEO)
CodecIDMobiclip = CodecID(C.AV_CODEC_ID_MOBICLIP)
CodecIDMotionpixels = CodecID(C.AV_CODEC_ID_MOTIONPIXELS)
CodecIDMovText = CodecID(C.AV_CODEC_ID_MOV_TEXT)
CodecIDMp1 = CodecID(C.AV_CODEC_ID_MP1)
CodecIDMp2 = CodecID(C.AV_CODEC_ID_MP2)
CodecIDMp3 = CodecID(C.AV_CODEC_ID_MP3)
CodecIDMp3Adu = CodecID(C.AV_CODEC_ID_MP3ADU)
CodecIDMp3On4 = CodecID(C.AV_CODEC_ID_MP3ON4)
CodecIDMp4Als = CodecID(C.AV_CODEC_ID_MP4ALS)
CodecIDMpeg1Video = CodecID(C.AV_CODEC_ID_MPEG1VIDEO)
CodecIDMpeg2Ts = CodecID(C.AV_CODEC_ID_MPEG2TS)
CodecIDMpeg2Video = CodecID(C.AV_CODEC_ID_MPEG2VIDEO)
CodecIDMpeg4 = CodecID(C.AV_CODEC_ID_MPEG4)
CodecIDMpeg4Systems = CodecID(C.AV_CODEC_ID_MPEG4SYSTEMS)
CodecIDMpegh3DAudio = CodecID(C.AV_CODEC_ID_MPEGH_3D_AUDIO)
CodecIDMpl2 = CodecID(C.AV_CODEC_ID_MPL2)
CodecIDMsa1 = CodecID(C.AV_CODEC_ID_MSA1)
CodecIDMscc = CodecID(C.AV_CODEC_ID_MSCC)
CodecIDMsmpeg4V1 = CodecID(C.AV_CODEC_ID_MSMPEG4V1)
CodecIDMsmpeg4V2 = CodecID(C.AV_CODEC_ID_MSMPEG4V2)
CodecIDMsmpeg4V3 = CodecID(C.AV_CODEC_ID_MSMPEG4V3)
CodecIDMsnsiren = CodecID(C.AV_CODEC_ID_MSNSIREN)
CodecIDMsp2 = CodecID(C.AV_CODEC_ID_MSP2)
CodecIDMsrle = CodecID(C.AV_CODEC_ID_MSRLE)
CodecIDMss1 = CodecID(C.AV_CODEC_ID_MSS1)
CodecIDMss2 = CodecID(C.AV_CODEC_ID_MSS2)
CodecIDMsvideo1 = CodecID(C.AV_CODEC_ID_MSVIDEO1)
CodecIDMszh = CodecID(C.AV_CODEC_ID_MSZH)
CodecIDMts2 = CodecID(C.AV_CODEC_ID_MTS2)
CodecIDMusepack7 = CodecID(C.AV_CODEC_ID_MUSEPACK7)
CodecIDMusepack8 = CodecID(C.AV_CODEC_ID_MUSEPACK8)
CodecIDMv30 = CodecID(C.AV_CODEC_ID_MV30)
CodecIDMvc1 = CodecID(C.AV_CODEC_ID_MVC1)
CodecIDMvc1Deprecated = CodecID(C.AV_CODEC_ID_MVC1)
CodecIDMvc2 = CodecID(C.AV_CODEC_ID_MVC2)
CodecIDMvc2Deprecated = CodecID(C.AV_CODEC_ID_MVC2)
CodecIDMvdv = CodecID(C.AV_CODEC_ID_MVDV)
CodecIDMvha = CodecID(C.AV_CODEC_ID_MVHA)
CodecIDMwsc = CodecID(C.AV_CODEC_ID_MWSC)
CodecIDMxpeg = CodecID(C.AV_CODEC_ID_MXPEG)
CodecIDNellymoser = CodecID(C.AV_CODEC_ID_NELLYMOSER)
CodecIDNone = CodecID(C.AV_CODEC_ID_NONE)
CodecIDNotchlc = CodecID(C.AV_CODEC_ID_NOTCHLC)
CodecIDNuv = CodecID(C.AV_CODEC_ID_NUV)
CodecIDOn2Avc = CodecID(C.AV_CODEC_ID_ON2AVC)
CodecIDOpus = CodecID(C.AV_CODEC_ID_OPUS)
CodecIDOpusDeprecated = CodecID(C.AV_CODEC_ID_OPUS)
CodecIDOsq = CodecID(C.AV_CODEC_ID_OSQ)
CodecIDOtf = CodecID(C.AV_CODEC_ID_OTF)
CodecIDPafAudio = CodecID(C.AV_CODEC_ID_PAF_AUDIO)
CodecIDPafAudioDeprecated = CodecID(C.AV_CODEC_ID_PAF_AUDIO)
CodecIDPafVideo = CodecID(C.AV_CODEC_ID_PAF_VIDEO)
CodecIDPafVideoDeprecated = CodecID(C.AV_CODEC_ID_PAF_VIDEO)
CodecIDPam = CodecID(C.AV_CODEC_ID_PAM)
CodecIDPbm = CodecID(C.AV_CODEC_ID_PBM)
CodecIDPcmAlaw = CodecID(C.AV_CODEC_ID_PCM_ALAW)
CodecIDPcmBluray = CodecID(C.AV_CODEC_ID_PCM_BLURAY)
CodecIDPcmDvd = CodecID(C.AV_CODEC_ID_PCM_DVD)
CodecIDPcmF16Le = CodecID(C.AV_CODEC_ID_PCM_F16LE)
CodecIDPcmF24Le = CodecID(C.AV_CODEC_ID_PCM_F24LE)
CodecIDPcmF32Be = CodecID(C.AV_CODEC_ID_PCM_F32BE)
CodecIDPcmF32Le = CodecID(C.AV_CODEC_ID_PCM_F32LE)
CodecIDPcmF64Be = CodecID(C.AV_CODEC_ID_PCM_F64BE)
CodecIDPcmF64Le = CodecID(C.AV_CODEC_ID_PCM_F64LE)
CodecIDPcmLxf = CodecID(C.AV_CODEC_ID_PCM_LXF)
CodecIDPcmMulaw = CodecID(C.AV_CODEC_ID_PCM_MULAW)
CodecIDPcmS16Be = CodecID(C.AV_CODEC_ID_PCM_S16BE)
CodecIDPcmS16BePlanar = CodecID(C.AV_CODEC_ID_PCM_S16BE_PLANAR)
CodecIDPcmS16Le = CodecID(C.AV_CODEC_ID_PCM_S16LE)
CodecIDPcmS16LePlanar = CodecID(C.AV_CODEC_ID_PCM_S16LE_PLANAR)
CodecIDPcmS24Be = CodecID(C.AV_CODEC_ID_PCM_S24BE)
CodecIDPcmS24Daud = CodecID(C.AV_CODEC_ID_PCM_S24DAUD)
CodecIDPcmS24Le = CodecID(C.AV_CODEC_ID_PCM_S24LE)
CodecIDPcmS24LePlanar = CodecID(C.AV_CODEC_ID_PCM_S24LE_PLANAR)
CodecIDPcmS24LePlanarDeprecated = CodecID(C.AV_CODEC_ID_PCM_S24LE_PLANAR)
CodecIDPcmS32Be = CodecID(C.AV_CODEC_ID_PCM_S32BE)
CodecIDPcmS32Le = CodecID(C.AV_CODEC_ID_PCM_S32LE)
CodecIDPcmS32LePlanar = CodecID(C.AV_CODEC_ID_PCM_S32LE_PLANAR)
CodecIDPcmS32LePlanarDeprecated = CodecID(C.AV_CODEC_ID_PCM_S32LE_PLANAR)
CodecIDPcmS64Be = CodecID(C.AV_CODEC_ID_PCM_S64BE)
CodecIDPcmS64Le = CodecID(C.AV_CODEC_ID_PCM_S64LE)
CodecIDPcmS8 = CodecID(C.AV_CODEC_ID_PCM_S8)
CodecIDPcmS8Planar = CodecID(C.AV_CODEC_ID_PCM_S8_PLANAR)
CodecIDPcmSga = CodecID(C.AV_CODEC_ID_PCM_SGA)
CodecIDPcmU16Be = CodecID(C.AV_CODEC_ID_PCM_U16BE)
CodecIDPcmU16Le = CodecID(C.AV_CODEC_ID_PCM_U16LE)
CodecIDPcmU24Be = CodecID(C.AV_CODEC_ID_PCM_U24BE)
CodecIDPcmU24Le = CodecID(C.AV_CODEC_ID_PCM_U24LE)
CodecIDPcmU32Be = CodecID(C.AV_CODEC_ID_PCM_U32BE)
CodecIDPcmU32Le = CodecID(C.AV_CODEC_ID_PCM_U32LE)
CodecIDPcmU8 = CodecID(C.AV_CODEC_ID_PCM_U8)
CodecIDPcmVidc = CodecID(C.AV_CODEC_ID_PCM_VIDC)
CodecIDPcmZork = CodecID(C.AV_CODEC_ID_PCM_ZORK)
CodecIDPcx = CodecID(C.AV_CODEC_ID_PCX)
CodecIDPdv = CodecID(C.AV_CODEC_ID_PDV)
CodecIDPfm = CodecID(C.AV_CODEC_ID_PFM)
CodecIDPgm = CodecID(C.AV_CODEC_ID_PGM)
CodecIDPgmyuv = CodecID(C.AV_CODEC_ID_PGMYUV)
CodecIDPgx = CodecID(C.AV_CODEC_ID_PGX)
CodecIDPhm = CodecID(C.AV_CODEC_ID_PHM)
CodecIDPhotocd = CodecID(C.AV_CODEC_ID_PHOTOCD)
CodecIDPictor = CodecID(C.AV_CODEC_ID_PICTOR)
CodecIDPixlet = CodecID(C.AV_CODEC_ID_PIXLET)
CodecIDPjs = CodecID(C.AV_CODEC_ID_PJS)
CodecIDPng = CodecID(C.AV_CODEC_ID_PNG)
CodecIDPpm = CodecID(C.AV_CODEC_ID_PPM)
CodecIDProbe = CodecID(C.AV_CODEC_ID_PROBE)
CodecIDProres = CodecID(C.AV_CODEC_ID_PRORES)
CodecIDProresRaw = CodecID(C.AV_CODEC_ID_PRORES_RAW)
CodecIDProsumer = CodecID(C.AV_CODEC_ID_PROSUMER)
CodecIDPsd = CodecID(C.AV_CODEC_ID_PSD)
CodecIDPtx = CodecID(C.AV_CODEC_ID_PTX)
CodecIDQcelp = CodecID(C.AV_CODEC_ID_QCELP)
CodecIDQdm2 = CodecID(C.AV_CODEC_ID_QDM2)
CodecIDQdmc = CodecID(C.AV_CODEC_ID_QDMC)
CodecIDQdraw = CodecID(C.AV_CODEC_ID_QDRAW)
CodecIDQoa = CodecID(C.AV_CODEC_ID_QOA)
CodecIDQoi = CodecID(C.AV_CODEC_ID_QOI)
CodecIDQpeg = CodecID(C.AV_CODEC_ID_QPEG)
CodecIDQtrle = CodecID(C.AV_CODEC_ID_QTRLE)
CodecIDR10K = CodecID(C.AV_CODEC_ID_R10K)
CodecIDR210 = CodecID(C.AV_CODEC_ID_R210)
CodecIDRa144 = CodecID(C.AV_CODEC_ID_RA_144)
CodecIDRa288 = CodecID(C.AV_CODEC_ID_RA_288)
CodecIDRadianceHdr = CodecID(C.AV_CODEC_ID_RADIANCE_HDR)
CodecIDRalf = CodecID(C.AV_CODEC_ID_RALF)
CodecIDRasc = CodecID(C.AV_CODEC_ID_RASC)
CodecIDRawvideo = CodecID(C.AV_CODEC_ID_RAWVIDEO)
CodecIDRealtext = CodecID(C.AV_CODEC_ID_REALTEXT)
CodecIDRka = CodecID(C.AV_CODEC_ID_RKA)
CodecIDRl2 = CodecID(C.AV_CODEC_ID_RL2)
CodecIDRoq = CodecID(C.AV_CODEC_ID_ROQ)
CodecIDRoqDpcm = CodecID(C.AV_CODEC_ID_ROQ_DPCM)
CodecIDRpza = CodecID(C.AV_CODEC_ID_RPZA)
CodecIDRscc = CodecID(C.AV_CODEC_ID_RSCC)
CodecIDRtv1 = CodecID(C.AV_CODEC_ID_RTV1)
CodecIDRv10 = CodecID(C.AV_CODEC_ID_RV10)
CodecIDRv20 = CodecID(C.AV_CODEC_ID_RV20)
CodecIDRv30 = CodecID(C.AV_CODEC_ID_RV30)
CodecIDRv40 = CodecID(C.AV_CODEC_ID_RV40)
CodecIDS302M = CodecID(C.AV_CODEC_ID_S302M)
CodecIDSami = CodecID(C.AV_CODEC_ID_SAMI)
CodecIDSanm = CodecID(C.AV_CODEC_ID_SANM)
CodecIDSanmDeprecated = CodecID(C.AV_CODEC_ID_SANM)
CodecIDSbc = CodecID(C.AV_CODEC_ID_SBC)
CodecIDScpr = CodecID(C.AV_CODEC_ID_SCPR)
CodecIDScreenpresso = CodecID(C.AV_CODEC_ID_SCREENPRESSO)
CodecIDScte35 = CodecID(C.AV_CODEC_ID_SCTE_35)
CodecIDSdx2Dpcm = CodecID(C.AV_CODEC_ID_SDX2_DPCM)
CodecIDSgaVideo = CodecID(C.AV_CODEC_ID_SGA_VIDEO)
CodecIDSgi = CodecID(C.AV_CODEC_ID_SGI)
CodecIDSgirle = CodecID(C.AV_CODEC_ID_SGIRLE)
CodecIDSgirleDeprecated = CodecID(C.AV_CODEC_ID_SGIRLE)
CodecIDSheervideo = CodecID(C.AV_CODEC_ID_SHEERVIDEO)
CodecIDShorten = CodecID(C.AV_CODEC_ID_SHORTEN)
CodecIDSimbiosisImx = CodecID(C.AV_CODEC_ID_SIMBIOSIS_IMX)
CodecIDSipr = CodecID(C.AV_CODEC_ID_SIPR)
CodecIDSiren = CodecID(C.AV_CODEC_ID_SIREN)
CodecIDSmackaudio = CodecID(C.AV_CODEC_ID_SMACKAUDIO)
CodecIDSmackvideo = CodecID(C.AV_CODEC_ID_SMACKVIDEO)
CodecIDSmc = CodecID(C.AV_CODEC_ID_SMC)
CodecIDSmpte2038 = CodecID(C.AV_CODEC_ID_SMPTE_2038)
CodecIDSmpte436mAnc = CodecID(C.AV_CODEC_ID_SMPTE_436M_ANC)
CodecIDSmpteKlv = CodecID(C.AV_CODEC_ID_SMPTE_KLV)
CodecIDSmv = CodecID(C.AV_CODEC_ID_SMV)
CodecIDSmvjpeg = CodecID(C.AV_CODEC_ID_SMVJPEG)
CodecIDSnow = CodecID(C.AV_CODEC_ID_SNOW)
CodecIDSolDpcm = CodecID(C.AV_CODEC_ID_SOL_DPCM)
CodecIDSonic = CodecID(C.AV_CODEC_ID_SONIC)
CodecIDSonicLs = CodecID(C.AV_CODEC_ID_SONIC_LS)
CodecIDSp5X = CodecID(C.AV_CODEC_ID_SP5X)
CodecIDSpeedhq = CodecID(C.AV_CODEC_ID_SPEEDHQ)
CodecIDSpeex = CodecID(C.AV_CODEC_ID_SPEEX)
CodecIDSrgc = CodecID(C.AV_CODEC_ID_SRGC)
CodecIDSrt = CodecID(C.AV_CODEC_ID_SRT)
CodecIDSsa = CodecID(C.AV_CODEC_ID_SSA)
CodecIDStl = CodecID(C.AV_CODEC_ID_STL)
CodecIDSubrip = CodecID(C.AV_CODEC_ID_SUBRIP)
CodecIDSubviewer = CodecID(C.AV_CODEC_ID_SUBVIEWER)
CodecIDSubviewer1 = CodecID(C.AV_CODEC_ID_SUBVIEWER1)
CodecIDSunrast = CodecID(C.AV_CODEC_ID_SUNRAST)
CodecIDSvg = CodecID(C.AV_CODEC_ID_SVG)
CodecIDSvq1 = CodecID(C.AV_CODEC_ID_SVQ1)
CodecIDSvq3 = CodecID(C.AV_CODEC_ID_SVQ3)
CodecIDTak = CodecID(C.AV_CODEC_ID_TAK)
CodecIDTakDeprecated = CodecID(C.AV_CODEC_ID_TAK)
CodecIDTarga = CodecID(C.AV_CODEC_ID_TARGA)
CodecIDTargaY216 = CodecID(C.AV_CODEC_ID_TARGA_Y216)
CodecIDTdsc = CodecID(C.AV_CODEC_ID_TDSC)
CodecIDText = CodecID(C.AV_CODEC_ID_TEXT)
CodecIDTgq = CodecID(C.AV_CODEC_ID_TGQ)
CodecIDTgv = CodecID(C.AV_CODEC_ID_TGV)
CodecIDTheora = CodecID(C.AV_CODEC_ID_THEORA)
CodecIDThp = CodecID(C.AV_CODEC_ID_THP)
CodecIDTiertexseqvideo = CodecID(C.AV_CODEC_ID_TIERTEXSEQVIDEO)
CodecIDTiff = CodecID(C.AV_CODEC_ID_TIFF)
CodecIDTimedId3 = CodecID(C.AV_CODEC_ID_TIMED_ID3)
CodecIDTmv = CodecID(C.AV_CODEC_ID_TMV)
CodecIDTqi = CodecID(C.AV_CODEC_ID_TQI)
CodecIDTruehd = CodecID(C.AV_CODEC_ID_TRUEHD)
CodecIDTruemotion1 = CodecID(C.AV_CODEC_ID_TRUEMOTION1)
CodecIDTruemotion2 = CodecID(C.AV_CODEC_ID_TRUEMOTION2)
CodecIDTruemotion2Rt = CodecID(C.AV_CODEC_ID_TRUEMOTION2RT)
CodecIDTruespeech = CodecID(C.AV_CODEC_ID_TRUESPEECH)
CodecIDTscc = CodecID(C.AV_CODEC_ID_TSCC)
CodecIDTscc2 = CodecID(C.AV_CODEC_ID_TSCC2)
CodecIDTta = CodecID(C.AV_CODEC_ID_TTA)
CodecIDTtf = CodecID(C.AV_CODEC_ID_TTF)
CodecIDTtml = CodecID(C.AV_CODEC_ID_TTML)
CodecIDTwinvq = CodecID(C.AV_CODEC_ID_TWINVQ)
CodecIDTxd = CodecID(C.AV_CODEC_ID_TXD)
CodecIDUlti = CodecID(C.AV_CODEC_ID_ULTI)
CodecIDUtvideo = CodecID(C.AV_CODEC_ID_UTVIDEO)
CodecIDV210 = CodecID(C.AV_CODEC_ID_V210)
CodecIDV210X = CodecID(C.AV_CODEC_ID_V210X)
CodecIDV308 = CodecID(C.AV_CODEC_ID_V308)
CodecIDV408 = CodecID(C.AV_CODEC_ID_V408)
CodecIDV410 = CodecID(C.AV_CODEC_ID_V410)
CodecIDVb = CodecID(C.AV_CODEC_ID_VB)
CodecIDVble = CodecID(C.AV_CODEC_ID_VBLE)
CodecIDVbn = CodecID(C.AV_CODEC_ID_VBN)
CodecIDVc1 = CodecID(C.AV_CODEC_ID_VC1)
CodecIDVc1Image = CodecID(C.AV_CODEC_ID_VC1IMAGE)
CodecIDVcr1 = CodecID(C.AV_CODEC_ID_VCR1)
CodecIDVixl = CodecID(C.AV_CODEC_ID_VIXL)
CodecIDVmdaudio = CodecID(C.AV_CODEC_ID_VMDAUDIO)
CodecIDVmdvideo = CodecID(C.AV_CODEC_ID_VMDVIDEO)
CodecIDVmix = CodecID(C.AV_CODEC_ID_VMIX)
CodecIDVmnc = CodecID(C.AV_CODEC_ID_VMNC)
CodecIDVnull = CodecID(C.AV_CODEC_ID_VNULL)
CodecIDVorbis = CodecID(C.AV_CODEC_ID_VORBIS)
CodecIDVp3 = CodecID(C.AV_CODEC_ID_VP3)
CodecIDVp4 = CodecID(C.AV_CODEC_ID_VP4)
CodecIDVp5 = CodecID(C.AV_CODEC_ID_VP5)
CodecIDVp6 = CodecID(C.AV_CODEC_ID_VP6)
CodecIDVp6A = CodecID(C.AV_CODEC_ID_VP6A)
CodecIDVp6F = CodecID(C.AV_CODEC_ID_VP6F)
CodecIDVp7 = CodecID(C.AV_CODEC_ID_VP7)
CodecIDVp7Deprecated = CodecID(C.AV_CODEC_ID_VP7)
CodecIDVp8 = CodecID(C.AV_CODEC_ID_VP8)
CodecIDVp9 = CodecID(C.AV_CODEC_ID_VP9)
CodecIDVplayer = CodecID(C.AV_CODEC_ID_VPLAYER)
CodecIDVqc = CodecID(C.AV_CODEC_ID_VQC)
CodecIDVvc = CodecID(C.AV_CODEC_ID_VVC)
CodecIDWadyDpcm = CodecID(C.AV_CODEC_ID_WADY_DPCM)
CodecIDWavarc = CodecID(C.AV_CODEC_ID_WAVARC)
CodecIDWavpack = CodecID(C.AV_CODEC_ID_WAVPACK)
CodecIDWbmp = CodecID(C.AV_CODEC_ID_WBMP)
CodecIDWcmv = CodecID(C.AV_CODEC_ID_WCMV)
CodecIDWebp = CodecID(C.AV_CODEC_ID_WEBP)
CodecIDWebpDeprecated = CodecID(C.AV_CODEC_ID_WEBP)
CodecIDWebvtt = CodecID(C.AV_CODEC_ID_WEBVTT)
CodecIDWestwoodSnd1 = CodecID(C.AV_CODEC_ID_WESTWOOD_SND1)
CodecIDWmalossless = CodecID(C.AV_CODEC_ID_WMALOSSLESS)
CodecIDWmapro = CodecID(C.AV_CODEC_ID_WMAPRO)
CodecIDWmav1 = CodecID(C.AV_CODEC_ID_WMAV1)
CodecIDWmav2 = CodecID(C.AV_CODEC_ID_WMAV2)
CodecIDWmavoice = CodecID(C.AV_CODEC_ID_WMAVOICE)
CodecIDWmv1 = CodecID(C.AV_CODEC_ID_WMV1)
CodecIDWmv2 = CodecID(C.AV_CODEC_ID_WMV2)
CodecIDWmv3 = CodecID(C.AV_CODEC_ID_WMV3)
CodecIDWmv3Image = CodecID(C.AV_CODEC_ID_WMV3IMAGE)
CodecIDWnv1 = CodecID(C.AV_CODEC_ID_WNV1)
CodecIDWrappedAvframe = CodecID(C.AV_CODEC_ID_WRAPPED_AVFRAME)
CodecIDWsVqa = CodecID(C.AV_CODEC_ID_WS_VQA)
CodecIDXanDpcm = CodecID(C.AV_CODEC_ID_XAN_DPCM)
CodecIDXanWc3 = CodecID(C.AV_CODEC_ID_XAN_WC3)
CodecIDXanWc4 = CodecID(C.AV_CODEC_ID_XAN_WC4)
CodecIDXbin = CodecID(C.AV_CODEC_ID_XBIN)
CodecIDXbm = CodecID(C.AV_CODEC_ID_XBM)
CodecIDXface = CodecID(C.AV_CODEC_ID_XFACE)
CodecIDXma1 = CodecID(C.AV_CODEC_ID_XMA1)
CodecIDXma2 = CodecID(C.AV_CODEC_ID_XMA2)
CodecIDXpm = CodecID(C.AV_CODEC_ID_XPM)
CodecIDXsub = CodecID(C.AV_CODEC_ID_XSUB)
CodecIDXwd = CodecID(C.AV_CODEC_ID_XWD)
CodecIDY41P = CodecID(C.AV_CODEC_ID_Y41P)
CodecIDYlc = CodecID(C.AV_CODEC_ID_YLC)
CodecIDYop = CodecID(C.AV_CODEC_ID_YOP)
CodecIDYuv4 = CodecID(C.AV_CODEC_ID_YUV4)
CodecIDZerocodec = CodecID(C.AV_CODEC_ID_ZEROCODEC)
CodecIDZlib = CodecID(C.AV_CODEC_ID_ZLIB)
CodecIDZmbv = CodecID(C.AV_CODEC_ID_ZMBV)
)
func (c CodecID) MediaType() MediaType {
return MediaType(C.avcodec_get_type((C.enum_AVCodecID)(c)))
}
func (c CodecID) Name() string {
return C.GoString(C.avcodec_get_name((C.enum_AVCodecID)(c)))
}
func (c CodecID) String() string {
return c.Name()
}
================================================
FILE: codec_id_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCodecID(t *testing.T) {
require.Equal(t, MediaTypeVideo, CodecIDH264.MediaType())
require.Equal(t, "h264", CodecIDH264.Name())
require.Equal(t, "h264", CodecIDH264.String())
}
================================================
FILE: codec_parameters.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html
type CodecParameters struct {
c *C.AVCodecParameters
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga647755ab2252e93221bb345f3d5e414f
func AllocCodecParameters() *CodecParameters {
return newCodecParametersFromC(C.avcodec_parameters_alloc())
}
func newCodecParametersFromC(c *C.AVCodecParameters) *CodecParameters {
if c == nil {
return nil
}
return &CodecParameters{c: c}
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga950c8da55b8112077e640b6a0cb8cf36
func (cp *CodecParameters) Free() {
if cp.c != nil {
C.avcodec_parameters_free(&cp.c)
}
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a5268fcf4ae8ed27edef54f836b926d93
func (cp *CodecParameters) BitRate() int64 {
return int64(cp.c.bit_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a4d581c205b18108a4f00e8fb3a2b26f9
func (cp *CodecParameters) ChannelLayout() ChannelLayout {
l, _ := newChannelLayoutFromC(&cp.c.ch_layout).clone()
return l
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a4d581c205b18108a4f00e8fb3a2b26f9
func (cp *CodecParameters) SetChannelLayout(l ChannelLayout) {
l.copy(&cp.c.ch_layout) //nolint: errcheck
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a9f76f2475ef24ff4c9771dd53072d040
func (cp *CodecParameters) CodecID() CodecID {
return CodecID(cp.c.codec_id)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a9f76f2475ef24ff4c9771dd53072d040
func (cp *CodecParameters) SetCodecID(i CodecID) {
cp.c.codec_id = uint32(i)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a9b6f7d220d100ba73defab295623356b
func (cp *CodecParameters) CodecTag() CodecTag {
return CodecTag(cp.c.codec_tag)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a9b6f7d220d100ba73defab295623356b
func (cp *CodecParameters) SetCodecTag(t CodecTag) {
cp.c.codec_tag = C.uint(t)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#ae4c7ac718a75adb31b5f2076a02fdedf
func (cp *CodecParameters) ChromaLocation() ChromaLocation {
return ChromaLocation(cp.c.chroma_location)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#aa884cae3fd16b30c61201a686664f96b
func (cp *CodecParameters) ColorPrimaries() ColorPrimaries {
return ColorPrimaries(cp.c.color_primaries)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#afa6744d9b8766db47a5ff7bddf0f2404
func (cp *CodecParameters) ColorRange() ColorRange {
return ColorRange(cp.c.color_range)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#afa6744d9b8766db47a5ff7bddf0f2404
func (cp *CodecParameters) SetColorRange(r ColorRange) {
cp.c.color_range = C.enum_AVColorRange(r)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a020398a4963e932853cefc169d90456d
func (cp *CodecParameters) ColorSpace() ColorSpace {
return ColorSpace(cp.c.color_space)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a020398a4963e932853cefc169d90456d
func (cp *CodecParameters) SetColorSpace(s ColorSpace) {
cp.c.color_space = C.enum_AVColorSpace(s)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#ac25ed8394e1efdbbcf28932ff0020893
func (cp *CodecParameters) ColorTransferCharacteristic() ColorTransferCharacteristic {
return ColorTransferCharacteristic(cp.c.color_trc)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a9befe0b86412646017afb0051d144d13
func (cp *CodecParameters) ExtraData() []byte {
return bytesFromC(func(size *C.size_t) *C.uint8_t {
*size = C.size_t(cp.c.extradata_size)
return cp.c.extradata
})
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a9befe0b86412646017afb0051d144d13
func (cp *CodecParameters) SetExtraData(b []byte) error {
return setBytesWithIntSizeInC(b, &cp.c.extradata, &cp.c.extradata_size)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a0ce9631123719789e4c7b0c23c66d534
func (cp *CodecParameters) FrameSize() int {
return int(cp.c.frame_size)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a0ce9631123719789e4c7b0c23c66d534
func (cp *CodecParameters) SetFrameSize(i int) {
cp.c.frame_size = C.int(i)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a1ec57ee84f19cf65d00eaa4d2a2253ce
func (cp *CodecParameters) Height() int {
return int(cp.c.height)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a1ec57ee84f19cf65d00eaa4d2a2253ce
func (cp *CodecParameters) SetHeight(h int) {
cp.c.height = C.int(h)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a26ae48eeaf8b315eca03b207e11edc7c
func (cp *CodecParameters) Level() Level {
return Level(cp.c.level)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a26ae48eeaf8b315eca03b207e11edc7c
func (cp *CodecParameters) SetLevel(l Level) {
cp.c.level = C.int(l)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a58369c3a8a986935b572df5aa6361ce2
func (cp *CodecParameters) MediaType() MediaType {
return MediaType(cp.c.codec_type)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a58369c3a8a986935b572df5aa6361ce2
func (cp *CodecParameters) SetMediaType(t MediaType) {
cp.c.codec_type = C.enum_AVMediaType(t)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#abee943e65d98f9763fa6602a356e774f
func (cp *CodecParameters) PixelFormat() PixelFormat {
return PixelFormat(cp.c.format)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#abee943e65d98f9763fa6602a356e774f
func (cp *CodecParameters) SetPixelFormat(f PixelFormat) {
cp.c.format = C.int(f)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a6b13b8a226ed923085718cd1323bfcb5
func (cp *CodecParameters) Profile() Profile {
return Profile(cp.c.profile)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a6b13b8a226ed923085718cd1323bfcb5
func (cp *CodecParameters) SetProfile(p Profile) {
cp.c.profile = C.int(p)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a7d6ef91120ffe80040c699e747a1ad68
func (cp *CodecParameters) SampleAspectRatio() Rational {
return newRationalFromC(cp.c.sample_aspect_ratio)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a7d6ef91120ffe80040c699e747a1ad68
func (cp *CodecParameters) SetSampleAspectRatio(r Rational) {
cp.c.sample_aspect_ratio = r.c
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#ad54da9241deabb3601e6e0e8fa832c19
func (cp *CodecParameters) SideData() *PacketSideData {
return newPacketSideDataFromC(&cp.c.coded_side_data, &cp.c.nb_coded_side_data)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#abee943e65d98f9763fa6602a356e774f
func (cp *CodecParameters) SampleFormat() SampleFormat {
return SampleFormat(cp.c.format)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#abee943e65d98f9763fa6602a356e774f
func (cp *CodecParameters) SetSampleFormat(f SampleFormat) {
cp.c.format = C.int(f)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#abfc9b0aa975206f7e77a125e6b78536e
func (cp *CodecParameters) SampleRate() int {
return int(cp.c.sample_rate)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#abfc9b0aa975206f7e77a125e6b78536e
func (cp *CodecParameters) SetSampleRate(r int) {
cp.c.sample_rate = C.int(r)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a51639f88aef9f4f283f538a0c033fbb8
func (cp *CodecParameters) Width() int {
return int(cp.c.width)
}
// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters.html#a51639f88aef9f4f283f538a0c033fbb8
func (cp *CodecParameters) SetWidth(w int) {
cp.c.width = C.int(w)
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga506c1c185ac48bb0086c61e267fc085c
func (cp *CodecParameters) FromCodecContext(cc *CodecContext) error {
return newError(C.avcodec_parameters_from_context(cp.c, cc.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga8a4998c9d1695abb01d379539d313227
func (cp *CodecParameters) ToCodecContext(cc *CodecContext) error {
return newError(C.avcodec_parameters_to_context(cc.c, cp.c))
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#ga6d02e640ccc12c783841ce51d09b9fa7
func (cp *CodecParameters) Copy(dst *CodecParameters) error {
return newError(C.avcodec_parameters_copy(dst.c, cp.c))
}
================================================
FILE: codec_parameters_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCodecParameters(t *testing.T) {
fc, err := globalHelper.inputFormatContext("video.mp4", nil)
require.NoError(t, err)
ss := fc.Streams()
require.Len(t, ss, 2)
s1 := ss[0]
s2 := ss[1]
cp1 := s1.CodecParameters()
require.Equal(t, int64(441324), cp1.BitRate())
require.Equal(t, ChromaLocationLeft, cp1.ChromaLocation())
require.Equal(t, CodecIDH264, cp1.CodecID())
require.Equal(t, CodecTag(0x31637661), cp1.CodecTag())
require.Equal(t, ColorPrimariesUnspecified, cp1.ColorPrimaries())
require.Equal(t, ColorRangeUnspecified, cp1.ColorRange())
require.Equal(t, ColorSpaceUnspecified, cp1.ColorSpace())
require.Equal(t, ColorTransferCharacteristicUnspecified, cp1.ColorTransferCharacteristic())
require.Equal(t, 180, cp1.Height())
require.Equal(t, Level(13), cp1.Level())
require.Equal(t, MediaTypeVideo, cp1.MediaType())
require.Equal(t, PixelFormatYuv420P, cp1.PixelFormat())
require.Equal(t, ProfileH264ConstrainedBaseline, cp1.Profile())
require.Equal(t, NewRational(1, 1), cp1.SampleAspectRatio())
require.Equal(t, 320, cp1.Width())
cp2 := s2.CodecParameters()
require.Equal(t, int64(161052), cp2.BitRate())
require.True(t, cp2.ChannelLayout().Equal(ChannelLayoutStereo))
require.Equal(t, CodecIDAac, cp2.CodecID())
require.Equal(t, CodecTag(0x6134706d), cp2.CodecTag())
require.Equal(t, 1024, cp2.FrameSize())
require.Equal(t, MediaTypeAudio, cp2.MediaType())
require.Equal(t, SampleFormatFltp, cp2.SampleFormat())
require.Equal(t, 48000, cp2.SampleRate())
cp3 := AllocCodecParameters()
require.NotNil(t, cp3)
defer cp3.Free()
err = cp2.Copy(cp3)
require.NoError(t, err)
require.Equal(t, cp2.CodecID(), cp3.CodecID())
cc4 := AllocCodecContext(nil)
require.NotNil(t, cc4)
defer cc4.Free()
err = cp2.ToCodecContext(cc4)
require.NoError(t, err)
require.Equal(t, cp2.CodecID(), cc4.CodecID())
cp5 := AllocCodecParameters()
require.NotNil(t, cp5)
defer cp5.Free()
err = cp5.FromCodecContext(cc4)
require.NoError(t, err)
require.Equal(t, cc4.CodecID(), cp5.CodecID())
cp6 := AllocCodecParameters()
require.NotNil(t, cp6)
defer cp6.Free()
cp6.SetChannelLayout(ChannelLayout21)
require.True(t, cp6.ChannelLayout().Equal(ChannelLayout21))
defer cp6.Free()
cp6.SetCodecID(CodecIDRawvideo)
require.Equal(t, CodecIDRawvideo, cp6.CodecID())
cp6.SetCodecTag(CodecTag(2))
require.Equal(t, CodecTag(2), cp6.CodecTag())
cp6.SetColorRange(ColorRangeJpeg)
require.Equal(t, ColorRangeJpeg, cp6.ColorRange())
cp6.SetColorSpace(ColorSpaceBt709)
require.Equal(t, ColorSpaceBt709, cp6.ColorSpace())
cp6.SetFrameSize(1)
require.Equal(t, 1, cp6.FrameSize())
cp6.SetHeight(1)
require.Equal(t, 1, cp6.Height())
cp1.SetLevel(16)
require.Equal(t, Level(16), cp1.Level())
cp6.SetMediaType(MediaTypeAudio)
require.Equal(t, MediaTypeAudio, cp6.MediaType())
cp1.SetProfile(ProfileH264Extended)
require.Equal(t, ProfileH264Extended, cp1.Profile())
cp6.SetPixelFormat(PixelFormat0Bgr)
require.Equal(t, PixelFormat0Bgr, cp6.PixelFormat())
cp6.SetSampleAspectRatio(NewRational(1, 2))
require.Equal(t, NewRational(1, 2), cp6.SampleAspectRatio())
cp6.SetSampleFormat(SampleFormatDbl)
require.Equal(t, SampleFormatDbl, cp6.SampleFormat())
cp6.SetSampleRate(4)
require.Equal(t, 4, cp6.SampleRate())
cp6.SetWidth(2)
require.Equal(t, 2, cp6.Width())
b := []byte("test")
require.NoError(t, cp6.SetExtraData(b))
require.Equal(t, b, cp6.ExtraData())
testPacketSideData(cp6.SideData(), t)
}
================================================
FILE: codec_tag.go
================================================
package astiav
type CodecTag uint32
================================================
FILE: codec_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCodec(t *testing.T) {
c := FindDecoder(CodecIDMp3)
require.NotNil(t, c)
require.Equal(t, c.ID(), CodecIDMp3)
require.Nil(t, c.SupportedChannelLayouts())
require.True(t, c.IsDecoder())
require.False(t, c.IsEncoder())
require.Nil(t, c.SupportedPixelFormats())
require.Equal(t, []SampleFormat{SampleFormatFltp, SampleFormatFlt}, c.SupportedSampleFormats())
require.Equal(t, "mp3float", c.Name())
require.Equal(t, "mp3float", c.String())
c = FindDecoderByName("aac")
require.NotNil(t, c)
els := []ChannelLayout{
ChannelLayoutMono,
ChannelLayoutStereo,
ChannelLayoutSurround,
ChannelLayout4Point0,
ChannelLayout5Point0Back,
ChannelLayout5Point1Back,
ChannelLayout7Point1WideBack,
ChannelLayout6Point1Back,
ChannelLayout7Point1,
ChannelLayout22Point2,
ChannelLayout5Point1Point2Back,
}
gls := c.SupportedChannelLayouts()
require.Len(t, gls, len(els))
for idx := range els {
require.True(t, els[idx].Equal(gls[idx]))
}
require.True(t, c.IsDecoder())
require.False(t, c.IsEncoder())
require.Equal(t, []SampleFormat{SampleFormatFltp}, c.SupportedSampleFormats())
require.Equal(t, "aac", c.Name())
require.Equal(t, "aac", c.String())
c = FindEncoderByName("aac")
require.NotNil(t, c)
require.Equal(t, []int{96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350}, c.SupportedSampleRates())
c = FindEncoder(CodecIDMjpeg)
require.NotNil(t, c)
require.False(t, c.IsDecoder())
require.True(t, c.IsEncoder())
require.Contains(t, c.SupportedPixelFormats(), PixelFormatYuvj420P)
require.Nil(t, c.SupportedSampleFormats())
require.Contains(t, c.Name(), "mjpeg")
require.Contains(t, c.String(), "mjpeg")
c = FindEncoderByName("mjpeg")
require.NotNil(t, c)
require.False(t, c.IsDecoder())
require.True(t, c.IsEncoder())
require.Equal(t, []PixelFormat{
PixelFormatYuvj420P,
PixelFormatYuvj422P,
PixelFormatYuvj444P,
PixelFormatYuv420P,
PixelFormatYuv422P,
PixelFormatYuv444P,
}, c.SupportedPixelFormats())
require.Equal(t, "mjpeg", c.Name())
require.Equal(t, "mjpeg", c.String())
require.Equal(t, []ColorRange{ColorRangeJpeg}, c.SupportedColorRanges())
require.Nil(t, c.SupportedColorSpaces())
c = FindEncoderByName("mpeg1video")
require.NotNil(t, c)
require.Equal(t, []Rational{
NewRational(24000, 1001),
NewRational(24, 1),
NewRational(25, 1),
NewRational(30000, 1001),
NewRational(30, 1),
NewRational(50, 1),
NewRational(60000, 1001),
NewRational(60, 1),
NewRational(15, 1),
NewRational(5, 1),
NewRational(10, 1),
NewRational(12, 1),
NewRational(15, 1),
}, c.SupportedFrameRates())
c = FindDecoderByName("invalid")
require.Nil(t, c)
var found bool
for _, c := range Codecs() {
if c.ID() == CodecIDMjpeg {
found = true
}
}
require.True(t, found)
}
================================================
FILE: color_primaries.go
================================================
package astiav
//#include <libavutil/pixfmt.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#ad384ee5a840bafd73daef08e6d9cafe7
type ColorPrimaries C.enum_AVColorPrimaries
const (
ColorPrimariesReserved0 = ColorPrimaries(C.AVCOL_PRI_RESERVED0)
ColorPrimariesBt709 = ColorPrimaries(C.AVCOL_PRI_BT709)
ColorPrimariesUnspecified = ColorPrimaries(C.AVCOL_PRI_UNSPECIFIED)
ColorPrimariesReserved = ColorPrimaries(C.AVCOL_PRI_RESERVED)
ColorPrimariesBt470M = ColorPrimaries(C.AVCOL_PRI_BT470M)
ColorPrimariesBt470Bg = ColorPrimaries(C.AVCOL_PRI_BT470BG)
ColorPrimariesSmpte170M = ColorPrimaries(C.AVCOL_PRI_SMPTE170M)
ColorPrimariesSmpte240M = ColorPrimaries(C.AVCOL_PRI_SMPTE240M)
ColorPrimariesFilm = ColorPrimaries(C.AVCOL_PRI_FILM)
ColorPrimariesBt2020 = ColorPrimaries(C.AVCOL_PRI_BT2020)
ColorPrimariesSmpte428 = ColorPrimaries(C.AVCOL_PRI_SMPTE428)
ColorPrimariesSmptest4281 = ColorPrimaries(C.AVCOL_PRI_SMPTEST428_1)
ColorPrimariesSmpte431 = ColorPrimaries(C.AVCOL_PRI_SMPTE431)
ColorPrimariesSmpte432 = ColorPrimaries(C.AVCOL_PRI_SMPTE432)
ColorPrimariesJedecP22 = ColorPrimaries(C.AVCOL_PRI_JEDEC_P22)
ColorPrimariesNb = ColorPrimaries(C.AVCOL_PRI_NB)
)
================================================
FILE: color_range.go
================================================
package astiav
//#include <libavutil/pixdesc.h>
//#include <libavutil/pixfmt.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#a3da0bf691418bc22c4bcbe6583ad589a
type ColorRange C.enum_AVColorRange
const (
ColorRangeUnspecified = ColorRange(C.AVCOL_RANGE_UNSPECIFIED)
ColorRangeMpeg = ColorRange(C.AVCOL_RANGE_MPEG)
ColorRangeJpeg = ColorRange(C.AVCOL_RANGE_JPEG)
ColorRangeNb = ColorRange(C.AVCOL_RANGE_NB)
)
// https://ffmpeg.org/doxygen/8.0/pixdesc_8c.html#a590decf389632dd3af095f3096a92caf
func (r ColorRange) Name() string {
return C.GoString(C.av_color_range_name(C.enum_AVColorRange(r)))
}
func (r ColorRange) String() string {
return r.Name()
}
================================================
FILE: color_range_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestColorRange(t *testing.T) {
require.Equal(t, "tv", ColorRangeMpeg.Name())
require.Equal(t, "tv", ColorRangeMpeg.String())
}
================================================
FILE: color_space.go
================================================
package astiav
//#include <libavutil/pixdesc.h>
//#include <libavutil/pixfmt.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#aff71a069509a1ad3ff54d53a1c894c85
type ColorSpace C.enum_AVColorSpace
const (
ColorSpaceRgb = ColorSpace(C.AVCOL_SPC_RGB)
ColorSpaceBt709 = ColorSpace(C.AVCOL_SPC_BT709)
ColorSpaceUnspecified = ColorSpace(C.AVCOL_SPC_UNSPECIFIED)
ColorSpaceReserved = ColorSpace(C.AVCOL_SPC_RESERVED)
ColorSpaceFcc = ColorSpace(C.AVCOL_SPC_FCC)
ColorSpaceBt470Bg = ColorSpace(C.AVCOL_SPC_BT470BG)
ColorSpaceSmpte170M = ColorSpace(C.AVCOL_SPC_SMPTE170M)
ColorSpaceSmpte240M = ColorSpace(C.AVCOL_SPC_SMPTE240M)
ColorSpaceYcgco = ColorSpace(C.AVCOL_SPC_YCGCO)
ColorSpaceYcgcoRe = ColorSpace(C.AVCOL_SPC_YCGCO_RE)
ColorSpaceYcgcoRo = ColorSpace(C.AVCOL_SPC_YCGCO_RO)
ColorSpaceYcocg = ColorSpace(C.AVCOL_SPC_YCOCG)
ColorSpaceBt2020Ncl = ColorSpace(C.AVCOL_SPC_BT2020_NCL)
ColorSpaceBt2020Cl = ColorSpace(C.AVCOL_SPC_BT2020_CL)
ColorSpaceSmpte2085 = ColorSpace(C.AVCOL_SPC_SMPTE2085)
ColorSpaceChromaDerivedNcl = ColorSpace(C.AVCOL_SPC_CHROMA_DERIVED_NCL)
ColorSpaceChromaDerivedCl = ColorSpace(C.AVCOL_SPC_CHROMA_DERIVED_CL)
ColorSpaceIctcp = ColorSpace(C.AVCOL_SPC_ICTCP)
ColorSpaceIptC2 = ColorSpace(C.AVCOL_SPC_IPT_C2)
ColorSpaceNb = ColorSpace(C.AVCOL_SPC_NB)
)
// https://ffmpeg.org/doxygen/8.0/pixdesc_8c.html#a7a5b3f4d128f0a0112b4a91f75055339
func (s ColorSpace) Name() string {
return C.GoString(C.av_color_space_name(C.enum_AVColorSpace(s)))
}
func (s ColorSpace) String() string {
return s.Name()
}
================================================
FILE: color_space_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestColorSpace(t *testing.T) {
require.Equal(t, "bt709", ColorSpaceBt709.Name())
require.Equal(t, "bt709", ColorSpaceBt709.String())
}
================================================
FILE: color_transfer_characteristic.go
================================================
package astiav
//#include <libavutil/pixfmt.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#ad4791ea14975f098b649db7fcd731ce6
type ColorTransferCharacteristic C.enum_AVColorTransferCharacteristic
const (
ColorTransferCharacteristicReserved0 = ColorTransferCharacteristic(C.AVCOL_TRC_RESERVED0)
ColorTransferCharacteristicBt709 = ColorTransferCharacteristic(C.AVCOL_TRC_BT709)
ColorTransferCharacteristicUnspecified = ColorTransferCharacteristic(C.AVCOL_TRC_UNSPECIFIED)
ColorTransferCharacteristicReserved = ColorTransferCharacteristic(C.AVCOL_TRC_RESERVED)
ColorTransferCharacteristicGamma22 = ColorTransferCharacteristic(C.AVCOL_TRC_GAMMA22)
ColorTransferCharacteristicGamma28 = ColorTransferCharacteristic(C.AVCOL_TRC_GAMMA28)
ColorTransferCharacteristicSmpte170M = ColorTransferCharacteristic(C.AVCOL_TRC_SMPTE170M)
ColorTransferCharacteristicSmpte240M = ColorTransferCharacteristic(C.AVCOL_TRC_SMPTE240M)
ColorTransferCharacteristicLinear = ColorTransferCharacteristic(C.AVCOL_TRC_LINEAR)
ColorTransferCharacteristicLog = ColorTransferCharacteristic(C.AVCOL_TRC_LOG)
ColorTransferCharacteristicLogSqrt = ColorTransferCharacteristic(C.AVCOL_TRC_LOG_SQRT)
ColorTransferCharacteristicIec6196624 = ColorTransferCharacteristic(C.AVCOL_TRC_IEC61966_2_4)
ColorTransferCharacteristicBt1361Ecg = ColorTransferCharacteristic(C.AVCOL_TRC_BT1361_ECG)
ColorTransferCharacteristicIec6196621 = ColorTransferCharacteristic(C.AVCOL_TRC_IEC61966_2_1)
ColorTransferCharacteristicBt202010 = ColorTransferCharacteristic(C.AVCOL_TRC_BT2020_10)
ColorTransferCharacteristicBt202012 = ColorTransferCharacteristic(C.AVCOL_TRC_BT2020_12)
ColorTransferCharacteristicSmpte2084 = ColorTransferCharacteristic(C.AVCOL_TRC_SMPTE2084)
ColorTransferCharacteristicSmptest2084 = ColorTransferCharacteristic(C.AVCOL_TRC_SMPTEST2084)
ColorTransferCharacteristicSmpte428 = ColorTransferCharacteristic(C.AVCOL_TRC_SMPTE428)
ColorTransferCharacteristicSmptest4281 = ColorTransferCharacteristic(C.AVCOL_TRC_SMPTEST428_1)
ColorTransferCharacteristicAribStdB67 = ColorTransferCharacteristic(C.AVCOL_TRC_ARIB_STD_B67)
ColorTransferCharacteristicNb = ColorTransferCharacteristic(C.AVCOL_TRC_NB)
)
================================================
FILE: device.go
================================================
package astiav
//#include <libavdevice/avdevice.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavd.html#ga7c90a3585267b55941ae2f7388c006b6
func RegisterAllDevices() {
C.avdevice_register_all()
}
================================================
FILE: device_test.go
================================================
package astiav
import (
"testing"
)
func TestDevice(t *testing.T) {
RegisterAllDevices()
}
================================================
FILE: dictionary.go
================================================
package astiav
//#include <libavcodec/avcodec.h>
//#include <libavutil/dict.h>
//#include <stdlib.h>
import "C"
import (
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/structAVDictionary.html
type Dictionary struct {
c *C.AVDictionary
}
func NewDictionary() *Dictionary {
return &Dictionary{}
}
func newDictionaryFromC(c *C.AVDictionary) *Dictionary {
if c == nil {
return nil
}
return &Dictionary{c: c}
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__dict.html#ga8d9c2de72b310cef8e6a28c9cd3acbbe
func (d *Dictionary) Set(key, value string, flags DictionaryFlags) error {
ck := C.CString(key)
defer C.free(unsafe.Pointer(ck))
cv := C.CString(value)
defer C.free(unsafe.Pointer(cv))
return newError(C.av_dict_set(&d.c, ck, cv, C.int(flags)))
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__dict.html#gaca5ff7c251e60bd13164d13c82f21b79
func (d *Dictionary) ParseString(i, keyValSep, pairsSep string, flags DictionaryFlags) error {
ci := C.CString(i)
defer C.free(unsafe.Pointer(ci))
ck := C.CString(keyValSep)
defer C.free(unsafe.Pointer(ck))
cp := C.CString(pairsSep)
defer C.free(unsafe.Pointer(cp))
return newError(C.av_dict_parse_string(&d.c, ci, ck, cp, C.int(flags)))
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__dict.html#gae67f143237b2cb2936c9b147aa6dfde3
func (d *Dictionary) Get(key string, prev *DictionaryEntry, flags DictionaryFlags) *DictionaryEntry {
ck := C.CString(key)
defer C.free(unsafe.Pointer(ck))
var cp *C.AVDictionaryEntry
if prev != nil {
cp = prev.c
}
if e := C.av_dict_get(d.c, ck, cp, C.int(flags)); e != nil {
return newDictionaryEntryFromC(e)
}
return nil
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__dict.html#ga1bafd682b1fbb90e48a4cc3814b820f7
func (d *Dictionary) Free() {
if d.c != nil {
C.av_dict_free(&d.c)
}
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__packet.html#ga2d2c8e143a2c98cf0aa31b072c286186
func (d *Dictionary) Pack() []byte {
return bytesFromC(func(size *C.size_t) *C.uint8_t {
return C.av_packet_pack_dictionary(d.c, size)
})
}
// https://ffmpeg.org/doxygen/8.0/group__lavc__packet.html#gaae45c29cb3a29dc80b0b8f4ee9724492
func (d *Dictionary) Unpack(b []byte) error {
return bytesToC(b, func(b *C.uint8_t, size C.size_t) error {
return newError(C.av_packet_unpack_dictionary(b, size, &d.c))
})
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__dict.html#ga59a6372b124b306e3a2233723c5cdc78
func (d *Dictionary) Copy(dst *Dictionary, flags DictionaryFlags) error {
return newError(C.av_dict_copy(&dst.c, d.c, C.int(flags)))
}
================================================
FILE: dictionary_entry.go
================================================
package astiav
//#include <libavutil/dict.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/structAVDictionaryEntry.html
type DictionaryEntry struct {
c *C.AVDictionaryEntry
}
func newDictionaryEntryFromC(c *C.AVDictionaryEntry) *DictionaryEntry {
return &DictionaryEntry{c: c}
}
// https://ffmpeg.org/doxygen/8.0/structAVDictionaryEntry.html#a38fc80176f8f839282bb61c03392e194
func (e DictionaryEntry) Key() string {
return C.GoString(e.c.key)
}
// https://ffmpeg.org/doxygen/8.0/structAVDictionaryEntry.html#aa38678f2cad36f120d42e56449c5edb4
func (e DictionaryEntry) Value() string {
return C.GoString(e.c.value)
}
================================================
FILE: dictionary_flag.go
================================================
package astiav
//#include <libavutil/dict.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavu__dict.html#gad9cbc53cec515b72ae7caa2e194c6bc0
type DictionaryFlag int64
const (
DictionaryFlagMatchCase = DictionaryFlag(C.AV_DICT_MATCH_CASE)
DictionaryFlagIgnoreSuffix = DictionaryFlag(C.AV_DICT_IGNORE_SUFFIX)
DictionaryFlagDontStrdupKey = DictionaryFlag(C.AV_DICT_DONT_STRDUP_KEY)
DictionaryFlagDontStrdupVal = DictionaryFlag(C.AV_DICT_DONT_STRDUP_VAL)
DictionaryFlagDontOverwrite = DictionaryFlag(C.AV_DICT_DONT_OVERWRITE)
DictionaryFlagAppend = DictionaryFlag(C.AV_DICT_APPEND)
DictionaryFlagMultikey = DictionaryFlag(C.AV_DICT_MULTIKEY)
)
================================================
FILE: dictionary_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestDictionary(t *testing.T) {
d1 := NewDictionary()
defer d1.Free()
err := d1.ParseString("invalid,,", ":", ",", 0)
require.Error(t, err)
err = d1.ParseString("k1=v1,k2=v2", "=", ",", 0)
require.NoError(t, err)
err = d1.Set("k3", "v3", 0)
require.NoError(t, err)
e := d1.Get("k1", nil, 0)
require.NotNil(t, e)
require.Equal(t, "k1", e.Key())
require.Equal(t, "v1", e.Value())
e = d1.Get("k2", nil, 0)
require.NotNil(t, e)
require.Equal(t, "k2", e.Key())
require.Equal(t, "v2", e.Value())
e = d1.Get("k3", nil, 0)
require.NotNil(t, e)
require.Equal(t, "k3", e.Key())
require.Equal(t, "v3", e.Value())
e = d1.Get("k4", nil, 0)
require.Nil(t, e)
b := d1.Pack()
require.Equal(t, "k1\x00v1\x00k2\x00v2\x00k3\x00v3\x00", string(b))
err = d1.Unpack([]byte("k4\x00v4\x00"))
require.NoError(t, err)
e = d1.Get("k4", nil, 0)
require.NotNil(t, e)
require.Equal(t, "k4", e.Key())
require.Equal(t, "v4", e.Value())
d2 := NewDictionary()
defer d2.Free()
require.NoError(t, d1.Copy(d2, NewDictionaryFlags()))
e = d2.Get("k4", nil, 0)
require.NotNil(t, e)
require.Equal(t, "k4", e.Key())
require.Equal(t, "v4", e.Value())
}
================================================
FILE: discard.go
================================================
package astiav
//#include <libavcodec/defs.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#ga352363bce7d3ed82c101b3bc001d1c16
type Discard C.enum_AVDiscard
const (
DiscardNone = Discard(C.AVDISCARD_NONE)
DiscardDefault = Discard(C.AVDISCARD_DEFAULT)
DiscardNonRef = Discard(C.AVDISCARD_NONREF)
DiscardBidirectional = Discard(C.AVDISCARD_BIDIR)
DiscardNonIntra = Discard(C.AVDISCARD_NONINTRA)
DiscardNonKey = Discard(C.AVDISCARD_NONKEY)
DiscardAll = Discard(C.AVDISCARD_ALL)
)
================================================
FILE: display_matrix.go
================================================
package astiav
//#include <libavutil/display.h>
import "C"
import (
"encoding/binary"
"fmt"
"unsafe"
)
// https://ffmpeg.org/doxygen/8.0/group__lavu__video__display.html
type DisplayMatrix [9]uint32
func newDisplayMatrixFromBytes(b []byte) (m *DisplayMatrix, err error) {
// Check length
if len(b) < 36 {
err = fmt.Errorf("astiav: invalid length %d < 36", len(b))
return
}
// Create display matrix
m = &DisplayMatrix{}
// Loop
for idx := 0; idx < 9; idx++ {
m[idx] = binary.LittleEndian.Uint32(b[idx*4 : (idx+1)*4])
}
return
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__video__display.html#ga5964303bfe085ad33683bc2454768d4a
func NewDisplayMatrixFromRotation(angle float64) *DisplayMatrix {
m := &DisplayMatrix{}
C.av_display_rotation_set((*C.int32_t)(unsafe.Pointer(&m[0])), C.double(angle))
return m
}
func (m DisplayMatrix) bytes() []byte {
b := make([]byte, 0, 36)
for _, v := range m {
b = binary.LittleEndian.AppendUint32(b, v)
}
return b
}
// Rotation is a clockwise angle
// https://ffmpeg.org/doxygen/8.0/group__lavu__video__display.html#gaac2ea94d3f66496c758349450b5b0217
func (m DisplayMatrix) Rotation() float64 {
return -float64(C.av_display_rotation_get((*C.int32_t)(unsafe.Pointer(&m[0]))))
}
================================================
FILE: display_matrix_test.go
================================================
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestDisplayMatrix(t *testing.T) {
_, err := newDisplayMatrixFromBytes([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
require.Error(t, err)
b := []byte{0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64}
dm, err := newDisplayMatrixFromBytes(b)
require.NoError(t, err)
require.Equal(t, DisplayMatrix{0x0, 0xffff0000, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x0, 0x40000000}, *dm)
require.Equal(t, -90.0, dm.Rotation())
require.Equal(t, b, dm.bytes())
dm = NewDisplayMatrixFromRotation(-90)
require.Equal(t, -90.0, dm.Rotation())
dm, err = newDisplayMatrixFromBytes([]byte{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64})
require.NoError(t, err)
require.Equal(t, DisplayMatrix{0x0, 0x10000, 0x0, 0xffff0000, 0x0, 0x0, 0x0, 0x0, 0x40000000}, *dm)
require.Equal(t, 90.0, dm.Rotation())
}
================================================
FILE: disposition_flag.go
================================================
package astiav
//#include <libavformat/avformat.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#af09f200b4cd9bf0baa05671436eef2fb
type DispositionFlag int64
const (
DispositionFlagAttachedPic = DispositionFlag(C.AV_DISPOSITION_ATTACHED_PIC)
DispositionFlagCaptions = DispositionFlag(C.AV_DISPOSITION_CAPTIONS)
DispositionFlagCleanEffects = DispositionFlag(C.AV_DISPOSITION_CLEAN_EFFECTS)
DispositionFlagComment = DispositionFlag(C.AV_DISPOSITION_COMMENT)
DispositionFlagDefault = DispositionFlag(C.AV_DISPOSITION_DEFAULT)
DispositionFlagDependent = DispositionFlag(C.AV_DISPOSITION_DEPENDENT)
DispositionFlagDescriptions = DispositionFlag(C.AV_DISPOSITION_DESCRIPTIONS)
DispositionFlagDub = DispositionFlag(C.AV_DISPOSITION_DUB)
DispositionFlagForced = DispositionFlag(C.AV_DISPOSITION_FORCED)
DispositionFlagHearingImpaired = DispositionFlag(C.AV_DISPOSITION_HEARING_IMPAIRED)
DispositionFlagKaraoke = DispositionFlag(C.AV_DISPOSITION_KARAOKE)
DispositionFlagLyrics = DispositionFlag(C.AV_DISPOSITION_LYRICS)
DispositionFlagMetadata = DispositionFlag(C.AV_DISPOSITION_METADATA)
DispositionFlagMultilayer = DispositionFlag(C.AV_DISPOSITION_MULTILAYER)
DispositionFlagNonDiegetic = DispositionFlag(C.AV_DISPOSITION_NON_DIEGETIC)
DispositionFlagOriginal = DispositionFlag(C.AV_DISPOSITION_ORIGINAL)
DispositionFlagStillImage = DispositionFlag(C.AV_DISPOSITION_STILL_IMAGE)
DispositionFlagTimedThumbnails = DispositionFlag(C.AV_DISPOSITION_TIMED_THUMBNAILS)
DispositionFlagVisualImpaired = DispositionFlag(C.AV_DISPOSITION_VISUAL_IMPAIRED)
)
================================================
FILE: error.go
================================================
package astiav
//#include <libavutil/avutil.h>
//#include <errno.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/group__lavu__error.html#ga586e134e9dad8f57a218b2cd8734b601
type Error int
const (
ErrBsfNotFound = Error(C.AVERROR_BSF_NOT_FOUND)
ErrBufferTooSmall = Error(C.AVERROR_BUFFER_TOO_SMALL)
ErrBug = Error(C.AVERROR_BUG)
ErrBug2 = Error(C.AVERROR_BUG2)
ErrDecoderNotFound = Error(C.AVERROR_DECODER_NOT_FOUND)
ErrDemuxerNotFound = Error(C.AVERROR_DEMUXER_NOT_FOUND)
ErrEagain = Error(-(C.EAGAIN))
ErrEio = Error(-(C.EIO))
ErrEncoderNotFound = Error(C.AVERROR_ENCODER_NOT_FOUND)
ErrEof = Error(C.AVERROR_EOF)
ErrEperm = Error(-(C.EPERM))
ErrEpipe = Error(-(C.EPIPE))
ErrEtimedout = Error(-(C.ETIMEDOUT))
ErrExit = Error(C.AVERROR_EXIT)
ErrExperimental = Error(C.AVERROR_EXPERIMENTAL)
ErrExternal = Error(C.AVERROR_EXTERNAL)
ErrFilterNotFound = Error(C.AVERROR_FILTER_NOT_FOUND)
ErrHttpBadRequest = Error(C.AVERROR_HTTP_BAD_REQUEST)
ErrHttpForbidden = Error(C.AVERROR_HTTP_FORBIDDEN)
ErrHttpNotFound = Error(C.AVERROR_HTTP_NOT_FOUND)
ErrHttpOther4Xx = Error(C.AVERROR_HTTP_OTHER_4XX)
ErrHttpServerError = Error(C.AVERROR_HTTP_SERVER_ERROR)
ErrHttpUnauthorized = Error(C.AVERROR_HTTP_UNAUTHORIZED)
ErrInputChanged = Error(C.AVERROR_INPUT_CHANGED)
ErrInvaliddata = Error(C.AVERROR_INVALIDDATA)
ErrMaxStringSize = Error(C.AV_ERROR_MAX_STRING_SIZE)
ErrMuxerNotFound = Error(C.AVERROR_MUXER_NOT_FOUND)
ErrOptionNotFound = Error(C.AVERROR_OPTION_NOT_FOUND)
ErrOutputChanged = Error(C.AVERROR_OUTPUT_CHANGED)
ErrPatchwelcome = Error(C.AVERROR_PATCHWELCOME)
ErrProtocolNotFound = Error(C.AVERROR_PROTOCOL_NOT_FOUND)
ErrStreamNotFound = Error(C.AVERROR_STREAM_NOT_FOUND)
ErrUnknown = Error(C.AVERROR_UNKNOWN)
)
func newError(ret C.int) error {
i := int(ret)
if i >= 0 {
return nil
}
return Error(i)
}
// https://ffmpeg.org/doxygen/8.0/group__lavu__error.html#ga5792b4a2d18d7d9cb0efbcfc335dce24
func (e Error) Error() string {
s, _ := stringFromC(255, func(buf *C.char, size C.size_t) error {
return newError(C.av_strerror(C.int(e), buf, size))
})
return s
}
func (e Error) Is(err error) bool {
a, ok := err.(Error)
if !ok {
return false
}
return int(a) == int(e)
}
================================================
FILE: error_recognition_flag.go
================================================
package astiav
//#include <libavcodec/defs.h>
import "C"
// https://ffmpeg.org/doxygen/8.0/defs_8h.html#a16258b3283a3d34c893dd9a39e29e369
type ErrorRecognitionFlag int64
const (
ErrorRecognitionFlagAggressive = ErrorRecognitionFlag(C.AV_EF_AGGRESSIVE)
ErrorRecognitionFlagBitstream = ErrorRecognitionFlag(C.AV_EF_BITSTREAM)
ErrorRecognitionFlagBuffer = ErrorRecognitionFlag(C.AV_EF_BUFFER)
ErrorRecognitionFlagCareful = ErrorRecognitionFlag(C.AV_EF_CAREFUL)
ErrorRecognitionFlagCompliant = ErrorRecognitionFlag(C.AV_EF_COMPLIANT)
ErrorRecognitionFlagCRCCheck = ErrorRecognitionFlag(C.AV_EF_CRCCHECK)
ErrorRecognitionFlagExplode = ErrorRecognitionFlag(C.AV_EF_EXPLODE)
ErrorRecognitionFlagIgnoreErr = ErrorRecognitionFlag(C.AV_EF_IGNORE_ERR)
)
================================================
FILE: error_test.go
================================================
package astiav
import (
"errors"
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
type testError struct{}
func (err testError) Error() string { return "" }
func TestError(t *testing.T) {
require.Equal(t, "Decoder not found", ErrDecoderNotFound.Error())
err1 := fmt.Errorf("test 1: %w", ErrDecoderNotFound)
require.True(t, errors.Is(err1, ErrDecoderNotFound))
require.False(t, errors.Is(err1, testError{}))
err2 := fmt.Errorf("test 2: %w", ErrDemuxerNotFound)
require.False(t, errors.Is(err2, ErrDecoderNotFound))
}
================================================
FILE: examples/bit_stream_filtering/main.go
================================================
package main
import (
"errors"
"flag"
"fmt"
"log"
"strings"
"github.com/asticode/go-astiav"
)
var (
filter = flag.String("f", "null", "the bit stream filter name")
input = flag.String("i", "", "the input path")
)
type stream struct {
bitStreamFilterContext *astiav.BitStreamFilterContext
bitStreamPkt *astiav.Packet
}
func main() {
// Handle ffmpeg logs
astiav.SetLogLevel(astiav.LogLevelDebug)
astiav.SetLogCallback(func(c astiav.Classer, l astiav.LogLevel, fmt, msg string) {
var cs string
if c != nil {
if cl := c.Class(); cl != nil {
cs = " - class: " + cl.String()
}
}
log.Printf("ffmpeg log: %s%s - level: %d\n", strings.TrimSpace(msg), cs, l)
})
// Parse flags
flag.Parse()
// Usage
if *input == "" {
log.Println("Usage: <binary path> -i <input path> -f <bit stream filter name>")
return
}
// Allocate packet
pkt := astiav.AllocPacket()
defer pkt.Free()
// Allocate input format context
inputFormatContext := astiav.AllocFormatContext()
if inputFormatContext == nil {
log.Println(errors.New("main: input format context is nil"))
return
}
defer inputFormatContext.Free()
// Open input
if err := inputFormatContext.OpenInput(*input, nil, nil); err != nil {
log.Println(fmt.Errorf("main: opening input failed: %w", err))
return
}
defer inputFormatContext.CloseInput()
// Find stream info
if err := inputFormatContext.FindStreamInfo(nil); err != nil {
log.Println(fmt.Errorf("main: finding stream info failed: %w", err))
return
}
// Loop through streams
streams := make(map[int]*stream) // Indexed by input stream index
for _, is := range inputFormatContext.Streams() {
// Only process audio or video
if is.CodecParameters().MediaType() != astiav.MediaTypeAudio &&
is.CodecParameters().MediaType() != astiav.MediaTypeVideo {
continue
}
// Create stream
s := &stream{}
// Allocate packet
s.bitStreamPkt = astiav.AllocPacket()
defer s.bitStreamPkt.Free()
// Find bit stream filter
bsf := astiav.FindBitStreamFilterByName(*filter)
if bsf == nil {
log.Println(errors.New("main: bit stream filter is nil"))
return
}
// Allocate bit stream filter context
var err error
if s.bitStreamFilterContext, err = astiav.AllocBitStreamFilterContext(bsf); err != nil {
log.Println(fmt.Errorf("main: allocating bit stream filter context failed: %w", err))
return
}
defer s.bitStreamFilterContext.Free()
// Copy codec parameters
if err := is.CodecParameters().Copy(s.bitStreamFilterContext.InputCodecParameters()); err != nil {
log.Println(fmt.Errorf("main: copying codec parameters failed: %w", err))
return
}
// Update time base
s.bitStreamFilterContext.SetInputTimeBase(is.TimeBase())
// Initialize bit stream filter context
if err := s.bitStreamFilterContext.Initialize(); err != nil {
log.Println(fmt.Errorf("main: initializing bit stream filter context failed: %w", err))
return
}
// Add stream
streams[is.Index()] = s
}
// Loop through packets
for {
// We use a closure to ease unreferencing the packet
if stop := func() bool {
// Read frame
if err := inputFormatContext.ReadFrame(pkt); err != nil {
if !errors.Is(err, astiav.ErrEof) {
log.Println(fmt.Errorf("main: reading frame failed: %w", err))
}
return true
}
// Make sure to unreference the packet
defer pkt.Unref()
// Get stream
s, ok := streams[pkt.StreamIndex()]
if !ok {
return false
}
// Filter bit stream
if err := filterBitStream(pkt, s); err != nil {
log.Println(fmt.Errorf("main: filtering bit stream failed: %w", err))
return true
}
return false
}(); stop {
break
}
}
// Loop through streams
for _, s := range streams {
// Flush bit stream filter
if err := filterBitStream(nil, s); err != nil {
log.Println(fmt.Errorf("main: filtering bit stream failed: %w", err))
return
}
}
// Done
log.Println("done")
}
func filterBitStream(pkt *astiav.Packet, s *stream) error {
// Send packet
if err := s.bitStreamFilterContext.SendPacket(pkt); err != nil && !errors.Is(err, astiav.ErrEagain) {
return fmt.Errorf("main: sending packet failed: %w", err)
}
// Loop
for {
// We use a closure to ease unreferencing the packet
if stop, err := func() (bool, error) {
// Receive packet
if err := s.bitStreamFilterContext.ReceivePacket(s.bitStreamPkt); err != nil {
if errors.Is(err, astiav.ErrEof) || errors.Is(err, astiav.ErrEagain) {
return true, nil
}
return false, fmt.Errorf("main: receiving packet failed: %w", err)
}
// Make sure to unreference the packet
defer s.bitStreamPkt.Unref()
// Do something with packet
log.Printf("new filtered packet: stream %d - pts: %d", s.bitStreamPkt.StreamIndex(), s.bitStreamPkt.Pts())
return false, nil
}(); err != nil {
return err
} else if stop {
break
}
}
return nil
}
================================================
FILE: examples/custom_io_demuxing/main.go
================================================
package main
import (
"errors"
"flag"
"fmt"
"log"
"os"
"strings"
"github.com/asticode/go-astiav"
)
var (
input = flag.String("i", "", "the input path")
)
func main() {
// Handle ffmpeg logs
astiav.SetLogLevel(astiav.LogLevelDebug)
astiav.SetLogCallback(func(c astiav.Classer, l astiav.LogLevel, fmt, msg string) {
var cs string
if c != nil {
if cl := c.Class(); cl != nil {
cs = " - class: " + cl.String()
}
}
log.Printf("ffmpeg log: %s%s - level: %d\n", strings.TrimSpace(msg), cs, l)
})
// Parse flags
flag.Parse()
// Usage
if *input == "" {
log.Println("Usage: <binary path> -i <input path>")
return
}
// Allocate packet
pkt := astiav.AllocPacket()
defer pkt.Free()
// Allocate input format context
inputFormatContext := astiav.AllocFormatContext()
if inputFormatContext == nil {
log.Println(errors.New("main: input format context is nil"))
return
}
defer inputFormatContext.Free()
// Open file
f, err := os.Open(*input)
if err != nil {
log.Println(fmt.Errorf("main: opening %s failed: %w", *input, err))
return
}
defer f.Close()
// Allocate io context
ioContext, err := astiav.AllocIOContext(
4096,
false,
func(b []byte) (n int, err error) {
return f.Read(b)
},
func(offset int64, whence int) (n int64, err error) {
return f.Seek(offset, whence)
},
nil,
)
if err != nil {
log.Println(fmt.Errorf("main: allocating io context failed: %w", err))
return
}
defer ioContext.Free()
// Store io context
inputFormatContext.SetPb(ioContext)
// Open input
if err := inputFormatContext.OpenInput("", nil, nil); err != nil {
log.Println(fmt.Errorf("main: opening input failed: %w", err))
return
}
defer inputFormatContext.CloseInput()
// Find stream info
if err := inputFormatContext.FindStreamInfo(nil); err != nil {
log.Println(fmt.Errorf("main: finding stream info failed: %w", err))
return
}
// Loop through packets
for {
// We use a closure to ease unreferencing the packet
if stop := func() bool {
// Read frame
if err := inputFormatContext.ReadFrame(pkt); err != nil {
if !errors.Is(err, astiav.ErrEof) {
log.Println(fmt.Errorf("main: reading frame failed: %w", err))
}
return true
}
// Make sure to unreference the packet
defer pkt.Unref()
// Do something with the packet
log.Printf("new packet: stream %d - pts: %d", pkt.StreamIndex(), pkt.Pts())
return false
}(); stop {
break
}
}
// Done
log.Println("done")
}
================================================
FILE: examples/custom_io_muxing/main.go
================================================
package main
import (
"errors"
"flag"
"fmt"
"log"
"os"
"strings"
"github.com/asticode/go-astiav"
)
var (
input = flag.String("i", "", "the input path")
output = flag.String("o", "", "the output path")
)
func main() {
// Handle ffmpeg logs
astiav.SetLogLevel(astiav.LogLevelDebug)
astiav.SetLogCallback(func(c astiav.Classer, l astiav.LogLevel, fmt, msg string) {
var cs string
if c != nil {
if cl := c.Class(); cl != nil {
cs = " - class: " + cl.String()
}
}
log.Printf("ffmpeg log: %s%s - level: %d\n", strings.TrimSpace(msg), cs, l)
})
// Parse flags
flag.Parse()
// Usage
if *input == "" || *output == "" {
log.Println("Usage: <binary path> -i <input path> -o <output path>")
return
}
// Allocate packet
pkt := astiav.AllocPacket()
defer pkt.Free()
// Allocate input format context
inputFormatContext := astiav.AllocFormatContext()
if inputFormatContext == nil {
log.Println(errors.New("main: input format context is nil"))
return
}
defer inputFormatContext.Free()
// Open input
if err := inputFormatContext.OpenInput(*input, nil, nil); err != nil {
log.Println(fmt.Errorf("main: opening input failed: %w", err))
return
}
defer inputFormatContext.CloseInput()
// Find stream info
if err := inputFormatContext.FindStreamInfo(nil); err != nil {
log.Println(fmt.Errorf("main: finding stream info failed: %w", err))
return
}
// Allocate output format context
outputFormatContext, err := astiav.AllocOutputFormatContext(nil, "mp4", "")
if err != nil {
log.Println(fmt.Errorf("main: allocating output format context failed: %w", err))
return
}
if outputFormatContext == nil {
log.Println(errors.New("main: output format context is nil"))
return
}
defer outputFormatContext.Free()
// Open file
f, err := os.Create(*output)
if err != nil {
log.Println(fmt.Errorf("main: creating %s failed: %w", *output, err))
return
}
defer f.Close()
// Allocate io context
ioContext, err := astiav.AllocIOContext(
4096,
true,
nil,
func(offset int64, whence int) (n int64, err error) {
return f.Seek(offset, whence)
},
func(b []byte) (n int, err error) {
return f.Write(b)
},
)
if err != nil {
log.Println(fmt.Errorf("main: allocating io context failed: %w", err))
return
}
defer ioContext.Free()
// Store io context
outputFormatContext.SetPb(ioContext)
// Loop through streams
inputStreams := make(map[int]*astiav.Stream) // Indexed by input stream index
outputStreams := make(map[int]*astiav.Stream) // Indexed by input stream index
for _, is := range inputFormatContext.Streams() {
// Only process audio or video
if is.CodecParameters().MediaType() != astiav.MediaTypeAudio &&
is.CodecParameters().MediaType() != astiav.MediaTypeVideo {
continue
}
// Add input stream
inputStreams[is.Index()] = is
// Add stream to output format context
os := outputFormatContext.NewStream(nil)
if os == nil {
log.Println(errors.New("main: output stream is nil"))
return
}
// Copy codec parameters
if err = is.CodecParameters().Copy(os.CodecParameters()); err != nil {
log.Println(fmt.Errorf("main: copying codec parameters failed: %w", err))
return
}
// Reset codec tag
os.CodecParameters().SetCodecTag(0)
// Add output stream
outputStreams[is.Index()] = os
}
// Write header
if err = outputFormatContext.WriteHeader(nil); err != nil {
log.Println(fmt.Errorf("main: writing header failed: %w", err))
return
}
// Loop through packets
for {
// We use a closure to ease unreferencing packet
if stop := func() bool {
// Read frame
if err = inputFormatContext.ReadFrame(pkt); err != nil {
if !errors.Is(err, astiav.ErrEof) {
log.Println(fmt.Errorf("main: reading frame failed: %w", err))
}
return true
}
// Make sure to unreference packet
defer pkt.Unref()
// Get input stream
inputStream, ok := inputStreams[pkt.StreamIndex()]
if !ok {
return false
}
// Get output stream
outputStream, ok := outputStreams[pkt.StreamIndex()]
if !ok {
return false
}
// Update packet
pkt.SetStreamIndex(outputStream.Index())
pkt.RescaleTs(inputStream.TimeBase(), outputStream.TimeBase())
pkt.SetPos(-1)
// Write frame
if err = outputFormatContext.WriteInterleavedFrame(pkt); err != nil {
log.Println(fmt.Errorf("main: writing interleaved frame failed: %w", err))
return true
}
return false
}(); stop {
break
}
}
// Write trailer
if err = outputFormatContext.WriteTrailer(); err != nil {
log.Println(fmt.Errorf("main: writing trailer failed: %w", err))
return
}
// Done
log.Println("done")
}
================================================
FILE: examples/demuxing_decoding/main.go
================================================
package main
import (
"errors"
"flag"
"fmt"
"log"
"strings"
"github.com/asticode/go-astiav"
"github.com/asticode/go-astikit"
)
var (
input = flag.String("i", "", "the input path")
)
type stream struct {
decCodec *astiav.Codec
decCodecContext *astiav.CodecContext
decLastPTS *int64
inputStream *astiav.Stream
}
func main() {
// Handle ffmpeg logs
astiav.SetLogLevel(astiav.LogLevelDebug)
astiav.SetLogCallback(func(c astiav.Classer, l astiav.LogLevel, fmt, msg string) {
var cs string
if c != nil {
if cl := c.Class(); cl != nil {
cs = " - class: " + cl.String()
}
}
log.Printf("ffmpeg log: %s%s - level: %d\n", strings.TrimSpace(msg), cs, l)
})
// Parse flags
flag.Parse()
// Usage
if *input == "" {
log.Println("Usage: <binary path> -i <input path>")
return
}
// Allocate packet
pkt := astiav.AllocPacket()
defer pkt.Free()
// Allocate frame
f := astiav.AllocFrame()
defer f.Free()
// Allocate input format context
inputFormatContext := astiav.AllocFormatContext()
if inputFormatContext == nil {
log.Println(errors.New("main: input format context is nil"))
return
}
defer inputFormatContext.Free()
// Open input
if err := inputFormatContext.OpenInput(*input, nil, nil); err != nil {
log.Println(fmt.Errorf("main: opening input failed: %w", err))
return
}
defer inputFormatContext.CloseInput()
// Find stream info
if err := inputFormatContext.FindStreamInfo(nil); err != nil {
log.Println(fmt.Errorf("main: finding stream info failed: %w", err))
return
}
// Loop through streams
streams := make(map[int]*stream) // Indexed by input stream index
for _, is := range inputFormatContext.Streams() {
// Only process audio or video
if is.CodecParameters().MediaType() != astiav.MediaTypeAudio &&
is.CodecParameters().MediaType() != astiav.MediaTypeVideo {
continue
}
// Create stream
s := &stream{inputStream: is}
// Find decoder
if s.decCodec = astiav.FindDecoder(is.CodecParameters().CodecID()); s.decCodec == nil {
log.Println(errors.New("main: codec is nil"))
return
}
// Allocate codec context
if s.decCodecContext = astiav.AllocCodecContext(s.decCodec); s.decCodecContext == nil {
log.Println(errors.New("main: codec context is nil"))
return
}
defer s.decCodecContext.Free()
// Update codec context
if err := is.CodecParameters().ToCodecContext(s.decCodecContext); err != nil {
log.Println(fmt.Errorf("main: updating codec context failed: %w", err))
return
}
// Open codec context
if err := s.decCodecContext.Open(s.decCodec, nil); err != nil {
log.Println(fmt.Errorf("main: opening codec context failed: %w", err))
return
}
// Add stream
streams[is.Index()] = s
}
// Loop
for {
// We use a closure to ease unreferencing the packet
if stop := func() bool {
// Read frame
if err := inputFormatContext.ReadFrame(pkt); err != nil {
if !errors.Is(err, astiav.ErrEof) {
log.Println(fmt.Errorf("main: reading frame failed: %w", err))
}
return true
}
// Make sure to unreference the packet
defer pkt.Unref()
// Get stream
s, ok := streams[pkt.StreamIndex()]
if !ok {
return false
}
// Send packet
if err := s.decCodecContext.SendPacket(pkt); err != nil {
log.Println(fmt.Errorf("main: sending packet failed: %w", err))
return true
}
// Loop
for {
// We use a closure to ease unreferencing the frame
if stop := func() bool {
// Receive frame
if err := s.decCodecContext.ReceiveFrame(f); err != nil {
if !errors.Is(err, astiav.ErrEof) && !errors.Is(err, astiav.ErrEagain) {
log.Println(fmt.Errorf("main: receiving frame failed: %w", err))
}
return true
}
// Make sure to unreference the frame
defer f.Unref()
// Ignore frames with non monotonic PTS
if s.decLastPTS != nil && *s.decLastPTS >= f.Pts() {
return false
}
s.decLastPTS = astikit.Int64Ptr(f.Pts())
// Log
log.Printf("new %s frame: stream %d - pts: %d", s.inputStream.CodecParameters().MediaType(), pkt.StreamIndex(), f.Pts())
return false
}(); stop {
break
}
}
return false
}(); stop {
break
}
}
// Done
log.Println("done")
}
================================================
FILE: examples/filtering/main.go
================================================
package main
import (
"errors"
"flag"
"fmt"
"log"
"strings"
"github.com/asticode/go-astiav"
"github.com/asticode/go-astikit"
)
var (
input = flag.String("i", "", "the input path")
)
var (
c = astikit.NewCloser()
inputFormatContext *astiav.FormatContext
s *stream
)
type stream struct {
buffersinkContext *astiav.BuffersinkFilterContext
buffersrcContext *astiav.BuffersrcFilterContext
decCodec *astiav.Codec
decCodecContext *astiav.CodecContext
decFrame *astiav.Frame
decLastPTS *int64
filterFrame *astiav.Frame
filterGraph *astiav.FilterGraph
inputStream *astiav.Stream
lastPts int64
}
func main() {
// Handle ffmpeg logs
astiav.SetLogLevel(astiav.LogLevelDebug)
astiav.SetLogCallback(func(c astiav.Classer, l astiav.LogLevel, fmt, msg string) {
var cs string
if c != nil {
if cl := c.Class(); cl != nil {
cs = " - class: " + cl.String()
}
}
log.Printf("ffmpeg log: %s%s - level: %d\n", strings.TrimSpace(msg), cs, l)
})
// Parse flags
flag.Parse()
// Usage
if *input == "" {
log.Println("Usage: <binary path> -i <input path>")
return
}
// We use an astikit.Closer to free all resources properly
defer c.Close()
// Open input file
if err := openInputFile(); err != nil {
log.Println(fmt.Errorf("main: opening input file failed: %w", err))
return
}
// Init filter
if err := initFilter(); err != nil {
log.Println(fmt.Errorf("main: initializing filter failed: %w", err))
return
}
// Allocate packet
pkt := astiav.AllocPacket()
c.Add(pkt.Free)
// Loop through packets
for {
// We use a closure to ease unreferencing the packet
if stop := func() bool {
// Read frame
if err := inputFormatContext.ReadFrame(pkt); err != nil {
if !errors.Is(err, astiav.ErrEof) {
log.Println(fmt.Errorf("main: reading frame failed: %w", err))
}
return true
}
// Make sure to unreference the packet
defer pkt.Unref()
// Invalid stream
if pkt.StreamIndex() != s.inputStream.Index() {
return false
}
// Send packet
if err := s.decCodecContext.SendPacket(pkt); err != nil {
log.Println(fmt.Errorf("main: sending packet failed: %w", err))
return true
}
// Loop
for {
// We use a closure to ease unreferencing the frame
if stop := func() bool {
// Receive frame
if err := s.decCodecContext.ReceiveFrame(s.decFrame); err != nil {
if !errors.Is(err, astiav.ErrEof) && !errors.Is(err, astiav.ErrEagain) {
log.Println(fmt.Errorf("main: receiving frame failed: %w", err))
}
return true
}
// Make sure to unreference the frame
defer s.decFrame.Unref()
// Ignore frames with non monotonic PTS
if s.decLastPTS != nil && *s.decLastPTS >= s.decFrame.Pts() {
return false
}
s.decLastPTS = astikit.Int64Ptr(s.decFrame.Pts())
// Filter frame
if err := filterFrame(s.decFrame, s); err != nil {
log.Println(fmt.Errorf("main: filtering frame failed: %w", err))
return true
}
return false
}(); stop {
break
}
}
return false
}(); stop {
break
}
}
// Flush filter
if err := filterFrame(nil, s); err != nil {
log.Println(fmt.Errorf("main: filtering frame failed: %w", err))
return
}
// Done
log.Println("done")
}
func openInputFile() (err error) {
// Allocate input format context
if inputFormatContext = astiav.AllocFormatContext(); inputFormatContext == nil {
err = errors.New("main: input format context is nil")
return
}
c.Add(inputFormatContext.Free)
// Open input
if err = inputFormatContext.OpenInput(*input, nil, nil); err != nil {
err = fmt.Errorf("main: opening input failed: %w", err)
return
}
c.Add(inputFormatContext.CloseInput)
// Find stream info
if err = inputFormatContext.FindStreamInfo(nil); err != nil {
err = fmt.Errorf("main: finding stream info failed: %w", err)
return
}
// Loop through streams
for _, is := range inputFormatContext.Streams() {
// Only process video
if is.CodecParameters().MediaType() != astiav.MediaTypeVideo {
continue
}
// Create stream
s = &stream{
inputStream: is,
lastPts: astiav.NoPtsValue,
}
// Find decoder
if s.decCodec = astiav.FindDecoder(is.CodecParameters().CodecID()); s.decCodec == nil {
err = errors.New("main: codec is nil")
return
}
// Allocate codec context
if s.decCodecContext = astiav.AllocCodecContext(s.decCodec); s.decCodecContext == nil {
err = errors.New("main: codec context is nil")
return
}
c.Add(s.decCodecContext.Free)
// Update codec context
if err = is.CodecParameters().ToCodecContext(s.decCodecContext); err != nil {
err = fmt.Errorf("main: updating codec context failed: %w", err)
return
}
// Open codec context
if err = s.decCodecContext.Open(s.decCodec, nil); err != nil {
err = fmt.Errorf("main: opening codec context failed: %w", err)
return
}
// Allocate frame
s.decFrame = astiav.AllocFrame()
c.Add(s.decFrame.Free)
break
}
// No video stream
if s == nil {
err = errors.New("main: no video stream")
r
gitextract_kmu419_u/ ├── .devcontainer/ │ ├── Dockerfile │ └── devcontainer.json ├── .github/ │ └── workflows/ │ ├── Makefile │ ├── test.yml │ └── windows.patch ├── .gitignore ├── .vscode/ │ ├── .gitignore │ └── c_cpp_properties.json ├── BREAKING_CHANGES.md ├── LICENSE ├── README.md ├── astiav.go ├── astiav_test.go ├── atomic.c ├── atomic.h ├── audio_fifo.go ├── audio_fifo_test.go ├── bit_stream_filter.go ├── bit_stream_filter_context.go ├── bit_stream_filter_context_test.go ├── bit_stream_filter_test.go ├── buffersink_filter_context.go ├── buffersink_flag.go ├── buffersrc_filter_context.go ├── buffersrc_filter_context_parameters.go ├── buffersrc_filter_context_parameters_test.go ├── buffersrc_filter_context_test.go ├── buffersrc_flag.go ├── bytes.go ├── bytes_test.go ├── channel_layout.go ├── channel_layout.h ├── channel_layout_test.go ├── chroma_location.go ├── class.c ├── class.go ├── class.h ├── class_category.go ├── class_test.go ├── codec.go ├── codec_context.c ├── codec_context.go ├── codec_context.h ├── codec_context_flag.go ├── codec_context_test.go ├── codec_hardware_config.go ├── codec_hardware_config_method_flag.go ├── codec_id.go ├── codec_id_test.go ├── codec_parameters.go ├── codec_parameters_test.go ├── codec_tag.go ├── codec_test.go ├── color_primaries.go ├── color_range.go ├── color_range_test.go ├── color_space.go ├── color_space_test.go ├── color_transfer_characteristic.go ├── device.go ├── device_test.go ├── dictionary.go ├── dictionary_entry.go ├── dictionary_flag.go ├── dictionary_test.go ├── discard.go ├── display_matrix.go ├── display_matrix_test.go ├── disposition_flag.go ├── error.go ├── error_recognition_flag.go ├── error_test.go ├── examples/ │ ├── bit_stream_filtering/ │ │ └── main.go │ ├── custom_io_demuxing/ │ │ └── main.go │ ├── custom_io_muxing/ │ │ └── main.go │ ├── demuxing_decoding/ │ │ └── main.go │ ├── filtering/ │ │ └── main.go │ ├── frame_data_manipulation/ │ │ └── main.go │ ├── hardware_decoding_filtering/ │ │ └── main.go │ ├── hardware_encoding/ │ │ └── main.go │ ├── remuxing/ │ │ └── main.go │ ├── resampling_audio/ │ │ └── main.go │ ├── scaling_video/ │ │ └── main.go │ └── transcoding/ │ └── main.go ├── filter.go ├── filter_chain.go ├── filter_command_flag.go ├── filter_context.go ├── filter_flag.go ├── filter_graph.go ├── filter_graph_segment.go ├── filter_graph_test.go ├── filter_in_out.go ├── filter_pad.go ├── filter_params.go ├── filter_test.go ├── flags.go ├── flags_test.go ├── format_context.go ├── format_context_ctx_flag.go ├── format_context_flag.go ├── format_context_test.go ├── format_event_flag.go ├── frame.c ├── frame.go ├── frame.h ├── frame_data.go ├── frame_data_test.go ├── frame_flag.go ├── frame_side_data.c ├── frame_side_data.go ├── frame_side_data.h ├── frame_side_data_test.go ├── frame_test.go ├── go.mod ├── go.sum ├── hardware_device_context.go ├── hardware_device_type.go ├── hardware_device_type_test.go ├── hardware_frames_constraints.go ├── hardware_frames_context.go ├── input_format.go ├── input_format_test.go ├── internal/ │ └── cmd/ │ └── flags/ │ └── main.go ├── io_context.c ├── io_context.go ├── io_context.h ├── io_context_flag.go ├── io_context_test.go ├── io_format_flag.go ├── io_interrupter.c ├── io_interrupter.go ├── io_interrupter.h ├── io_interrupter_test.go ├── level.go ├── log.c ├── log.go ├── log.h ├── log_test.go ├── macros.c ├── macros.h ├── mathematics.go ├── mathematics_test.go ├── media_type.go ├── media_type_test.go ├── option.c ├── option.go ├── option.h ├── option_search_flag.go ├── option_test.go ├── output_format.go ├── output_format_test.go ├── packet.go ├── packet_flag.go ├── packet_side_data.go ├── packet_side_data_test.go ├── packet_test.go ├── picture_type.go ├── picture_type_test.go ├── pixel_format.go ├── pixel_format_descriptor.go ├── pixel_format_descriptor_flag.go ├── pixel_format_descriptor_test.go ├── pixel_format_test.go ├── private_data.go ├── profile.go ├── program.go ├── program_test.go ├── rational.go ├── rational_test.go ├── region_of_interest.go ├── rounding.go ├── sample_format.go ├── sample_format_test.go ├── seek_flag.go ├── skip_samples.go ├── skip_samples_test.go ├── software_resample_context.go ├── software_resample_context_test.go ├── software_scale_context.go ├── software_scale_context_flag.go ├── software_scale_context_test.go ├── stream.go ├── stream_event_flag.go ├── stream_test.go ├── strict_std_compliance.go ├── testdata/ │ ├── audio-s16le-bytes │ ├── audio-s16le.pcm │ ├── image-rgba-bytes │ ├── image-rgba-struct │ ├── image-rgba-upscaled-bytes │ ├── video-yuv420p-bytes │ ├── video-yuv420p-struct │ └── video-yuv420p.h264 ├── thread_type.go ├── time.go └── time_test.go
Showing preview only (223K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2255 symbols across 166 files)
FILE: astiav_test.go
function TestMain (line 15) | func TestMain(m *testing.M) {
type helper (line 29) | type helper struct
method close (line 43) | func (h *helper) close() {
method inputFormatContext (line 57) | func (h *helper) inputFormatContext(name string, ifmt *InputFormat) (f...
method inputFirstPacket (line 92) | func (h *helper) inputFirstPacket(name string) (pkt *Packet, err error) {
method inputLastFrame (line 125) | func (h *helper) inputLastFrame(name string, mediaType MediaType, ifmt...
function newHelper (line 35) | func newHelper() *helper {
type helperInput (line 47) | type helperInput struct
function newHelperInput (line 53) | func newHelperInput() *helperInput {
FILE: atomic.c
function astiavAtomicLoadInt (line 3) | int astiavAtomicLoadInt(atomic_int* i)
function astiavAtomicStoreInt (line 8) | void astiavAtomicStoreInt(atomic_int* i, int v)
FILE: audio_fifo.go
type AudioFifo (line 8) | type AudioFifo struct
method Realloc (line 25) | func (a *AudioFifo) Realloc(nbSamples int) error {
method Size (line 30) | func (a *AudioFifo) Size() int {
method Space (line 35) | func (a *AudioFifo) Space() int {
method Write (line 40) | func (a *AudioFifo) Write(f *Frame) (int, error) {
method Read (line 49) | func (a *AudioFifo) Read(f *Frame) (int, error) {
method Free (line 58) | func (a *AudioFifo) Free() {
function newAudioFifoFromC (line 12) | func newAudioFifoFromC(c *C.AVAudioFifo) *AudioFifo {
function AllocAudioFifo (line 20) | func AllocAudioFifo(sampleFmt SampleFormat, channels int, nbSamples int)...
FILE: audio_fifo_test.go
function TestAudioFIFO (line 9) | func TestAudioFIFO(t *testing.T) {
FILE: bit_stream_filter.go
type BitStreamFilter (line 11) | type BitStreamFilter struct
method Name (line 30) | func (bsf *BitStreamFilter) Name() string {
method String (line 34) | func (bsf *BitStreamFilter) String() string {
function newBitStreamFilterFromC (line 15) | func newBitStreamFilterFromC(c *C.AVBitStreamFilter) *BitStreamFilter {
function FindBitStreamFilterByName (line 23) | func FindBitStreamFilterByName(n string) *BitStreamFilter {
FILE: bit_stream_filter_context.go
type BitStreamFilterContext (line 11) | type BitStreamFilterContext struct
method Class (line 41) | func (bsfc *BitStreamFilterContext) Class() *Class {
method Initialize (line 49) | func (bsfc *BitStreamFilterContext) Initialize() error {
method PrivateData (line 54) | func (bsfc *BitStreamFilterContext) PrivateData() *PrivateData {
method SendPacket (line 59) | func (bsfc *BitStreamFilterContext) SendPacket(p *Packet) error {
method ReceivePacket (line 68) | func (bsfc *BitStreamFilterContext) ReceivePacket(p *Packet) error {
method Free (line 76) | func (bsfc *BitStreamFilterContext) Free() {
method InputTimeBase (line 91) | func (bsfc *BitStreamFilterContext) InputTimeBase() Rational {
method SetInputTimeBase (line 96) | func (bsfc *BitStreamFilterContext) SetInputTimeBase(r Rational) {
method InputCodecParameters (line 101) | func (bsfc *BitStreamFilterContext) InputCodecParameters() *CodecParam...
method OutputCodecParameters (line 106) | func (bsfc *BitStreamFilterContext) OutputCodecParameters() *CodecPara...
function newBSFContextFromC (line 15) | func newBSFContextFromC(c *C.AVBSFContext) *BitStreamFilterContext {
function AllocBitStreamFilterContext (line 27) | func AllocBitStreamFilterContext(f *BitStreamFilter) (*BitStreamFilterCo...
FILE: bit_stream_filter_context_test.go
function TestBitStreamFilterContext (line 9) | func TestBitStreamFilterContext(t *testing.T) {
FILE: bit_stream_filter_test.go
function TestBitStreamFilter (line 9) | func TestBitStreamFilter(t *testing.T) {
FILE: buffersink_filter_context.go
type BuffersinkFilterContext (line 6) | type BuffersinkFilterContext struct
method ChannelLayout (line 15) | func (bfc *BuffersinkFilterContext) ChannelLayout() ChannelLayout {
method ColorRange (line 22) | func (bfc *BuffersinkFilterContext) ColorRange() ColorRange {
method ColorSpace (line 27) | func (bfc *BuffersinkFilterContext) ColorSpace() ColorSpace {
method FilterContext (line 31) | func (bfc *BuffersinkFilterContext) FilterContext() *FilterContext {
method FrameRate (line 36) | func (bfc *BuffersinkFilterContext) FrameRate() Rational {
method GetFrame (line 41) | func (bfc *BuffersinkFilterContext) GetFrame(f *Frame, fs BuffersinkFl...
method Height (line 50) | func (bfc *BuffersinkFilterContext) Height() int {
method MediaType (line 55) | func (bfc *BuffersinkFilterContext) MediaType() MediaType {
method PixelFormat (line 60) | func (bfc *BuffersinkFilterContext) PixelFormat() PixelFormat {
method SampleAspectRatio (line 65) | func (bfc *BuffersinkFilterContext) SampleAspectRatio() Rational {
method SampleFormat (line 70) | func (bfc *BuffersinkFilterContext) SampleFormat() SampleFormat {
method SampleRate (line 75) | func (bfc *BuffersinkFilterContext) SampleRate() int {
method TimeBase (line 80) | func (bfc *BuffersinkFilterContext) TimeBase() Rational {
method Width (line 85) | func (bfc *BuffersinkFilterContext) Width() int {
function newBuffersinkFilterContext (line 10) | func newBuffersinkFilterContext(fc *FilterContext) *BuffersinkFilterCont...
FILE: buffersink_flag.go
type BuffersinkFlag (line 7) | type BuffersinkFlag
constant BuffersinkFlagPeek (line 10) | BuffersinkFlagPeek = BuffersinkFlag(C.AV_BUFFERSINK_FLAG_PEEK)
constant BuffersinkFlagNoRequest (line 11) | BuffersinkFlagNoRequest = BuffersinkFlag(C.AV_BUFFERSINK_FLAG_NO_REQUEST)
FILE: buffersrc_filter_context.go
type BuffersrcFilterContext (line 6) | type BuffersrcFilterContext struct
method AddFrame (line 15) | func (bfc *BuffersrcFilterContext) AddFrame(f *Frame, fs BuffersrcFlag...
method FilterContext (line 23) | func (bfc *BuffersrcFilterContext) FilterContext() *FilterContext {
method Initialize (line 28) | func (bfc *BuffersrcFilterContext) Initialize(d *Dictionary) error {
method SetParameters (line 37) | func (bfc *BuffersrcFilterContext) SetParameters(bfcp *BuffersrcFilter...
function newBuffersrcFilterContext (line 10) | func newBuffersrcFilterContext(fc *FilterContext) *BuffersrcFilterContext {
FILE: buffersrc_filter_context_parameters.go
type BuffersrcFilterContextParameters (line 8) | type BuffersrcFilterContextParameters struct
method Free (line 24) | func (bfcp *BuffersrcFilterContextParameters) Free() {
method ChannelLayout (line 34) | func (bfcp *BuffersrcFilterContextParameters) ChannelLayout() ChannelL...
method SetChannelLayout (line 40) | func (bfcp *BuffersrcFilterContextParameters) SetChannelLayout(l Chann...
method ColorRange (line 45) | func (bfcp *BuffersrcFilterContextParameters) ColorRange() ColorRange {
method SetColorRange (line 50) | func (bfcp *BuffersrcFilterContextParameters) SetColorRange(r ColorRan...
method ColorSpace (line 55) | func (bfcp *BuffersrcFilterContextParameters) ColorSpace() ColorSpace {
method SetColorSpace (line 60) | func (bfcp *BuffersrcFilterContextParameters) SetColorSpace(s ColorSpa...
method Framerate (line 65) | func (bfcp *BuffersrcFilterContextParameters) Framerate() Rational {
method SetFramerate (line 70) | func (bfcp *BuffersrcFilterContextParameters) SetFramerate(f Rational) {
method SetHardwareFramesContext (line 75) | func (bfcp *BuffersrcFilterContextParameters) SetHardwareFramesContext...
method Height (line 87) | func (bfcp *BuffersrcFilterContextParameters) Height() int {
method SetHeight (line 92) | func (bfcp *BuffersrcFilterContextParameters) SetHeight(height int) {
method PixelFormat (line 97) | func (bfcp *BuffersrcFilterContextParameters) PixelFormat() PixelFormat {
method SetPixelFormat (line 102) | func (bfcp *BuffersrcFilterContextParameters) SetPixelFormat(f PixelFo...
method SampleAspectRatio (line 107) | func (bfcp *BuffersrcFilterContextParameters) SampleAspectRatio() Rati...
method SetSampleAspectRatio (line 112) | func (bfcp *BuffersrcFilterContextParameters) SetSampleAspectRatio(r R...
method SampleFormat (line 117) | func (bfcp *BuffersrcFilterContextParameters) SampleFormat() SampleFor...
method SetSampleFormat (line 122) | func (bfcp *BuffersrcFilterContextParameters) SetSampleFormat(f Sample...
method SampleRate (line 127) | func (bfcp *BuffersrcFilterContextParameters) SampleRate() int {
method SetSampleRate (line 132) | func (bfcp *BuffersrcFilterContextParameters) SetSampleRate(sampleRate...
method TimeBase (line 137) | func (bfcp *BuffersrcFilterContextParameters) TimeBase() Rational {
method SetTimeBase (line 142) | func (bfcp *BuffersrcFilterContextParameters) SetTimeBase(r Rational) {
method Width (line 147) | func (bfcp *BuffersrcFilterContextParameters) Width() int {
method SetWidth (line 152) | func (bfcp *BuffersrcFilterContextParameters) SetWidth(width int) {
function newBuffersrcFilterContextParametersFromC (line 12) | func newBuffersrcFilterContextParametersFromC(c *C.AVBufferSrcParameters...
function AllocBuffersrcFilterContextParameters (line 20) | func AllocBuffersrcFilterContextParameters() *BuffersrcFilterContextPara...
FILE: buffersrc_filter_context_parameters_test.go
function TestBuffersrcFilterContextParameters (line 9) | func TestBuffersrcFilterContextParameters(t *testing.T) {
FILE: buffersrc_filter_context_test.go
function TestBuffersrcFilterContext (line 8) | func TestBuffersrcFilterContext(t *testing.T) {
FILE: buffersrc_flag.go
type BuffersrcFlag (line 7) | type BuffersrcFlag
constant BuffersrcFlagNoCheckFormat (line 10) | BuffersrcFlagNoCheckFormat = BuffersrcFlag(C.AV_BUFFERSRC_FLAG_NO_CHECK_...
constant BuffersrcFlagPush (line 11) | BuffersrcFlagPush = BuffersrcFlag(C.AV_BUFFERSRC_FLAG_PUSH)
constant BuffersrcFlagKeepRef (line 12) | BuffersrcFlagKeepRef = BuffersrcFlag(C.AV_BUFFERSRC_FLAG_KEEP_REF)
FILE: bytes.go
function stringFromC (line 13) | func stringFromC(len int, fn func(buf *C.char, size C.size_t) error) (st...
function bytesFromC (line 26) | func bytesFromC(fn func(size *C.size_t) *C.uint8_t) []byte {
function bytesToC (line 32) | func bytesToC(b []byte, fn func(b *C.uint8_t, size C.size_t) error) error {
function setBytesWithIntSizeInC (line 43) | func setBytesWithIntSizeInC(b []byte, d **C.uint8_t, size *C.int) error {
FILE: bytes_test.go
function TestBytes (line 5) | func TestBytes(t *testing.T) {
FILE: channel_layout.go
type ChannelLayout (line 50) | type ChannelLayout struct
method Channels (line 59) | func (l ChannelLayout) Channels() int {
method String (line 66) | func (l ChannelLayout) String() string {
method Describe (line 76) | func (l ChannelLayout) Describe(b []byte) (int, error) {
method Valid (line 91) | func (l ChannelLayout) Valid() bool {
method Compare (line 99) | func (l ChannelLayout) Compare(l2 ChannelLayout) (equal bool, err erro...
method Equal (line 110) | func (l ChannelLayout) Equal(l2 ChannelLayout) bool {
method copy (line 116) | func (l ChannelLayout) copy(dst *C.AVChannelLayout) error {
method clone (line 120) | func (l ChannelLayout) clone() (ChannelLayout, error) {
function newChannelLayoutFromC (line 54) | func newChannelLayoutFromC(c *C.AVChannelLayout) ChannelLayout {
FILE: channel_layout_test.go
function TestChannelLayout (line 9) | func TestChannelLayout(t *testing.T) {
FILE: chroma_location.go
type ChromaLocation (line 7) | type ChromaLocation
constant ChromaLocationUnspecified (line 10) | ChromaLocationUnspecified = ChromaLocation(C.AVCHROMA_LOC_UNSPECIFIED)
constant ChromaLocationLeft (line 11) | ChromaLocationLeft = ChromaLocation(C.AVCHROMA_LOC_LEFT)
constant ChromaLocationCenter (line 12) | ChromaLocationCenter = ChromaLocation(C.AVCHROMA_LOC_CENTER)
constant ChromaLocationTopleft (line 13) | ChromaLocationTopleft = ChromaLocation(C.AVCHROMA_LOC_TOPLEFT)
constant ChromaLocationTop (line 14) | ChromaLocationTop = ChromaLocation(C.AVCHROMA_LOC_TOP)
constant ChromaLocationBottomleft (line 15) | ChromaLocationBottomleft = ChromaLocation(C.AVCHROMA_LOC_BOTTOMLEFT)
constant ChromaLocationBottom (line 16) | ChromaLocationBottom = ChromaLocation(C.AVCHROMA_LOC_BOTTOM)
constant ChromaLocationNb (line 17) | ChromaLocationNb = ChromaLocation(C.AVCHROMA_LOC_NB)
FILE: class.c
function AVClassCategory (line 9) | AVClassCategory astiavClassCategory(AVClass* c, void* ptr) {
function AVClass (line 14) | AVClass** astiavClassParent(AVClass* c, void* ptr) {
FILE: class.go
type Class (line 12) | type Class struct
method Category (line 32) | func (c *Class) Category() ClassCategory {
method ItemName (line 37) | func (c *Class) ItemName() string {
method Name (line 42) | func (c *Class) Name() string {
method Parent (line 47) | func (c *Class) Parent() *Class {
method String (line 51) | func (c *Class) String() string {
function newClassFromC (line 17) | func newClassFromC(ptr unsafe.Pointer) *Class {
type Classer (line 55) | type Classer interface
type UnknownClasser (line 61) | type UnknownClasser struct
method Class (line 69) | func (c *UnknownClasser) Class() *Class {
function newUnknownClasser (line 65) | func newUnknownClasser(ptr unsafe.Pointer) *UnknownClasser {
type ClonedClasser (line 75) | type ClonedClasser struct
method Class (line 87) | func (c *ClonedClasser) Class() *Class {
function newClonedClasser (line 79) | func newClonedClasser(c Classer) *ClonedClasser {
type classerPool (line 93) | type classerPool struct
method unsafePointer (line 102) | func (p *classerPool) unsafePointer(c Classer) unsafe.Pointer {
method set (line 113) | func (p *classerPool) set(c Classer) {
method del (line 121) | func (p *classerPool) del(c Classer) {
method get (line 129) | func (p *classerPool) get(ptr unsafe.Pointer) (Classer, bool) {
function newClasserPool (line 98) | func newClasserPool() *classerPool {
FILE: class_category.go
type ClassCategory (line 7) | type ClassCategory
constant ClassCategoryBitstreamFilter (line 10) | ClassCategoryBitstreamFilter = ClassCategory(C.AV_CLASS_CATEGORY_BITST...
constant ClassCategoryDecoder (line 11) | ClassCategoryDecoder = ClassCategory(C.AV_CLASS_CATEGORY_DECODER)
constant ClassCategoryDemuxer (line 12) | ClassCategoryDemuxer = ClassCategory(C.AV_CLASS_CATEGORY_DEMUXER)
constant ClassCategoryDeviceAudioInput (line 13) | ClassCategoryDeviceAudioInput = ClassCategory(C.AV_CLASS_CATEGORY_DEVIC...
constant ClassCategoryDeviceAudioOutput (line 14) | ClassCategoryDeviceAudioOutput = ClassCategory(C.AV_CLASS_CATEGORY_DEVIC...
constant ClassCategoryDeviceInput (line 15) | ClassCategoryDeviceInput = ClassCategory(C.AV_CLASS_CATEGORY_DEVIC...
constant ClassCategoryDeviceOutput (line 16) | ClassCategoryDeviceOutput = ClassCategory(C.AV_CLASS_CATEGORY_DEVIC...
constant ClassCategoryDeviceVideoInput (line 17) | ClassCategoryDeviceVideoInput = ClassCategory(C.AV_CLASS_CATEGORY_DEVIC...
constant ClassCategoryDeviceVideoOutput (line 18) | ClassCategoryDeviceVideoOutput = ClassCategory(C.AV_CLASS_CATEGORY_DEVIC...
constant ClassCategoryEncoder (line 19) | ClassCategoryEncoder = ClassCategory(C.AV_CLASS_CATEGORY_ENCODER)
constant ClassCategoryFilter (line 20) | ClassCategoryFilter = ClassCategory(C.AV_CLASS_CATEGORY_FILTER)
constant ClassCategoryInput (line 21) | ClassCategoryInput = ClassCategory(C.AV_CLASS_CATEGORY_INPUT)
constant ClassCategoryMuxer (line 22) | ClassCategoryMuxer = ClassCategory(C.AV_CLASS_CATEGORY_MUXER)
constant ClassCategoryNa (line 23) | ClassCategoryNa = ClassCategory(C.AV_CLASS_CATEGORY_NA)
constant ClassCategoryNb (line 24) | ClassCategoryNb = ClassCategory(C.AV_CLASS_CATEGORY_NB)
constant ClassCategoryOutput (line 25) | ClassCategoryOutput = ClassCategory(C.AV_CLASS_CATEGORY_OUTPUT)
constant ClassCategorySwresampler (line 26) | ClassCategorySwresampler = ClassCategory(C.AV_CLASS_CATEGORY_SWRES...
constant ClassCategorySwscaler (line 27) | ClassCategorySwscaler = ClassCategory(C.AV_CLASS_CATEGORY_SWSCA...
FILE: class_test.go
function TestClass (line 13) | func TestClass(t *testing.T) {
function TestClassers (line 29) | func TestClassers(t *testing.T) {
FILE: codec.go
type Codec (line 11) | type Codec struct
method Name (line 23) | func (c *Codec) Name() string {
method String (line 27) | func (c *Codec) String() string {
method ID (line 32) | func (c *Codec) ID() CodecID {
method IsDecoder (line 37) | func (c *Codec) IsDecoder() bool {
method IsEncoder (line 42) | func (c *Codec) IsEncoder() bool {
method supportedConfig (line 47) | func (c *Codec) supportedConfig(config C.enum_AVCodecConfig, fn func(p...
method SupportedChannelLayouts (line 60) | func (c *Codec) SupportedChannelLayouts() (o []ChannelLayout) {
method SupportedColorRanges (line 69) | func (c *Codec) SupportedColorRanges() (o []ColorRange) {
method SupportedColorSpaces (line 77) | func (c *Codec) SupportedColorSpaces() (o []ColorSpace) {
method SupportedPixelFormats (line 85) | func (c *Codec) SupportedPixelFormats() (o []PixelFormat) {
method SupportedSampleFormats (line 93) | func (c *Codec) SupportedSampleFormats() (o []SampleFormat) {
method SupportedFrameRates (line 101) | func (c *Codec) SupportedFrameRates() (o []Rational) {
method SupportedSampleRates (line 109) | func (c *Codec) SupportedSampleRates() (o []int) {
method HardwareConfigs (line 141) | func (c *Codec) HardwareConfigs() (configs []CodecHardwareConfig) {
function newCodecFromC (line 15) | func newCodecFromC(c *C.AVCodec) *Codec {
function FindDecoder (line 117) | func FindDecoder(id CodecID) *Codec {
function FindDecoderByName (line 122) | func FindDecoderByName(n string) *Codec {
function FindEncoder (line 129) | func FindEncoder(id CodecID) *Codec {
function FindEncoderByName (line 134) | func FindEncoderByName(n string) *Codec {
function Codecs (line 155) | func Codecs() (cs []*Codec) {
FILE: codec_context.c
function astiavCodecContextGetFormat (line 5) | enum AVPixelFormat astiavCodecContextGetFormat(AVCodecContext *ctx, cons...
function astiavSetCodecContextGetFormat (line 15) | void astiavSetCodecContextGetFormat(AVCodecContext *ctx)
function astiavResetCodecContextGetFormat (line 19) | void astiavResetCodecContextGetFormat(AVCodecContext *ctx)
FILE: codec_context.go
type CodecContext (line 11) | type CodecContext struct
method Free (line 36) | func (cc *CodecContext) Free() {
method String (line 56) | func (cc *CodecContext) String() string {
method BitRate (line 65) | func (cc *CodecContext) BitRate() int64 {
method SetBitRate (line 70) | func (cc *CodecContext) SetBitRate(bitRate int64) {
method ChannelLayout (line 75) | func (cc *CodecContext) ChannelLayout() ChannelLayout {
method SetChannelLayout (line 81) | func (cc *CodecContext) SetChannelLayout(l ChannelLayout) {
method ChromaLocation (line 86) | func (cc *CodecContext) ChromaLocation() ChromaLocation {
method Class (line 91) | func (cc *CodecContext) Class() *Class {
method CodecID (line 99) | func (cc *CodecContext) CodecID() CodecID {
method ColorPrimaries (line 104) | func (cc *CodecContext) ColorPrimaries() ColorPrimaries {
method SetColorPrimaries (line 109) | func (cc *CodecContext) SetColorPrimaries(p ColorPrimaries) {
method ColorRange (line 114) | func (cc *CodecContext) ColorRange() ColorRange {
method SetColorRange (line 119) | func (cc *CodecContext) SetColorRange(r ColorRange) {
method ColorSpace (line 124) | func (cc *CodecContext) ColorSpace() ColorSpace {
method SetColorSpace (line 129) | func (cc *CodecContext) SetColorSpace(s ColorSpace) {
method ColorTransferCharacteristic (line 134) | func (cc *CodecContext) ColorTransferCharacteristic() ColorTransferCha...
method SetColorTransferCharacteristic (line 139) | func (cc *CodecContext) SetColorTransferCharacteristic(tc ColorTransfe...
method ErrorRecognitionFlags (line 144) | func (cc *CodecContext) ErrorRecognitionFlags() ErrorRecognitionFlags {
method SetErrorRecognitionFlags (line 149) | func (cc *CodecContext) SetErrorRecognitionFlags(fs ErrorRecognitionFl...
method ExtraData (line 154) | func (cc *CodecContext) ExtraData() []byte {
method SetExtraData (line 162) | func (cc *CodecContext) SetExtraData(b []byte) error {
method Flags (line 167) | func (cc *CodecContext) Flags() CodecContextFlags {
method SetFlags (line 172) | func (cc *CodecContext) SetFlags(fs CodecContextFlags) {
method Flags2 (line 177) | func (cc *CodecContext) Flags2() CodecContextFlags2 {
method SetFlags2 (line 182) | func (cc *CodecContext) SetFlags2(fs CodecContextFlags2) {
method Framerate (line 187) | func (cc *CodecContext) Framerate() Rational {
method SetFramerate (line 192) | func (cc *CodecContext) SetFramerate(f Rational) {
method FrameSize (line 197) | func (cc *CodecContext) FrameSize() int {
method GopSize (line 202) | func (cc *CodecContext) GopSize() int {
method SetGopSize (line 207) | func (cc *CodecContext) SetGopSize(gopSize int) {
method Height (line 212) | func (cc *CodecContext) Height() int {
method SetHeight (line 217) | func (cc *CodecContext) SetHeight(height int) {
method Level (line 222) | func (cc *CodecContext) Level() Level {
method SetLevel (line 227) | func (cc *CodecContext) SetLevel(l Level) {
method MediaType (line 232) | func (cc *CodecContext) MediaType() MediaType {
method PixelFormat (line 237) | func (cc *CodecContext) PixelFormat() PixelFormat {
method SetPixelFormat (line 242) | func (cc *CodecContext) SetPixelFormat(pixFmt PixelFormat) {
method PrivateData (line 247) | func (cc *CodecContext) PrivateData() *PrivateData {
method Profile (line 252) | func (cc *CodecContext) Profile() Profile {
method SetProfile (line 257) | func (cc *CodecContext) SetProfile(p Profile) {
method Qmin (line 262) | func (cc *CodecContext) Qmin() int {
method SetQmin (line 267) | func (cc *CodecContext) SetQmin(qmin int) {
method SampleAspectRatio (line 272) | func (cc *CodecContext) SampleAspectRatio() Rational {
method SetSampleAspectRatio (line 277) | func (cc *CodecContext) SetSampleAspectRatio(r Rational) {
method SampleFormat (line 282) | func (cc *CodecContext) SampleFormat() SampleFormat {
method SetSampleFormat (line 287) | func (cc *CodecContext) SetSampleFormat(f SampleFormat) {
method SampleRate (line 292) | func (cc *CodecContext) SampleRate() int {
method SetSampleRate (line 297) | func (cc *CodecContext) SetSampleRate(sampleRate int) {
method StrictStdCompliance (line 302) | func (cc *CodecContext) StrictStdCompliance() StrictStdCompliance {
method SetStrictStdCompliance (line 307) | func (cc *CodecContext) SetStrictStdCompliance(c StrictStdCompliance) {
method TimeBase (line 312) | func (cc *CodecContext) TimeBase() Rational {
method SetTimeBase (line 317) | func (cc *CodecContext) SetTimeBase(r Rational) {
method ThreadCount (line 322) | func (cc *CodecContext) ThreadCount() int {
method SetThreadCount (line 327) | func (cc *CodecContext) SetThreadCount(threadCount int) {
method ThreadType (line 332) | func (cc *CodecContext) ThreadType() ThreadType {
method SetThreadType (line 337) | func (cc *CodecContext) SetThreadType(t ThreadType) {
method Width (line 342) | func (cc *CodecContext) Width() int {
method SetWidth (line 347) | func (cc *CodecContext) SetWidth(width int) {
method Open (line 352) | func (cc *CodecContext) Open(c *Codec, d *Dictionary) error {
method ReceivePacket (line 361) | func (cc *CodecContext) ReceivePacket(p *Packet) error {
method SendPacket (line 370) | func (cc *CodecContext) SendPacket(p *Packet) error {
method ReceiveFrame (line 379) | func (cc *CodecContext) ReceiveFrame(f *Frame) error {
method SendFrame (line 388) | func (cc *CodecContext) SendFrame(f *Frame) error {
method ToCodecParameters (line 396) | func (cc *CodecContext) ToCodecParameters(cp *CodecParameters) error {
method FromCodecParameters (line 400) | func (cc *CodecContext) FromCodecParameters(cp *CodecParameters) error {
method SetHardwareDeviceContext (line 405) | func (cc *CodecContext) SetHardwareDeviceContext(hdc *HardwareDeviceCo...
method HardwareFramesContext (line 417) | func (cc *CodecContext) HardwareFramesContext() *HardwareFramesContext {
method SetHardwareFramesContext (line 422) | func (cc *CodecContext) SetHardwareFramesContext(hfc *HardwareFramesCo...
method ExtraHardwareFrames (line 434) | func (cc *CodecContext) ExtraHardwareFrames() int {
method SetExtraHardwareFrames (line 439) | func (cc *CodecContext) SetExtraHardwareFrames(n int) {
method UnsafePointer (line 443) | func (cc *CodecContext) UnsafePointer() unsafe.Pointer {
method SetPixelFormatCallback (line 455) | func (cc *CodecContext) SetPixelFormatCallback(c CodecContextPixelForm...
method MaxBFrames (line 493) | func (cc *CodecContext) MaxBFrames() int {
method SetMaxBFrames (line 498) | func (cc *CodecContext) SetMaxBFrames(n int) {
method RateControlMaxRate (line 503) | func (cc *CodecContext) RateControlMaxRate() int64 {
method SetRateControlMaxRate (line 508) | func (cc *CodecContext) SetRateControlMaxRate(n int64) {
method RateControlMinRate (line 513) | func (cc *CodecContext) RateControlMinRate() int64 {
method SetRateControlMinRate (line 518) | func (cc *CodecContext) SetRateControlMinRate(n int64) {
method RateControlBufferSize (line 523) | func (cc *CodecContext) RateControlBufferSize() int {
method SetRateControlBufferSize (line 528) | func (cc *CodecContext) SetRateControlBufferSize(n int) {
function newCodecContextFromC (line 15) | func newCodecContextFromC(c *C.AVCodecContext) *CodecContext {
function AllocCodecContext (line 27) | func AllocCodecContext(c *Codec) *CodecContext {
type CodecContextPixelFormatCallback (line 447) | type CodecContextPixelFormatCallback
function goAstiavCodecContextGetFormat (line 471) | func goAstiavCodecContextGetFormat(cc *C.AVCodecContext, pfsCPtr *C.enum...
FILE: codec_context.h
type AVPixelFormat (line 3) | enum AVPixelFormat
type AVPixelFormat (line 3) | enum AVPixelFormat
type AVPixelFormat (line 4) | enum AVPixelFormat
type AVPixelFormat (line 4) | enum AVPixelFormat
FILE: codec_context_flag.go
type CodecContextFlag (line 7) | type CodecContextFlag
constant CodecContextFlagUnaligned (line 10) | CodecContextFlagUnaligned = CodecContextFlag(C.AV_CODEC_FLAG_UNALIGNED)
constant CodecContextFlagQscale (line 11) | CodecContextFlagQscale = CodecContextFlag(C.AV_CODEC_FLAG_QSCALE)
constant CodecContextFlag4Mv (line 12) | CodecContextFlag4Mv = CodecContextFlag(C.AV_CODEC_FLAG_4MV)
constant CodecContextFlagOutputCorrupt (line 13) | CodecContextFlagOutputCorrupt = CodecContextFlag(C.AV_CODEC_FLAG_OUTPUT_...
constant CodecContextFlagQpel (line 14) | CodecContextFlagQpel = CodecContextFlag(C.AV_CODEC_FLAG_QPEL)
constant CodecContextFlagPass1 (line 15) | CodecContextFlagPass1 = CodecContextFlag(C.AV_CODEC_FLAG_PASS1)
constant CodecContextFlagPass2 (line 16) | CodecContextFlagPass2 = CodecContextFlag(C.AV_CODEC_FLAG_PASS2)
constant CodecContextFlagLoopFilter (line 17) | CodecContextFlagLoopFilter = CodecContextFlag(C.AV_CODEC_FLAG_LOOP_FI...
constant CodecContextFlagGray (line 18) | CodecContextFlagGray = CodecContextFlag(C.AV_CODEC_FLAG_GRAY)
constant CodecContextFlagPsnr (line 19) | CodecContextFlagPsnr = CodecContextFlag(C.AV_CODEC_FLAG_PSNR)
constant CodecContextFlagInterlacedDct (line 20) | CodecContextFlagInterlacedDct = CodecContextFlag(C.AV_CODEC_FLAG_INTERLA...
constant CodecContextFlagLowDelay (line 21) | CodecContextFlagLowDelay = CodecContextFlag(C.AV_CODEC_FLAG_LOW_DELAY)
constant CodecContextFlagGlobalHeader (line 22) | CodecContextFlagGlobalHeader = CodecContextFlag(C.AV_CODEC_FLAG_GLOBAL_...
constant CodecContextFlagBitexact (line 23) | CodecContextFlagBitexact = CodecContextFlag(C.AV_CODEC_FLAG_BITEXACT)
constant CodecContextFlagAcPred (line 24) | CodecContextFlagAcPred = CodecContextFlag(C.AV_CODEC_FLAG_AC_PRED)
constant CodecContextFlagInterlacedMe (line 25) | CodecContextFlagInterlacedMe = CodecContextFlag(C.AV_CODEC_FLAG_INTERLA...
constant CodecContextFlagClosedGop (line 26) | CodecContextFlagClosedGop = CodecContextFlag(C.AV_CODEC_FLAG_CLOSED_...
type CodecContextFlag2 (line 29) | type CodecContextFlag2
constant CodecFlag2Fast (line 33) | CodecFlag2Fast = CodecContextFlag2(C.AV_CODEC_FLAG2_FAST)
constant CodecFlag2NoOutput (line 34) | CodecFlag2NoOutput = CodecContextFlag2(C.AV_CODEC_FLAG2_NO_OUTPUT)
constant CodecFlag2LocalHeader (line 35) | CodecFlag2LocalHeader = CodecContextFlag2(C.AV_CODEC_FLAG2_LOCAL_HEADER)
constant CodecFlag2Chunks (line 36) | CodecFlag2Chunks = CodecContextFlag2(C.AV_CODEC_FLAG2_CHUNKS)
constant CodecFlag2IgnoreCrop (line 37) | CodecFlag2IgnoreCrop = CodecContextFlag2(C.AV_CODEC_FLAG2_IGNORE_CROP)
constant CodecFlag2ShowAll (line 38) | CodecFlag2ShowAll = CodecContextFlag2(C.AV_CODEC_FLAG2_SHOW_ALL)
constant CodecFlag2ExportMvs (line 39) | CodecFlag2ExportMvs = CodecContextFlag2(C.AV_CODEC_FLAG2_EXPORT_MVS)
constant CodecFlag2SkipManual (line 40) | CodecFlag2SkipManual = CodecContextFlag2(C.AV_CODEC_FLAG2_SKIP_MANUAL)
constant CodecFlag2RoFlushNoop (line 41) | CodecFlag2RoFlushNoop = CodecContextFlag2(C.AV_CODEC_FLAG2_RO_FLUSH_NOOP)
constant CodecFlag2IccProfiles (line 42) | CodecFlag2IccProfiles = CodecContextFlag2(C.AV_CODEC_FLAG2_ICC_PROFILES)
FILE: codec_context_test.go
function TestCodecContext (line 10) | func TestCodecContext(t *testing.T) {
FILE: codec_hardware_config.go
type CodecHardwareConfig (line 7) | type CodecHardwareConfig struct
method HardwareDeviceType (line 16) | func (chc CodecHardwareConfig) HardwareDeviceType() HardwareDeviceType {
method MethodFlags (line 21) | func (chc CodecHardwareConfig) MethodFlags() CodecHardwareConfigMethod...
method PixelFormat (line 26) | func (chc CodecHardwareConfig) PixelFormat() PixelFormat {
function newCodecHardwareConfigFromC (line 11) | func newCodecHardwareConfigFromC(c *C.AVCodecHWConfig) CodecHardwareConf...
FILE: codec_hardware_config_method_flag.go
type CodecHardwareConfigMethodFlag (line 7) | type CodecHardwareConfigMethodFlag
constant CodecHardwareConfigMethodFlagAdHoc (line 10) | CodecHardwareConfigMethodFlagAdHoc = CodecHardwareConfigMethodFlag...
constant CodecHardwareConfigMethodFlagHwDeviceCtx (line 11) | CodecHardwareConfigMethodFlagHwDeviceCtx = CodecHardwareConfigMethodFlag...
constant CodecHardwareConfigMethodFlagHwFramesCtx (line 12) | CodecHardwareConfigMethodFlagHwFramesCtx = CodecHardwareConfigMethodFlag...
constant CodecHardwareConfigMethodFlagInternal (line 13) | CodecHardwareConfigMethodFlagInternal = CodecHardwareConfigMethodFlag...
FILE: codec_id.go
type CodecID (line 8) | type CodecID
method MediaType (line 566) | func (c CodecID) MediaType() MediaType {
method Name (line 570) | func (c CodecID) Name() string {
method String (line 574) | func (c CodecID) String() string {
constant CodecID012V (line 11) | CodecID012V = CodecID(C.AV_CODEC_ID_012V)
constant CodecID4Gv (line 12) | CodecID4Gv = CodecID(C.AV_CODEC_ID_4GV)
constant CodecID4Xm (line 13) | CodecID4Xm = CodecID(C.AV_CODEC_ID_4XM)
constant CodecID8Bps (line 14) | CodecID8Bps = CodecID(C.AV_CODEC_ID_8BPS)
constant CodecID8SvxExp (line 15) | CodecID8SvxExp = CodecID(C.AV_CODEC_ID_8SVX_EXP)
constant CodecID8SvxFib (line 16) | CodecID8SvxFib = CodecID(C.AV_CODEC_ID_8SVX_FIB)
constant CodecIDA64Multi (line 17) | CodecIDA64Multi = CodecID(C.AV_CODEC_ID_A64_MULTI)
constant CodecIDA64Multi5 (line 18) | CodecIDA64Multi5 = CodecID(C.AV_CODEC_ID_A64_MULTI5)
constant CodecIDAac (line 19) | CodecIDAac = CodecID(C.AV_CODEC_ID_AAC)
constant CodecIDAacLatm (line 20) | CodecIDAacLatm = CodecID(C.AV_CODEC_ID_AAC_LATM)
constant CodecIDAasc (line 21) | CodecIDAasc = CodecID(C.AV_CODEC_ID_AASC)
constant CodecIDAc3 (line 22) | CodecIDAc3 = CodecID(C.AV_CODEC_ID_AC3)
constant CodecIDAc4 (line 23) | CodecIDAc4 = CodecID(C.AV_CODEC_ID_AC4)
constant CodecIDAcelpKelvin (line 24) | CodecIDAcelpKelvin = CodecID(C.AV_CODEC_ID_ACELP_KELVIN)
constant CodecIDAdpcm4Xm (line 25) | CodecIDAdpcm4Xm = CodecID(C.AV_CODEC_ID_ADPCM_4XM)
constant CodecIDAdpcmAdx (line 26) | CodecIDAdpcmAdx = CodecID(C.AV_CODEC_ID_ADPCM_ADX)
constant CodecIDAdpcmAfc (line 27) | CodecIDAdpcmAfc = CodecID(C.AV_CODEC_ID_ADPCM_AFC)
constant CodecIDAdpcmAgm (line 28) | CodecIDAdpcmAgm = CodecID(C.AV_CODEC_ID_ADPCM_AGM)
constant CodecIDAdpcmAica (line 29) | CodecIDAdpcmAica = CodecID(C.AV_CODEC_ID_ADPCM_AICA)
constant CodecIDAdpcmArgo (line 30) | CodecIDAdpcmArgo = CodecID(C.AV_CODEC_ID_ADPCM_ARGO)
constant CodecIDAdpcmCt (line 31) | CodecIDAdpcmCt = CodecID(C.AV_CODEC_ID_ADPCM_CT)
constant CodecIDAdpcmDtk (line 32) | CodecIDAdpcmDtk = CodecID(C.AV_CODEC_ID_ADPCM_DTK)
constant CodecIDAdpcmEa (line 33) | CodecIDAdpcmEa = CodecID(C.AV_CODEC_ID_ADPCM_EA)
constant CodecIDAdpcmEaMaxisXa (line 34) | CodecIDAdpcmEaMaxisXa = CodecID(C.AV_CODEC_ID_ADPCM_EA_MAXIS_XA)
constant CodecIDAdpcmEaR1 (line 35) | CodecIDAdpcmEaR1 = CodecID(C.AV_CODEC_ID_ADPCM_EA_R1)
constant CodecIDAdpcmEaR2 (line 36) | CodecIDAdpcmEaR2 = CodecID(C.AV_CODEC_ID_ADPCM_EA_R2)
constant CodecIDAdpcmEaR3 (line 37) | CodecIDAdpcmEaR3 = CodecID(C.AV_CODEC_ID_ADPCM_EA_R3)
constant CodecIDAdpcmEaXas (line 38) | CodecIDAdpcmEaXas = CodecID(C.AV_CODEC_ID_ADPCM_EA_XAS)
constant CodecIDAdpcmG722 (line 39) | CodecIDAdpcmG722 = CodecID(C.AV_CODEC_ID_ADPCM_G722)
constant CodecIDAdpcmG726 (line 40) | CodecIDAdpcmG726 = CodecID(C.AV_CODEC_ID_ADPCM_G726)
constant CodecIDAdpcmG726Le (line 41) | CodecIDAdpcmG726Le = CodecID(C.AV_CODEC_ID_ADPCM_G726LE)
constant CodecIDAdpcmImaAcorn (line 42) | CodecIDAdpcmImaAcorn = CodecID(C.AV_CODEC_ID_ADPCM_IMA_ACORN)
constant CodecIDAdpcmImaAlp (line 43) | CodecIDAdpcmImaAlp = CodecID(C.AV_CODEC_ID_ADPCM_IMA_ALP)
constant CodecIDAdpcmImaAmv (line 44) | CodecIDAdpcmImaAmv = CodecID(C.AV_CODEC_ID_ADPCM_IMA_AMV)
constant CodecIDAdpcmImaApc (line 45) | CodecIDAdpcmImaApc = CodecID(C.AV_CODEC_ID_ADPCM_IMA_APC)
constant CodecIDAdpcmImaApm (line 46) | CodecIDAdpcmImaApm = CodecID(C.AV_CODEC_ID_ADPCM_IMA_APM)
constant CodecIDAdpcmImaCunning (line 47) | CodecIDAdpcmImaCunning = CodecID(C.AV_CODEC_ID_ADPCM_IMA_CUNNING)
constant CodecIDAdpcmImaDat4 (line 48) | CodecIDAdpcmImaDat4 = CodecID(C.AV_CODEC_ID_ADPCM_IMA_DAT4)
constant CodecIDAdpcmImaDk3 (line 49) | CodecIDAdpcmImaDk3 = CodecID(C.AV_CODEC_ID_ADPCM_IMA_DK3)
constant CodecIDAdpcmImaDk4 (line 50) | CodecIDAdpcmImaDk4 = CodecID(C.AV_CODEC_ID_ADPCM_IMA_DK4)
constant CodecIDAdpcmImaEaEacs (line 51) | CodecIDAdpcmImaEaEacs = CodecID(C.AV_CODEC_ID_ADPCM_IMA_EA_EACS)
constant CodecIDAdpcmImaEaSead (line 52) | CodecIDAdpcmImaEaSead = CodecID(C.AV_CODEC_ID_ADPCM_IMA_EA_SEAD)
constant CodecIDAdpcmImaIss (line 53) | CodecIDAdpcmImaIss = CodecID(C.AV_CODEC_ID_ADPCM_IMA_ISS)
constant CodecIDAdpcmImaMoflex (line 54) | CodecIDAdpcmImaMoflex = CodecID(C.AV_CODEC_ID_ADPCM_IMA_MOFLEX)
constant CodecIDAdpcmImaMtf (line 55) | CodecIDAdpcmImaMtf = CodecID(C.AV_CODEC_ID_ADPCM_IMA_MTF)
constant CodecIDAdpcmImaOki (line 56) | CodecIDAdpcmImaOki = CodecID(C.AV_CODEC_ID_ADPCM_IMA_OKI)
constant CodecIDAdpcmImaQt (line 57) | CodecIDAdpcmImaQt = CodecID(C.AV_CODEC_ID_ADPCM_IMA_QT)
constant CodecIDAdpcmImaRad (line 58) | CodecIDAdpcmImaRad = CodecID(C.AV_CODEC_ID_ADPCM_IMA_RAD)
constant CodecIDAdpcmImaSmjpeg (line 59) | CodecIDAdpcmImaSmjpeg = CodecID(C.AV_CODEC_ID_ADPCM_IMA_SMJPEG)
constant CodecIDAdpcmImaSsi (line 60) | CodecIDAdpcmImaSsi = CodecID(C.AV_CODEC_ID_ADPCM_IMA_SSI)
constant CodecIDAdpcmImaWav (line 61) | CodecIDAdpcmImaWav = CodecID(C.AV_CODEC_ID_ADPCM_IMA_WAV)
constant CodecIDAdpcmImaWs (line 62) | CodecIDAdpcmImaWs = CodecID(C.AV_CODEC_ID_ADPCM_IMA_WS)
constant CodecIDAdpcmMs (line 63) | CodecIDAdpcmMs = CodecID(C.AV_CODEC_ID_ADPCM_MS)
constant CodecIDAdpcmMtaf (line 64) | CodecIDAdpcmMtaf = CodecID(C.AV_CODEC_ID_ADPCM_MTAF)
constant CodecIDAdpcmPsx (line 65) | CodecIDAdpcmPsx = CodecID(C.AV_CODEC_ID_ADPCM_PSX)
constant CodecIDAdpcmSbpro2 (line 66) | CodecIDAdpcmSbpro2 = CodecID(C.AV_CODEC_ID_ADPCM_SBPRO_2)
constant CodecIDAdpcmSbpro3 (line 67) | CodecIDAdpcmSbpro3 = CodecID(C.AV_CODEC_ID_ADPCM_SBPRO_3)
constant CodecIDAdpcmSbpro4 (line 68) | CodecIDAdpcmSbpro4 = CodecID(C.AV_CODEC_ID_ADPCM_SBPRO_4)
constant CodecIDAdpcmSwf (line 69) | CodecIDAdpcmSwf = CodecID(C.AV_CODEC_ID_ADPCM_SWF)
constant CodecIDAdpcmThp (line 70) | CodecIDAdpcmThp = CodecID(C.AV_CODEC_ID_ADPCM_THP)
constant CodecIDAdpcmThpLe (line 71) | CodecIDAdpcmThpLe = CodecID(C.AV_CODEC_ID_ADPCM_THP_LE)
constant CodecIDAdpcmVima (line 72) | CodecIDAdpcmVima = CodecID(C.AV_CODEC_ID_ADPCM_VIMA)
constant CodecIDAdpcmVimaDeprecated (line 73) | CodecIDAdpcmVimaDeprecated = CodecID(C.AV_CODEC_ID_ADPCM_VIMA)
constant CodecIDAdpcmXa (line 74) | CodecIDAdpcmXa = CodecID(C.AV_CODEC_ID_ADPCM_XA)
constant CodecIDAdpcmXmd (line 75) | CodecIDAdpcmXmd = CodecID(C.AV_CODEC_ID_ADPCM_XMD)
constant CodecIDAdpcmYamaha (line 76) | CodecIDAdpcmYamaha = CodecID(C.AV_CODEC_ID_ADPCM_YAMAHA)
constant CodecIDAdpcmZork (line 77) | CodecIDAdpcmZork = CodecID(C.AV_CODEC_ID_ADPCM_ZORK)
constant CodecIDAgm (line 78) | CodecIDAgm = CodecID(C.AV_CODEC_ID_AGM)
constant CodecIDAic (line 79) | CodecIDAic = CodecID(C.AV_CODEC_ID_AIC)
constant CodecIDAlac (line 80) | CodecIDAlac = CodecID(C.AV_CODEC_ID_ALAC)
constant CodecIDAliasPix (line 81) | CodecIDAliasPix = CodecID(C.AV_CODEC_ID_ALIAS_PIX)
constant CodecIDAmrNb (line 82) | CodecIDAmrNb = CodecID(C.AV_CODEC_ID_AMR_NB)
constant CodecIDAmrWb (line 83) | CodecIDAmrWb = CodecID(C.AV_CODEC_ID_AMR_WB)
constant CodecIDAmv (line 84) | CodecIDAmv = CodecID(C.AV_CODEC_ID_AMV)
constant CodecIDAnm (line 85) | CodecIDAnm = CodecID(C.AV_CODEC_ID_ANM)
constant CodecIDAnsi (line 86) | CodecIDAnsi = CodecID(C.AV_CODEC_ID_ANSI)
constant CodecIDAnull (line 87) | CodecIDAnull = CodecID(C.AV_CODEC_ID_ANULL)
constant CodecIDApac (line 88) | CodecIDApac = CodecID(C.AV_CODEC_ID_APAC)
constant CodecIDApe (line 89) | CodecIDApe = CodecID(C.AV_CODEC_ID_APE)
constant CodecIDApng (line 90) | CodecIDApng = CodecID(C.AV_CODEC_ID_APNG)
constant CodecIDAptx (line 91) | CodecIDAptx = CodecID(C.AV_CODEC_ID_APTX)
constant CodecIDAptxHd (line 92) | CodecIDAptxHd = CodecID(C.AV_CODEC_ID_APTX_HD)
constant CodecIDArbc (line 93) | CodecIDArbc = CodecID(C.AV_CODEC_ID_ARBC)
constant CodecIDArgo (line 94) | CodecIDArgo = CodecID(C.AV_CODEC_ID_ARGO)
constant CodecIDAribCaption (line 95) | CodecIDAribCaption = CodecID(C.AV_CODEC_ID_ARIB_CAPTION)
constant CodecIDAss (line 96) | CodecIDAss = CodecID(C.AV_CODEC_ID_ASS)
constant CodecIDAsv1 (line 97) | CodecIDAsv1 = CodecID(C.AV_CODEC_ID_ASV1)
constant CodecIDAsv2 (line 98) | CodecIDAsv2 = CodecID(C.AV_CODEC_ID_ASV2)
constant CodecIDAtrac1 (line 99) | CodecIDAtrac1 = CodecID(C.AV_CODEC_ID_ATRAC1)
constant CodecIDAtrac3 (line 100) | CodecIDAtrac3 = CodecID(C.AV_CODEC_ID_ATRAC3)
constant CodecIDAtrac3Al (line 101) | CodecIDAtrac3Al = CodecID(C.AV_CODEC_ID_ATRAC3AL)
constant CodecIDAtrac3P (line 102) | CodecIDAtrac3P = CodecID(C.AV_CODEC_ID_ATRAC3P)
constant CodecIDAtrac3Pal (line 103) | CodecIDAtrac3Pal = CodecID(C.AV_CODEC_ID_ATRAC3PAL)
constant CodecIDAtrac9 (line 104) | CodecIDAtrac9 = CodecID(C.AV_CODEC_ID_ATRAC9)
constant CodecIDAura (line 105) | CodecIDAura = CodecID(C.AV_CODEC_ID_AURA)
constant CodecIDAura2 (line 106) | CodecIDAura2 = CodecID(C.AV_CODEC_ID_AURA2)
constant CodecIDAv1 (line 107) | CodecIDAv1 = CodecID(C.AV_CODEC_ID_AV1)
constant CodecIDAvrn (line 108) | CodecIDAvrn = CodecID(C.AV_CODEC_ID_AVRN)
constant CodecIDAvrp (line 109) | CodecIDAvrp = CodecID(C.AV_CODEC_ID_AVRP)
constant CodecIDAvs (line 110) | CodecIDAvs = CodecID(C.AV_CODEC_ID_AVS)
constant CodecIDAvs2 (line 111) | CodecIDAvs2 = CodecID(C.AV_CODEC_ID_AVS2)
constant CodecIDAvs3 (line 112) | CodecIDAvs3 = CodecID(C.AV_CODEC_ID_AVS3)
constant CodecIDAvui (line 113) | CodecIDAvui = CodecID(C.AV_CODEC_ID_AVUI)
constant CodecIDBCodecIDext (line 114) | CodecIDBCodecIDext = CodecID(C.AV_CODEC_ID_BINTEXT)
constant CodecIDBethsoftvid (line 115) | CodecIDBethsoftvid = CodecID(C.AV_CODEC_ID_BETHSOFTVID)
constant CodecIDBfi (line 116) | CodecIDBfi = CodecID(C.AV_CODEC_ID_BFI)
constant CodecIDBinData (line 117) | CodecIDBinData = CodecID(C.AV_CODEC_ID_BIN_DATA)
constant CodecIDBinkaudioDct (line 118) | CodecIDBinkaudioDct = CodecID(C.AV_CODEC_ID_BINKAUDIO_DCT)
constant CodecIDBinkaudioRdft (line 119) | CodecIDBinkaudioRdft = CodecID(C.AV_CODEC_ID_BINKAUDIO_RDFT)
constant CodecIDBinkvideo (line 120) | CodecIDBinkvideo = CodecID(C.AV_CODEC_ID_BINKVIDEO)
constant CodecIDBitpacked (line 121) | CodecIDBitpacked = CodecID(C.AV_CODEC_ID_BITPACKED)
constant CodecIDBmp (line 122) | CodecIDBmp = CodecID(C.AV_CODEC_ID_BMP)
constant CodecIDBmvAudio (line 123) | CodecIDBmvAudio = CodecID(C.AV_CODEC_ID_BMV_AUDIO)
constant CodecIDBmvVideo (line 124) | CodecIDBmvVideo = CodecID(C.AV_CODEC_ID_BMV_VIDEO)
constant CodecIDBonk (line 125) | CodecIDBonk = CodecID(C.AV_CODEC_ID_BONK)
constant CodecIDBrenderPix (line 126) | CodecIDBrenderPix = CodecID(C.AV_CODEC_ID_BRENDER_PIX)
constant CodecIDBrenderPixDeprecated (line 127) | CodecIDBrenderPixDeprecated = CodecID(C.AV_CODEC_ID_BRENDER_PIX)
constant CodecIDC93 (line 128) | CodecIDC93 = CodecID(C.AV_CODEC_ID_C93)
constant CodecIDCavs (line 129) | CodecIDCavs = CodecID(C.AV_CODEC_ID_CAVS)
constant CodecIDCbd2Dpcm (line 130) | CodecIDCbd2Dpcm = CodecID(C.AV_CODEC_ID_CBD2_DPCM)
constant CodecIDCdgraphics (line 131) | CodecIDCdgraphics = CodecID(C.AV_CODEC_ID_CDGRAPHICS)
constant CodecIDCdtoons (line 132) | CodecIDCdtoons = CodecID(C.AV_CODEC_ID_CDTOONS)
constant CodecIDCdxl (line 133) | CodecIDCdxl = CodecID(C.AV_CODEC_ID_CDXL)
constant CodecIDCelt (line 134) | CodecIDCelt = CodecID(C.AV_CODEC_ID_CELT)
constant CodecIDCfhd (line 135) | CodecIDCfhd = CodecID(C.AV_CODEC_ID_CFHD)
constant CodecIDCinepak (line 136) | CodecIDCinepak = CodecID(C.AV_CODEC_ID_CINEPAK)
constant CodecIDClearvideo (line 137) | CodecIDClearvideo = CodecID(C.AV_CODEC_ID_CLEARVIDEO)
constant CodecIDCljr (line 138) | CodecIDCljr = CodecID(C.AV_CODEC_ID_CLJR)
constant CodecIDCllc (line 139) | CodecIDCllc = CodecID(C.AV_CODEC_ID_CLLC)
constant CodecIDCmv (line 140) | CodecIDCmv = CodecID(C.AV_CODEC_ID_CMV)
constant CodecIDCodec2 (line 141) | CodecIDCodec2 = CodecID(C.AV_CODEC_ID_CODEC2)
constant CodecIDComfortNoise (line 142) | CodecIDComfortNoise = CodecID(C.AV_CODEC_ID_COMFORT_NOISE)
constant CodecIDCook (line 143) | CodecIDCook = CodecID(C.AV_CODEC_ID_COOK)
constant CodecIDCpia (line 144) | CodecIDCpia = CodecID(C.AV_CODEC_ID_CPIA)
constant CodecIDCri (line 145) | CodecIDCri = CodecID(C.AV_CODEC_ID_CRI)
constant CodecIDCscd (line 146) | CodecIDCscd = CodecID(C.AV_CODEC_ID_CSCD)
constant CodecIDCyuv (line 147) | CodecIDCyuv = CodecID(C.AV_CODEC_ID_CYUV)
constant CodecIDDaala (line 148) | CodecIDDaala = CodecID(C.AV_CODEC_ID_DAALA)
constant CodecIDDds (line 149) | CodecIDDds = CodecID(C.AV_CODEC_ID_DDS)
constant CodecIDDerfDpcm (line 150) | CodecIDDerfDpcm = CodecID(C.AV_CODEC_ID_DERF_DPCM)
constant CodecIDDfa (line 151) | CodecIDDfa = CodecID(C.AV_CODEC_ID_DFA)
constant CodecIDDfpwm (line 152) | CodecIDDfpwm = CodecID(C.AV_CODEC_ID_DFPWM)
constant CodecIDDirac (line 153) | CodecIDDirac = CodecID(C.AV_CODEC_ID_DIRAC)
constant CodecIDDnxhd (line 154) | CodecIDDnxhd = CodecID(C.AV_CODEC_ID_DNXHD)
constant CodecIDDolbyE (line 155) | CodecIDDolbyE = CodecID(C.AV_CODEC_ID_DOLBY_E)
constant CodecIDDpx (line 156) | CodecIDDpx = CodecID(C.AV_CODEC_ID_DPX)
constant CodecIDDsdLsbf (line 157) | CodecIDDsdLsbf = CodecID(C.AV_CODEC_ID_DSD_LSBF)
constant CodecIDDsdLsbfPlanar (line 158) | CodecIDDsdLsbfPlanar = CodecID(C.AV_CODEC_ID_DSD_LSBF_PLANAR)
constant CodecIDDsdMsbf (line 159) | CodecIDDsdMsbf = CodecID(C.AV_CODEC_ID_DSD_MSBF)
constant CodecIDDsdMsbfPlanar (line 160) | CodecIDDsdMsbfPlanar = CodecID(C.AV_CODEC_ID_DSD_MSBF_PLANAR)
constant CodecIDDsicinaudio (line 161) | CodecIDDsicinaudio = CodecID(C.AV_CODEC_ID_DSICINAUDIO)
constant CodecIDDsicinvideo (line 162) | CodecIDDsicinvideo = CodecID(C.AV_CODEC_ID_DSICINVIDEO)
constant CodecIDDssSp (line 163) | CodecIDDssSp = CodecID(C.AV_CODEC_ID_DSS_SP)
constant CodecIDDst (line 164) | CodecIDDst = CodecID(C.AV_CODEC_ID_DST)
constant CodecIDDts (line 165) | CodecIDDts = CodecID(C.AV_CODEC_ID_DTS)
constant CodecIDDvaudio (line 166) | CodecIDDvaudio = CodecID(C.AV_CODEC_ID_DVAUDIO)
constant CodecIDDvbSubtitle (line 167) | CodecIDDvbSubtitle = CodecID(C.AV_CODEC_ID_DVB_SUBTITLE)
constant CodecIDDvbTeletext (line 168) | CodecIDDvbTeletext = CodecID(C.AV_CODEC_ID_DVB_TELETEXT)
constant CodecIDDvdNav (line 169) | CodecIDDvdNav = CodecID(C.AV_CODEC_ID_DVD_NAV)
constant CodecIDDvdSubtitle (line 170) | CodecIDDvdSubtitle = CodecID(C.AV_CODEC_ID_DVD_SUBTITLE)
constant CodecIDDvvideo (line 171) | CodecIDDvvideo = CodecID(C.AV_CODEC_ID_DVVIDEO)
constant CodecIDDxa (line 172) | CodecIDDxa = CodecID(C.AV_CODEC_ID_DXA)
constant CodecIDDxtory (line 173) | CodecIDDxtory = CodecID(C.AV_CODEC_ID_DXTORY)
constant CodecIDDxv (line 174) | CodecIDDxv = CodecID(C.AV_CODEC_ID_DXV)
constant CodecIDEac3 (line 175) | CodecIDEac3 = CodecID(C.AV_CODEC_ID_EAC3)
constant CodecIDEia608 (line 176) | CodecIDEia608 = CodecID(C.AV_CODEC_ID_EIA_608)
constant CodecIDEpg (line 177) | CodecIDEpg = CodecID(C.AV_CODEC_ID_EPG)
constant CodecIDEscape124 (line 178) | CodecIDEscape124 = CodecID(C.AV_CODEC_ID_ESCAPE124)
constant CodecIDEscape130 (line 179) | CodecIDEscape130 = CodecID(C.AV_CODEC_ID_ESCAPE130)
constant CodecIDEscape130Deprecated (line 180) | CodecIDEscape130Deprecated = CodecID(C.AV_CODEC_ID_ESCAPE130)
constant CodecIDEvc (line 181) | CodecIDEvc = CodecID(C.AV_CODEC_ID_EVC)
constant CodecIDEvrc (line 182) | CodecIDEvrc = CodecID(C.AV_CODEC_ID_EVRC)
constant CodecIDExr (line 183) | CodecIDExr = CodecID(C.AV_CODEC_ID_EXR)
constant CodecIDExrDeprecated (line 184) | CodecIDExrDeprecated = CodecID(C.AV_CODEC_ID_EXR)
constant CodecIDFastaudio (line 185) | CodecIDFastaudio = CodecID(C.AV_CODEC_ID_FASTAUDIO)
constant CodecIDFfmetadata (line 186) | CodecIDFfmetadata = CodecID(C.AV_CODEC_ID_FFMETADATA)
constant CodecIDFfv1 (line 187) | CodecIDFfv1 = CodecID(C.AV_CODEC_ID_FFV1)
constant CodecIDFfvhuff (line 188) | CodecIDFfvhuff = CodecID(C.AV_CODEC_ID_FFVHUFF)
constant CodecIDFfwavesynth (line 189) | CodecIDFfwavesynth = CodecID(C.AV_CODEC_ID_FFWAVESYNTH)
constant CodecIDFic (line 190) | CodecIDFic = CodecID(C.AV_CODEC_ID_FIC)
constant CodecIDFirstAudio (line 191) | CodecIDFirstAudio = CodecID(C.AV_CODEC_ID_FIRST_AUDIO)
constant CodecIDFirstSubtitle (line 192) | CodecIDFirstSubtitle = CodecID(C.AV_CODEC_ID_FIRST_SUBTITLE)
constant CodecIDFirstUnknown (line 193) | CodecIDFirstUnknown = CodecID(C.AV_CODEC_ID_FIRST_UNKNOWN)
constant CodecIDFits (line 194) | CodecIDFits = CodecID(C.AV_CODEC_ID_FITS)
constant CodecIDFlac (line 195) | CodecIDFlac = CodecID(C.AV_CODEC_ID_FLAC)
constant CodecIDFlashsv (line 196) | CodecIDFlashsv = CodecID(C.AV_CODEC_ID_FLASHSV)
constant CodecIDFlashsv2 (line 197) | CodecIDFlashsv2 = CodecID(C.AV_CODEC_ID_FLASHSV2)
constant CodecIDFlic (line 198) | CodecIDFlic = CodecID(C.AV_CODEC_ID_FLIC)
constant CodecIDFlv1 (line 199) | CodecIDFlv1 = CodecID(C.AV_CODEC_ID_FLV1)
constant CodecIDFmvc (line 200) | CodecIDFmvc = CodecID(C.AV_CODEC_ID_FMVC)
constant CodecIDFraps (line 201) | CodecIDFraps = CodecID(C.AV_CODEC_ID_FRAPS)
constant CodecIDFrwu (line 202) | CodecIDFrwu = CodecID(C.AV_CODEC_ID_FRWU)
constant CodecIDFtr (line 203) | CodecIDFtr = CodecID(C.AV_CODEC_ID_FTR)
constant CodecIDG2M (line 204) | CodecIDG2M = CodecID(C.AV_CODEC_ID_G2M)
constant CodecIDG2MDeprecated (line 205) | CodecIDG2MDeprecated = CodecID(C.AV_CODEC_ID_G2M)
constant CodecIDG7231 (line 206) | CodecIDG7231 = CodecID(C.AV_CODEC_ID_G723_1)
constant CodecIDG729 (line 207) | CodecIDG729 = CodecID(C.AV_CODEC_ID_G729)
constant CodecIDGdv (line 208) | CodecIDGdv = CodecID(C.AV_CODEC_ID_GDV)
constant CodecIDGem (line 209) | CodecIDGem = CodecID(C.AV_CODEC_ID_GEM)
constant CodecIDGif (line 210) | CodecIDGif = CodecID(C.AV_CODEC_ID_GIF)
constant CodecIDGremlinDpcm (line 211) | CodecIDGremlinDpcm = CodecID(C.AV_CODEC_ID_GREMLIN_DPCM)
constant CodecIDGsm (line 212) | CodecIDGsm = CodecID(C.AV_CODEC_ID_GSM)
constant CodecIDGsmMs (line 213) | CodecIDGsmMs = CodecID(C.AV_CODEC_ID_GSM_MS)
constant CodecIDH261 (line 214) | CodecIDH261 = CodecID(C.AV_CODEC_ID_H261)
constant CodecIDH263 (line 215) | CodecIDH263 = CodecID(C.AV_CODEC_ID_H263)
constant CodecIDH263I (line 216) | CodecIDH263I = CodecID(C.AV_CODEC_ID_H263I)
constant CodecIDH263P (line 217) | CodecIDH263P = CodecID(C.AV_CODEC_ID_H263P)
constant CodecIDH264 (line 218) | CodecIDH264 = CodecID(C.AV_CODEC_ID_H264)
constant CodecIDH265 (line 219) | CodecIDH265 = CodecID(C.AV_CODEC_ID_H265)
constant CodecIDH266 (line 220) | CodecIDH266 = CodecID(C.AV_CODEC_ID_H266)
constant CodecIDHap (line 221) | CodecIDHap = CodecID(C.AV_CODEC_ID_HAP)
constant CodecIDHca (line 222) | CodecIDHca = CodecID(C.AV_CODEC_ID_HCA)
constant CodecIDHcom (line 223) | CodecIDHcom = CodecID(C.AV_CODEC_ID_HCOM)
constant CodecIDHdmvPgsSubtitle (line 224) | CodecIDHdmvPgsSubtitle = CodecID(C.AV_CODEC_ID_HDMV_PGS_SUBTITLE)
constant CodecIDHdmvTextSubtitle (line 225) | CodecIDHdmvTextSubtitle = CodecID(C.AV_CODEC_ID_HDMV_TEXT_SUBTITLE)
constant CodecIDHevc (line 226) | CodecIDHevc = CodecID(C.AV_CODEC_ID_HEVC)
constant CodecIDHevcDeprecated (line 227) | CodecIDHevcDeprecated = CodecID(C.AV_CODEC_ID_HEVC)
constant CodecIDHnm4Video (line 228) | CodecIDHnm4Video = CodecID(C.AV_CODEC_ID_HNM4_VIDEO)
constant CodecIDHqHqa (line 229) | CodecIDHqHqa = CodecID(C.AV_CODEC_ID_HQ_HQA)
constant CodecIDHqx (line 230) | CodecIDHqx = CodecID(C.AV_CODEC_ID_HQX)
constant CodecIDHuffyuv (line 231) | CodecIDHuffyuv = CodecID(C.AV_CODEC_ID_HUFFYUV)
constant CodecIDHymt (line 232) | CodecIDHymt = CodecID(C.AV_CODEC_ID_HYMT)
constant CodecIDIac (line 233) | CodecIDIac = CodecID(C.AV_CODEC_ID_IAC)
constant CodecIDIdcin (line 234) | CodecIDIdcin = CodecID(C.AV_CODEC_ID_IDCIN)
constant CodecIDIdf (line 235) | CodecIDIdf = CodecID(C.AV_CODEC_ID_IDF)
constant CodecIDIffByterun1 (line 236) | CodecIDIffByterun1 = CodecID(C.AV_CODEC_ID_IFF_BYTERUN1)
constant CodecIDIffIlbm (line 237) | CodecIDIffIlbm = CodecID(C.AV_CODEC_ID_IFF_ILBM)
constant CodecIDIlbc (line 238) | CodecIDIlbc = CodecID(C.AV_CODEC_ID_ILBC)
constant CodecIDImc (line 239) | CodecIDImc = CodecID(C.AV_CODEC_ID_IMC)
constant CodecIDImm4 (line 240) | CodecIDImm4 = CodecID(C.AV_CODEC_ID_IMM4)
constant CodecIDImm5 (line 241) | CodecIDImm5 = CodecID(C.AV_CODEC_ID_IMM5)
constant CodecIDIndeo2 (line 242) | CodecIDIndeo2 = CodecID(C.AV_CODEC_ID_INDEO2)
constant CodecIDIndeo3 (line 243) | CodecIDIndeo3 = CodecID(C.AV_CODEC_ID_INDEO3)
constant CodecIDIndeo4 (line 244) | CodecIDIndeo4 = CodecID(C.AV_CODEC_ID_INDEO4)
constant CodecIDIndeo5 (line 245) | CodecIDIndeo5 = CodecID(C.AV_CODEC_ID_INDEO5)
constant CodecIDInterplayAcm (line 246) | CodecIDInterplayAcm = CodecID(C.AV_CODEC_ID_INTERPLAY_ACM)
constant CodecIDInterplayDpcm (line 247) | CodecIDInterplayDpcm = CodecID(C.AV_CODEC_ID_INTERPLAY_DPCM)
constant CodecIDInterplayVideo (line 248) | CodecIDInterplayVideo = CodecID(C.AV_CODEC_ID_INTERPLAY_VIDEO)
constant CodecIDIpu (line 249) | CodecIDIpu = CodecID(C.AV_CODEC_ID_IPU)
constant CodecIDIvtvVbi (line 250) | CodecIDIvtvVbi = CodecID(C.AV_CODEC_ID_IVTV_VBI)
constant CodecIDJacosub (line 251) | CodecIDJacosub = CodecID(C.AV_CODEC_ID_JACOSUB)
constant CodecIDJpeg2000 (line 252) | CodecIDJpeg2000 = CodecID(C.AV_CODEC_ID_JPEG2000)
constant CodecIDJpegls (line 253) | CodecIDJpegls = CodecID(C.AV_CODEC_ID_JPEGLS)
constant CodecIDJpegxl (line 254) | CodecIDJpegxl = CodecID(C.AV_CODEC_ID_JPEGXL)
constant CodecIDJpegxlAnim (line 255) | CodecIDJpegxlAnim = CodecID(C.AV_CODEC_ID_JPEGXL_ANIM)
constant CodecIDJv (line 256) | CodecIDJv = CodecID(C.AV_CODEC_ID_JV)
constant CodecIDKgv1 (line 257) | CodecIDKgv1 = CodecID(C.AV_CODEC_ID_KGV1)
constant CodecIDKmvc (line 258) | CodecIDKmvc = CodecID(C.AV_CODEC_ID_KMVC)
constant CodecIDLagarith (line 259) | CodecIDLagarith = CodecID(C.AV_CODEC_ID_LAGARITH)
constant CodecIDLc3 (line 260) | CodecIDLc3 = CodecID(C.AV_CODEC_ID_LC3)
constant CodecIDLcevc (line 261) | CodecIDLcevc = CodecID(C.AV_CODEC_ID_LCEVC)
constant CodecIDLead (line 262) | CodecIDLead = CodecID(C.AV_CODEC_ID_LEAD)
constant CodecIDLjpeg (line 263) | CodecIDLjpeg = CodecID(C.AV_CODEC_ID_LJPEG)
constant CodecIDLoco (line 264) | CodecIDLoco = CodecID(C.AV_CODEC_ID_LOCO)
constant CodecIDLscr (line 265) | CodecIDLscr = CodecID(C.AV_CODEC_ID_LSCR)
constant CodecIDM101 (line 266) | CodecIDM101 = CodecID(C.AV_CODEC_ID_M101)
constant CodecIDMace3 (line 267) | CodecIDMace3 = CodecID(C.AV_CODEC_ID_MACE3)
constant CodecIDMace6 (line 268) | CodecIDMace6 = CodecID(C.AV_CODEC_ID_MACE6)
constant CodecIDMad (line 269) | CodecIDMad = CodecID(C.AV_CODEC_ID_MAD)
constant CodecIDMagicyuv (line 270) | CodecIDMagicyuv = CodecID(C.AV_CODEC_ID_MAGICYUV)
constant CodecIDMdec (line 271) | CodecIDMdec = CodecID(C.AV_CODEC_ID_MDEC)
constant CodecIDMedia100 (line 272) | CodecIDMedia100 = CodecID(C.AV_CODEC_ID_MEDIA100)
constant CodecIDMetasound (line 273) | CodecIDMetasound = CodecID(C.AV_CODEC_ID_METASOUND)
constant CodecIDMicrodvd (line 274) | CodecIDMicrodvd = CodecID(C.AV_CODEC_ID_MICRODVD)
constant CodecIDMimic (line 275) | CodecIDMimic = CodecID(C.AV_CODEC_ID_MIMIC)
constant CodecIDMisc4 (line 276) | CodecIDMisc4 = CodecID(C.AV_CODEC_ID_MISC4)
constant CodecIDMjpeg (line 277) | CodecIDMjpeg = CodecID(C.AV_CODEC_ID_MJPEG)
constant CodecIDMjpegb (line 278) | CodecIDMjpegb = CodecID(C.AV_CODEC_ID_MJPEGB)
constant CodecIDMlp (line 279) | CodecIDMlp = CodecID(C.AV_CODEC_ID_MLP)
constant CodecIDMmvideo (line 280) | CodecIDMmvideo = CodecID(C.AV_CODEC_ID_MMVIDEO)
constant CodecIDMobiclip (line 281) | CodecIDMobiclip = CodecID(C.AV_CODEC_ID_MOBICLIP)
constant CodecIDMotionpixels (line 282) | CodecIDMotionpixels = CodecID(C.AV_CODEC_ID_MOTIONPIXELS)
constant CodecIDMovText (line 283) | CodecIDMovText = CodecID(C.AV_CODEC_ID_MOV_TEXT)
constant CodecIDMp1 (line 284) | CodecIDMp1 = CodecID(C.AV_CODEC_ID_MP1)
constant CodecIDMp2 (line 285) | CodecIDMp2 = CodecID(C.AV_CODEC_ID_MP2)
constant CodecIDMp3 (line 286) | CodecIDMp3 = CodecID(C.AV_CODEC_ID_MP3)
constant CodecIDMp3Adu (line 287) | CodecIDMp3Adu = CodecID(C.AV_CODEC_ID_MP3ADU)
constant CodecIDMp3On4 (line 288) | CodecIDMp3On4 = CodecID(C.AV_CODEC_ID_MP3ON4)
constant CodecIDMp4Als (line 289) | CodecIDMp4Als = CodecID(C.AV_CODEC_ID_MP4ALS)
constant CodecIDMpeg1Video (line 290) | CodecIDMpeg1Video = CodecID(C.AV_CODEC_ID_MPEG1VIDEO)
constant CodecIDMpeg2Ts (line 291) | CodecIDMpeg2Ts = CodecID(C.AV_CODEC_ID_MPEG2TS)
constant CodecIDMpeg2Video (line 292) | CodecIDMpeg2Video = CodecID(C.AV_CODEC_ID_MPEG2VIDEO)
constant CodecIDMpeg4 (line 293) | CodecIDMpeg4 = CodecID(C.AV_CODEC_ID_MPEG4)
constant CodecIDMpeg4Systems (line 294) | CodecIDMpeg4Systems = CodecID(C.AV_CODEC_ID_MPEG4SYSTEMS)
constant CodecIDMpegh3DAudio (line 295) | CodecIDMpegh3DAudio = CodecID(C.AV_CODEC_ID_MPEGH_3D_AUDIO)
constant CodecIDMpl2 (line 296) | CodecIDMpl2 = CodecID(C.AV_CODEC_ID_MPL2)
constant CodecIDMsa1 (line 297) | CodecIDMsa1 = CodecID(C.AV_CODEC_ID_MSA1)
constant CodecIDMscc (line 298) | CodecIDMscc = CodecID(C.AV_CODEC_ID_MSCC)
constant CodecIDMsmpeg4V1 (line 299) | CodecIDMsmpeg4V1 = CodecID(C.AV_CODEC_ID_MSMPEG4V1)
constant CodecIDMsmpeg4V2 (line 300) | CodecIDMsmpeg4V2 = CodecID(C.AV_CODEC_ID_MSMPEG4V2)
constant CodecIDMsmpeg4V3 (line 301) | CodecIDMsmpeg4V3 = CodecID(C.AV_CODEC_ID_MSMPEG4V3)
constant CodecIDMsnsiren (line 302) | CodecIDMsnsiren = CodecID(C.AV_CODEC_ID_MSNSIREN)
constant CodecIDMsp2 (line 303) | CodecIDMsp2 = CodecID(C.AV_CODEC_ID_MSP2)
constant CodecIDMsrle (line 304) | CodecIDMsrle = CodecID(C.AV_CODEC_ID_MSRLE)
constant CodecIDMss1 (line 305) | CodecIDMss1 = CodecID(C.AV_CODEC_ID_MSS1)
constant CodecIDMss2 (line 306) | CodecIDMss2 = CodecID(C.AV_CODEC_ID_MSS2)
constant CodecIDMsvideo1 (line 307) | CodecIDMsvideo1 = CodecID(C.AV_CODEC_ID_MSVIDEO1)
constant CodecIDMszh (line 308) | CodecIDMszh = CodecID(C.AV_CODEC_ID_MSZH)
constant CodecIDMts2 (line 309) | CodecIDMts2 = CodecID(C.AV_CODEC_ID_MTS2)
constant CodecIDMusepack7 (line 310) | CodecIDMusepack7 = CodecID(C.AV_CODEC_ID_MUSEPACK7)
constant CodecIDMusepack8 (line 311) | CodecIDMusepack8 = CodecID(C.AV_CODEC_ID_MUSEPACK8)
constant CodecIDMv30 (line 312) | CodecIDMv30 = CodecID(C.AV_CODEC_ID_MV30)
constant CodecIDMvc1 (line 313) | CodecIDMvc1 = CodecID(C.AV_CODEC_ID_MVC1)
constant CodecIDMvc1Deprecated (line 314) | CodecIDMvc1Deprecated = CodecID(C.AV_CODEC_ID_MVC1)
constant CodecIDMvc2 (line 315) | CodecIDMvc2 = CodecID(C.AV_CODEC_ID_MVC2)
constant CodecIDMvc2Deprecated (line 316) | CodecIDMvc2Deprecated = CodecID(C.AV_CODEC_ID_MVC2)
constant CodecIDMvdv (line 317) | CodecIDMvdv = CodecID(C.AV_CODEC_ID_MVDV)
constant CodecIDMvha (line 318) | CodecIDMvha = CodecID(C.AV_CODEC_ID_MVHA)
constant CodecIDMwsc (line 319) | CodecIDMwsc = CodecID(C.AV_CODEC_ID_MWSC)
constant CodecIDMxpeg (line 320) | CodecIDMxpeg = CodecID(C.AV_CODEC_ID_MXPEG)
constant CodecIDNellymoser (line 321) | CodecIDNellymoser = CodecID(C.AV_CODEC_ID_NELLYMOSER)
constant CodecIDNone (line 322) | CodecIDNone = CodecID(C.AV_CODEC_ID_NONE)
constant CodecIDNotchlc (line 323) | CodecIDNotchlc = CodecID(C.AV_CODEC_ID_NOTCHLC)
constant CodecIDNuv (line 324) | CodecIDNuv = CodecID(C.AV_CODEC_ID_NUV)
constant CodecIDOn2Avc (line 325) | CodecIDOn2Avc = CodecID(C.AV_CODEC_ID_ON2AVC)
constant CodecIDOpus (line 326) | CodecIDOpus = CodecID(C.AV_CODEC_ID_OPUS)
constant CodecIDOpusDeprecated (line 327) | CodecIDOpusDeprecated = CodecID(C.AV_CODEC_ID_OPUS)
constant CodecIDOsq (line 328) | CodecIDOsq = CodecID(C.AV_CODEC_ID_OSQ)
constant CodecIDOtf (line 329) | CodecIDOtf = CodecID(C.AV_CODEC_ID_OTF)
constant CodecIDPafAudio (line 330) | CodecIDPafAudio = CodecID(C.AV_CODEC_ID_PAF_AUDIO)
constant CodecIDPafAudioDeprecated (line 331) | CodecIDPafAudioDeprecated = CodecID(C.AV_CODEC_ID_PAF_AUDIO)
constant CodecIDPafVideo (line 332) | CodecIDPafVideo = CodecID(C.AV_CODEC_ID_PAF_VIDEO)
constant CodecIDPafVideoDeprecated (line 333) | CodecIDPafVideoDeprecated = CodecID(C.AV_CODEC_ID_PAF_VIDEO)
constant CodecIDPam (line 334) | CodecIDPam = CodecID(C.AV_CODEC_ID_PAM)
constant CodecIDPbm (line 335) | CodecIDPbm = CodecID(C.AV_CODEC_ID_PBM)
constant CodecIDPcmAlaw (line 336) | CodecIDPcmAlaw = CodecID(C.AV_CODEC_ID_PCM_ALAW)
constant CodecIDPcmBluray (line 337) | CodecIDPcmBluray = CodecID(C.AV_CODEC_ID_PCM_BLURAY)
constant CodecIDPcmDvd (line 338) | CodecIDPcmDvd = CodecID(C.AV_CODEC_ID_PCM_DVD)
constant CodecIDPcmF16Le (line 339) | CodecIDPcmF16Le = CodecID(C.AV_CODEC_ID_PCM_F16LE)
constant CodecIDPcmF24Le (line 340) | CodecIDPcmF24Le = CodecID(C.AV_CODEC_ID_PCM_F24LE)
constant CodecIDPcmF32Be (line 341) | CodecIDPcmF32Be = CodecID(C.AV_CODEC_ID_PCM_F32BE)
constant CodecIDPcmF32Le (line 342) | CodecIDPcmF32Le = CodecID(C.AV_CODEC_ID_PCM_F32LE)
constant CodecIDPcmF64Be (line 343) | CodecIDPcmF64Be = CodecID(C.AV_CODEC_ID_PCM_F64BE)
constant CodecIDPcmF64Le (line 344) | CodecIDPcmF64Le = CodecID(C.AV_CODEC_ID_PCM_F64LE)
constant CodecIDPcmLxf (line 345) | CodecIDPcmLxf = CodecID(C.AV_CODEC_ID_PCM_LXF)
constant CodecIDPcmMulaw (line 346) | CodecIDPcmMulaw = CodecID(C.AV_CODEC_ID_PCM_MULAW)
constant CodecIDPcmS16Be (line 347) | CodecIDPcmS16Be = CodecID(C.AV_CODEC_ID_PCM_S16BE)
constant CodecIDPcmS16BePlanar (line 348) | CodecIDPcmS16BePlanar = CodecID(C.AV_CODEC_ID_PCM_S16BE_PLANAR)
constant CodecIDPcmS16Le (line 349) | CodecIDPcmS16Le = CodecID(C.AV_CODEC_ID_PCM_S16LE)
constant CodecIDPcmS16LePlanar (line 350) | CodecIDPcmS16LePlanar = CodecID(C.AV_CODEC_ID_PCM_S16LE_PLANAR)
constant CodecIDPcmS24Be (line 351) | CodecIDPcmS24Be = CodecID(C.AV_CODEC_ID_PCM_S24BE)
constant CodecIDPcmS24Daud (line 352) | CodecIDPcmS24Daud = CodecID(C.AV_CODEC_ID_PCM_S24DAUD)
constant CodecIDPcmS24Le (line 353) | CodecIDPcmS24Le = CodecID(C.AV_CODEC_ID_PCM_S24LE)
constant CodecIDPcmS24LePlanar (line 354) | CodecIDPcmS24LePlanar = CodecID(C.AV_CODEC_ID_PCM_S24LE_PLANAR)
constant CodecIDPcmS24LePlanarDeprecated (line 355) | CodecIDPcmS24LePlanarDeprecated = CodecID(C.AV_CODEC_ID_PCM_S24LE_PLANAR)
constant CodecIDPcmS32Be (line 356) | CodecIDPcmS32Be = CodecID(C.AV_CODEC_ID_PCM_S32BE)
constant CodecIDPcmS32Le (line 357) | CodecIDPcmS32Le = CodecID(C.AV_CODEC_ID_PCM_S32LE)
constant CodecIDPcmS32LePlanar (line 358) | CodecIDPcmS32LePlanar = CodecID(C.AV_CODEC_ID_PCM_S32LE_PLANAR)
constant CodecIDPcmS32LePlanarDeprecated (line 359) | CodecIDPcmS32LePlanarDeprecated = CodecID(C.AV_CODEC_ID_PCM_S32LE_PLANAR)
constant CodecIDPcmS64Be (line 360) | CodecIDPcmS64Be = CodecID(C.AV_CODEC_ID_PCM_S64BE)
constant CodecIDPcmS64Le (line 361) | CodecIDPcmS64Le = CodecID(C.AV_CODEC_ID_PCM_S64LE)
constant CodecIDPcmS8 (line 362) | CodecIDPcmS8 = CodecID(C.AV_CODEC_ID_PCM_S8)
constant CodecIDPcmS8Planar (line 363) | CodecIDPcmS8Planar = CodecID(C.AV_CODEC_ID_PCM_S8_PLANAR)
constant CodecIDPcmSga (line 364) | CodecIDPcmSga = CodecID(C.AV_CODEC_ID_PCM_SGA)
constant CodecIDPcmU16Be (line 365) | CodecIDPcmU16Be = CodecID(C.AV_CODEC_ID_PCM_U16BE)
constant CodecIDPcmU16Le (line 366) | CodecIDPcmU16Le = CodecID(C.AV_CODEC_ID_PCM_U16LE)
constant CodecIDPcmU24Be (line 367) | CodecIDPcmU24Be = CodecID(C.AV_CODEC_ID_PCM_U24BE)
constant CodecIDPcmU24Le (line 368) | CodecIDPcmU24Le = CodecID(C.AV_CODEC_ID_PCM_U24LE)
constant CodecIDPcmU32Be (line 369) | CodecIDPcmU32Be = CodecID(C.AV_CODEC_ID_PCM_U32BE)
constant CodecIDPcmU32Le (line 370) | CodecIDPcmU32Le = CodecID(C.AV_CODEC_ID_PCM_U32LE)
constant CodecIDPcmU8 (line 371) | CodecIDPcmU8 = CodecID(C.AV_CODEC_ID_PCM_U8)
constant CodecIDPcmVidc (line 372) | CodecIDPcmVidc = CodecID(C.AV_CODEC_ID_PCM_VIDC)
constant CodecIDPcmZork (line 373) | CodecIDPcmZork = CodecID(C.AV_CODEC_ID_PCM_ZORK)
constant CodecIDPcx (line 374) | CodecIDPcx = CodecID(C.AV_CODEC_ID_PCX)
constant CodecIDPdv (line 375) | CodecIDPdv = CodecID(C.AV_CODEC_ID_PDV)
constant CodecIDPfm (line 376) | CodecIDPfm = CodecID(C.AV_CODEC_ID_PFM)
constant CodecIDPgm (line 377) | CodecIDPgm = CodecID(C.AV_CODEC_ID_PGM)
constant CodecIDPgmyuv (line 378) | CodecIDPgmyuv = CodecID(C.AV_CODEC_ID_PGMYUV)
constant CodecIDPgx (line 379) | CodecIDPgx = CodecID(C.AV_CODEC_ID_PGX)
constant CodecIDPhm (line 380) | CodecIDPhm = CodecID(C.AV_CODEC_ID_PHM)
constant CodecIDPhotocd (line 381) | CodecIDPhotocd = CodecID(C.AV_CODEC_ID_PHOTOCD)
constant CodecIDPictor (line 382) | CodecIDPictor = CodecID(C.AV_CODEC_ID_PICTOR)
constant CodecIDPixlet (line 383) | CodecIDPixlet = CodecID(C.AV_CODEC_ID_PIXLET)
constant CodecIDPjs (line 384) | CodecIDPjs = CodecID(C.AV_CODEC_ID_PJS)
constant CodecIDPng (line 385) | CodecIDPng = CodecID(C.AV_CODEC_ID_PNG)
constant CodecIDPpm (line 386) | CodecIDPpm = CodecID(C.AV_CODEC_ID_PPM)
constant CodecIDProbe (line 387) | CodecIDProbe = CodecID(C.AV_CODEC_ID_PROBE)
constant CodecIDProres (line 388) | CodecIDProres = CodecID(C.AV_CODEC_ID_PRORES)
constant CodecIDProresRaw (line 389) | CodecIDProresRaw = CodecID(C.AV_CODEC_ID_PRORES_RAW)
constant CodecIDProsumer (line 390) | CodecIDProsumer = CodecID(C.AV_CODEC_ID_PROSUMER)
constant CodecIDPsd (line 391) | CodecIDPsd = CodecID(C.AV_CODEC_ID_PSD)
constant CodecIDPtx (line 392) | CodecIDPtx = CodecID(C.AV_CODEC_ID_PTX)
constant CodecIDQcelp (line 393) | CodecIDQcelp = CodecID(C.AV_CODEC_ID_QCELP)
constant CodecIDQdm2 (line 394) | CodecIDQdm2 = CodecID(C.AV_CODEC_ID_QDM2)
constant CodecIDQdmc (line 395) | CodecIDQdmc = CodecID(C.AV_CODEC_ID_QDMC)
constant CodecIDQdraw (line 396) | CodecIDQdraw = CodecID(C.AV_CODEC_ID_QDRAW)
constant CodecIDQoa (line 397) | CodecIDQoa = CodecID(C.AV_CODEC_ID_QOA)
constant CodecIDQoi (line 398) | CodecIDQoi = CodecID(C.AV_CODEC_ID_QOI)
constant CodecIDQpeg (line 399) | CodecIDQpeg = CodecID(C.AV_CODEC_ID_QPEG)
constant CodecIDQtrle (line 400) | CodecIDQtrle = CodecID(C.AV_CODEC_ID_QTRLE)
constant CodecIDR10K (line 401) | CodecIDR10K = CodecID(C.AV_CODEC_ID_R10K)
constant CodecIDR210 (line 402) | CodecIDR210 = CodecID(C.AV_CODEC_ID_R210)
constant CodecIDRa144 (line 403) | CodecIDRa144 = CodecID(C.AV_CODEC_ID_RA_144)
constant CodecIDRa288 (line 404) | CodecIDRa288 = CodecID(C.AV_CODEC_ID_RA_288)
constant CodecIDRadianceHdr (line 405) | CodecIDRadianceHdr = CodecID(C.AV_CODEC_ID_RADIANCE_HDR)
constant CodecIDRalf (line 406) | CodecIDRalf = CodecID(C.AV_CODEC_ID_RALF)
constant CodecIDRasc (line 407) | CodecIDRasc = CodecID(C.AV_CODEC_ID_RASC)
constant CodecIDRawvideo (line 408) | CodecIDRawvideo = CodecID(C.AV_CODEC_ID_RAWVIDEO)
constant CodecIDRealtext (line 409) | CodecIDRealtext = CodecID(C.AV_CODEC_ID_REALTEXT)
constant CodecIDRka (line 410) | CodecIDRka = CodecID(C.AV_CODEC_ID_RKA)
constant CodecIDRl2 (line 411) | CodecIDRl2 = CodecID(C.AV_CODEC_ID_RL2)
constant CodecIDRoq (line 412) | CodecIDRoq = CodecID(C.AV_CODEC_ID_ROQ)
constant CodecIDRoqDpcm (line 413) | CodecIDRoqDpcm = CodecID(C.AV_CODEC_ID_ROQ_DPCM)
constant CodecIDRpza (line 414) | CodecIDRpza = CodecID(C.AV_CODEC_ID_RPZA)
constant CodecIDRscc (line 415) | CodecIDRscc = CodecID(C.AV_CODEC_ID_RSCC)
constant CodecIDRtv1 (line 416) | CodecIDRtv1 = CodecID(C.AV_CODEC_ID_RTV1)
constant CodecIDRv10 (line 417) | CodecIDRv10 = CodecID(C.AV_CODEC_ID_RV10)
constant CodecIDRv20 (line 418) | CodecIDRv20 = CodecID(C.AV_CODEC_ID_RV20)
constant CodecIDRv30 (line 419) | CodecIDRv30 = CodecID(C.AV_CODEC_ID_RV30)
constant CodecIDRv40 (line 420) | CodecIDRv40 = CodecID(C.AV_CODEC_ID_RV40)
constant CodecIDS302M (line 421) | CodecIDS302M = CodecID(C.AV_CODEC_ID_S302M)
constant CodecIDSami (line 422) | CodecIDSami = CodecID(C.AV_CODEC_ID_SAMI)
constant CodecIDSanm (line 423) | CodecIDSanm = CodecID(C.AV_CODEC_ID_SANM)
constant CodecIDSanmDeprecated (line 424) | CodecIDSanmDeprecated = CodecID(C.AV_CODEC_ID_SANM)
constant CodecIDSbc (line 425) | CodecIDSbc = CodecID(C.AV_CODEC_ID_SBC)
constant CodecIDScpr (line 426) | CodecIDScpr = CodecID(C.AV_CODEC_ID_SCPR)
constant CodecIDScreenpresso (line 427) | CodecIDScreenpresso = CodecID(C.AV_CODEC_ID_SCREENPRESSO)
constant CodecIDScte35 (line 428) | CodecIDScte35 = CodecID(C.AV_CODEC_ID_SCTE_35)
constant CodecIDSdx2Dpcm (line 429) | CodecIDSdx2Dpcm = CodecID(C.AV_CODEC_ID_SDX2_DPCM)
constant CodecIDSgaVideo (line 430) | CodecIDSgaVideo = CodecID(C.AV_CODEC_ID_SGA_VIDEO)
constant CodecIDSgi (line 431) | CodecIDSgi = CodecID(C.AV_CODEC_ID_SGI)
constant CodecIDSgirle (line 432) | CodecIDSgirle = CodecID(C.AV_CODEC_ID_SGIRLE)
constant CodecIDSgirleDeprecated (line 433) | CodecIDSgirleDeprecated = CodecID(C.AV_CODEC_ID_SGIRLE)
constant CodecIDSheervideo (line 434) | CodecIDSheervideo = CodecID(C.AV_CODEC_ID_SHEERVIDEO)
constant CodecIDShorten (line 435) | CodecIDShorten = CodecID(C.AV_CODEC_ID_SHORTEN)
constant CodecIDSimbiosisImx (line 436) | CodecIDSimbiosisImx = CodecID(C.AV_CODEC_ID_SIMBIOSIS_IMX)
constant CodecIDSipr (line 437) | CodecIDSipr = CodecID(C.AV_CODEC_ID_SIPR)
constant CodecIDSiren (line 438) | CodecIDSiren = CodecID(C.AV_CODEC_ID_SIREN)
constant CodecIDSmackaudio (line 439) | CodecIDSmackaudio = CodecID(C.AV_CODEC_ID_SMACKAUDIO)
constant CodecIDSmackvideo (line 440) | CodecIDSmackvideo = CodecID(C.AV_CODEC_ID_SMACKVIDEO)
constant CodecIDSmc (line 441) | CodecIDSmc = CodecID(C.AV_CODEC_ID_SMC)
constant CodecIDSmpte2038 (line 442) | CodecIDSmpte2038 = CodecID(C.AV_CODEC_ID_SMPTE_2038)
constant CodecIDSmpte436mAnc (line 443) | CodecIDSmpte436mAnc = CodecID(C.AV_CODEC_ID_SMPTE_436M_ANC)
constant CodecIDSmpteKlv (line 444) | CodecIDSmpteKlv = CodecID(C.AV_CODEC_ID_SMPTE_KLV)
constant CodecIDSmv (line 445) | CodecIDSmv = CodecID(C.AV_CODEC_ID_SMV)
constant CodecIDSmvjpeg (line 446) | CodecIDSmvjpeg = CodecID(C.AV_CODEC_ID_SMVJPEG)
constant CodecIDSnow (line 447) | CodecIDSnow = CodecID(C.AV_CODEC_ID_SNOW)
constant CodecIDSolDpcm (line 448) | CodecIDSolDpcm = CodecID(C.AV_CODEC_ID_SOL_DPCM)
constant CodecIDSonic (line 449) | CodecIDSonic = CodecID(C.AV_CODEC_ID_SONIC)
constant CodecIDSonicLs (line 450) | CodecIDSonicLs = CodecID(C.AV_CODEC_ID_SONIC_LS)
constant CodecIDSp5X (line 451) | CodecIDSp5X = CodecID(C.AV_CODEC_ID_SP5X)
constant CodecIDSpeedhq (line 452) | CodecIDSpeedhq = CodecID(C.AV_CODEC_ID_SPEEDHQ)
constant CodecIDSpeex (line 453) | CodecIDSpeex = CodecID(C.AV_CODEC_ID_SPEEX)
constant CodecIDSrgc (line 454) | CodecIDSrgc = CodecID(C.AV_CODEC_ID_SRGC)
constant CodecIDSrt (line 455) | CodecIDSrt = CodecID(C.AV_CODEC_ID_SRT)
constant CodecIDSsa (line 456) | CodecIDSsa = CodecID(C.AV_CODEC_ID_SSA)
constant CodecIDStl (line 457) | CodecIDStl = CodecID(C.AV_CODEC_ID_STL)
constant CodecIDSubrip (line 458) | CodecIDSubrip = CodecID(C.AV_CODEC_ID_SUBRIP)
constant CodecIDSubviewer (line 459) | CodecIDSubviewer = CodecID(C.AV_CODEC_ID_SUBVIEWER)
constant CodecIDSubviewer1 (line 460) | CodecIDSubviewer1 = CodecID(C.AV_CODEC_ID_SUBVIEWER1)
constant CodecIDSunrast (line 461) | CodecIDSunrast = CodecID(C.AV_CODEC_ID_SUNRAST)
constant CodecIDSvg (line 462) | CodecIDSvg = CodecID(C.AV_CODEC_ID_SVG)
constant CodecIDSvq1 (line 463) | CodecIDSvq1 = CodecID(C.AV_CODEC_ID_SVQ1)
constant CodecIDSvq3 (line 464) | CodecIDSvq3 = CodecID(C.AV_CODEC_ID_SVQ3)
constant CodecIDTak (line 465) | CodecIDTak = CodecID(C.AV_CODEC_ID_TAK)
constant CodecIDTakDeprecated (line 466) | CodecIDTakDeprecated = CodecID(C.AV_CODEC_ID_TAK)
constant CodecIDTarga (line 467) | CodecIDTarga = CodecID(C.AV_CODEC_ID_TARGA)
constant CodecIDTargaY216 (line 468) | CodecIDTargaY216 = CodecID(C.AV_CODEC_ID_TARGA_Y216)
constant CodecIDTdsc (line 469) | CodecIDTdsc = CodecID(C.AV_CODEC_ID_TDSC)
constant CodecIDText (line 470) | CodecIDText = CodecID(C.AV_CODEC_ID_TEXT)
constant CodecIDTgq (line 471) | CodecIDTgq = CodecID(C.AV_CODEC_ID_TGQ)
constant CodecIDTgv (line 472) | CodecIDTgv = CodecID(C.AV_CODEC_ID_TGV)
constant CodecIDTheora (line 473) | CodecIDTheora = CodecID(C.AV_CODEC_ID_THEORA)
constant CodecIDThp (line 474) | CodecIDThp = CodecID(C.AV_CODEC_ID_THP)
constant CodecIDTiertexseqvideo (line 475) | CodecIDTiertexseqvideo = CodecID(C.AV_CODEC_ID_TIERTEXSEQVIDEO)
constant CodecIDTiff (line 476) | CodecIDTiff = CodecID(C.AV_CODEC_ID_TIFF)
constant CodecIDTimedId3 (line 477) | CodecIDTimedId3 = CodecID(C.AV_CODEC_ID_TIMED_ID3)
constant CodecIDTmv (line 478) | CodecIDTmv = CodecID(C.AV_CODEC_ID_TMV)
constant CodecIDTqi (line 479) | CodecIDTqi = CodecID(C.AV_CODEC_ID_TQI)
constant CodecIDTruehd (line 480) | CodecIDTruehd = CodecID(C.AV_CODEC_ID_TRUEHD)
constant CodecIDTruemotion1 (line 481) | CodecIDTruemotion1 = CodecID(C.AV_CODEC_ID_TRUEMOTION1)
constant CodecIDTruemotion2 (line 482) | CodecIDTruemotion2 = CodecID(C.AV_CODEC_ID_TRUEMOTION2)
constant CodecIDTruemotion2Rt (line 483) | CodecIDTruemotion2Rt = CodecID(C.AV_CODEC_ID_TRUEMOTION2RT)
constant CodecIDTruespeech (line 484) | CodecIDTruespeech = CodecID(C.AV_CODEC_ID_TRUESPEECH)
constant CodecIDTscc (line 485) | CodecIDTscc = CodecID(C.AV_CODEC_ID_TSCC)
constant CodecIDTscc2 (line 486) | CodecIDTscc2 = CodecID(C.AV_CODEC_ID_TSCC2)
constant CodecIDTta (line 487) | CodecIDTta = CodecID(C.AV_CODEC_ID_TTA)
constant CodecIDTtf (line 488) | CodecIDTtf = CodecID(C.AV_CODEC_ID_TTF)
constant CodecIDTtml (line 489) | CodecIDTtml = CodecID(C.AV_CODEC_ID_TTML)
constant CodecIDTwinvq (line 490) | CodecIDTwinvq = CodecID(C.AV_CODEC_ID_TWINVQ)
constant CodecIDTxd (line 491) | CodecIDTxd = CodecID(C.AV_CODEC_ID_TXD)
constant CodecIDUlti (line 492) | CodecIDUlti = CodecID(C.AV_CODEC_ID_ULTI)
constant CodecIDUtvideo (line 493) | CodecIDUtvideo = CodecID(C.AV_CODEC_ID_UTVIDEO)
constant CodecIDV210 (line 494) | CodecIDV210 = CodecID(C.AV_CODEC_ID_V210)
constant CodecIDV210X (line 495) | CodecIDV210X = CodecID(C.AV_CODEC_ID_V210X)
constant CodecIDV308 (line 496) | CodecIDV308 = CodecID(C.AV_CODEC_ID_V308)
constant CodecIDV408 (line 497) | CodecIDV408 = CodecID(C.AV_CODEC_ID_V408)
constant CodecIDV410 (line 498) | CodecIDV410 = CodecID(C.AV_CODEC_ID_V410)
constant CodecIDVb (line 499) | CodecIDVb = CodecID(C.AV_CODEC_ID_VB)
constant CodecIDVble (line 500) | CodecIDVble = CodecID(C.AV_CODEC_ID_VBLE)
constant CodecIDVbn (line 501) | CodecIDVbn = CodecID(C.AV_CODEC_ID_VBN)
constant CodecIDVc1 (line 502) | CodecIDVc1 = CodecID(C.AV_CODEC_ID_VC1)
constant CodecIDVc1Image (line 503) | CodecIDVc1Image = CodecID(C.AV_CODEC_ID_VC1IMAGE)
constant CodecIDVcr1 (line 504) | CodecIDVcr1 = CodecID(C.AV_CODEC_ID_VCR1)
constant CodecIDVixl (line 505) | CodecIDVixl = CodecID(C.AV_CODEC_ID_VIXL)
constant CodecIDVmdaudio (line 506) | CodecIDVmdaudio = CodecID(C.AV_CODEC_ID_VMDAUDIO)
constant CodecIDVmdvideo (line 507) | CodecIDVmdvideo = CodecID(C.AV_CODEC_ID_VMDVIDEO)
constant CodecIDVmix (line 508) | CodecIDVmix = CodecID(C.AV_CODEC_ID_VMIX)
constant CodecIDVmnc (line 509) | CodecIDVmnc = CodecID(C.AV_CODEC_ID_VMNC)
constant CodecIDVnull (line 510) | CodecIDVnull = CodecID(C.AV_CODEC_ID_VNULL)
constant CodecIDVorbis (line 511) | CodecIDVorbis = CodecID(C.AV_CODEC_ID_VORBIS)
constant CodecIDVp3 (line 512) | CodecIDVp3 = CodecID(C.AV_CODEC_ID_VP3)
constant CodecIDVp4 (line 513) | CodecIDVp4 = CodecID(C.AV_CODEC_ID_VP4)
constant CodecIDVp5 (line 514) | CodecIDVp5 = CodecID(C.AV_CODEC_ID_VP5)
constant CodecIDVp6 (line 515) | CodecIDVp6 = CodecID(C.AV_CODEC_ID_VP6)
constant CodecIDVp6A (line 516) | CodecIDVp6A = CodecID(C.AV_CODEC_ID_VP6A)
constant CodecIDVp6F (line 517) | CodecIDVp6F = CodecID(C.AV_CODEC_ID_VP6F)
constant CodecIDVp7 (line 518) | CodecIDVp7 = CodecID(C.AV_CODEC_ID_VP7)
constant CodecIDVp7Deprecated (line 519) | CodecIDVp7Deprecated = CodecID(C.AV_CODEC_ID_VP7)
constant CodecIDVp8 (line 520) | CodecIDVp8 = CodecID(C.AV_CODEC_ID_VP8)
constant CodecIDVp9 (line 521) | CodecIDVp9 = CodecID(C.AV_CODEC_ID_VP9)
constant CodecIDVplayer (line 522) | CodecIDVplayer = CodecID(C.AV_CODEC_ID_VPLAYER)
constant CodecIDVqc (line 523) | CodecIDVqc = CodecID(C.AV_CODEC_ID_VQC)
constant CodecIDVvc (line 524) | CodecIDVvc = CodecID(C.AV_CODEC_ID_VVC)
constant CodecIDWadyDpcm (line 525) | CodecIDWadyDpcm = CodecID(C.AV_CODEC_ID_WADY_DPCM)
constant CodecIDWavarc (line 526) | CodecIDWavarc = CodecID(C.AV_CODEC_ID_WAVARC)
constant CodecIDWavpack (line 527) | CodecIDWavpack = CodecID(C.AV_CODEC_ID_WAVPACK)
constant CodecIDWbmp (line 528) | CodecIDWbmp = CodecID(C.AV_CODEC_ID_WBMP)
constant CodecIDWcmv (line 529) | CodecIDWcmv = CodecID(C.AV_CODEC_ID_WCMV)
constant CodecIDWebp (line 530) | CodecIDWebp = CodecID(C.AV_CODEC_ID_WEBP)
constant CodecIDWebpDeprecated (line 531) | CodecIDWebpDeprecated = CodecID(C.AV_CODEC_ID_WEBP)
constant CodecIDWebvtt (line 532) | CodecIDWebvtt = CodecID(C.AV_CODEC_ID_WEBVTT)
constant CodecIDWestwoodSnd1 (line 533) | CodecIDWestwoodSnd1 = CodecID(C.AV_CODEC_ID_WESTWOOD_SND1)
constant CodecIDWmalossless (line 534) | CodecIDWmalossless = CodecID(C.AV_CODEC_ID_WMALOSSLESS)
constant CodecIDWmapro (line 535) | CodecIDWmapro = CodecID(C.AV_CODEC_ID_WMAPRO)
constant CodecIDWmav1 (line 536) | CodecIDWmav1 = CodecID(C.AV_CODEC_ID_WMAV1)
constant CodecIDWmav2 (line 537) | CodecIDWmav2 = CodecID(C.AV_CODEC_ID_WMAV2)
constant CodecIDWmavoice (line 538) | CodecIDWmavoice = CodecID(C.AV_CODEC_ID_WMAVOICE)
constant CodecIDWmv1 (line 539) | CodecIDWmv1 = CodecID(C.AV_CODEC_ID_WMV1)
constant CodecIDWmv2 (line 540) | CodecIDWmv2 = CodecID(C.AV_CODEC_ID_WMV2)
constant CodecIDWmv3 (line 541) | CodecIDWmv3 = CodecID(C.AV_CODEC_ID_WMV3)
constant CodecIDWmv3Image (line 542) | CodecIDWmv3Image = CodecID(C.AV_CODEC_ID_WMV3IMAGE)
constant CodecIDWnv1 (line 543) | CodecIDWnv1 = CodecID(C.AV_CODEC_ID_WNV1)
constant CodecIDWrappedAvframe (line 544) | CodecIDWrappedAvframe = CodecID(C.AV_CODEC_ID_WRAPPED_AVFRAME)
constant CodecIDWsVqa (line 545) | CodecIDWsVqa = CodecID(C.AV_CODEC_ID_WS_VQA)
constant CodecIDXanDpcm (line 546) | CodecIDXanDpcm = CodecID(C.AV_CODEC_ID_XAN_DPCM)
constant CodecIDXanWc3 (line 547) | CodecIDXanWc3 = CodecID(C.AV_CODEC_ID_XAN_WC3)
constant CodecIDXanWc4 (line 548) | CodecIDXanWc4 = CodecID(C.AV_CODEC_ID_XAN_WC4)
constant CodecIDXbin (line 549) | CodecIDXbin = CodecID(C.AV_CODEC_ID_XBIN)
constant CodecIDXbm (line 550) | CodecIDXbm = CodecID(C.AV_CODEC_ID_XBM)
constant CodecIDXface (line 551) | CodecIDXface = CodecID(C.AV_CODEC_ID_XFACE)
constant CodecIDXma1 (line 552) | CodecIDXma1 = CodecID(C.AV_CODEC_ID_XMA1)
constant CodecIDXma2 (line 553) | CodecIDXma2 = CodecID(C.AV_CODEC_ID_XMA2)
constant CodecIDXpm (line 554) | CodecIDXpm = CodecID(C.AV_CODEC_ID_XPM)
constant CodecIDXsub (line 555) | CodecIDXsub = CodecID(C.AV_CODEC_ID_XSUB)
constant CodecIDXwd (line 556) | CodecIDXwd = CodecID(C.AV_CODEC_ID_XWD)
constant CodecIDY41P (line 557) | CodecIDY41P = CodecID(C.AV_CODEC_ID_Y41P)
constant CodecIDYlc (line 558) | CodecIDYlc = CodecID(C.AV_CODEC_ID_YLC)
constant CodecIDYop (line 559) | CodecIDYop = CodecID(C.AV_CODEC_ID_YOP)
constant CodecIDYuv4 (line 560) | CodecIDYuv4 = CodecID(C.AV_CODEC_ID_YUV4)
constant CodecIDZerocodec (line 561) | CodecIDZerocodec = CodecID(C.AV_CODEC_ID_ZEROCODEC)
constant CodecIDZlib (line 562) | CodecIDZlib = CodecID(C.AV_CODEC_ID_ZLIB)
constant CodecIDZmbv (line 563) | CodecIDZmbv = CodecID(C.AV_CODEC_ID_ZMBV)
FILE: codec_id_test.go
function TestCodecID (line 9) | func TestCodecID(t *testing.T) {
FILE: codec_parameters.go
type CodecParameters (line 7) | type CodecParameters struct
method Free (line 24) | func (cp *CodecParameters) Free() {
method BitRate (line 31) | func (cp *CodecParameters) BitRate() int64 {
method ChannelLayout (line 36) | func (cp *CodecParameters) ChannelLayout() ChannelLayout {
method SetChannelLayout (line 42) | func (cp *CodecParameters) SetChannelLayout(l ChannelLayout) {
method CodecID (line 47) | func (cp *CodecParameters) CodecID() CodecID {
method SetCodecID (line 52) | func (cp *CodecParameters) SetCodecID(i CodecID) {
method CodecTag (line 57) | func (cp *CodecParameters) CodecTag() CodecTag {
method SetCodecTag (line 62) | func (cp *CodecParameters) SetCodecTag(t CodecTag) {
method ChromaLocation (line 67) | func (cp *CodecParameters) ChromaLocation() ChromaLocation {
method ColorPrimaries (line 72) | func (cp *CodecParameters) ColorPrimaries() ColorPrimaries {
method ColorRange (line 77) | func (cp *CodecParameters) ColorRange() ColorRange {
method SetColorRange (line 82) | func (cp *CodecParameters) SetColorRange(r ColorRange) {
method ColorSpace (line 87) | func (cp *CodecParameters) ColorSpace() ColorSpace {
method SetColorSpace (line 92) | func (cp *CodecParameters) SetColorSpace(s ColorSpace) {
method ColorTransferCharacteristic (line 97) | func (cp *CodecParameters) ColorTransferCharacteristic() ColorTransfer...
method ExtraData (line 102) | func (cp *CodecParameters) ExtraData() []byte {
method SetExtraData (line 110) | func (cp *CodecParameters) SetExtraData(b []byte) error {
method FrameSize (line 115) | func (cp *CodecParameters) FrameSize() int {
method SetFrameSize (line 120) | func (cp *CodecParameters) SetFrameSize(i int) {
method Height (line 125) | func (cp *CodecParameters) Height() int {
method SetHeight (line 130) | func (cp *CodecParameters) SetHeight(h int) {
method Level (line 135) | func (cp *CodecParameters) Level() Level {
method SetLevel (line 140) | func (cp *CodecParameters) SetLevel(l Level) {
method MediaType (line 145) | func (cp *CodecParameters) MediaType() MediaType {
method SetMediaType (line 150) | func (cp *CodecParameters) SetMediaType(t MediaType) {
method PixelFormat (line 155) | func (cp *CodecParameters) PixelFormat() PixelFormat {
method SetPixelFormat (line 160) | func (cp *CodecParameters) SetPixelFormat(f PixelFormat) {
method Profile (line 165) | func (cp *CodecParameters) Profile() Profile {
method SetProfile (line 170) | func (cp *CodecParameters) SetProfile(p Profile) {
method SampleAspectRatio (line 175) | func (cp *CodecParameters) SampleAspectRatio() Rational {
method SetSampleAspectRatio (line 180) | func (cp *CodecParameters) SetSampleAspectRatio(r Rational) {
method SideData (line 185) | func (cp *CodecParameters) SideData() *PacketSideData {
method SampleFormat (line 190) | func (cp *CodecParameters) SampleFormat() SampleFormat {
method SetSampleFormat (line 195) | func (cp *CodecParameters) SetSampleFormat(f SampleFormat) {
method SampleRate (line 200) | func (cp *CodecParameters) SampleRate() int {
method SetSampleRate (line 205) | func (cp *CodecParameters) SetSampleRate(r int) {
method Width (line 210) | func (cp *CodecParameters) Width() int {
method SetWidth (line 215) | func (cp *CodecParameters) SetWidth(w int) {
method FromCodecContext (line 220) | func (cp *CodecParameters) FromCodecContext(cc *CodecContext) error {
method ToCodecContext (line 225) | func (cp *CodecParameters) ToCodecContext(cc *CodecContext) error {
method Copy (line 230) | func (cp *CodecParameters) Copy(dst *CodecParameters) error {
function AllocCodecParameters (line 12) | func AllocCodecParameters() *CodecParameters {
function newCodecParametersFromC (line 16) | func newCodecParametersFromC(c *C.AVCodecParameters) *CodecParameters {
FILE: codec_parameters_test.go
function TestCodecParameters (line 9) | func TestCodecParameters(t *testing.T) {
FILE: codec_tag.go
type CodecTag (line 3) | type CodecTag
FILE: codec_test.go
function TestCodec (line 9) | func TestCodec(t *testing.T) {
FILE: color_primaries.go
type ColorPrimaries (line 7) | type ColorPrimaries
constant ColorPrimariesReserved0 (line 10) | ColorPrimariesReserved0 = ColorPrimaries(C.AVCOL_PRI_RESERVED0)
constant ColorPrimariesBt709 (line 11) | ColorPrimariesBt709 = ColorPrimaries(C.AVCOL_PRI_BT709)
constant ColorPrimariesUnspecified (line 12) | ColorPrimariesUnspecified = ColorPrimaries(C.AVCOL_PRI_UNSPECIFIED)
constant ColorPrimariesReserved (line 13) | ColorPrimariesReserved = ColorPrimaries(C.AVCOL_PRI_RESERVED)
constant ColorPrimariesBt470M (line 14) | ColorPrimariesBt470M = ColorPrimaries(C.AVCOL_PRI_BT470M)
constant ColorPrimariesBt470Bg (line 15) | ColorPrimariesBt470Bg = ColorPrimaries(C.AVCOL_PRI_BT470BG)
constant ColorPrimariesSmpte170M (line 16) | ColorPrimariesSmpte170M = ColorPrimaries(C.AVCOL_PRI_SMPTE170M)
constant ColorPrimariesSmpte240M (line 17) | ColorPrimariesSmpte240M = ColorPrimaries(C.AVCOL_PRI_SMPTE240M)
constant ColorPrimariesFilm (line 18) | ColorPrimariesFilm = ColorPrimaries(C.AVCOL_PRI_FILM)
constant ColorPrimariesBt2020 (line 19) | ColorPrimariesBt2020 = ColorPrimaries(C.AVCOL_PRI_BT2020)
constant ColorPrimariesSmpte428 (line 20) | ColorPrimariesSmpte428 = ColorPrimaries(C.AVCOL_PRI_SMPTE428)
constant ColorPrimariesSmptest4281 (line 21) | ColorPrimariesSmptest4281 = ColorPrimaries(C.AVCOL_PRI_SMPTEST428_1)
constant ColorPrimariesSmpte431 (line 22) | ColorPrimariesSmpte431 = ColorPrimaries(C.AVCOL_PRI_SMPTE431)
constant ColorPrimariesSmpte432 (line 23) | ColorPrimariesSmpte432 = ColorPrimaries(C.AVCOL_PRI_SMPTE432)
constant ColorPrimariesJedecP22 (line 24) | ColorPrimariesJedecP22 = ColorPrimaries(C.AVCOL_PRI_JEDEC_P22)
constant ColorPrimariesNb (line 25) | ColorPrimariesNb = ColorPrimaries(C.AVCOL_PRI_NB)
FILE: color_range.go
type ColorRange (line 8) | type ColorRange
method Name (line 18) | func (r ColorRange) Name() string {
method String (line 22) | func (r ColorRange) String() string {
constant ColorRangeUnspecified (line 11) | ColorRangeUnspecified = ColorRange(C.AVCOL_RANGE_UNSPECIFIED)
constant ColorRangeMpeg (line 12) | ColorRangeMpeg = ColorRange(C.AVCOL_RANGE_MPEG)
constant ColorRangeJpeg (line 13) | ColorRangeJpeg = ColorRange(C.AVCOL_RANGE_JPEG)
constant ColorRangeNb (line 14) | ColorRangeNb = ColorRange(C.AVCOL_RANGE_NB)
FILE: color_range_test.go
function TestColorRange (line 9) | func TestColorRange(t *testing.T) {
FILE: color_space.go
type ColorSpace (line 8) | type ColorSpace
method Name (line 34) | func (s ColorSpace) Name() string {
method String (line 38) | func (s ColorSpace) String() string {
constant ColorSpaceRgb (line 11) | ColorSpaceRgb = ColorSpace(C.AVCOL_SPC_RGB)
constant ColorSpaceBt709 (line 12) | ColorSpaceBt709 = ColorSpace(C.AVCOL_SPC_BT709)
constant ColorSpaceUnspecified (line 13) | ColorSpaceUnspecified = ColorSpace(C.AVCOL_SPC_UNSPECIFIED)
constant ColorSpaceReserved (line 14) | ColorSpaceReserved = ColorSpace(C.AVCOL_SPC_RESERVED)
constant ColorSpaceFcc (line 15) | ColorSpaceFcc = ColorSpace(C.AVCOL_SPC_FCC)
constant ColorSpaceBt470Bg (line 16) | ColorSpaceBt470Bg = ColorSpace(C.AVCOL_SPC_BT470BG)
constant ColorSpaceSmpte170M (line 17) | ColorSpaceSmpte170M = ColorSpace(C.AVCOL_SPC_SMPTE170M)
constant ColorSpaceSmpte240M (line 18) | ColorSpaceSmpte240M = ColorSpace(C.AVCOL_SPC_SMPTE240M)
constant ColorSpaceYcgco (line 19) | ColorSpaceYcgco = ColorSpace(C.AVCOL_SPC_YCGCO)
constant ColorSpaceYcgcoRe (line 20) | ColorSpaceYcgcoRe = ColorSpace(C.AVCOL_SPC_YCGCO_RE)
constant ColorSpaceYcgcoRo (line 21) | ColorSpaceYcgcoRo = ColorSpace(C.AVCOL_SPC_YCGCO_RO)
constant ColorSpaceYcocg (line 22) | ColorSpaceYcocg = ColorSpace(C.AVCOL_SPC_YCOCG)
constant ColorSpaceBt2020Ncl (line 23) | ColorSpaceBt2020Ncl = ColorSpace(C.AVCOL_SPC_BT2020_NCL)
constant ColorSpaceBt2020Cl (line 24) | ColorSpaceBt2020Cl = ColorSpace(C.AVCOL_SPC_BT2020_CL)
constant ColorSpaceSmpte2085 (line 25) | ColorSpaceSmpte2085 = ColorSpace(C.AVCOL_SPC_SMPTE2085)
constant ColorSpaceChromaDerivedNcl (line 26) | ColorSpaceChromaDerivedNcl = ColorSpace(C.AVCOL_SPC_CHROMA_DERIVED_NCL)
constant ColorSpaceChromaDerivedCl (line 27) | ColorSpaceChromaDerivedCl = ColorSpace(C.AVCOL_SPC_CHROMA_DERIVED_CL)
constant ColorSpaceIctcp (line 28) | ColorSpaceIctcp = ColorSpace(C.AVCOL_SPC_ICTCP)
constant ColorSpaceIptC2 (line 29) | ColorSpaceIptC2 = ColorSpace(C.AVCOL_SPC_IPT_C2)
constant ColorSpaceNb (line 30) | ColorSpaceNb = ColorSpace(C.AVCOL_SPC_NB)
FILE: color_space_test.go
function TestColorSpace (line 9) | func TestColorSpace(t *testing.T) {
FILE: color_transfer_characteristic.go
type ColorTransferCharacteristic (line 7) | type ColorTransferCharacteristic
constant ColorTransferCharacteristicReserved0 (line 10) | ColorTransferCharacteristicReserved0 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicBt709 (line 11) | ColorTransferCharacteristicBt709 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicUnspecified (line 12) | ColorTransferCharacteristicUnspecified = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicReserved (line 13) | ColorTransferCharacteristicReserved = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicGamma22 (line 14) | ColorTransferCharacteristicGamma22 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicGamma28 (line 15) | ColorTransferCharacteristicGamma28 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicSmpte170M (line 16) | ColorTransferCharacteristicSmpte170M = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicSmpte240M (line 17) | ColorTransferCharacteristicSmpte240M = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicLinear (line 18) | ColorTransferCharacteristicLinear = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicLog (line 19) | ColorTransferCharacteristicLog = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicLogSqrt (line 20) | ColorTransferCharacteristicLogSqrt = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicIec6196624 (line 21) | ColorTransferCharacteristicIec6196624 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicBt1361Ecg (line 22) | ColorTransferCharacteristicBt1361Ecg = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicIec6196621 (line 23) | ColorTransferCharacteristicIec6196621 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicBt202010 (line 24) | ColorTransferCharacteristicBt202010 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicBt202012 (line 25) | ColorTransferCharacteristicBt202012 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicSmpte2084 (line 26) | ColorTransferCharacteristicSmpte2084 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicSmptest2084 (line 27) | ColorTransferCharacteristicSmptest2084 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicSmpte428 (line 28) | ColorTransferCharacteristicSmpte428 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicSmptest4281 (line 29) | ColorTransferCharacteristicSmptest4281 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicAribStdB67 (line 30) | ColorTransferCharacteristicAribStdB67 = ColorTransferCharacteristic(C.A...
constant ColorTransferCharacteristicNb (line 31) | ColorTransferCharacteristicNb = ColorTransferCharacteristic(C.A...
FILE: device.go
function RegisterAllDevices (line 7) | func RegisterAllDevices() {
FILE: device_test.go
function TestDevice (line 7) | func TestDevice(t *testing.T) {
FILE: dictionary.go
type Dictionary (line 12) | type Dictionary struct
method Set (line 28) | func (d *Dictionary) Set(key, value string, flags DictionaryFlags) err...
method ParseString (line 37) | func (d *Dictionary) ParseString(i, keyValSep, pairsSep string, flags ...
method Get (line 48) | func (d *Dictionary) Get(key string, prev *DictionaryEntry, flags Dict...
method Free (line 62) | func (d *Dictionary) Free() {
method Pack (line 69) | func (d *Dictionary) Pack() []byte {
method Unpack (line 76) | func (d *Dictionary) Unpack(b []byte) error {
method Copy (line 83) | func (d *Dictionary) Copy(dst *Dictionary, flags DictionaryFlags) error {
function NewDictionary (line 16) | func NewDictionary() *Dictionary {
function newDictionaryFromC (line 20) | func newDictionaryFromC(c *C.AVDictionary) *Dictionary {
FILE: dictionary_entry.go
type DictionaryEntry (line 7) | type DictionaryEntry struct
method Key (line 16) | func (e DictionaryEntry) Key() string {
method Value (line 21) | func (e DictionaryEntry) Value() string {
function newDictionaryEntryFromC (line 11) | func newDictionaryEntryFromC(c *C.AVDictionaryEntry) *DictionaryEntry {
FILE: dictionary_flag.go
type DictionaryFlag (line 7) | type DictionaryFlag
constant DictionaryFlagMatchCase (line 10) | DictionaryFlagMatchCase = DictionaryFlag(C.AV_DICT_MATCH_CASE)
constant DictionaryFlagIgnoreSuffix (line 11) | DictionaryFlagIgnoreSuffix = DictionaryFlag(C.AV_DICT_IGNORE_SUFFIX)
constant DictionaryFlagDontStrdupKey (line 12) | DictionaryFlagDontStrdupKey = DictionaryFlag(C.AV_DICT_DONT_STRDUP_KEY)
constant DictionaryFlagDontStrdupVal (line 13) | DictionaryFlagDontStrdupVal = DictionaryFlag(C.AV_DICT_DONT_STRDUP_VAL)
constant DictionaryFlagDontOverwrite (line 14) | DictionaryFlagDontOverwrite = DictionaryFlag(C.AV_DICT_DONT_OVERWRITE)
constant DictionaryFlagAppend (line 15) | DictionaryFlagAppend = DictionaryFlag(C.AV_DICT_APPEND)
constant DictionaryFlagMultikey (line 16) | DictionaryFlagMultikey = DictionaryFlag(C.AV_DICT_MULTIKEY)
FILE: dictionary_test.go
function TestDictionary (line 9) | func TestDictionary(t *testing.T) {
FILE: discard.go
type Discard (line 7) | type Discard
constant DiscardNone (line 10) | DiscardNone = Discard(C.AVDISCARD_NONE)
constant DiscardDefault (line 11) | DiscardDefault = Discard(C.AVDISCARD_DEFAULT)
constant DiscardNonRef (line 12) | DiscardNonRef = Discard(C.AVDISCARD_NONREF)
constant DiscardBidirectional (line 13) | DiscardBidirectional = Discard(C.AVDISCARD_BIDIR)
constant DiscardNonIntra (line 14) | DiscardNonIntra = Discard(C.AVDISCARD_NONINTRA)
constant DiscardNonKey (line 15) | DiscardNonKey = Discard(C.AVDISCARD_NONKEY)
constant DiscardAll (line 16) | DiscardAll = Discard(C.AVDISCARD_ALL)
FILE: display_matrix.go
type DisplayMatrix (line 12) | type DisplayMatrix
method bytes (line 38) | func (m DisplayMatrix) bytes() []byte {
method Rotation (line 48) | func (m DisplayMatrix) Rotation() float64 {
function newDisplayMatrixFromBytes (line 14) | func newDisplayMatrixFromBytes(b []byte) (m *DisplayMatrix, err error) {
function NewDisplayMatrixFromRotation (line 32) | func NewDisplayMatrixFromRotation(angle float64) *DisplayMatrix {
FILE: display_matrix_test.go
function TestDisplayMatrix (line 9) | func TestDisplayMatrix(t *testing.T) {
FILE: disposition_flag.go
type DispositionFlag (line 7) | type DispositionFlag
constant DispositionFlagAttachedPic (line 10) | DispositionFlagAttachedPic = DispositionFlag(C.AV_DISPOSITION_ATTACH...
constant DispositionFlagCaptions (line 11) | DispositionFlagCaptions = DispositionFlag(C.AV_DISPOSITION_CAPTIONS)
constant DispositionFlagCleanEffects (line 12) | DispositionFlagCleanEffects = DispositionFlag(C.AV_DISPOSITION_CLEAN_...
constant DispositionFlagComment (line 13) | DispositionFlagComment = DispositionFlag(C.AV_DISPOSITION_COMMENT)
constant DispositionFlagDefault (line 14) | DispositionFlagDefault = DispositionFlag(C.AV_DISPOSITION_DEFAULT)
constant DispositionFlagDependent (line 15) | DispositionFlagDependent = DispositionFlag(C.AV_DISPOSITION_DEPEND...
constant DispositionFlagDescriptions (line 16) | DispositionFlagDescriptions = DispositionFlag(C.AV_DISPOSITION_DESCRI...
constant DispositionFlagDub (line 17) | DispositionFlagDub = DispositionFlag(C.AV_DISPOSITION_DUB)
constant DispositionFlagForced (line 18) | DispositionFlagForced = DispositionFlag(C.AV_DISPOSITION_FORCED)
constant DispositionFlagHearingImpaired (line 19) | DispositionFlagHearingImpaired = DispositionFlag(C.AV_DISPOSITION_HEARIN...
constant DispositionFlagKaraoke (line 20) | DispositionFlagKaraoke = DispositionFlag(C.AV_DISPOSITION_KARAOKE)
constant DispositionFlagLyrics (line 21) | DispositionFlagLyrics = DispositionFlag(C.AV_DISPOSITION_LYRICS)
constant DispositionFlagMetadata (line 22) | DispositionFlagMetadata = DispositionFlag(C.AV_DISPOSITION_METADATA)
constant DispositionFlagMultilayer (line 23) | DispositionFlagMultilayer = DispositionFlag(C.AV_DISPOSITION_MULTIL...
constant DispositionFlagNonDiegetic (line 24) | DispositionFlagNonDiegetic = DispositionFlag(C.AV_DISPOSITION_NON_DI...
constant DispositionFlagOriginal (line 25) | DispositionFlagOriginal = DispositionFlag(C.AV_DISPOSITION_ORIGINAL)
constant DispositionFlagStillImage (line 26) | DispositionFlagStillImage = DispositionFlag(C.AV_DISPOSITION_STILL_...
constant DispositionFlagTimedThumbnails (line 27) | DispositionFlagTimedThumbnails = DispositionFlag(C.AV_DISPOSITION_TIMED_...
constant DispositionFlagVisualImpaired (line 28) | DispositionFlagVisualImpaired = DispositionFlag(C.AV_DISPOSITION_VISUAL...
FILE: error.go
type Error (line 8) | type Error
method Error (line 55) | func (e Error) Error() string {
method Is (line 62) | func (e Error) Is(err error) bool {
constant ErrBsfNotFound (line 11) | ErrBsfNotFound = Error(C.AVERROR_BSF_NOT_FOUND)
constant ErrBufferTooSmall (line 12) | ErrBufferTooSmall = Error(C.AVERROR_BUFFER_TOO_SMALL)
constant ErrBug (line 13) | ErrBug = Error(C.AVERROR_BUG)
constant ErrBug2 (line 14) | ErrBug2 = Error(C.AVERROR_BUG2)
constant ErrDecoderNotFound (line 15) | ErrDecoderNotFound = Error(C.AVERROR_DECODER_NOT_FOUND)
constant ErrDemuxerNotFound (line 16) | ErrDemuxerNotFound = Error(C.AVERROR_DEMUXER_NOT_FOUND)
constant ErrEagain (line 17) | ErrEagain = Error(-(C.EAGAIN))
constant ErrEio (line 18) | ErrEio = Error(-(C.EIO))
constant ErrEncoderNotFound (line 19) | ErrEncoderNotFound = Error(C.AVERROR_ENCODER_NOT_FOUND)
constant ErrEof (line 20) | ErrEof = Error(C.AVERROR_EOF)
constant ErrEperm (line 21) | ErrEperm = Error(-(C.EPERM))
constant ErrEpipe (line 22) | ErrEpipe = Error(-(C.EPIPE))
constant ErrEtimedout (line 23) | ErrEtimedout = Error(-(C.ETIMEDOUT))
constant ErrExit (line 24) | ErrExit = Error(C.AVERROR_EXIT)
constant ErrExperimental (line 25) | ErrExperimental = Error(C.AVERROR_EXPERIMENTAL)
constant ErrExternal (line 26) | ErrExternal = Error(C.AVERROR_EXTERNAL)
constant ErrFilterNotFound (line 27) | ErrFilterNotFound = Error(C.AVERROR_FILTER_NOT_FOUND)
constant ErrHttpBadRequest (line 28) | ErrHttpBadRequest = Error(C.AVERROR_HTTP_BAD_REQUEST)
constant ErrHttpForbidden (line 29) | ErrHttpForbidden = Error(C.AVERROR_HTTP_FORBIDDEN)
constant ErrHttpNotFound (line 30) | ErrHttpNotFound = Error(C.AVERROR_HTTP_NOT_FOUND)
constant ErrHttpOther4Xx (line 31) | ErrHttpOther4Xx = Error(C.AVERROR_HTTP_OTHER_4XX)
constant ErrHttpServerError (line 32) | ErrHttpServerError = Error(C.AVERROR_HTTP_SERVER_ERROR)
constant ErrHttpUnauthorized (line 33) | ErrHttpUnauthorized = Error(C.AVERROR_HTTP_UNAUTHORIZED)
constant ErrInputChanged (line 34) | ErrInputChanged = Error(C.AVERROR_INPUT_CHANGED)
constant ErrInvaliddata (line 35) | ErrInvaliddata = Error(C.AVERROR_INVALIDDATA)
constant ErrMaxStringSize (line 36) | ErrMaxStringSize = Error(C.AV_ERROR_MAX_STRING_SIZE)
constant ErrMuxerNotFound (line 37) | ErrMuxerNotFound = Error(C.AVERROR_MUXER_NOT_FOUND)
constant ErrOptionNotFound (line 38) | ErrOptionNotFound = Error(C.AVERROR_OPTION_NOT_FOUND)
constant ErrOutputChanged (line 39) | ErrOutputChanged = Error(C.AVERROR_OUTPUT_CHANGED)
constant ErrPatchwelcome (line 40) | ErrPatchwelcome = Error(C.AVERROR_PATCHWELCOME)
constant ErrProtocolNotFound (line 41) | ErrProtocolNotFound = Error(C.AVERROR_PROTOCOL_NOT_FOUND)
constant ErrStreamNotFound (line 42) | ErrStreamNotFound = Error(C.AVERROR_STREAM_NOT_FOUND)
constant ErrUnknown (line 43) | ErrUnknown = Error(C.AVERROR_UNKNOWN)
function newError (line 46) | func newError(ret C.int) error {
FILE: error_recognition_flag.go
type ErrorRecognitionFlag (line 7) | type ErrorRecognitionFlag
constant ErrorRecognitionFlagAggressive (line 10) | ErrorRecognitionFlagAggressive = ErrorRecognitionFlag(C.AV_EF_AGGRESSIVE)
constant ErrorRecognitionFlagBitstream (line 11) | ErrorRecognitionFlagBitstream = ErrorRecognitionFlag(C.AV_EF_BITSTREAM)
constant ErrorRecognitionFlagBuffer (line 12) | ErrorRecognitionFlagBuffer = ErrorRecognitionFlag(C.AV_EF_BUFFER)
constant ErrorRecognitionFlagCareful (line 13) | ErrorRecognitionFlagCareful = ErrorRecognitionFlag(C.AV_EF_CAREFUL)
constant ErrorRecognitionFlagCompliant (line 14) | ErrorRecognitionFlagCompliant = ErrorRecognitionFlag(C.AV_EF_COMPLIANT)
constant ErrorRecognitionFlagCRCCheck (line 15) | ErrorRecognitionFlagCRCCheck = ErrorRecognitionFlag(C.AV_EF_CRCCHECK)
constant ErrorRecognitionFlagExplode (line 16) | ErrorRecognitionFlagExplode = ErrorRecognitionFlag(C.AV_EF_EXPLODE)
constant ErrorRecognitionFlagIgnoreErr (line 17) | ErrorRecognitionFlagIgnoreErr = ErrorRecognitionFlag(C.AV_EF_IGNORE_ERR)
FILE: error_test.go
type testError (line 11) | type testError struct
method Error (line 13) | func (err testError) Error() string { return "" }
function TestError (line 15) | func TestError(t *testing.T) {
FILE: examples/bit_stream_filtering/main.go
type stream (line 18) | type stream struct
function main (line 23) | func main() {
function filterBitStream (line 165) | func filterBitStream(pkt *astiav.Packet, s *stream) error {
FILE: examples/custom_io_demuxing/main.go
function main (line 18) | func main() {
FILE: examples/custom_io_muxing/main.go
function main (line 19) | func main() {
FILE: examples/demuxing_decoding/main.go
type stream (line 18) | type stream struct
function main (line 25) | func main() {
FILE: examples/filtering/main.go
type stream (line 24) | type stream struct
function main (line 37) | func main() {
function openInputFile (line 151) | func openInputFile() (err error) {
function initFilter (line 225) | func initFilter() (err error) {
function filterFrame (line 324) | func filterFrame(f *astiav.Frame, s *stream) (err error) {
FILE: examples/frame_data_manipulation/main.go
function main (line 12) | func main() {
FILE: examples/hardware_decoding_filtering/main.go
function main (line 37) | func main() {
function initFilter (line 281) | func initFilter() (err error) {
function filterFrame (line 392) | func filterFrame() (err error) {
function doSomethingWithHardwareFrame (line 429) | func doSomethingWithHardwareFrame(hardwareFrame *astiav.Frame) error {
FILE: examples/hardware_encoding/main.go
function main (line 24) | func main() {
FILE: examples/remuxing/main.go
function main (line 18) | func main() {
FILE: examples/resampling_audio/main.go
function main (line 27) | func main() {
function flushSoftwareResampleContext (line 255) | func flushSoftwareResampleContext(finalFlush bool) error {
function addResampledFrameToAudioFIFO (line 284) | func addResampledFrameToAudioFIFO(flush bool) error {
FILE: examples/scaling_video/main.go
function main (line 20) | func main() {
FILE: examples/transcoding/main.go
type stream (line 26) | type stream struct
function main (line 42) | func main() {
function openInputFile (line 181) | func openInputFile() (err error) {
function openOutputFile (line 256) | func openOutputFile() (err error) {
function initFilters (line 369) | func initFilters() (err error) {
function filterEncodeWriteFrame (line 489) | func filterEncodeWriteFrame(f *astiav.Frame, s *stream) (err error) {
function encodeWriteFrame (line 528) | func encodeWriteFrame(f *astiav.Frame, s *stream) (err error) {
FILE: filter.go
type Filter (line 10) | type Filter struct
method Flags (line 29) | func (f *Filter) Flags() FilterFlags {
method Name (line 34) | func (f *Filter) Name() string {
method Description (line 39) | func (f *Filter) Description() string {
method String (line 43) | func (f *Filter) String() string {
method NbInputs (line 48) | func (f *Filter) NbInputs() int {
method NbOutputs (line 53) | func (f *Filter) NbOutputs() int {
method Inputs (line 58) | func (f *Filter) Inputs() (ps []*FilterPad) {
method Outputs (line 66) | func (f *Filter) Outputs() (ps []*FilterPad) {
function newFilterFromC (line 14) | func newFilterFromC(c *C.AVFilter) *Filter {
function FindFilterByName (line 22) | func FindFilterByName(n string) *Filter {
FILE: filter_chain.go
type FilterChain (line 11) | type FilterChain struct
method Filters (line 23) | func (fc *FilterChain) Filters() (fs []*FilterParams) {
method NbFilters (line 32) | func (fc *FilterChain) NbFilters() int {
function newFilterChainFromC (line 15) | func newFilterChainFromC(c *C.AVFilterChain) *FilterChain {
FILE: filter_command_flag.go
type FilterCommandFlag (line 7) | type FilterCommandFlag
constant FilterCommandFlagOne (line 10) | FilterCommandFlagOne = FilterCommandFlag(C.AVFILTER_CMD_FLAG_ONE)
constant FilterCommandFlagFast (line 11) | FilterCommandFlagFast = FilterCommandFlag(C.AVFILTER_CMD_FLAG_FAST)
FILE: filter_context.go
type FilterContext (line 10) | type FilterContext struct
method Free (line 26) | func (fc *FilterContext) Free() {
method Class (line 42) | func (fc *FilterContext) Class() *Class {
method SetHardwareDeviceContext (line 50) | func (fc *FilterContext) SetHardwareDeviceContext(hdc *HardwareDeviceC...
method Filter (line 62) | func (fc *FilterContext) Filter() *Filter {
function newFilterContext (line 14) | func newFilterContext(c *C.AVFilterContext) *FilterContext {
FILE: filter_flag.go
type FilterFlag (line 7) | type FilterFlag
constant FilterFlagDynamicInputs (line 10) | FilterFlagDynamicInputs = FilterFlag(C.AVFILTER_FLAG_DYNAMIC_I...
constant FilterFlagDynamicOutputs (line 11) | FilterFlagDynamicOutputs = FilterFlag(C.AVFILTER_FLAG_DYNAMIC_O...
constant FilterFlagSliceThreads (line 12) | FilterFlagSliceThreads = FilterFlag(C.AVFILTER_FLAG_SLICE_THR...
constant FilterFlagMetadataOnly (line 13) | FilterFlagMetadataOnly = FilterFlag(C.AVFILTER_FLAG_METADATA_...
constant FilterFlagHardwareDevice (line 14) | FilterFlagHardwareDevice = FilterFlag(C.AVFILTER_FLAG_HWDEVICE)
constant FilterFlagSupportTimelineGeneric (line 15) | FilterFlagSupportTimelineGeneric = FilterFlag(C.AVFILTER_FLAG_SUPPORT_T...
constant FilterFlagSupportTimelineInternal (line 16) | FilterFlagSupportTimelineInternal = FilterFlag(C.AVFILTER_FLAG_SUPPORT_T...
constant FilterFlagSupportTimeline (line 17) | FilterFlagSupportTimeline = FilterFlag(C.AVFILTER_FLAG_SUPPORT_T...
FILE: filter_graph.go
type FilterGraph (line 12) | type FilterGraph struct
method Free (line 35) | func (g *FilterGraph) Free() {
method String (line 59) | func (g *FilterGraph) String() string {
method Class (line 64) | func (g *FilterGraph) Class() *Class {
method ThreadCount (line 72) | func (g *FilterGraph) ThreadCount() int {
method SetThreadCount (line 77) | func (g *FilterGraph) SetThreadCount(threadCount int) {
method ThreadType (line 82) | func (g *FilterGraph) ThreadType() ThreadType {
method SetThreadType (line 87) | func (g *FilterGraph) SetThreadType(t ThreadType) {
method NewBuffersinkFilterContext (line 92) | func (g *FilterGraph) NewBuffersinkFilterContext(f *Filter, name strin...
method NewBuffersrcFilterContext (line 105) | func (g *FilterGraph) NewBuffersrcFilterContext(f *Filter, name string...
method Parse (line 118) | func (g *FilterGraph) Parse(content string, inputs, outputs *FilterInO...
method ParseSegment (line 133) | func (g *FilterGraph) ParseSegment(content string) (*FilterGraphSegmen...
method Configure (line 144) | func (g *FilterGraph) Configure() error {
method SendCommand (line 149) | func (g *FilterGraph) SendCommand(target, cmd, args string, f FilterCo...
method NbFilters (line 163) | func (g *FilterGraph) NbFilters() int {
method Filters (line 168) | func (g *FilterGraph) Filters() (fs []*FilterContext) {
function newFilterGraphFromC (line 18) | func newFilterGraphFromC(c *C.AVFilterGraph) *FilterGraph {
function AllocFilterGraph (line 30) | func AllocFilterGraph() *FilterGraph {
FILE: filter_graph_segment.go
type FilterGraphSegment (line 11) | type FilterGraphSegment struct
method Free (line 23) | func (fgs *FilterGraphSegment) Free() {
method Chains (line 30) | func (fgs *FilterGraphSegment) Chains() (cs []*FilterChain) {
method NbChains (line 39) | func (fgs *FilterGraphSegment) NbChains() int {
function newFilterGraphSegmentFromC (line 15) | func newFilterGraphSegmentFromC(c *C.AVFilterGraphSegment) *FilterGraphS...
FILE: filter_graph_test.go
function TestFilterGraph (line 10) | func TestFilterGraph(t *testing.T) {
FILE: filter_in_out.go
type FilterInOut (line 8) | type FilterInOut struct
method Free (line 25) | func (i *FilterInOut) Free() {
method SetName (line 32) | func (i *FilterInOut) SetName(n string) {
method SetFilterContext (line 39) | func (i *FilterInOut) SetFilterContext(c *FilterContext) {
method SetPadIdx (line 44) | func (i *FilterInOut) SetPadIdx(idx int) {
method SetNext (line 49) | func (i *FilterInOut) SetNext(n *FilterInOut) {
function newFilterInOutFromC (line 12) | func newFilterInOutFromC(c *C.AVFilterInOut) *FilterInOut {
function AllocFilterInOut (line 20) | func AllocFilterInOut() *FilterInOut {
FILE: filter_pad.go
type FilterPad (line 4) | type FilterPad struct
method MediaType (line 12) | func (fp *FilterPad) MediaType() MediaType {
function newFilterPad (line 8) | func newFilterPad(mediaType MediaType) *FilterPad {
FILE: filter_params.go
type FilterParams (line 7) | type FilterParams struct
method FilterName (line 19) | func (fp *FilterParams) FilterName() string {
function newFilterParamsFromC (line 11) | func newFilterParamsFromC(c *C.AVFilterParams) *FilterParams {
FILE: filter_test.go
function TestFilter (line 9) | func TestFilter(t *testing.T) {
FILE: flags.go
type BuffersinkFlags (line 8) | type BuffersinkFlags
method Add (line 18) | func (fs BuffersinkFlags) Add(f BuffersinkFlag) BuffersinkFlags {
method Del (line 22) | func (fs BuffersinkFlags) Del(f BuffersinkFlag) BuffersinkFlags {
method Has (line 26) | func (fs BuffersinkFlags) Has(f BuffersinkFlag) bool { return astikit....
function NewBuffersinkFlags (line 10) | func NewBuffersinkFlags(fs ...BuffersinkFlag) BuffersinkFlags {
type BuffersrcFlags (line 28) | type BuffersrcFlags
method Add (line 38) | func (fs BuffersrcFlags) Add(f BuffersrcFlag) BuffersrcFlags {
method Del (line 42) | func (fs BuffersrcFlags) Del(f BuffersrcFlag) BuffersrcFlags {
method Has (line 46) | func (fs BuffersrcFlags) Has(f BuffersrcFlag) bool { return astikit.Bi...
function NewBuffersrcFlags (line 30) | func NewBuffersrcFlags(fs ...BuffersrcFlag) BuffersrcFlags {
type CodecContextFlags (line 48) | type CodecContextFlags
method Add (line 58) | func (fs CodecContextFlags) Add(f CodecContextFlag) CodecContextFlags {
method Del (line 62) | func (fs CodecContextFlags) Del(f CodecContextFlag) CodecContextFlags {
method Has (line 66) | func (fs CodecContextFlags) Has(f CodecContextFlag) bool { return asti...
function NewCodecContextFlags (line 50) | func NewCodecContextFlags(fs ...CodecContextFlag) CodecContextFlags {
type CodecContextFlags2 (line 68) | type CodecContextFlags2
method Add (line 78) | func (fs CodecContextFlags2) Add(f CodecContextFlag2) CodecContextFlag...
method Del (line 82) | func (fs CodecContextFlags2) Del(f CodecContextFlag2) CodecContextFlag...
method Has (line 86) | func (fs CodecContextFlags2) Has(f CodecContextFlag2) bool { return as...
function NewCodecContextFlags2 (line 70) | func NewCodecContextFlags2(fs ...CodecContextFlag2) CodecContextFlags2 {
type CodecHardwareConfigMethodFlags (line 88) | type CodecHardwareConfigMethodFlags
method Add (line 98) | func (fs CodecHardwareConfigMethodFlags) Add(f CodecHardwareConfigMeth...
method Del (line 102) | func (fs CodecHardwareConfigMethodFlags) Del(f CodecHardwareConfigMeth...
method Has (line 106) | func (fs CodecHardwareConfigMethodFlags) Has(f CodecHardwareConfigMeth...
function NewCodecHardwareConfigMethodFlags (line 90) | func NewCodecHardwareConfigMethodFlags(fs ...CodecHardwareConfigMethodFl...
type DictionaryFlags (line 108) | type DictionaryFlags
method Add (line 118) | func (fs DictionaryFlags) Add(f DictionaryFlag) DictionaryFlags {
method Del (line 122) | func (fs DictionaryFlags) Del(f DictionaryFlag) DictionaryFlags {
method Has (line 126) | func (fs DictionaryFlags) Has(f DictionaryFlag) bool { return astikit....
function NewDictionaryFlags (line 110) | func NewDictionaryFlags(fs ...DictionaryFlag) DictionaryFlags {
type DispositionFlags (line 128) | type DispositionFlags
method Add (line 138) | func (fs DispositionFlags) Add(f DispositionFlag) DispositionFlags {
method Del (line 142) | func (fs DispositionFlags) Del(f DispositionFlag) DispositionFlags {
method Has (line 146) | func (fs DispositionFlags) Has(f DispositionFlag) bool { return astiki...
function NewDispositionFlags (line 130) | func NewDispositionFlags(fs ...DispositionFlag) DispositionFlags {
type ErrorRecognitionFlags (line 148) | type ErrorRecognitionFlags
method Add (line 158) | func (fs ErrorRecognitionFlags) Add(f ErrorRecognitionFlag) ErrorRecog...
method Del (line 162) | func (fs ErrorRecognitionFlags) Del(f ErrorRecognitionFlag) ErrorRecog...
method Has (line 166) | func (fs ErrorRecognitionFlags) Has(f ErrorRecognitionFlag) bool { ret...
function NewErrorRecognitionFlags (line 150) | func NewErrorRecognitionFlags(fs ...ErrorRecognitionFlag) ErrorRecogniti...
type FilterFlags (line 168) | type FilterFlags
method Add (line 178) | func (fs FilterFlags) Add(f FilterFlag) FilterFlags {
method Del (line 182) | func (fs FilterFlags) Del(f FilterFlag) FilterFlags {
method Has (line 186) | func (fs FilterFlags) Has(f FilterFlag) bool { return astikit.BitFlags...
function NewFilterFlags (line 170) | func NewFilterFlags(fs ...FilterFlag) FilterFlags {
type FilterCommandFlags (line 188) | type FilterCommandFlags
method Add (line 198) | func (fs FilterCommandFlags) Add(f FilterCommandFlag) FilterCommandFla...
method Del (line 202) | func (fs FilterCommandFlags) Del(f FilterCommandFlag) FilterCommandFla...
method Has (line 206) | func (fs FilterCommandFlags) Has(f FilterCommandFlag) bool { return as...
function NewFilterCommandFlags (line 190) | func NewFilterCommandFlags(fs ...FilterCommandFlag) FilterCommandFlags {
type FormatContextFlags (line 208) | type FormatContextFlags
method Add (line 218) | func (fs FormatContextFlags) Add(f FormatContextFlag) FormatContextFla...
method Del (line 222) | func (fs FormatContextFlags) Del(f FormatContextFlag) FormatContextFla...
method Has (line 226) | func (fs FormatContextFlags) Has(f FormatContextFlag) bool { return as...
function NewFormatContextFlags (line 210) | func NewFormatContextFlags(fs ...FormatContextFlag) FormatContextFlags {
type FormatContextCtxFlags (line 228) | type FormatContextCtxFlags
method Add (line 238) | func (fs FormatContextCtxFlags) Add(f FormatContextCtxFlag) FormatCont...
method Del (line 242) | func (fs FormatContextCtxFlags) Del(f FormatContextCtxFlag) FormatCont...
method Has (line 246) | func (fs FormatContextCtxFlags) Has(f FormatContextCtxFlag) bool { ret...
function NewFormatContextCtxFlags (line 230) | func NewFormatContextCtxFlags(fs ...FormatContextCtxFlag) FormatContextC...
type FormatEventFlags (line 248) | type FormatEventFlags
method Add (line 258) | func (fs FormatEventFlags) Add(f FormatEventFlag) FormatEventFlags {
method Del (line 262) | func (fs FormatEventFlags) Del(f FormatEventFlag) FormatEventFlags {
method Has (line 266) | func (fs FormatEventFlags) Has(f FormatEventFlag) bool { return astiki...
function NewFormatEventFlags (line 250) | func NewFormatEventFlags(fs ...FormatEventFlag) FormatEventFlags {
type FrameFlags (line 268) | type FrameFlags
method Add (line 278) | func (fs FrameFlags) Add(f FrameFlag) FrameFlags {
method Del (line 282) | func (fs FrameFlags) Del(f FrameFlag) FrameFlags {
method Has (line 286) | func (fs FrameFlags) Has(f FrameFlag) bool { return astikit.BitFlags(f...
function NewFrameFlags (line 270) | func NewFrameFlags(fs ...FrameFlag) FrameFlags {
type IOContextFlags (line 288) | type IOContextFlags
method Add (line 298) | func (fs IOContextFlags) Add(f IOContextFlag) IOContextFlags {
method Del (line 302) | func (fs IOContextFlags) Del(f IOContextFlag) IOContextFlags {
method Has (line 306) | func (fs IOContextFlags) Has(f IOContextFlag) bool { return astikit.Bi...
function NewIOContextFlags (line 290) | func NewIOContextFlags(fs ...IOContextFlag) IOContextFlags {
type IOFormatFlags (line 308) | type IOFormatFlags
method Add (line 318) | func (fs IOFormatFlags) Add(f IOFormatFlag) IOFormatFlags {
method Del (line 322) | func (fs IOFormatFlags) Del(f IOFormatFlag) IOFormatFlags {
method Has (line 326) | func (fs IOFormatFlags) Has(f IOFormatFlag) bool { return astikit.BitF...
function NewIOFormatFlags (line 310) | func NewIOFormatFlags(fs ...IOFormatFlag) IOFormatFlags {
type OptionSearchFlags (line 328) | type OptionSearchFlags
method Add (line 338) | func (fs OptionSearchFlags) Add(f OptionSearchFlag) OptionSearchFlags {
method Del (line 342) | func (fs OptionSearchFlags) Del(f OptionSearchFlag) OptionSearchFlags {
method Has (line 346) | func (fs OptionSearchFlags) Has(f OptionSearchFlag) bool { return asti...
function NewOptionSearchFlags (line 330) | func NewOptionSearchFlags(fs ...OptionSearchFlag) OptionSearchFlags {
type PacketFlags (line 348) | type PacketFlags
method Add (line 358) | func (fs PacketFlags) Add(f PacketFlag) PacketFlags {
method Del (line 362) | func (fs PacketFlags) Del(f PacketFlag) PacketFlags {
method Has (line 366) | func (fs PacketFlags) Has(f PacketFlag) bool { return astikit.BitFlags...
function NewPacketFlags (line 350) | func NewPacketFlags(fs ...PacketFlag) PacketFlags {
type PixelFormatDescriptorFlags (line 368) | type PixelFormatDescriptorFlags
method Add (line 378) | func (fs PixelFormatDescriptorFlags) Add(f PixelFormatDescriptorFlag) ...
method Del (line 382) | func (fs PixelFormatDescriptorFlags) Del(f PixelFormatDescriptorFlag) ...
method Has (line 386) | func (fs PixelFormatDescriptorFlags) Has(f PixelFormatDescriptorFlag) ...
function NewPixelFormatDescriptorFlags (line 370) | func NewPixelFormatDescriptorFlags(fs ...PixelFormatDescriptorFlag) Pixe...
type SeekFlags (line 388) | type SeekFlags
method Add (line 398) | func (fs SeekFlags) Add(f SeekFlag) SeekFlags {
method Del (line 402) | func (fs SeekFlags) Del(f SeekFlag) SeekFlags {
method Has (line 406) | func (fs SeekFlags) Has(f SeekFlag) bool { return astikit.BitFlags(fs)...
function NewSeekFlags (line 390) | func NewSeekFlags(fs ...SeekFlag) SeekFlags {
type SoftwareScaleContextFlags (line 408) | type SoftwareScaleContextFlags
method Add (line 418) | func (fs SoftwareScaleContextFlags) Add(f SoftwareScaleContextFlag) So...
method Del (line 422) | func (fs SoftwareScaleContextFlags) Del(f SoftwareScaleContextFlag) So...
method Has (line 426) | func (fs SoftwareScaleContextFlags) Has(f SoftwareScaleContextFlag) bo...
function NewSoftwareScaleContextFlags (line 410) | func NewSoftwareScaleContextFlags(fs ...SoftwareScaleContextFlag) Softwa...
type StreamEventFlags (line 428) | type StreamEventFlags
method Add (line 438) | func (fs StreamEventFlags) Add(f StreamEventFlag) StreamEventFlags {
method Del (line 442) | func (fs StreamEventFlags) Del(f StreamEventFlag) StreamEventFlags {
method Has (line 446) | func (fs StreamEventFlags) Has(f StreamEventFlag) bool { return astiki...
function NewStreamEventFlags (line 430) | func NewStreamEventFlags(fs ...StreamEventFlag) StreamEventFlags {
FILE: flags_test.go
function TestBuffersinkFlags (line 10) | func TestBuffersinkFlags(t *testing.T) {
function TestBuffersrcFlags (line 19) | func TestBuffersrcFlags(t *testing.T) {
function TestCodecContextFlags (line 28) | func TestCodecContextFlags(t *testing.T) {
function TestCodecContextFlags2 (line 37) | func TestCodecContextFlags2(t *testing.T) {
function TestCodecHardwareConfigMethodFlags (line 46) | func TestCodecHardwareConfigMethodFlags(t *testing.T) {
function TestDictionaryFlags (line 55) | func TestDictionaryFlags(t *testing.T) {
function TestDispositionFlags (line 64) | func TestDispositionFlags(t *testing.T) {
function TestErrorRecognitionFlags (line 73) | func TestErrorRecognitionFlags(t *testing.T) {
function TestFilterFlags (line 82) | func TestFilterFlags(t *testing.T) {
function TestFilterCommandFlags (line 91) | func TestFilterCommandFlags(t *testing.T) {
function TestFormatContextFlags (line 100) | func TestFormatContextFlags(t *testing.T) {
function TestFormatContextCtxFlags (line 109) | func TestFormatContextCtxFlags(t *testing.T) {
function TestFormatEventFlags (line 118) | func TestFormatEventFlags(t *testing.T) {
function TestFrameFlags (line 127) | func TestFrameFlags(t *testing.T) {
function TestIOContextFlags (line 136) | func TestIOContextFlags(t *testing.T) {
function TestIOFormatFlags (line 145) | func TestIOFormatFlags(t *testing.T) {
function TestOptionSearchFlags (line 154) | func TestOptionSearchFlags(t *testing.T) {
function TestPacketFlags (line 163) | func TestPacketFlags(t *testing.T) {
function TestPixelFormatDescriptorFlags (line 172) | func TestPixelFormatDescriptorFlags(t *testing.T) {
function TestSeekFlags (line 181) | func TestSeekFlags(t *testing.T) {
function TestSoftwareScaleContextFlags (line 190) | func TestSoftwareScaleContextFlags(t *testing.T) {
function TestStreamEventFlags (line 199) | func TestStreamEventFlags(t *testing.T) {
FILE: format_context.go
type FormatContext (line 13) | type FormatContext struct
method Free (line 57) | func (fc *FormatContext) Free() {
method BitRate (line 73) | func (fc *FormatContext) BitRate() int64 {
method Class (line 78) | func (fc *FormatContext) Class() *Class {
method CtxFlags (line 86) | func (fc *FormatContext) CtxFlags() FormatContextCtxFlags {
method Duration (line 91) | func (fc *FormatContext) Duration() int64 {
method EventFlags (line 96) | func (fc *FormatContext) EventFlags() FormatEventFlags {
method Flags (line 101) | func (fc *FormatContext) Flags() FormatContextFlags {
method SetFlags (line 106) | func (fc *FormatContext) SetFlags(f FormatContextFlags) {
method SetIOInterrupter (line 111) | func (fc *FormatContext) SetIOInterrupter(i *IOInterrupter) {
method InputFormat (line 120) | func (fc *FormatContext) InputFormat() *InputFormat {
method IOFlags (line 125) | func (fc *FormatContext) IOFlags() IOContextFlags {
method MaxAnalyzeDuration (line 130) | func (fc *FormatContext) MaxAnalyzeDuration() int64 {
method Metadata (line 135) | func (fc *FormatContext) Metadata() *Dictionary {
method SetMetadata (line 140) | func (fc *FormatContext) SetMetadata(d *Dictionary) {
method NbPrograms (line 149) | func (fc *FormatContext) NbPrograms() int {
method Programs (line 154) | func (fc *FormatContext) Programs() (ps []*Program) {
method NbStreams (line 163) | func (fc *FormatContext) NbStreams() int {
method Streams (line 167) | func (fc *FormatContext) Streams() (ss []*Stream) {
method OutputFormat (line 176) | func (fc *FormatContext) OutputFormat() *OutputFormat {
method Pb (line 181) | func (fc *FormatContext) Pb() *IOContext {
method SetPb (line 193) | func (fc *FormatContext) SetPb(i *IOContext) {
method PrivateData (line 198) | func (fc *FormatContext) PrivateData() *PrivateData {
method StartTime (line 203) | func (fc *FormatContext) StartTime() int64 {
method StrictStdCompliance (line 208) | func (fc *FormatContext) StrictStdCompliance() StrictStdCompliance {
method SetStrictStdCompliance (line 213) | func (fc *FormatContext) SetStrictStdCompliance(strictStdCompliance St...
method OpenInput (line 218) | func (fc *FormatContext) OpenInput(url string, fmt *InputFormat, d *Di...
method CloseInput (line 242) | func (fc *FormatContext) CloseInput() {
method NewProgram (line 264) | func (fc *FormatContext) NewProgram(id int) *Program {
method NewStream (line 269) | func (fc *FormatContext) NewStream(c *Codec) *Stream {
method FindStreamInfo (line 278) | func (fc *FormatContext) FindStreamInfo(d *Dictionary) error {
method ReadFrame (line 287) | func (fc *FormatContext) ReadFrame(p *Packet) error {
method SeekFrame (line 296) | func (fc *FormatContext) SeekFrame(streamIndex int, timestamp int64, f...
method Flush (line 301) | func (fc *FormatContext) Flush() error {
method WriteHeader (line 306) | func (fc *FormatContext) WriteHeader(d *Dictionary) error {
method WriteFrame (line 315) | func (fc *FormatContext) WriteFrame(p *Packet) error {
method WriteInterleavedFrame (line 324) | func (fc *FormatContext) WriteInterleavedFrame(p *Packet) error {
method WriteTrailer (line 333) | func (fc *FormatContext) WriteTrailer() error {
method GuessSampleAspectRatio (line 338) | func (fc *FormatContext) GuessSampleAspectRatio(s *Stream, f *Frame) R...
method GuessFrameRate (line 347) | func (fc *FormatContext) GuessFrameRate(s *Stream, f *Frame) Rational {
method SDPCreate (line 356) | func (fc *FormatContext) SDPCreate() (string, error) {
method FindBestStream (line 364) | func (fc *FormatContext) FindBestStream(mt MediaType, wantedStreamInde...
method Dump (line 382) | func (fc *FormatContext) Dump(streamIndex int, url string, isOutput bo...
function newFormatContextFromC (line 17) | func newFormatContextFromC(c *C.AVFormatContext) *FormatContext {
function AllocFormatContext (line 29) | func AllocFormatContext() *FormatContext {
function AllocOutputFormatContext (line 34) | func AllocOutputFormatContext(of *OutputFormat, formatName, filename str...
FILE: format_context_ctx_flag.go
type FormatContextCtxFlag (line 7) | type FormatContextCtxFlag
constant FormatContextCtxFlagNoHeader (line 10) | FormatContextCtxFlagNoHeader = FormatContextCtxFlag(C.AVFMTCTX_NOHEADER)
constant FormatContextCtxFlagUnseekable (line 11) | FormatContextCtxFlagUnseekable = FormatContextCtxFlag(C.AVFMTCTX_UNSEEKA...
FILE: format_context_flag.go
type FormatContextFlag (line 7) | type FormatContextFlag
constant FormatContextFlagAutoBsf (line 10) | FormatContextFlagAutoBsf = FormatContextFlag(C.AVFMT_FLAG_AUTO_BSF)
constant FormatContextFlagBitexact (line 11) | FormatContextFlagBitexact = FormatContextFlag(C.AVFMT_FLAG_BITEXACT)
constant FormatContextFlagCustomIo (line 12) | FormatContextFlagCustomIo = FormatContextFlag(C.AVFMT_FLAG_CUSTOM_IO)
constant FormatContextFlagDiscardCorrupt (line 13) | FormatContextFlagDiscardCorrupt = FormatContextFlag(C.AVFMT_FLAG_DISCARD...
constant FormatContextFlagFastSeek (line 14) | FormatContextFlagFastSeek = FormatContextFlag(C.AVFMT_FLAG_FAST_SEEK)
constant FormatContextFlagFlushPackets (line 15) | FormatContextFlagFlushPackets = FormatContextFlag(C.AVFMT_FLAG_FLUSH_P...
constant FormatContextFlagGenPts (line 16) | FormatContextFlagGenPts = FormatContextFlag(C.AVFMT_FLAG_GENPTS)
constant FormatContextFlagIgnDts (line 17) | FormatContextFlagIgnDts = FormatContextFlag(C.AVFMT_FLAG_IGNDTS)
constant FormatContextFlagIgnidx (line 18) | FormatContextFlagIgnidx = FormatContextFlag(C.AVFMT_FLAG_IGNIDX)
constant FormatContextFlagNobuffer (line 19) | FormatContextFlagNobuffer = FormatContextFlag(C.AVFMT_FLAG_NOBUFFER)
constant FormatContextFlagNofillin (line 20) | FormatContextFlagNofillin = FormatContextFlag(C.AVFMT_FLAG_NOFILLIN)
constant FormatContextFlagNonblock (line 21) | FormatContextFlagNonblock = FormatContextFlag(C.AVFMT_FLAG_NONBLOCK)
constant FormatContextFlagNoparse (line 22) | FormatContextFlagNoparse = FormatContextFlag(C.AVFMT_FLAG_NOPARSE)
constant FormatContextFlagSortDts (line 23) | FormatContextFlagSortDts = FormatContextFlag(C.AVFMT_FLAG_SORT_DTS)
FILE: format_context_test.go
function TestFormatContext (line 10) | func TestFormatContext(t *testing.T) {
FILE: format_event_flag.go
type FormatEventFlag (line 7) | type FormatEventFlag
constant FormatEventFlagMetadataUpdated (line 10) | FormatEventFlagMetadataUpdated = FormatEventFlag(C.AVFMT_EVENT_FLAG_META...
FILE: frame.c
function astiavSamplesCopyToBuffer (line 7) | int astiavSamplesCopyToBuffer(uint8_t* dst, int dst_size, const uint8_t ...
FILE: frame.go
constant NumDataPointers (line 15) | NumDataPointers = uint(C.AV_NUM_DATA_POINTERS)
type Frame (line 18) | type Frame struct
method AllocBuffer (line 35) | func (f *Frame) AllocBuffer(align int) error {
method AllocHardwareBuffer (line 40) | func (f *Frame) AllocHardwareBuffer(hfc *HardwareFramesContext) error {
method ChannelLayout (line 45) | func (f *Frame) ChannelLayout() ChannelLayout {
method SetChannelLayout (line 51) | func (f *Frame) SetChannelLayout(l ChannelLayout) {
method ColorRange (line 56) | func (f *Frame) ColorRange() ColorRange {
method SetColorRange (line 61) | func (f *Frame) SetColorRange(r ColorRange) {
method ColorSpace (line 66) | func (f *Frame) ColorSpace() ColorSpace {
method SetColorSpace (line 71) | func (f *Frame) SetColorSpace(s ColorSpace) {
method Data (line 76) | func (f *Frame) Data() *FrameData {
method HardwareFramesContext (line 81) | func (f *Frame) HardwareFramesContext() *HardwareFramesContext {
method Height (line 86) | func (f *Frame) Height() int {
method SetHeight (line 91) | func (f *Frame) SetHeight(h int) {
method Flags (line 96) | func (f *Frame) Flags() FrameFlags {
method SetFlags (line 101) | func (f *Frame) SetFlags(fs FrameFlags) {
method ImageBufferSize (line 106) | func (f *Frame) ImageBufferSize(align int) (int, error) {
method ImageCopyToBuffer (line 115) | func (f *Frame) ImageCopyToBuffer(b []byte, align int) (int, error) {
method ImageFillBlack (line 124) | func (f *Frame) ImageFillBlack() error {
method SamplesBufferSize (line 133) | func (f *Frame) SamplesBufferSize(align int) (int, error) {
method SamplesCopyToBuffer (line 141) | func (f *Frame) SamplesCopyToBuffer(b []byte, align int) (int, error) {
method SamplesFillSilence (line 150) | func (f *Frame) SamplesFillSilence() error {
method Linesize (line 155) | func (f *Frame) Linesize() [NumDataPointers]int {
method NbSamples (line 164) | func (f *Frame) NbSamples() int {
method SetNbSamples (line 169) | func (f *Frame) SetNbSamples(n int) {
method PictureType (line 174) | func (f *Frame) PictureType() PictureType {
method SetPictureType (line 179) | func (f *Frame) SetPictureType(t PictureType) {
method PixelFormat (line 184) | func (f *Frame) PixelFormat() PixelFormat {
method SetPixelFormat (line 189) | func (f *Frame) SetPixelFormat(pf PixelFormat) {
method PktDts (line 194) | func (f *Frame) PktDts() int64 {
method Pts (line 199) | func (f *Frame) Pts() int64 {
method SetPts (line 204) | func (f *Frame) SetPts(i int64) {
method SampleAspectRatio (line 209) | func (f *Frame) SampleAspectRatio() Rational {
method SetSampleAspectRatio (line 214) | func (f *Frame) SetSampleAspectRatio(r Rational) {
method SampleFormat (line 219) | func (f *Frame) SampleFormat() SampleFormat {
method SetSampleFormat (line 224) | func (f *Frame) SetSampleFormat(sf SampleFormat) {
method SampleRate (line 229) | func (f *Frame) SampleRate() int {
method SetSampleRate (line 234) | func (f *Frame) SetSampleRate(r int) {
method SideData (line 239) | func (f *Frame) SideData() *FrameSideData {
method Metadata (line 244) | func (f *Frame) Metadata() *Dictionary {
method SetMetadata (line 249) | func (f *Frame) SetMetadata(d *Dictionary) {
method Width (line 258) | func (f *Frame) Width() int {
method SetWidth (line 263) | func (f *Frame) SetWidth(w int) {
method TransferHardwareData (line 268) | func (f *Frame) TransferHardwareData(dst *Frame) error {
method Free (line 273) | func (f *Frame) Free() {
method Ref (line 280) | func (f *Frame) Ref(src *Frame) error {
method Clone (line 285) | func (f *Frame) Clone() *Frame {
method Unref (line 290) | func (f *Frame) Unref() {
method MoveRef (line 295) | func (f *Frame) MoveRef(src *Frame) {
method UnsafePointer (line 299) | func (f *Frame) UnsafePointer() unsafe.Pointer {
method IsWritable (line 304) | func (f *Frame) IsWritable() bool {
method MakeWritable (line 309) | func (f *Frame) MakeWritable() error {
method Copy (line 314) | func (f *Frame) Copy(dst *Frame) error {
function newFrameFromC (line 22) | func newFrameFromC(c *C.AVFrame) *Frame {
function AllocFrame (line 30) | func AllocFrame() *Frame {
FILE: frame.h
type AVSampleFormat (line 4) | enum AVSampleFormat
FILE: frame_data.go
type FrameData (line 16) | type FrameData struct
method Bytes (line 38) | func (d *FrameData) Bytes(align int) ([]byte, error) {
method SetBytes (line 43) | func (d *FrameData) SetBytes(b []byte, align int) error {
method GuessImageFormat (line 59) | func (d *FrameData) GuessImageFormat() (image.Image, error) {
method imageYCbCrSubsampleRatio (line 86) | func (d *FrameData) imageYCbCrSubsampleRatio() image.YCbCrSubsampleRat...
method toImagePix (line 103) | func (d *FrameData) toImagePix(pix *[]uint8, stride *int, rect *image....
method toImageYCbCr (line 113) | func (d *FrameData) toImageYCbCr(y, cb, cr *[]uint8, yStride, cStride ...
method toImageYCbCrA (line 131) | func (d *FrameData) toImageYCbCrA(y, cb, cr, a *[]uint8, yStride, cStr...
method ToImage (line 139) | func (d *FrameData) ToImage(dst image.Image) error {
method fromImagePix (line 184) | func (d *FrameData) fromImagePix(pix []uint8, stride int) error {
method fromImageYCbCr (line 192) | func (d *FrameData) fromImageYCbCr(y, cb, cr []uint8, yStride, cStride...
method fromImageYCbCrA (line 204) | func (d *FrameData) fromImageYCbCrA(y, cb, cr, a []uint8, yStride, cSt...
method FromImage (line 218) | func (d *FrameData) FromImage(src image.Image) error {
type frameDataFramer (line 20) | type frameDataFramer interface
type frameDataPlane (line 29) | type frameDataPlane struct
function newFrameData (line 34) | func newFrameData(f frameDataFramer) *FrameData {
type frameDataFrame (line 249) | type frameDataFrame struct
method bytes (line 257) | func (f *frameDataFrame) bytes(align int) ([]byte, error) {
method copyPlanes (line 293) | func (f *frameDataFrame) copyPlanes(ps []frameDataPlane) error {
method height (line 325) | func (f *frameDataFrame) height() int {
method mediaType (line 329) | func (f *frameDataFrame) mediaType() MediaType {
method pixelFormat (line 342) | func (f *frameDataFrame) pixelFormat() PixelFormat {
method planes (line 346) | func (f *frameDataFrame) planes(b []byte, align int) ([]frameDataPlane...
method width (line 416) | func (f *frameDataFrame) width() int {
function newFrameDataFrame (line 253) | func newFrameDataFrame(f *Frame) *frameDataFrame {
FILE: frame_data_test.go
type mockedFrameDataFrame (line 12) | type mockedFrameDataFrame struct
method bytes (line 23) | func (f *mockedFrameDataFrame) bytes(align int) ([]byte, error) {
method copyPlanes (line 27) | func (f *mockedFrameDataFrame) copyPlanes(ps []frameDataPlane) error {
method height (line 32) | func (f *mockedFrameDataFrame) height() int {
method pixelFormat (line 36) | func (f *mockedFrameDataFrame) pixelFormat() PixelFormat {
method planes (line 40) | func (f *mockedFrameDataFrame) planes(b []byte, align int) ([]frameDat...
method width (line 44) | func (f *mockedFrameDataFrame) width() int {
function TestFrameDataInternal (line 48) | func TestFrameDataInternal(t *testing.T) {
function TestFrameData (line 465) | func TestFrameData(t *testing.T) {
FILE: frame_flag.go
type FrameFlag (line 7) | type FrameFlag
constant FrameFlagCorrupt (line 10) | FrameFlagCorrupt = FrameFlag(C.AV_FRAME_FLAG_CORRUPT)
constant FrameFlagDiscard (line 11) | FrameFlagDiscard = FrameFlag(C.AV_FRAME_FLAG_DISCARD)
constant FrameFlagInterlaced (line 12) | FrameFlagInterlaced = FrameFlag(C.AV_FRAME_FLAG_INTERLACED)
constant FrameFlagKey (line 13) | FrameFlagKey = FrameFlag(C.AV_FRAME_FLAG_KEY)
constant FrameFlagLossless (line 14) | FrameFlagLossless = FrameFlag(C.AV_FRAME_FLAG_LOSSLESS)
constant FrameFlagTopFieldFirst (line 15) | FrameFlagTopFieldFirst = FrameFlag(C.AV_FRAME_FLAG_TOP_FIELD_FIRST)
FILE: frame_side_data.c
function AVRegionOfInterest (line 3) | AVRegionOfInterest* astiavConvertRegionsOfInterestFrameSideData(AVFrameS...
FILE: frame_side_data.go
type FrameSideData (line 14) | type FrameSideData struct
method RegionsOfInterest (line 27) | func (d *FrameSideData) RegionsOfInterest() *frameSideDataRegionsOfInt...
function newFrameSideDataFromC (line 19) | func newFrameSideDataFromC(sd ***C.AVFrameSideData, size *C.int) *FrameS...
type frameSideDataRegionsOfInterest (line 31) | type frameSideDataRegionsOfInterest struct
method data (line 39) | func (d *frameSideDataRegionsOfInterest) data(sd *C.AVFrameSideData) *...
method Add (line 43) | func (d *frameSideDataRegionsOfInterest) Add(rois []RegionOfInterest) ...
method Get (line 61) | func (d *frameSideDataRegionsOfInterest) Get() ([]RegionOfInterest, bo...
function newFrameSideDataRegionsOfInterest (line 35) | func newFrameSideDataRegionsOfInterest(d *FrameSideData) *frameSideDataR...
FILE: frame_side_data_test.go
function testFrameSideData (line 9) | func testFrameSideData(sd *FrameSideData, t *testing.T) {
function TestFrameSideData (line 32) | func TestFrameSideData(t *testing.T) {
FILE: frame_test.go
function TestFrame (line 10) | func TestFrame(t *testing.T) {
FILE: hardware_device_context.go
type HardwareDeviceContext (line 11) | type HardwareDeviceContext struct
method HardwareFramesConstraints (line 34) | func (hdc *HardwareDeviceContext) HardwareFramesConstraints() *Hardwar...
method Free (line 38) | func (hdc *HardwareDeviceContext) Free() {
function CreateHardwareDeviceContext (line 16) | func CreateHardwareDeviceContext(t HardwareDeviceType, device string, op...
FILE: hardware_device_type.go
type HardwareDeviceType (line 10) | type HardwareDeviceType
method Name (line 28) | func (t HardwareDeviceType) Name() string {
method String (line 32) | func (t HardwareDeviceType) String() string {
constant HardwareDeviceTypeCUDA (line 13) | HardwareDeviceTypeCUDA = HardwareDeviceType(C.AV_HWDEVICE_TYPE_C...
constant HardwareDeviceTypeD3D11VA (line 14) | HardwareDeviceTypeD3D11VA = HardwareDeviceType(C.AV_HWDEVICE_TYPE_D...
constant HardwareDeviceTypeDRM (line 15) | HardwareDeviceTypeDRM = HardwareDeviceType(C.AV_HWDEVICE_TYPE_DRM)
constant HardwareDeviceTypeDXVA2 (line 16) | HardwareDeviceTypeDXVA2 = HardwareDeviceType(C.AV_HWDEVICE_TYPE_D...
constant HardwareDeviceTypeMediaCodec (line 17) | HardwareDeviceTypeMediaCodec = HardwareDeviceType(C.AV_HWDEVICE_TYPE_M...
constant HardwareDeviceTypeNone (line 18) | HardwareDeviceTypeNone = HardwareDeviceType(C.AV_HWDEVICE_TYPE_N...
constant HardwareDeviceTypeOpenCL (line 19) | HardwareDeviceTypeOpenCL = HardwareDeviceType(C.AV_HWDEVICE_TYPE_O...
constant HardwareDeviceTypeQSV (line 20) | HardwareDeviceTypeQSV = HardwareDeviceType(C.AV_HWDEVICE_TYPE_QSV)
constant HardwareDeviceTypeVAAPI (line 21) | HardwareDeviceTypeVAAPI = HardwareDeviceType(C.AV_HWDEVICE_TYPE_V...
constant HardwareDeviceTypeVDPAU (line 22) | HardwareDeviceTypeVDPAU = HardwareDeviceType(C.AV_HWDEVICE_TYPE_V...
constant HardwareDeviceTypeVideoToolbox (line 23) | HardwareDeviceTypeVideoToolbox = HardwareDeviceType(C.AV_HWDEVICE_TYPE_V...
constant HardwareDeviceTypeVulkan (line 24) | HardwareDeviceTypeVulkan = HardwareDeviceType(C.AV_HWDEVICE_TYPE_V...
function FindHardwareDeviceTypeByName (line 37) | func FindHardwareDeviceTypeByName(n string) HardwareDeviceType {
FILE: hardware_device_type_test.go
function TestHardwareDeviceType (line 9) | func TestHardwareDeviceType(t *testing.T) {
FILE: hardware_frames_constraints.go
type HardwareFramesConstraints (line 8) | type HardwareFramesConstraints struct
method pixelFormats (line 19) | func (hfc *HardwareFramesConstraints) pixelFormats(formats *C.enum_AVP...
method ValidHardwarePixelFormats (line 35) | func (hfc *HardwareFramesConstraints) ValidHardwarePixelFormats() (o [...
method ValidSoftwarePixelFormats (line 40) | func (hfc *HardwareFramesConstraints) ValidSoftwarePixelFormats() (o [...
method MinWidth (line 45) | func (hfc *HardwareFramesConstraints) MinWidth() int {
method MinHeight (line 50) | func (hfc *HardwareFramesConstraints) MinHeight() int {
method MaxWidth (line 55) | func (hfc *HardwareFramesConstraints) MaxWidth() int {
method MaxHeight (line 60) | func (hfc *HardwareFramesConstraints) MaxHeight() int {
method Free (line 65) | func (hfc *HardwareFramesConstraints) Free() {
function newHardwareFramesConstraintsFromC (line 12) | func newHardwareFramesConstraintsFromC(c *C.AVHWFramesConstraints) *Hard...
FILE: hardware_frames_context.go
type HardwareFramesContext (line 10) | type HardwareFramesContext struct
method Free (line 26) | func (hfc *HardwareFramesContext) Free() {
method data (line 32) | func (hfc *HardwareFramesContext) data() *C.AVHWFramesContext {
method SetWidth (line 37) | func (hfc *HardwareFramesContext) SetWidth(width int) {
method SetHeight (line 42) | func (hfc *HardwareFramesContext) SetHeight(height int) {
method SetHardwarePixelFormat (line 47) | func (hfc *HardwareFramesContext) SetHardwarePixelFormat(format PixelF...
method SetSoftwarePixelFormat (line 52) | func (hfc *HardwareFramesContext) SetSoftwarePixelFormat(swFormat Pixe...
method SetInitialPoolSize (line 57) | func (hfc *HardwareFramesContext) SetInitialPoolSize(initialPoolSize i...
method Initialize (line 62) | func (hfc *HardwareFramesContext) Initialize() error {
function newHardwareFramesContextFromC (line 14) | func newHardwareFramesContextFromC(c *C.struct_AVBufferRef) *HardwareFra...
function AllocHardwareFramesContext (line 22) | func AllocHardwareFramesContext(hdc *HardwareDeviceContext) *HardwareFra...
FILE: input_format.go
type InputFormat (line 8) | type InputFormat struct
method Flags (line 27) | func (f *InputFormat) Flags() IOFormatFlags {
method Name (line 32) | func (f *InputFormat) Name() string {
method LongName (line 37) | func (f *InputFormat) LongName() string {
method String (line 41) | func (f *InputFormat) String() string {
function newInputFormatFromC (line 12) | func newInputFormatFromC(c *C.AVInputFormat) *InputFormat {
function FindInputFormat (line 20) | func FindInputFormat(name string) *InputFormat {
FILE: input_format_test.go
function TestInputFormat (line 9) | func TestInputFormat(t *testing.T) {
FILE: internal/cmd/flags/main.go
type listItem (line 11) | type listItem struct
function main (line 88) | func main() {
FILE: io_context.c
function astiavIOContextReadFunc (line 4) | int astiavIOContextReadFunc(void *opaque, uint8_t *buf, int buf_size)
function astiavIOContextSeekFunc (line 9) | int64_t astiavIOContextSeekFunc(void *opaque, int64_t offset, int whence)
function astiavIOContextWriteFunc (line 14) | int astiavIOContextWriteFunc(void *opaque, uint8_t *buf, int buf_size)
FILE: io_context.go
type IOContext (line 15) | type IOContext struct
method Class (line 130) | func (ic *IOContext) Class() *Class {
method Close (line 138) | func (ic *IOContext) Close() error {
method Free (line 157) | func (ic *IOContext) Free() {
method Read (line 181) | func (ic *IOContext) Read(b []byte) (n int, err error) {
method Seek (line 211) | func (ic *IOContext) Seek(offset int64, whence int) (int64, error) {
method Write (line 220) | func (ic *IOContext) Write(b []byte) {
method Flush (line 231) | func (ic *IOContext) Flush() {
function newIOContextFromC (line 20) | func newIOContextFromC(c *C.AVIOContext) *IOContext {
type IOContextReadFunc (line 31) | type IOContextReadFunc
type IOContextSeekFunc (line 33) | type IOContextSeekFunc
type IOContextWriteFunc (line 35) | type IOContextWriteFunc
function AllocIOContext (line 38) | func AllocIOContext(bufferSize int, writable bool, readFunc IOContextRea...
function OpenIOContext (line 112) | func OpenIOContext(filename string, flags IOContextFlags, ii *IOInterrup...
type ioContextHandler (line 235) | type ioContextHandler struct
type ioContextHandlerPool (line 243) | type ioContextHandlerPool struct
method set (line 252) | func (p *ioContextHandlerPool) set(id unsafe.Pointer, h *ioContextHand...
method get (line 258) | func (p *ioContextHandlerPool) get(id unsafe.Pointer) (h *ioContextHan...
method del (line 265) | func (p *ioContextHandlerPool) del(id unsafe.Pointer) {
function newIOContextHandlerPool (line 248) | func newIOContextHandlerPool() *ioContextHandlerPool {
function goAstiavIOContextReadFunc (line 272) | func goAstiavIOContextReadFunc(opaque unsafe.Pointer, buf *C.uint8_t, bu...
function goAstiavIOContextSeekFunc (line 300) | func goAstiavIOContextSeekFunc(opaque unsafe.Pointer, offset C.int64_t, ...
function goAstiavIOContextWriteFunc (line 320) | func goAstiavIOContextWriteFunc(opaque unsafe.Pointer, buf *C.uint8_t, b...
FILE: io_context_flag.go
type IOContextFlag (line 7) | type IOContextFlag
constant IOContextFlagRead (line 10) | IOContextFlagRead = IOContextFlag(C.AVIO_FLAG_READ)
constant IOContextFlagWrite (line 11) | IOContextFlagWrite = IOContextFlag(C.AVIO_FLAG_WRITE)
constant IOContextFlagReadWrite (line 12) | IOContextFlagReadWrite = IOContextFlag(C.AVIO_FLAG_READ_WRITE)
constant IOContextFlagNonBlock (line 13) | IOContextFlagNonBlock = IOContextFlag(C.AVIO_FLAG_NONBLOCK)
constant IOContextFlagDirect (line 14) | IOContextFlagDirect = IOContextFlag(C.AVIO_FLAG_DIRECT)
FILE: io_context_test.go
function TestIOContext (line 12) | func TestIOContext(t *testing.T) {
function TestOpenIOContext (line 57) | func TestOpenIOContext(t *testing.T) {
FILE: io_format_flag.go
type IOFormatFlag (line 7) | type IOFormatFlag
constant IOFormatFlagNofile (line 10) | IOFormatFlagNofile = IOFormatFlag(C.AVFMT_NOFILE)
constant IOFormatFlagNeednumber (line 11) | IOFormatFlagNeednumber = IOFormatFlag(C.AVFMT_NEEDNUMBER)
constant IOFormatFlagExperimental (line 12) | IOFormatFlagExperimental = IOFormatFlag(C.AVFMT_EXPERIMENTAL)
constant IOFormatFlagShowIds (line 13) | IOFormatFlagShowIds = IOFormatFlag(C.AVFMT_SHOW_IDS)
constant IOFormatFlagGlobalheader (line 14) | IOFormatFlagGlobalheader = IOFormatFlag(C.AVFMT_GLOBALHEADER)
constant IOFormatFlagNotimestamps (line 15) | IOFormatFlagNotimestamps = IOFormatFlag(C.AVFMT_NOTIMESTAMPS)
constant IOFormatFlagGenericIndex (line 16) | IOFormatFlagGenericIndex = IOFormatFlag(C.AVFMT_GENERIC_INDEX)
constant IOFormatFlagTsDiscont (line 17) | IOFormatFlagTsDiscont = IOFormatFlag(C.AVFMT_TS_DISCONT)
constant IOFormatFlagVariableFps (line 18) | IOFormatFlagVariableFps = IOFormatFlag(C.AVFMT_VARIABLE_FPS)
constant IOFormatFlagNodimensions (line 19) | IOFormatFlagNodimensions = IOFormatFlag(C.AVFMT_NODIMENSIONS)
constant IOFormatFlagNostreams (line 20) | IOFormatFlagNostreams = IOFormatFlag(C.AVFMT_NOSTREAMS)
constant IOFormatFlagNobinsearch (line 21) | IOFormatFlagNobinsearch = IOFormatFlag(C.AVFMT_NOBINSEARCH)
constant IOFormatFlagNogensearch (line 22) | IOFormatFlagNogensearch = IOFormatFlag(C.AVFMT_NOGENSEARCH)
constant IOFormatFlagNoByteSeek (line 23) | IOFormatFlagNoByteSeek = IOFormatFlag(C.AVFMT_NO_BYTE_SEEK)
constant IOFormatFlagTsNonstrict (line 24) | IOFormatFlagTsNonstrict = IOFormatFlag(C.AVFMT_TS_NONSTRICT)
constant IOFormatFlagTsNegative (line 25) | IOFormatFlagTsNegative = IOFormatFlag(C.AVFMT_TS_NEGATIVE)
constant IOFormatFlagSeekToPts (line 26) | IOFormatFlagSeekToPts = IOFormatFlag(C.AVFMT_SEEK_TO_PTS)
FILE: io_interrupter.c
function astiavInterruptCallback (line 6) | int astiavInterruptCallback(void *ret)
function AVIOInterruptCB (line 11) | AVIOInterruptCB* astiavNewInterruptCallback(atomic_int *ret)
FILE: io_interrupter.go
type IOInterrupter (line 10) | type IOInterrupter struct
method Free (line 21) | func (i *IOInterrupter) Free() {
method Interrupt (line 28) | func (i *IOInterrupter) Interrupt() {
method Interrupted (line 32) | func (i *IOInterrupter) Interrupted() bool {
method Resume (line 36) | func (i *IOInterrupter) Resume() {
function NewIOInterrupter (line 15) | func NewIOInterrupter() *IOInterrupter {
FILE: io_interrupter_test.go
function TestIOInterrupter (line 9) | func TestIOInterrupter(t *testing.T) {
FILE: level.go
type Level (line 7) | type Level
constant LevelUnknown (line 10) | LevelUnknown = Level(C.AV_LEVEL_UNKNOWN)
FILE: log.c
function astiavLogCallback (line 9) | void astiavLogCallback(void *ptr, int level, const char *fmt, va_list vl)
function astiavSetLogCallback (line 17) | void astiavSetLogCallback()
function astiavResetLogCallback (line 22) | void astiavResetLogCallback()
function astiavLog (line 27) | void astiavLog(void* ptr, int level, const char *fmt, char* arg)
FILE: log.go
type LogLevel (line 12) | type LogLevel
constant LogLevelQuiet (line 15) | LogLevelQuiet = LogLevel(C.AV_LOG_QUIET)
constant LogLevelPanic (line 16) | LogLevelPanic = LogLevel(C.AV_LOG_PANIC)
constant LogLevelFatal (line 17) | LogLevelFatal = LogLevel(C.AV_LOG_FATAL)
constant LogLevelError (line 18) | LogLevelError = LogLevel(C.AV_LOG_ERROR)
constant LogLevelWarning (line 19) | LogLevelWarning = LogLevel(C.AV_LOG_WARNING)
constant LogLevelInfo (line 20) | LogLevelInfo = LogLevel(C.AV_LOG_INFO)
constant LogLevelVerbose (line 21) | LogLevelVerbose = LogLevel(C.AV_LOG_VERBOSE)
constant LogLevelDebug (line 22) | LogLevelDebug = LogLevel(C.AV_LOG_DEBUG)
function SetLogLevel (line 26) | func SetLogLevel(l LogLevel) {
function GetLogLevel (line 31) | func GetLogLevel() LogLevel {
type LogCallback (line 35) | type LogCallback
function SetLogCallback (line 40) | func SetLogCallback(c LogCallback) {
function goAstiavLogCallback (line 46) | func goAstiavLogCallback(ptr unsafe.Pointer, level C.int, fmt, msg *C.ch...
function ResetLogCallback (line 66) | func ResetLogCallback() {
function Log (line 71) | func Log(c Classer, l LogLevel, fmt string, args ...string) {
FILE: log_test.go
type logItem (line 9) | type logItem struct
function TestLog (line 16) | func TestLog(t *testing.T) {
FILE: macros.c
function astiavFFAlign (line 4) | ptrdiff_t astiavFFAlign(int i, int align)
FILE: mathematics.go
function RescaleQ (line 7) | func RescaleQ(a int64, b Rational, c Rational) int64 {
function RescaleQRnd (line 12) | func RescaleQRnd(a int64, b Rational, c Rational, r Rounding) int64 {
FILE: mathematics_test.go
function TestMathematics (line 9) | func TestMathematics(t *testing.T) {
FILE: media_type.go
type MediaType (line 8) | type MediaType
method String (line 21) | func (t MediaType) String() string {
constant MediaTypeAttachment (line 11) | MediaTypeAttachment = MediaType(C.AVMEDIA_TYPE_ATTACHMENT)
constant MediaTypeAudio (line 12) | MediaTypeAudio = MediaType(C.AVMEDIA_TYPE_AUDIO)
constant MediaTypeData (line 13) | MediaTypeData = MediaType(C.AVMEDIA_TYPE_DATA)
constant MediaTypeNb (line 14) | MediaTypeNb = MediaType(C.AVMEDIA_TYPE_NB)
constant MediaTypeSubtitle (line 15) | MediaTypeSubtitle = MediaType(C.AVMEDIA_TYPE_SUBTITLE)
constant MediaTypeUnknown (line 16) | MediaTypeUnknown = MediaType(C.AVMEDIA_TYPE_UNKNOWN)
constant MediaTypeVideo (line 17) | MediaTypeVideo = MediaType(C.AVMEDIA_TYPE_VIDEO)
FILE: media_type_test.go
function TestMediaType (line 9) | func TestMediaType(t *testing.T) {
FILE: option.c
function astiavOptionGet (line 3) | int astiavOptionGet(void *obj, const char *name, const char **value, int...
FILE: option.go
type Option (line 11) | type Option struct
method Name (line 23) | func (o *Option) Name() string {
function newOptionFromC (line 15) | func newOptionFromC(c *C.AVOption) *Option {
type Options (line 27) | type Options struct
method List (line 39) | func (os *Options) List() (list []*Option) {
method Set (line 52) | func (os *Options) Set(name, value string, f OptionSearchFlags) error {
method Get (line 61) | func (os *Options) Get(name string, f OptionSearchFlags) (string, erro...
function newOptionsFromC (line 31) | func newOptionsFromC(c unsafe.Pointer) *Options {
FILE: option_search_flag.go
type OptionSearchFlag (line 7) | type OptionSearchFlag
constant OptionSearchFlagChildren (line 10) | OptionSearchFlagChildren = CodecContextFlag(C.AV_OPT_SEARCH_CHILDREN)
constant OptionSearchFlagFakeObject (line 11) | OptionSearchFlagFakeObject = CodecContextFlag(C.AV_OPT_SEARCH_FAKE_OBJ)
FILE: option_test.go
function TestOption (line 9) | func TestOption(t *testing.T) {
FILE: output_format.go
type OutputFormat (line 8) | type OutputFormat struct
method Flags (line 27) | func (f *OutputFormat) Flags() IOFormatFlags {
method Name (line 32) | func (f *OutputFormat) Name() string {
method LongName (line 37) | func (f *OutputFormat) LongName() string {
method String (line 41) | func (f *OutputFormat) String() string {
function newOutputFormatFromC (line 12) | func newOutputFormatFromC(c *C.AVOutputFormat) *OutputFormat {
function FindOutputFormat (line 20) | func FindOutputFormat(name string) *OutputFormat {
FILE: output_format_test.go
function TestOutputFormat (line 9) | func TestOutputFormat(t *testing.T) {
FILE: packet.go
type Packet (line 11) | type Packet struct
method Data (line 28) | func (p *Packet) Data() []byte {
method Dts (line 39) | func (p *Packet) Dts() int64 {
method SetDts (line 44) | func (p *Packet) SetDts(v int64) {
method Duration (line 49) | func (p *Packet) Duration() int64 {
method SetDuration (line 54) | func (p *Packet) SetDuration(d int64) {
method Flags (line 59) | func (p *Packet) Flags() PacketFlags {
method SetFlags (line 64) | func (p *Packet) SetFlags(f PacketFlags) {
method Pos (line 69) | func (p *Packet) Pos() int64 {
method SetPos (line 74) | func (p *Packet) SetPos(v int64) {
method Pts (line 79) | func (p *Packet) Pts() int64 {
method SetPts (line 84) | func (p *Packet) SetPts(v int64) {
method SideData (line 89) | func (p *Packet) SideData() *PacketSideData {
method Size (line 94) | func (p *Packet) Size() int {
method SetSize (line 99) | func (p *Packet) SetSize(s int) {
method StreamIndex (line 104) | func (p *Packet) StreamIndex() int {
method SetStreamIndex (line 109) | func (p *Packet) SetStreamIndex(i int) {
method Free (line 114) | func (p *Packet) Free() {
method Clone (line 121) | func (p *Packet) Clone() *Packet {
method CopyProperties (line 126) | func (p *Packet) CopyProperties(src *Packet) error {
method MakeReferenceCounted (line 131) | func (p *Packet) MakeReferenceCounted() error {
method MakeWritable (line 136) | func (p *Packet) MakeWritable() error {
method IsWritable (line 140) | func (p *Packet) IsWritable() bool {
method AllocPayload (line 145) | func (p *Packet) AllocPayload(s int) error {
method Ref (line 150) | func (p *Packet) Ref(src *Packet) error {
method Unref (line 155) | func (p *Packet) Unref() {
method MoveRef (line 160) | func (p *Packet) MoveRef(src *Packet) {
method RescaleTs (line 165) | func (p *Packet) RescaleTs(src, dst Rational) {
method FromData (line 170) | func (p *Packet) FromData(data []byte) (err error) {
function newPacketFromC (line 15) | func newPacketFromC(c *C.AVPacket) *Packet {
function AllocPacket (line 23) | func AllocPacket() *Packet {
FILE: packet_flag.go
type PacketFlag (line 7) | type PacketFlag
constant PacketFlagCorrupt (line 10) | PacketFlagCorrupt = PacketFlag(C.AV_PKT_FLAG_CORRUPT)
constant PacketFlagDiscard (line 11) | PacketFlagDiscard = PacketFlag(C.AV_PKT_FLAG_DISCARD)
constant PacketFlagKey (line 12) | PacketFlagKey = PacketFlag(C.AV_PKT_FLAG_KEY)
FILE: packet_side_data.go
type PacketSideData (line 12) | type PacketSideData struct
method DisplayMatrix (line 25) | func (d *PacketSideData) DisplayMatrix() *packetSideDataDisplayMatrix {
method SkipSamples (line 54) | func (d *PacketSideData) SkipSamples() *packetSideDataSkipSamples {
method addBytes (line 83) | func (d *PacketSideData) addBytes(t C.enum_AVPacketSideDataType, b []b...
method getBytes (line 98) | func (d *PacketSideData) getBytes(t C.enum_AVPacketSideDataType) []byte {
function newPacketSideDataFromC (line 17) | func newPacketSideDataFromC(sd **C.AVPacketSideData, size *C.int) *Packe...
type packetSideDataDisplayMatrix (line 29) | type packetSideDataDisplayMatrix struct
method Add (line 37) | func (d *packetSideDataDisplayMatrix) Add(m *DisplayMatrix) error {
method Get (line 41) | func (d *packetSideDataDisplayMatrix) Get() (*DisplayMatrix, bool) {
function newPacketSideDataDisplayMatrix (line 33) | func newPacketSideDataDisplayMatrix(d *PacketSideData) *packetSideDataDi...
type packetSideDataSkipSamples (line 58) | type packetSideDataSkipSamples struct
method Add (line 66) | func (d *packetSideDataSkipSamples) Add(ss *SkipSamples) error {
method Get (line 70) | func (d *packetSideDataSkipSamples) Get() (*SkipSamples, bool) {
function newPacketSideDataSkipSamples (line 62) | func newPacketSideDataSkipSamples(d *PacketSideData) *packetSideDataSkip...
FILE: packet_side_data_test.go
function testPacketSideData (line 9) | func testPacketSideData(sd *PacketSideData, t *testing.T) {
function TestPacketSideData (line 17) | func TestPacketSideData(t *testing.T) {
FILE: packet_test.go
function TestPacket (line 9) | func TestPacket(t *testing.T) {
FILE: picture_type.go
type PictureType (line 7) | type PictureType
method String (line 21) | func (t PictureType) String() string {
constant PictureTypeNone (line 10) | PictureTypeNone = PictureType(C.AV_PICTURE_TYPE_NONE)
constant PictureTypeI (line 11) | PictureTypeI = PictureType(C.AV_PICTURE_TYPE_I)
constant PictureTypeP (line 12) | PictureTypeP = PictureType(C.AV_PICTURE_TYPE_P)
constant PictureTypeB (line 13) | PictureTypeB = PictureType(C.AV_PICTURE_TYPE_B)
constant PictureTypeS (line 14) | PictureTypeS = PictureType(C.AV_PICTURE_TYPE_S)
constant PictureTypeSi (line 15) | PictureTypeSi = PictureType(C.AV_PICTURE_TYPE_SI)
constant PictureTypeSp (line 16) | PictureTypeSp = PictureType(C.AV_PICTURE_TYPE_SP)
constant PictureTypeBi (line 17) | PictureTypeBi = PictureType(C.AV_PICTURE_TYPE_BI)
FILE: picture_type_test.go
function TestPictureType (line 9) | func TestPictureType(t *testing.T) {
FILE: pixel_format.go
type PixelFormat (line 11) | type PixelFormat
method Name (line 206) | func (f PixelFormat) Name() string {
method String (line 210) | func (f PixelFormat) String() string {
method Descriptor (line 214) | func (f PixelFormat) Descriptor() *PixelFormatDescriptor {
constant PixelFormat0Bgr (line 14) | PixelFormat0Bgr = PixelFormat(C.AV_PIX_FMT_0BGR)
constant PixelFormat0Rgb (line 15) | PixelFormat0Rgb = PixelFormat(C.AV_PIX_FMT_0RGB)
constant PixelFormatAbgr (line 16) | PixelFormatAbgr = PixelFormat(C.AV_PIX_FMT_ABGR)
constant PixelFormatArgb (line 17) | PixelFormatArgb = PixelFormat(C.AV_PIX_FMT_ARGB)
constant PixelFormatAyuv64Be (line 18) | PixelFormatAyuv64Be = PixelFormat(C.AV_PIX_FMT_AYUV64BE)
constant PixelFormatAyuv64Le (line 19) | PixelFormatAyuv64Le = PixelFormat(C.AV_PIX_FMT_AYUV64LE)
constant PixelFormatBayerBggr16Be (line 20) | PixelFormatBayerBggr16Be = PixelFormat(C.AV_PIX_FMT_BAYER_BGGR16BE)
constant PixelFormatBayerBggr16Le (line 21) | PixelFormatBayerBggr16Le = PixelFormat(C.AV_PIX_FMT_BAYER_BGGR16LE)
constant PixelFormatBayerBggr8 (line 22) | PixelFormatBayerBggr8 = PixelFormat(C.AV_PIX_FMT_BAYER_BGGR8)
constant PixelFormatBayerGbrg16Be (line 23) | PixelFormatBayerGbrg16Be = PixelFormat(C.AV_PIX_FMT_BAYER_GBRG16BE)
constant PixelFormatBayerGbrg16Le (line 24) | PixelFormatBayerGbrg16Le = PixelFormat(C.AV_PIX_FMT_BAYER_GBRG16LE)
constant PixelFormatBayerGbrg8 (line 25) | PixelFormatBayerGbrg8 = PixelFormat(C.AV_PIX_FMT_BAYER_GBRG8)
constant PixelFormatBayerGrbg16Be (line 26) | PixelFormatBayerGrbg16Be = PixelFormat(C.AV_PIX_FMT_BAYER_GRBG16BE)
constant PixelFormatBayerGrbg16Le (line 27) | PixelFormatBayerGrbg16Le = PixelFormat(C.AV_PIX_FMT_BAYER_GRBG16LE)
constant PixelFormatBayerGrbg8 (line 28) | PixelFormatBayerGrbg8 = PixelFormat(C.AV_PIX_FMT_BAYER_GRBG8)
constant PixelFormatBayerRggb16Be (line 29) | PixelFormatBayerRggb16Be = PixelFormat(C.AV_PIX_FMT_BAYER_RGGB16BE)
constant PixelFormatBayerRggb16Le (line 30) | PixelFormatBayerRggb16Le = PixelFormat(C.AV_PIX_FMT_BAYER_RGGB16LE)
constant PixelFormatBayerRggb8 (line 31) | PixelFormatBayerRggb8 = PixelFormat(C.AV_PIX_FMT_BAYER_RGGB8)
constant PixelFormatBgr0 (line 32) | PixelFormatBgr0 = PixelFormat(C.AV_PIX_FMT_BGR0)
constant PixelFormatBgr24 (line 33) | PixelFormatBgr24 = PixelFormat(C.AV_PIX_FMT_BGR24)
constant PixelFormatBgr4 (line 34) | PixelFormatBgr4 = PixelFormat(C.AV_PIX_FMT_BGR4)
constant PixelFormatBgr444Be (line 35) | PixelFormatBgr444Be = PixelFormat(C.AV_PIX_FMT_BGR444BE)
constant PixelFormatBgr444Le (line 36) | PixelFormatBgr444Le = PixelFormat(C.AV_PIX_FMT_BGR444LE)
constant PixelFormatBgr48Be (line 37) | PixelFormatBgr48Be = PixelFormat(C.AV_PIX_FMT_BGR48BE)
constant PixelFormatBgr48Le (line 38) | PixelFormatBgr48Le = PixelFormat(C.AV_PIX_FMT_BGR48LE)
constant PixelFormatBgr4Byte (line 39) | PixelFormatBgr4Byte = PixelFormat(C.AV_PIX_FMT_BGR4_BYTE)
constant PixelFormatBgr555Be (line 40) | PixelFormatBgr555Be = PixelFormat(C.AV_PIX_FMT_BGR555BE)
constant PixelFormatBgr555Le (line 41) | PixelFormatBgr555Le = PixelFormat(C.AV_PIX_FMT_BGR555LE)
constant PixelFormatBgr565Be (line 42) | PixelFormatBgr565Be = PixelFormat(C.AV_PIX_FMT_BGR565BE)
constant PixelFormatBgr565Le (line 43) | PixelFormatBgr565Le = PixelFormat(C.AV_PIX_FMT_BGR565LE)
constant PixelFormatBgr8 (line 44) | PixelFormatBgr8 = PixelFormat(C.AV_PIX_FMT_BGR8)
constant PixelFormatBgra (line 45) | PixelFormatBgra = PixelFormat(C.AV_PIX_FMT_BGRA)
constant PixelFormatBgra64Be (line 46) | PixelFormatBgra64Be = PixelFormat(C.AV_PIX_FMT_BGRA64BE)
constant PixelFormatBgra64Le (line 47) | PixelFormatBgra64Le = PixelFormat(C.AV_PIX_FMT_BGRA64LE)
constant PixelFormatCuda (line 48) | PixelFormatCuda = PixelFormat(C.AV_PIX_FMT_CUDA)
constant PixelFormatD3D11 (line 49) | PixelFormatD3D11 = PixelFormat(C.AV_PIX_FMT_D3D11)
constant PixelFormatD3D11VaVld (line 50) | PixelFormatD3D11VaVld = PixelFormat(C.AV_PIX_FMT_D3D11VA_VLD)
constant PixelFormatDrmPrime (line 51) | PixelFormatDrmPrime = PixelFormat(C.AV_PIX_FMT_DRM_PRIME)
constant PixelFormatDxva2Vld (line 52) | PixelFormatDxva2Vld = PixelFormat(C.AV_PIX_FMT_DXVA2_VLD)
constant PixelFormatGbr24P (line 53) | PixelFormatGbr24P = PixelFormat(C.AV_PIX_FMT_GBR24P)
constant PixelFormatGbrap (line 54) | PixelFormatGbrap = PixelFormat(C.AV_PIX_FMT_GBRAP)
constant PixelFormatGbrap10Be (line 55) | PixelFormatGbrap10Be = PixelFormat(C.AV_PIX_FMT_GBRAP10BE)
constant PixelFormatGbrap10Le (line 56) | PixelFormatGbrap10Le = PixelFormat(C.AV_PIX_FMT_GBRAP10LE)
constant PixelFormatGbrap12Be (line 57) | PixelFormatGbrap12Be = PixelFormat(C.AV_PIX_FMT_GBRAP12BE)
constant PixelFormatGbrap12Le (line 58) | PixelFormatGbrap12Le = PixelFormat(C.AV_PIX_FMT_GBRAP12LE)
constant PixelFormatGbrap16Be (line 59) | PixelFormatGbrap16Be = PixelFormat(C.AV_PIX_FMT_GBRAP16BE)
constant PixelFormatGbrap16Le (line 60) | PixelFormatGbrap16Le = PixelFormat(C.AV_PIX_FMT_GBRAP16LE)
constant PixelFormatGbrapf32Be (line 61) | PixelFormatGbrapf32Be = PixelFormat(C.AV_PIX_FMT_GBRAPF32BE)
constant PixelFormatGbrapf32Le (line 62) | PixelFormatGbrapf32Le = PixelFormat(C.AV_PIX_FMT_GBRAPF32LE)
constant PixelFormatGbrp (line 63) | PixelFormatGbrp = PixelFormat(C.AV_PIX_FMT_GBRP)
constant PixelFormatGbrp10Be (line 64) | PixelFormatGbrp10Be = PixelFormat(C.AV_PIX_FMT_GBRP10BE)
constant PixelFormatGbrp10Le (line 65) | PixelFormatGbrp10Le = PixelFormat(C.AV_PIX_FMT_GBRP10LE)
constant PixelFormatGbrp12Be (line 66) | PixelFormatGbrp12Be = PixelFormat(C.AV_PIX_FMT_GBRP12BE)
constant PixelFormatGbrp12Le (line 67) | PixelFormatGbrp12Le = PixelFormat(C.AV_PIX_FMT_GBRP12LE)
constant PixelFormatGbrp14Be (line 68) | PixelFormatGbrp14Be = PixelFormat(C.AV_PIX_FMT_GBRP14BE)
constant PixelFormatGbrp14Le (line 69) | PixelFormatGbrp14Le = PixelFormat(C.AV_PIX_FMT_GBRP14LE)
constant PixelFormatGbrp16Be (line 70) | PixelFormatGbrp16Be = PixelFormat(C.AV_PIX_FMT_GBRP16BE)
constant PixelFormatGbrp16Le (line 71) | PixelFormatGbrp16Le = PixelFormat(C.AV_PIX_FMT_GBRP16LE)
constant PixelFormatGbrp9Be (line 72) | PixelFormatGbrp9Be = PixelFormat(C.AV_PIX_FMT_GBRP9BE)
constant PixelFormatGbrp9Le (line 73) | PixelFormatGbrp9Le = PixelFormat(C.AV_PIX_FMT_GBRP9LE)
constant PixelFormatGbrpf32Be (line 74) | PixelFormatGbrpf32Be = PixelFormat(C.AV_PIX_FMT_GBRPF32BE)
constant PixelFormatGbrpf32Le (line 75) | PixelFormatGbrpf32Le = PixelFormat(C.AV_PIX_FMT_GBRPF32LE)
constant PixelFormatGray10Be (line 76) | PixelFormatGray10Be = PixelFormat(C.AV_PIX_FMT_GRAY10BE)
constant PixelFormatGray10Le (line 77) | PixelFormatGray10Le = PixelFormat(C.AV_PIX_FMT_GRAY10LE)
constant PixelFormatGray12Be (line 78) | PixelFormatGray12Be = PixelFormat(C.AV_PIX_FMT_GRAY12BE)
constant PixelFormatGray12Le (line 79) | PixelFormatGray12Le = PixelFormat(C.AV_PIX_FMT_GRAY12LE)
constant PixelFormatGray14Be (line 80) | PixelFormatGray14Be = PixelFormat(C.AV_PIX_FMT_GRAY14BE)
constant PixelFormatGray14Le (line 81) | PixelFormatGray14Le = PixelFormat(C.AV_PIX_FMT_GRAY14LE)
constant PixelFormatGray16Be (line 82) | PixelFormatGray16Be = PixelFormat(C.AV_PIX_FMT_GRAY16BE)
constant PixelFormatGray16Le (line 83) | PixelFormatGray16Le = PixelFormat(C.AV_PIX_FMT_GRAY16LE)
constant PixelFormatGray8 (line 84) | PixelFormatGray8 = PixelFormat(C.AV_PIX_FMT_GRAY8)
constant PixelFormatGray8A (line 85) | PixelFormatGray8A = PixelFormat(C.AV_PIX_FMT_GRAY8A)
constant PixelFormatGray9Be (line 86) | PixelFormatGray9Be = PixelFormat(C.AV_PIX_FMT_GRAY9BE)
constant PixelFormatGray9Le (line 87) | PixelFormatGray9Le = PixelFormat(C.AV_PIX_FMT_GRAY9LE)
constant PixelFormatGrayf32Be (line 88) | PixelFormatGrayf32Be = PixelFormat(C.AV_PIX_FMT_GRAYF32BE)
constant PixelFormatGrayf32Le (line 89) | PixelFormatGrayf32Le = PixelFormat(C.AV_PIX_FMT_GRAYF32LE)
constant PixelFormatMediacodec (line 90) | PixelFormatMediacodec = PixelFormat(C.AV_PIX_FMT_MEDIACODEC)
constant PixelFormatMmal (line 91) | PixelFormatMmal = PixelFormat(C.AV_PIX_FMT_MMAL)
constant PixelFormatMonoblack (line 92) | PixelFormatMonoblack = PixelFormat(C.AV_PIX_FMT_MONOBLACK)
constant PixelFormatMonowhite (line 93) | PixelFormatMonowhite = PixelFormat(C.AV_PIX_FMT_MONOWHITE)
constant PixelFormatNb (line 94) | PixelFormatNb = PixelFormat(C.AV_PIX_FMT_NB)
constant PixelFormatNone (line 95) | PixelFormatNone = PixelFormat(C.AV_PIX_FMT_NONE)
constant PixelFormatNv12 (line 96) | PixelFormatNv12 = PixelFormat(C.AV_PIX_FMT_NV12)
constant PixelFormatNv16 (line 97) | PixelFormatNv16 = PixelFormat(C.AV_PIX_FMT_NV16)
constant PixelFormatNv20Be (line 98) | PixelFormatNv20Be = PixelFormat(C.AV_PIX_FMT_NV20BE)
constant PixelFormatNv20Le (line 99) | PixelFormatNv20Le = PixelFormat(C.AV_PIX_FMT_NV20LE)
constant PixelFormatNv21 (line 100) | PixelFormatNv21 = PixelFormat(C.AV_PIX_FMT_NV21)
constant PixelFormatOpencl (line 101) | PixelFormatOpencl = PixelFormat(C.AV_PIX_FMT_OPENCL)
constant PixelFormatP010Be (line 102) | PixelFormatP010Be = PixelFormat(C.AV_PIX_FMT_P010BE)
constant PixelFormatP010Le (line 103) | PixelFormatP010Le = PixelFormat(C.AV_PIX_FMT_P010LE)
constant PixelFormatP016Be (line 104) | PixelFormatP016Be = PixelFormat(C.AV_PIX_FMT_P016BE)
constant PixelFormatP016Le (line 105) | PixelFormatP016Le = PixelFormat(C.AV_PIX_FMT_P016LE)
constant PixelFormatPal8 (line 106) | PixelFormatPal8 = PixelFormat(C.AV_PIX_FMT_PAL8)
constant PixelFormatQsv (line 107) | PixelFormatQsv = PixelFormat(C.AV_PIX_FMT_QSV)
constant PixelFormatRgb0 (line 108) | PixelFormatRgb0 = PixelFormat(C.AV_PIX_FMT_RGB0)
constant PixelFormatRgb24 (line 109) | PixelFormatRgb24 = PixelFormat(C.AV_PIX_FMT_RGB24)
constant PixelFormatRgb4 (line 110) | PixelFormatRgb4 = PixelFormat(C.AV_PIX_FMT_RGB4)
constant PixelFormatRgb444Be (line 111) | PixelFormatRgb444Be = PixelFormat(C.AV_PIX_FMT_RGB444BE)
constant PixelFormatRgb444Le (line 112) | PixelFormatRgb444Le = PixelFormat(C.AV_PIX_FMT_RGB444LE)
constant PixelFormatRgb48Be (line 113) | PixelFormatRgb48Be = PixelFormat(C.AV_PIX_FMT_RGB48BE)
constant PixelFormatRgb48Le (line 114) | PixelFormatRgb48Le = PixelFormat(C.AV_PIX_FMT_RGB48LE)
constant PixelFormatRgb4Byte (line 115) | PixelFormatRgb4Byte = PixelFormat(C.AV_PIX_FMT_RGB4_BYTE)
constant PixelFormatRgb555Be (line 116) | PixelFormatRgb555Be = PixelFormat(C.AV_PIX_FMT_RGB555BE)
constant PixelFormatRgb555Le (line 117) | PixelFormatRgb555Le = PixelFormat(C.AV_PIX_FMT_RGB555LE)
constant PixelFormatRgb565Be (line 118) | PixelFormatRgb565Be = PixelFormat(C.AV_PIX_FMT_RGB565BE)
constant PixelFormatRgb565Le (line 119) | PixelFormatRgb565Le = PixelFormat(C.AV_PIX_FMT_RGB565LE)
constant PixelFormatRgb8 (line 120) | PixelFormatRgb8 = PixelFormat(C.AV_PIX_FMT_RGB8)
constant PixelFormatRgba (line 121) | PixelFormatRgba = PixelFormat(C.AV_PIX_FMT_RGBA)
constant PixelFormatRgba64Be (line 122) | PixelFormatRgba64Be = PixelFormat(C.AV_PIX_FMT_RGBA64BE)
constant PixelFormatRgba64Le (line 123) | PixelFormatRgba64Le = PixelFormat(C.AV_PIX_FMT_RGBA64LE)
constant PixelFormatUyvy422 (line 124) | PixelFormatUyvy422 = PixelFormat(C.AV_PIX_FMT_UYVY422)
constant PixelFormatUyyvyy411 (line 125) | PixelFormatUyyvyy411 = PixelFormat(C.AV_PIX_FMT_UYYVYY411)
constant PixelFormatVaapi (line 126) | PixelFormatVaapi = PixelFormat(C.AV_PIX_FMT_VAAPI)
constant PixelFormatVdpau (line 127) | PixelFormatVdpau = PixelFormat(C.AV_PIX_FMT_VDPAU)
constant PixelFormatVideotoolbox (line 128) | PixelFormatVideotoolbox = PixelFormat(C.AV_PIX_FMT_VIDEOTOOLBOX)
constant PixelFormatXyz12Be (line 129) | PixelFormatXyz12Be = PixelFormat(C.AV_PIX_FMT_XYZ12BE)
constant PixelFormatXyz12Le (line 130) | PixelFormatXyz12Le = PixelFormat(C.AV_PIX_FMT_XYZ12LE)
constant PixelFormatY400A (line 131) | PixelFormatY400A = PixelFormat(C.AV_PIX_FMT_Y400A)
constant PixelFormatYa16Be (line 132) | PixelFormatYa16Be = PixelFormat(C.AV_PIX_FMT_YA16BE)
constant PixelFormatYa16Le (line 133) | PixelFormatYa16Le = PixelFormat(C.AV_PIX_FMT_YA16LE)
constant PixelFormatYa8 (line 134) | PixelFormatYa8 = PixelFormat(C.AV_PIX_FMT_YA8)
constant PixelFormatYuv410P (line 135) | PixelFormatYuv410P = PixelFormat(C.AV_PIX_FMT_YUV410P)
constant PixelFormatYuv411P (line 136) | PixelFormatYuv411P = PixelFormat(C.AV_PIX_FMT_YUV411P)
constant PixelFormatYuv420P (line 137) | PixelFormatYuv420P = PixelFormat(C.AV_PIX_FMT_YUV420P)
constant PixelFormatYuv420P10Be (line 138) | PixelFormatYuv420P10Be = PixelFormat(C.AV_PIX_FMT_YUV420P10BE)
constant PixelFormatYuv420P10Le (line 139) | PixelFormatYuv420P10Le = PixelFormat(C.AV_PIX_FMT_YUV420P10LE)
constant PixelFormatYuv420P12Be (line 140) | PixelFormatYuv420P12Be = PixelFormat(C.AV_PIX_FMT_YUV420P12BE)
constant PixelFormatYuv420P12Le (line 141) | PixelFormatYuv420P12Le = PixelFormat(C.AV_PIX_FMT_YUV420P12LE)
constant PixelFormatYuv420P14Be (line 142) | PixelFormatYuv420P14Be = PixelFormat(C.AV_PIX_FMT_YUV420P14BE)
constant PixelFormatYuv420P14Le (line 143) | PixelFormatYuv420P14Le = PixelFormat(C.AV_PIX_FMT_YUV420P14LE)
constant PixelFormatYuv420P16Be (line 144) | PixelFormatYuv420P16Be = PixelFormat(C.AV_PIX_FMT_YUV420P16BE)
constant PixelFormatYuv420P16Le (line 145) | PixelFormatYuv420P16Le = PixelFormat(C.AV_PIX_FMT_YUV420P16LE)
constant PixelFormatYuv420P9Be (line 146) | PixelFormatYuv420P9Be = PixelFormat(C.AV_PIX_FMT_YUV420P9BE)
constant PixelFormatYuv420P9Le (line 147) | PixelFormatYuv420P9Le = PixelFormat(C.AV_PIX_FMT_YUV420P9LE)
constant PixelFormatYuv422P (line 148) | PixelFormatYuv422P = PixelFormat(C.AV_PIX_FMT_YUV422P)
constant PixelFormatYuv422P10Be (line 149) | PixelFormatYuv422P10Be = PixelFormat(C.AV_PIX_FMT_YUV422P10BE)
constant PixelFormatYuv422P10Le (line 150) | PixelFormatYuv422P10Le = PixelFormat(C.AV_PIX_FMT_YUV422P10LE)
constant PixelFormatYuv422P12Be (line 151) | PixelFormatYuv422P12Be = PixelFormat(C.AV_PIX_FMT_YUV422P12BE)
constant PixelFormatYuv422P12Le (line 152) | PixelFormatYuv422P12Le = PixelFormat(C.AV_PIX_FMT_YUV422P12LE)
constant PixelFormatYuv422P14Be (line 153) | PixelFormatYuv422P14Be = PixelFormat(C.AV_PIX_FMT_YUV422P14BE)
constant PixelFormatYuv422P14Le (line 154) | PixelFormatYuv422P14Le = PixelFormat(C.AV_PIX_FMT_YUV422P14LE)
constant PixelFormatYuv422P16Be (line 155) | PixelFormatYuv422P16Be = PixelFormat(C.AV_PIX_FMT_YUV422P16BE)
constant PixelFormatYuv422P16Le (line 156) | PixelFormatYuv422P16Le = PixelFormat(C.AV_PIX_FMT_YUV422P16LE)
constant PixelFormatYuv422P9Be (line 157) | PixelFormatYuv422P9Be = PixelFormat(C.AV_PIX_FMT_YUV422P9BE)
constant PixelFormatYuv422P9Le (line 158) | PixelFormatYuv422P9Le = PixelFormat(C.AV_PIX_FMT_YUV422P9LE)
constant PixelFormatYuv440P (line 159) | PixelFormatYuv440P = PixelFormat(C.AV_PIX_FMT_YUV440P)
constant PixelFormatYuv440P10Be (line 160) | PixelFormatYuv440P10Be = PixelFormat(C.AV_PIX_FMT_YUV440P10BE)
constant PixelFormatYuv440P10Le (line 161) | PixelFormatYuv440P10Le = PixelFormat(C.AV_PIX_FMT_YUV440P10LE)
constant PixelFormatYuv440P12Be (line 162) | PixelFormatYuv440P12Be = PixelFormat(C.AV_PIX_FMT_YUV440P12BE)
constant PixelFormatYuv440P12Le (line 163) | PixelFormatYuv440P12Le = PixelFormat(C.AV_PIX_FMT_YUV440P12LE)
constant PixelFormatYuv444P (line 164) | PixelFormatYuv444P = PixelFormat(C.AV_PIX_FMT_YUV444P)
constant PixelFormatYuv444P10Be (line 165) | PixelFormatYuv444P10Be = PixelFormat(C.AV_PIX_FMT_YUV444P10BE)
constant PixelFormatYuv444P10Le (line 166) | PixelFormatYuv444P10Le = PixelFormat(C.AV_PIX_FMT_YUV444P10LE)
constant PixelFormatYuv444P12Be (line 167) | PixelFormatYuv444P12Be = PixelFormat(C.AV_PIX_FMT_YUV444P12BE)
constant PixelFormatYuv444P12Le (line 168) | PixelFormatYuv444P12Le = PixelFormat(C.AV_PIX_FMT_YUV444P12LE)
constant PixelFormatYuv444P14Be (line 169) | PixelFormatYuv444P14Be = PixelFormat(C.AV_PIX_FMT_YUV444P14BE)
constant PixelFormatYuv444P14Le (line 170) | PixelFormatYuv444P14Le = PixelFormat(C.AV_PIX_FMT_YUV444P14LE)
constant PixelFormatYuv444P16Be (line 171) | PixelFormatYuv444P16Be = PixelFormat(C.AV_PIX_FMT_YUV444P16BE)
constant PixelFormatYuv444P16Le (line 172) | PixelFormatYuv444P16Le = PixelFormat(C.AV_PIX_FMT_YUV444P16LE)
constant PixelFormatYuv444P9Be (line 173) | PixelFormatYuv444P9Be = PixelFormat(C.AV_PIX_FMT_YUV444P9BE)
constant PixelFormatYuv444P9Le (line 174) | PixelFormatYuv444P9Le = PixelFormat(C.AV_PIX_FMT_YUV444P9LE)
constant PixelFormatYuva420P (line 175) | PixelFormatYuva420P = PixelFormat(C.AV_PIX_FMT_YUVA420P)
constant PixelFormatYuva420P10Be (line 176) | PixelFormatYuva420P10Be = PixelFormat(C.AV_PIX_FMT_YUVA420P10BE)
constant PixelFormatYuva420P10Le (line 177) | PixelFormatYuva420P10Le = PixelFormat(C.AV_PIX_FMT_YUVA420P10LE)
constant PixelFormatYuva420P16Be (line 178) | PixelFormatYuva420P16Be = PixelFormat(C.AV_PIX_FMT_YUVA420P16BE)
constant PixelFormatYuva420P16Le (line 179) | PixelFormatYuva420P16Le = PixelFormat(C.AV_PIX_FMT_YUVA420P16LE)
constant PixelFormatYuva420P9Be (line 180) | PixelFormatYuva420P9Be = PixelFormat(C.AV_PIX_FMT_YUVA420P9BE)
constant PixelFormatYuva420P9Le (line 181) | PixelFormatYuva420P9Le = PixelFormat(C.AV_PIX_FMT_YUVA420P9LE)
constant PixelFormatYuva422P (line 182) | PixelFormatYuva422P = PixelFormat(C.AV_PIX_FMT_YUVA422P)
constant PixelFormatYuva422P10Be (line 183) | PixelFormatYuva422P10Be = PixelFormat(C.AV_PIX_FMT_YUVA422P10BE)
constant PixelFormatYuva422P10Le (line 184) | PixelFormatYuva422P10Le = PixelFormat(C.AV_PIX_FMT_YUVA422P10LE)
constant PixelFormatYuva422P16Be (line 185) | PixelFormatYuva422P16Be = PixelFormat(C.AV_PIX_FMT_YUVA422P16BE)
constant PixelFormatYuva422P16Le (line 186) | PixelFormatYuva422P16Le = PixelFormat(C.AV_PIX_FMT_YUVA422P16LE)
constant PixelFormatYuva422P9Be (line 187) | PixelFormatYuva422P9Be = PixelFormat(C.AV_PIX_FMT_YUVA422P9BE)
constant PixelFormatYuva422P9Le (line 188) | PixelFormatYuva422P9Le = PixelFormat(C.AV_PIX_FMT_YUVA422P9LE)
constant PixelFormatYuva444P (line 189) | PixelFormatYuva444P = PixelFormat(C.AV_PIX_FMT_YUVA444P)
constant PixelFormatYuva444P10Be (line 190) | PixelFormatYuva444P10Be = PixelFormat(C.AV_PIX_FMT_YUVA444P10BE)
constant PixelFormatYuva444P10Le (line 191) | PixelFormatYuva444P10Le = PixelFormat(C.AV_PIX_FMT_YUVA444P10LE)
constant PixelFormatYuva444P16Be (line 192) | PixelFormatYuva444P16Be = PixelFormat(C.AV_PIX_FMT_YUVA444P16BE)
constant PixelFormatYuva444P16Le (line 193) | PixelFormatYuva444P16Le = PixelFormat(C.AV_PIX_FMT_YUVA444P16LE)
constant PixelFormatYuva444P9Be (line 194) | PixelFormatYuva444P9Be = PixelFormat(C.AV_PIX_FMT_YUVA444P9BE)
constant PixelFormatYuva444P9Le (line 195) | PixelFormatYuva444P9Le = PixelFormat(C.AV_PIX_FMT_YUVA444P9LE)
constant PixelFormatYuvj411P (line 196) | PixelFormatYuvj411P = PixelFormat(C.AV_PIX_FMT_YUVJ411P)
constant PixelFormatYuvj420P (line 197) | PixelFormatYuvj420P = PixelFormat(C.AV_PIX_FMT_YUVJ420P)
constant PixelFormatYuvj422P (line 198) | PixelFormatYuvj422P = PixelFormat(C.AV_PIX_FMT_YUVJ422P)
constant PixelFormatYuvj440P (line 199) | PixelFormatYuvj440P = PixelFormat(C.AV_PIX_FMT_YUVJ440P)
constant PixelFormatYuvj444P (line 200) | PixelFormatYuvj444P = PixelFormat(C.AV_PIX_FMT_YUVJ444P)
constant PixelFormatYuyv422 (line 201) | PixelFormatYuyv422 = PixelFormat(C.AV_PIX_FMT_YUYV422)
constant PixelFormatYvyu422 (line 202) | PixelFormatYvyu422 = PixelFormat(C.AV_PIX_FMT_YVYU422)
function FindPixelFormatByName (line 219) | func FindPixelFormatByName(name string) PixelFormat {
FILE: pixel_format_descriptor.go
type PixelFormatDescriptor (line 7) | type PixelFormatDescriptor struct
method Name (line 19) | func (pfd *PixelFormatDescriptor) Name() string {
method Flags (line 24) | func (pfd *PixelFormatDescriptor) Flags() PixelFormatDescriptorFlags {
function newPixelFormatDescriptorFromC (line 11) | func newPixelFormatDescriptorFromC(c *C.AVPixFmtDescriptor) *PixelFormat...
FILE: pixel_format_descriptor_flag.go
type PixelFormatDescriptorFlag (line 7) | type PixelFormatDescriptorFlag
constant PixelFormatDescriptorFlagBe (line 10) | PixelFormatDescriptorFlagBe = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagPal (line 11) | PixelFormatDescriptorFlagPal = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagBitStream (line 12) | PixelFormatDescriptorFlagBitStream = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagHwAccel (line 13) | PixelFormatDescriptorFlagHwAccel = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagPlanar (line 14) | PixelFormatDescriptorFlagPlanar = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagRgb (line 15) | PixelFormatDescriptorFlagRgb = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagAlpha (line 16) | PixelFormatDescriptorFlagAlpha = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagBayer (line 17) | PixelFormatDescriptorFlagBayer = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagFloat (line 18) | PixelFormatDescriptorFlagFloat = PixelFormatDescriptorFlag(C.AV_PIX_...
constant PixelFormatDescriptorFlagXyz (line 19) | PixelFormatDescriptorFlagXyz = PixelFormatDescriptorFlag(C.AV_PIX_...
FILE: pixel_format_descriptor_test.go
function TestPixelFormatDescriptor (line 9) | func TestPixelFormatDescriptor(t *testing.T) {
FILE: pixel_format_test.go
function TestPixelFormat (line 9) | func TestPixelFormat(t *testing.T) {
FILE: private_data.go
type PrivateData (line 5) | type PrivateData struct
method Options (line 16) | func (pd *PrivateData) Options() *Options {
function newPrivateDataFromC (line 9) | func newPrivateDataFromC(c unsafe.Pointer) *PrivateData {
FILE: profile.go
type Profile (line 7) | type Profile
constant ProfileUnknown (line 10) | ProfileUnknown = Profile(C.AV_PROFILE_UNKNOWN)
constant ProfileReserved (line 11) | ProfileReserved = Profile(C.AV_PROFILE_RESERVED)
constant ProfileAacEld (line 12) | ProfileAacEld = Profile(C.AV_PROFILE_AAC_ELD)
constant ProfileAacHe (line 13) | ProfileAacHe = Profile(C.AV_PROFILE_AAC_HE)
constant ProfileAacHeV2 (line 14) | ProfileAacHeV2 = Profile(C.AV_PROFILE_AAC_HE_V2)
constant ProfileAacLd (line 15) | ProfileAacLd = Profile(C.AV_PROFILE_AAC_LD)
constant ProfileAacLow (line 16) | ProfileAacLow = Profile(C.AV_PROFILE_AAC_LOW)
constant ProfileAacLtp (line 17) | ProfileAacLtp = Profile(C.AV_PROFILE_AAC_LTP)
constant ProfileAacMain (line 18) | ProfileAacMain = Profile(C.AV_PROFILE_AAC_MAIN)
constant ProfileAacSsr (line 19) | ProfileAacSsr = Profile(C.AV_PROFILE_AAC_SSR)
constant ProfileAacUsac (line 20) | ProfileAacUsac = Profile(C.AV_PROFILE_AAC_USAC)
constant ProfileAribProfileA (line 21) | ProfileAribProfileA = Profile(C.AV_PROFILE_ARIB_PRO...
constant ProfileAribProfileC (line 22) | ProfileAribProfileC = Profile(C.AV_PROFILE_ARIB_PRO...
constant ProfileAv1High (line 23) | ProfileAv1High = Profile(C.AV_PROFILE_AV1_HIGH)
constant ProfileAv1Main (line 24) | ProfileAv1Main = Profile(C.AV_PROFILE_AV1_MAIN)
constant ProfileAv1Professional (line 25) | ProfileAv1Professional = Profile(C.AV_PROFILE_AV1_PROF...
constant ProfileDnxhd (line 26) | ProfileDnxhd = Profile(C.AV_PROFILE_DNXHD)
constant ProfileDnxhr444 (line 27) | ProfileDnxhr444 = Profile(C.AV_PROFILE_DNXHR_444)
constant ProfileDnxhrHq (line 28) | ProfileDnxhrHq = Profile(C.AV_PROFILE_DNXHR_HQ)
constant ProfileDnxhrHqx (line 29) | ProfileDnxhrHqx = Profile(C.AV_PROFILE_DNXHR_HQX)
constant ProfileDnxhrLb (line 30) | ProfileDnxhrLb = Profile(C.AV_PROFILE_DNXHR_LB)
constant ProfileDnxhrSq (line 31) | ProfileDnxhrSq = Profile(C.AV_PROFILE_DNXHR_SQ)
constant ProfileDts (line 32) | ProfileDts = Profile(C.AV_PROFILE_DTS)
constant ProfileDts9624 (line 33) | ProfileDts9624 = Profile(C.AV_PROFILE_DTS_96_24)
constant ProfileDtsEs (line 34) | ProfileDtsEs = Profile(C.AV_PROFILE_DTS_ES)
constant ProfileDtsExpress (line 35) | ProfileDtsExpress = Profile(C.AV_PROFILE_DTS_EXPR...
constant ProfileDtsHdHra (line 36) | ProfileDtsHdHra = Profile(C.AV_PROFILE_DTS_HD_HRA)
constant ProfileDtsHdMa (line 37) | ProfileDtsHdMa = Profile(C.AV_PROFILE_DTS_HD_MA)
constant ProfileDtsHdMaX (line 38) | ProfileDtsHdMaX = Profile(C.AV_PROFILE_DTS_HD_M...
constant ProfileDtsHdMaXImax (line 39) | ProfileDtsHdMaXImax = Profile(C.AV_PROFILE_DTS_HD_M...
constant ProfileEac3DdpAtmos (line 40) | ProfileEac3DdpAtmos = Profile(C.AV_PROFILE_EAC3_DDP...
constant ProfileEvcBaseline (line 41) | ProfileEvcBaseline = Profile(C.AV_PROFILE_EVC_BASE...
constant ProfileEvcMain (line 42) | ProfileEvcMain = Profile(C.AV_PROFILE_EVC_MAIN)
constant ProfileH264Baseline (line 43) | ProfileH264Baseline = Profile(C.AV_PROFILE_H264_BAS...
constant ProfileH264Cavlc444 (line 44) | ProfileH264Cavlc444 = Profile(C.AV_PROFILE_H264_CAV...
constant ProfileH264Constrained (line 45) | ProfileH264Constrained = Profile(C.AV_PROFILE_H264_CON...
constant ProfileH264ConstrainedBaseline (line 46) | ProfileH264ConstrainedBaseline = Profile(C.AV_PROFILE_H264_CON...
constant ProfileH264Extended (line 47) | ProfileH264Extended = Profile(C.AV_PROFILE_H264_EXT...
constant ProfileH264High (line 48) | ProfileH264High = Profile(C.AV_PROFILE_H264_HIGH)
constant ProfileH264High10 (line 49) | ProfileH264High10 = Profile(C.AV_PROFILE_H264_HIG...
constant ProfileH264High10Intra (line 50) | ProfileH264High10Intra = Profile(C.AV_PROFILE_H264_HIG...
constant ProfileH264High422 (line 51) | ProfileH264High422 = Profile(C.AV_PROFILE_H264_HIG...
constant ProfileH264High422Intra (line 52) | ProfileH264High422Intra = Profile(C.AV_PROFILE_H264_HIG...
constant ProfileH264High444 (line 53) | ProfileH264High444 = Profile(C.AV_PROFILE_H264_HIG...
constant ProfileH264High444Intra (line 54) | ProfileH264High444Intra = Profile(C.AV_PROFILE_H264_HIG...
constant ProfileH264High444Predictive (line 55) | ProfileH264High444Predictive = Profile(C.AV_PROFILE_H264_HIG...
constant ProfileH264Intra (line 56) | ProfileH264Intra = Profile(C.AV_PROFILE_H264_INTRA)
constant ProfileH264Main (line 57) | ProfileH264Main = Profile(C.AV_PROFILE_H264_MAIN)
constant ProfileH264MultiviewHigh (line 58) | ProfileH264MultiviewHigh = Profile(C.AV_PROFILE_H264_MUL...
constant ProfileH264StereoHigh (line 59) | ProfileH264StereoHigh = Profile(C.AV_PROFILE_H264_STE...
constant ProfileHevcMain (line 60) | ProfileHevcMain = Profile(C.AV_PROFILE_HEVC_MAIN)
constant ProfileHevcMain10 (line 61) | ProfileHevcMain10 = Profile(C.AV_PROFILE_HEVC_MAI...
constant ProfileHevcMainStillPicture (line 62) | ProfileHevcMainStillPicture = Profile(C.AV_PROFILE_HEVC_MAI...
constant ProfileHevcMultiviewMain (line 63) | ProfileHevcMultiviewMain = Profile(C.AV_PROFILE_HEVC_MUL...
constant ProfileHevcRext (line 64) | ProfileHevcRext = Profile(C.AV_PROFILE_HEVC_REXT)
constant ProfileHevcScc (line 65) | ProfileHevcScc = Profile(C.AV_PROFILE_HEVC_SCC)
constant ProfileJpeg2000CstreamNoRestriction (line 66) | ProfileJpeg2000CstreamNoRestriction = Profile(C.AV_PROFILE_JPEG2000...
constant ProfileJpeg2000CstreamRestriction0 (line 67) | ProfileJpeg2000CstreamRestriction0 = Profile(C.AV_PROFILE_JPEG2000...
constant ProfileJpeg2000CstreamRestriction1 (line 68) | ProfileJpeg2000CstreamRestriction1 = Profile(C.AV_PROFILE_JPEG20
Condensed preview — 197 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,298K chars).
[
{
"path": ".devcontainer/Dockerfile",
"chars": 857,
"preview": "FROM debian:latest\n\nRUN apt-get update\n\n##\n# git\n##\n\nRUN apt-get install -y git nano\n\n##\n# ffmpeg\n##\n\nARG FFMPEG_VERSION"
},
{
"path": ".devcontainer/devcontainer.json",
"chars": 598,
"preview": "{\n\t\"build\": {\n\t\t\"args\": {\n\t\t\t\"FFMPEG_VERSION\": \"n8.0\",\n\t\t\t\"GO_VERSION\": \"1.25.5\"\n\t\t},\n\t\t\"dockerfile\": \"Dockerfile\"\n\t},\n\t"
},
{
"path": ".github/workflows/Makefile",
"chars": 357,
"preview": "version=\nsrcPath=\npatchPath=\n\ninstall-ffmpeg:\n\trm -rf $(srcPath)\n\tmkdir -p $(srcPath)\n\tcd $(srcPath) && git clone https:"
},
{
"path": ".github/workflows/test.yml",
"chars": 3919,
"preview": "name: Test\n\non:\n push:\n branches: [ \"master\", \"test-github-actions\" ]\n pull_request:\n branches: [ \"master\" ]\n\njo"
},
{
"path": ".github/workflows/windows.patch",
"chars": 902,
"preview": "# https://trac.ffmpeg.org/ticket/6620\ndiff --git a/ffbuild/library.mak b/ffbuild/library.mak\n--- a/ffbuild/library.mak\n+"
},
{
"path": ".gitignore",
"chars": 28,
"preview": ".DS_Store\ncoverage.out\n.idea"
},
{
"path": ".vscode/.gitignore",
"chars": 13,
"preview": "settings.json"
},
{
"path": ".vscode/c_cpp_properties.json",
"chars": 193,
"preview": "{\n \"configurations\": [\n {\n \"includePath\": [\n \"${workspaceFolder}/**\",\n "
},
{
"path": "BREAKING_CHANGES.md",
"chars": 2022,
"preview": "# v0.40.0\n\n- `Codec`.`ChannelLayouts`, `Codec`.`PixelFormats` and `Codec`.`SampleFormats` have been renamed to `Codec`.`"
},
{
"path": "LICENSE",
"chars": 1071,
"preview": "MIT License\n\nCopyright (c) 2022 Quentin Renard\n\nPermission is hereby granted, free of charge, to any person obtaining a "
},
{
"path": "README.md",
"chars": 5935,
"preview": "[](http://goreportcard.com/report/github.com"
},
{
"path": "astiav.go",
"chars": 128,
"preview": "package astiav\n\n//#cgo pkg-config: libavcodec libavdevice libavfilter libavformat libswresample libswscale libavutil\nimp"
},
{
"path": "astiav_test.go",
"chars": 5466,
"preview": "package astiav\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"sync\"\n\t\"testing\"\n\n\t\"github.com/asticode/go-astikit\"\n)\n\nvar globalHelpe"
},
{
"path": "atomic.c",
"chars": 177,
"preview": "#include <stdatomic.h>\n\nint astiavAtomicLoadInt(atomic_int* i)\n{\n return atomic_load(i);\n}\n\nvoid astiavAtomicStoreInt"
},
{
"path": "atomic.h",
"chars": 112,
"preview": "#include <stdatomic.h>\n\nint astiavAtomicLoadInt(atomic_int* i);\nvoid astiavAtomicStoreInt(atomic_int* i, int v);"
},
{
"path": "audio_fifo.go",
"chars": 2021,
"preview": "package astiav\n\n//#include <libavutil/audio_fifo.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/struct"
},
{
"path": "audio_fifo_test.go",
"chars": 909,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestAudioFIFO(t *testing.T) {\n\tafn :"
},
{
"path": "bit_stream_filter.go",
"chars": 866,
"preview": "package astiav\n\n//#include <libavcodec/bsf.h>\n//#include <stdlib.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://ffmpeg.o"
},
{
"path": "bit_stream_filter_context.go",
"chars": 3357,
"preview": "package astiav\n\n//#include <libavcodec/bsf.h>\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8"
},
{
"path": "bit_stream_filter_context_test.go",
"chars": 1022,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestBitStreamFilterContext(t *testin"
},
{
"path": "bit_stream_filter_test.go",
"chars": 338,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestBitStreamFilter(t *testing.T) {\n"
},
{
"path": "buffersink_filter_context.go",
"chars": 3475,
"preview": "package astiav\n\n//#include <libavfilter/buffersink.h>\nimport \"C\"\n\ntype BuffersinkFilterContext struct {\n\tfc *FilterConte"
},
{
"path": "buffersink_flag.go",
"chars": 346,
"preview": "package astiav\n\n//#include <libavfilter/buffersink.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffer"
},
{
"path": "buffersrc_filter_context.go",
"chars": 1163,
"preview": "package astiav\n\n//#include <libavfilter/buffersrc.h>\nimport \"C\"\n\ntype BuffersrcFilterContext struct {\n\tfc *FilterContext"
},
{
"path": "buffersrc_filter_context_parameters.go",
"chars": 5984,
"preview": "package astiav\n\n//#include <libavfilter/buffersrc.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/struc"
},
{
"path": "buffersrc_filter_context_parameters_test.go",
"chars": 1078,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestBuffersrcFilterContextParameters"
},
{
"path": "buffersrc_filter_context_test.go",
"chars": 418,
"preview": "package astiav\n\nimport (\n\t\"github.com/stretchr/testify/require\"\n\t\"testing\"\n)\n\nfunc TestBuffersrcFilterContext(t *testing"
},
{
"path": "buffersrc_flag.go",
"chars": 458,
"preview": "package astiav\n\n//#include <libavfilter/buffersrc.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavfi__buffers"
},
{
"path": "bytes.go",
"chars": 1348,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <stdlib.h>\n//#include <stdint.h>\nimport \"C\"\nimport (\n\t\"erro"
},
{
"path": "bytes_test.go",
"chars": 141,
"preview": "package astiav\n\nimport \"testing\"\n\nfunc TestBytes(t *testing.T) {\n\t// TODO Test stringFromC\n\t// TODO Test bytesFromC\n\t// "
},
{
"path": "channel_layout.go",
"chars": 5426,
"preview": "package astiav\n\n//#include \"channel_layout.h\"\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/group__"
},
{
"path": "channel_layout.h",
"chars": 3928,
"preview": "#include <libavutil/channel_layout.h>\n\n// Calling C.AV_CHANNEL_LAYOUT_* in Go gives a \"could not determine kind of name "
},
{
"path": "channel_layout_test.go",
"chars": 573,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestChannelLayout(t *testing.T) {\n\tc"
},
{
"path": "chroma_location.go",
"chars": 735,
"preview": "package astiav\n\n//#include <libavutil/pixfmt.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#a1f86ed1b6a"
},
{
"path": "class.c",
"chars": 537,
"preview": "#include <libavutil/log.h>\n#include <stdint.h>\n#include <stdlib.h>\n\nchar* astiavClassItemName(AVClass* c, void* ptr) {\n\t"
},
{
"path": "class.go",
"chars": 2559,
"preview": "package astiav\n\n//#include \"class.h\"\nimport \"C\"\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/s"
},
{
"path": "class.h",
"chars": 189,
"preview": "#include <libavutil/log.h>\n\nchar* astiavClassItemName(AVClass* c, void* ptr);\nAVClassCategory astiavClassCategory(AVClas"
},
{
"path": "class_category.go",
"chars": 1626,
"preview": "package astiav\n\n//#include <libavutil/log.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/log_8h.html#aeb1c06cc3e47a029"
},
{
"path": "class_test.go",
"chars": 2098,
"preview": "package astiav\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"unsafe\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nf"
},
{
"path": "codec.go",
"chars": 5419,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <libavutil/channel_layout.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n"
},
{
"path": "codec_context.c",
"chars": 604,
"preview": "#include \"codec_context.h\"\n#include <libavcodec/avcodec.h>\n#include <stdlib.h>\n\nenum AVPixelFormat astiavCodecContextGet"
},
{
"path": "codec_context.go",
"chars": 17759,
"preview": "package astiav\n\n//#include \"codec_context.h\"\nimport \"C\"\nimport (\n\t\"sync\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/"
},
{
"path": "codec_context.h",
"chars": 382,
"preview": "#include <libavcodec/avcodec.h>\n\nextern enum AVPixelFormat goAstiavCodecContextGetFormat(AVCodecContext *ctx, enum AVPix"
},
{
"path": "codec_context_flag.go",
"chars": 2337,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#g"
},
{
"path": "codec_context_test.go",
"chars": 6300,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\t\"unsafe\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCodecContext(t *testin"
},
{
"path": "codec_hardware_config.go",
"chars": 934,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/structAVCodecHWConfig.ht"
},
{
"path": "codec_hardware_config_method_flag.go",
"chars": 696,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavc__core.html#g"
},
{
"path": "codec_id.go",
"chars": 36780,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/"
},
{
"path": "codec_id_test.go",
"chars": 267,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCodecID(t *testing.T) {\n\trequire"
},
{
"path": "codec_parameters.go",
"chars": 8469,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/structAVCodecParameters."
},
{
"path": "codec_parameters_test.go",
"chars": 3525,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCodecParameters(t *testing.T) {\n"
},
{
"path": "codec_tag.go",
"chars": 37,
"preview": "package astiav\n\ntype CodecTag uint32\n"
},
{
"path": "codec_test.go",
"chars": 2880,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCodec(t *testing.T) {\n\tc := Find"
},
{
"path": "color_primaries.go",
"chars": 1247,
"preview": "package astiav\n\n//#include <libavutil/pixfmt.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#ad384ee5a84"
},
{
"path": "color_range.go",
"chars": 699,
"preview": "package astiav\n\n//#include <libavutil/pixdesc.h>\n//#include <libavutil/pixfmt.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxyg"
},
{
"path": "color_range_test.go",
"chars": 213,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestColorRange(t *testing.T) {\n\trequ"
},
{
"path": "color_space.go",
"chars": 1727,
"preview": "package astiav\n\n//#include <libavutil/pixdesc.h>\n//#include <libavutil/pixfmt.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxyg"
},
{
"path": "color_space_test.go",
"chars": 221,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestColorSpace(t *testing.T) {\n\trequ"
},
{
"path": "color_transfer_characteristic.go",
"chars": 2260,
"preview": "package astiav\n\n//#include <libavutil/pixfmt.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/pixfmt_8h.html#ad4791ea149"
},
{
"path": "device.go",
"chars": 207,
"preview": "package astiav\n\n//#include <libavdevice/avdevice.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavd.html#ga7c9"
},
{
"path": "device_test.go",
"chars": 95,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n)\n\nfunc TestDevice(t *testing.T) {\n\tRegisterAllDevices()\n}\n"
},
{
"path": "dictionary.go",
"chars": 2539,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <libavutil/dict.h>\n//#include <stdlib.h>\nimport \"C\"\nimport "
},
{
"path": "dictionary_entry.go",
"chars": 623,
"preview": "package astiav\n\n//#include <libavutil/dict.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/structAVDictionaryEntry.html"
},
{
"path": "dictionary_flag.go",
"chars": 674,
"preview": "package astiav\n\n//#include <libavutil/dict.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavu__dict.html#gad9c"
},
{
"path": "dictionary_test.go",
"chars": 1234,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestDictionary(t *testing.T) {\n\td1 :"
},
{
"path": "discard.go",
"chars": 557,
"preview": "package astiav\n\n//#include <libavcodec/defs.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavc__decoding.html#"
},
{
"path": "display_matrix.go",
"chars": 1248,
"preview": "package astiav\n\n//#include <libavutil/display.h>\nimport \"C\"\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"unsafe\"\n)\n\n// https://f"
},
{
"path": "display_matrix_test.go",
"chars": 1062,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestDisplayMatrix(t *testing.T) {\n\t_"
},
{
"path": "disposition_flag.go",
"chars": 1684,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#af09f"
},
{
"path": "error.go",
"chars": 2390,
"preview": "package astiav\n\n//#include <libavutil/avutil.h>\n//#include <errno.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group"
},
{
"path": "error_recognition_flag.go",
"chars": 769,
"preview": "package astiav\n\n//#include <libavcodec/defs.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/defs_8h.html#a16258b3283a3d"
},
{
"path": "error_test.go",
"chars": 537,
"preview": "package astiav\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\ntype testError struct{}\n"
},
{
"path": "examples/bit_stream_filtering/main.go",
"chars": 4914,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n)\n\nvar (\n\tfilter = f"
},
{
"path": "examples/custom_io_demuxing/main.go",
"chars": 2493,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n)\n\nvar (\n\tinpu"
},
{
"path": "examples/custom_io_muxing/main.go",
"chars": 4670,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n)\n\nvar (\n\tinpu"
},
{
"path": "examples/demuxing_decoding/main.go",
"chars": 4273,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n\t\"github.com/asticod"
},
{
"path": "examples/filtering/main.go",
"chars": 8981,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n\t\"github.com/asticod"
},
{
"path": "examples/frame_data_manipulation/main.go",
"chars": 3876,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n)\n\nfunc main() {\n\t// Handle f"
},
{
"path": "examples/hardware_decoding_filtering/main.go",
"chars": 12719,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n\t\"github.com/asticod"
},
{
"path": "examples/hardware_encoding/main.go",
"chars": 6833,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n)\n\nvar (\n\t"
},
{
"path": "examples/remuxing/main.go",
"chars": 4558,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n)\n\nvar (\n\tinput = f"
},
{
"path": "examples/resampling_audio/main.go",
"chars": 8178,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n\t\"github.com/asticod"
},
{
"path": "examples/scaling_video/main.go",
"chars": 2748,
"preview": "package main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"image/png\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n)\n\nvar (\n\to"
},
{
"path": "examples/transcoding/main.go",
"chars": 16087,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/asticode/go-astiav\"\n\t\"github.com/asticod"
},
{
"path": "filter.go",
"chars": 1967,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/s"
},
{
"path": "filter_chain.go",
"chars": 861,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\nimport (\n\t\"math\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxyg"
},
{
"path": "filter_command_flag.go",
"chars": 328,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavfi.html#gace"
},
{
"path": "filter_context.go",
"chars": 1633,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/s"
},
{
"path": "filter_flag.go",
"chars": 840,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavfi.html#gae6"
},
{
"path": "filter_graph.go",
"chars": 5597,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"math\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg"
},
{
"path": "filter_graph_segment.go",
"chars": 1126,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\nimport (\n\t\"math\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxyg"
},
{
"path": "filter_graph_test.go",
"chars": 11243,
"preview": "package astiav\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestFilterGraph(t *testing.T)"
},
{
"path": "filter_in_out.go",
"chars": 1459,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/struct"
},
{
"path": "filter_pad.go",
"chars": 308,
"preview": "package astiav\n\n// Struct attributes are internal but there are C functions to get some of them\ntype FilterPad struct {\n"
},
{
"path": "filter_params.go",
"chars": 479,
"preview": "package astiav\n\n//#include <libavfilter/avfilter.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/structAVFilterParams.h"
},
{
"path": "filter_test.go",
"chars": 403,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestFilter(t *testing.T) {\n\tf := Fin"
},
{
"path": "flags.go",
"chars": 12686,
"preview": "// Code generated by astiav. DO NOT EDIT.\npackage astiav\n\nimport (\n\t\"github.com/asticode/go-astikit\"\n)\n\ntype BuffersinkF"
},
{
"path": "flags_test.go",
"chars": 6740,
"preview": "// Code generated by astiav. DO NOT EDIT.\npackage astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n"
},
{
"path": "format_context.go",
"chars": 12601,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <libavformat/avformat.h>\nimport \"C\"\nimport (\n\t\"fmt\"\n\t\"math\""
},
{
"path": "format_context_ctx_flag.go",
"chars": 346,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#a42e3"
},
{
"path": "format_context_flag.go",
"chars": 1260,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#a69e2"
},
{
"path": "format_context_test.go",
"chars": 6982,
"preview": "package astiav\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestFormatContext(t"
},
{
"path": "format_event_flag.go",
"chars": 274,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#a1948"
},
{
"path": "frame.c",
"chars": 759,
"preview": "#include <errno.h>\n#include <libavutil/avutil.h>\n#include <libavutil/samplefmt.h>\n#include <stdint.h>\n#include <string.h"
},
{
"path": "frame.go",
"chars": 10660,
"preview": "package astiav\n\n//#include <libavutil/channel_layout.h>\n//#include <libavutil/frame.h>\n//#include <libavutil/imgutils.h>"
},
{
"path": "frame.h",
"chars": 223,
"preview": "#include <libavutil/samplefmt.h>\n#include <stdint.h>\n\nint astiavSamplesCopyToBuffer(uint8_t* dst, int dst_size, const ui"
},
{
"path": "frame_data.go",
"chars": 11865,
"preview": "package astiav\n\n//#include <libavutil/imgutils.h>\n//#include <libavutil/samplefmt.h>\n//#include <stdlib.h>\n//#include \"m"
},
{
"path": "frame_data_test.go",
"chars": 11923,
"preview": "package astiav\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\ntype mockedFrameDat"
},
{
"path": "frame_flag.go",
"chars": 565,
"preview": "package astiav\n\n//#include <libavutil/frame.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavu__frame__flags.h"
},
{
"path": "frame_side_data.c",
"chars": 160,
"preview": "#include <libavutil/frame.h>\n\nAVRegionOfInterest* astiavConvertRegionsOfInterestFrameSideData(AVFrameSideData *sd) {\n "
},
{
"path": "frame_side_data.go",
"chars": 2450,
"preview": "package astiav\n\n//#include <libavutil/frame.h>\n//#include \"frame_side_data.h\"\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"math\"\n\t\"un"
},
{
"path": "frame_side_data.h",
"chars": 115,
"preview": "#include <libavutil/frame.h>\n\nAVRegionOfInterest* astiavConvertRegionsOfInterestFrameSideData(AVFrameSideData *sd);"
},
{
"path": "frame_side_data_test.go",
"chars": 1340,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc testFrameSideData(sd *FrameSideData,"
},
{
"path": "frame_test.go",
"chars": 23324,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\t\"unsafe\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestFrame(t *testing.T) {\n"
},
{
"path": "go.mod",
"chars": 369,
"preview": "module github.com/asticode/go-astiav\n\ngo 1.21\n\nrequire (\n\tgithub.com/asticode/go-astikit v0.42.0\n\tgithub.com/stretchr/te"
},
{
"path": "go.sum",
"chars": 1205,
"preview": "github.com/asticode/go-astikit v0.42.0 h1:pnir/2KLUSr0527Tv908iAH6EGYYrYta132vvjXsH5w=\ngithub.com/asticode/go-astikit v0"
},
{
"path": "hardware_device_context.go",
"chars": 1233,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <libavutil/hwcontext.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n//"
},
{
"path": "hardware_device_type.go",
"chars": 1732,
"preview": "package astiav\n\n//#include <libavutil/hwcontext.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/hw"
},
{
"path": "hardware_device_type_test.go",
"chars": 321,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestHardwareDeviceType(t *testing.T)"
},
{
"path": "hardware_frames_constraints.go",
"chars": 2200,
"preview": "package astiav\n\n//#include <libavutil/hwcontext.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/structA"
},
{
"path": "hardware_frames_context.go",
"chars": 2101,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/str"
},
{
"path": "input_format.go",
"chars": 1148,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/struct"
},
{
"path": "input_format_test.go",
"chars": 377,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestInputFormat(t *testing.T) {\n\tfor"
},
{
"path": "internal/cmd/flags/main.go",
"chars": 3156,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"text/template\"\n)\n\ntype listItem struct {\n\tName string\n\tS"
},
{
"path": "io_context.c",
"chars": 458,
"preview": "#include \"io_context.h\"\n#include <stdint.h>\n\nint astiavIOContextReadFunc(void *opaque, uint8_t *buf, int buf_size)\n{\n "
},
{
"path": "io_context.go",
"chars": 8050,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\n//#include \"io_context.h\"\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\""
},
{
"path": "io_context.h",
"chars": 484,
"preview": "#include <stdint.h>\n\nextern int goAstiavIOContextReadFunc(void *opaque, uint8_t *buf, int buf_size);\nextern int64_t goAs"
},
{
"path": "io_context_flag.go",
"chars": 484,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avio_8h.html#a21e61cb4"
},
{
"path": "io_context_test.go",
"chars": 2246,
"preview": "package astiav\n\nimport (\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestIOC"
},
{
"path": "io_format_flag.go",
"chars": 1235,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#a752c"
},
{
"path": "io_interrupter.c",
"chars": 378,
"preview": "#include <libavformat/avio.h>\n#include <libavutil/mem.h>\n#include <stdatomic.h>\n#include <stdlib.h>\n\nint astiavInterrupt"
},
{
"path": "io_interrupter.go",
"chars": 669,
"preview": "package astiav\n\n//#include \"atomic.h\"\n//#include \"io_interrupter.h\"\n//#include <libavutil/mem.h>\n//#include <stdlib.h>\ni"
},
{
"path": "io_interrupter.h",
"chars": 155,
"preview": "#include <libavformat/avio.h>\n#include <stdatomic.h>\n\nint astiavInterruptCallback(void *ret);\nAVIOInterruptCB* astiavNew"
},
{
"path": "io_interrupter_test.go",
"chars": 299,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestIOInterrupter(t *testing.T) {\n\ti"
},
{
"path": "level.go",
"chars": 211,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/defs_8h.html#a3b66f83dc9"
},
{
"path": "log.c",
"chars": 618,
"preview": "#include \"log.h\"\n#include <libavutil/log.h>\n#include <stdio.h>\n\n#ifndef ASTIAV_LOG_BUF_SIZE\n#define ASTIAV_LOG_BUF_SIZE "
},
{
"path": "log.go",
"chars": 2183,
"preview": "package astiav\n\n//#include \"log.h\"\n//#include <libavutil/log.h>\n//#include <stdlib.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n/"
},
{
"path": "log.h",
"chars": 298,
"preview": "#include <stdarg.h>\n\nextern void goAstiavLogCallback(void* ptr, int level, char* fmt, char* msg);\nvoid astiavLogCallback"
},
{
"path": "log_test.go",
"chars": 1287,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\ntype logItem struct {\n\tc Classer\n\tfmt s"
},
{
"path": "macros.c",
"chars": 123,
"preview": "#include <libavutil/macros.h>\n#include <stddef.h>\n\nptrdiff_t astiavFFAlign(int i, int align)\n{\n\treturn FFALIGN(i, align)"
},
{
"path": "macros.h",
"chars": 63,
"preview": "#include <stddef.h>\n\nptrdiff_t astiavFFAlign(int i, int align);"
},
{
"path": "mathematics.go",
"chars": 513,
"preview": "package astiav\n\n//#include <libavutil/mathematics.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavu__math.htm"
},
{
"path": "mathematics_test.go",
"chars": 403,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestMathematics(t *testing.T) {\n\treq"
},
{
"path": "media_type.go",
"chars": 826,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <libavutil/avutil.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxy"
},
{
"path": "media_type_test.go",
"chars": 168,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestMediaType(t *testing.T) {\n\trequi"
},
{
"path": "option.c",
"chars": 271,
"preview": "#include <libavutil/opt.h>\n\nint astiavOptionGet(void *obj, const char *name, const char **value, int flags)\n{\n uint8_"
},
{
"path": "option.go",
"chars": 1748,
"preview": "package astiav\n\n//#include <libavutil/opt.h>\n//#include \"option.h\"\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://www.ffmpe"
},
{
"path": "option.h",
"chars": 80,
"preview": "int astiavOptionGet(void *obj, const char *name, const char **value, int flags);"
},
{
"path": "option_search_flag.go",
"chars": 332,
"preview": "package astiav\n\n//#include <libavutil/opt.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__opt__mng.html#ga25801b"
},
{
"path": "option_test.go",
"chars": 812,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestOption(t *testing.T) {\n\tfc, err "
},
{
"path": "output_format.go",
"chars": 1170,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/struct"
},
{
"path": "output_format_test.go",
"chars": 384,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestOutputFormat(t *testing.T) {\n\tfo"
},
{
"path": "packet.go",
"chars": 5601,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxyg"
},
{
"path": "packet_flag.go",
"chars": 350,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavc__packet.html"
},
{
"path": "packet_side_data.go",
"chars": 3001,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxyg"
},
{
"path": "packet_side_data_test.go",
"chars": 1022,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc testPacketSideData(sd *PacketSideDat"
},
{
"path": "packet_test.go",
"chars": 3908,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestPacket(t *testing.T) {\n\tpkt1, er"
},
{
"path": "picture_type.go",
"chars": 839,
"preview": "package astiav\n\n//#include <libavutil/avutil.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavu__picture.html#"
},
{
"path": "picture_type_test.go",
"chars": 164,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestPictureType(t *testing.T) {\n\treq"
},
{
"path": "pixel_format.go",
"chars": 12947,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\n//#include <libavutil/avutil.h>\n//#include <libavutil/pixdesc.h>\n//#in"
},
{
"path": "pixel_format_descriptor.go",
"chars": 746,
"preview": "package astiav\n\n//#include <libavutil/pixdesc.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/structAVPixFmtDescriptor."
},
{
"path": "pixel_format_descriptor_flag.go",
"chars": 1081,
"preview": "package astiav\n\n//#include <libavutil/pixdesc.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/pixdesc_8h.html#ac7c7d0be"
},
{
"path": "pixel_format_descriptor_test.go",
"chars": 299,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestPixelFormatDescriptor(t *testing"
},
{
"path": "pixel_format_test.go",
"chars": 322,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestPixelFormat(t *testing.T) {\n\tp :"
},
{
"path": "private_data.go",
"chars": 275,
"preview": "package astiav\n\nimport \"unsafe\"\n\ntype PrivateData struct {\n\tc unsafe.Pointer\n}\n\nfunc newPrivateDataFromC(c unsafe.Pointe"
},
{
"path": "profile.go",
"chars": 9025,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/defs_8h.html#a1c4e97fd8f"
},
{
"path": "program.go",
"chars": 3610,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/s"
},
{
"path": "program_test.go",
"chars": 1106,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestProgram(t *testing.T) {\n\tfc := A"
},
{
"path": "rational.go",
"chars": 947,
"preview": "package astiav\n\n//#include <libavutil/rational.h>\nimport \"C\"\nimport \"strconv\"\n\n// https://ffmpeg.org/doxygen/8.0/structA"
},
{
"path": "rational_test.go",
"chars": 494,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestRational(t *testing.T) {\n\tr := N"
},
{
"path": "region_of_interest.go",
"chars": 281,
"preview": "package astiav\n\n//#include <libavutil/frame.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/structAVRegionOfInterest.ht"
},
{
"path": "rounding.go",
"chars": 496,
"preview": "package astiav\n\n//#include <libavutil/mathematics.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavu__math.htm"
},
{
"path": "sample_format.go",
"chars": 1656,
"preview": "package astiav\n\n//#include <libavutil/samplefmt.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__lavu__sampfmts.h"
},
{
"path": "sample_format_test.go",
"chars": 317,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestSampleFormat(t *testing.T) {\n\tre"
},
{
"path": "seek_flag.go",
"chars": 380,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#ac736"
},
{
"path": "skip_samples.go",
"chars": 965,
"preview": "package astiav\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n)\n\n// https://ffmpeg.org/doxygen/8.0/group__lavc__packet__side__data."
},
{
"path": "skip_samples_test.go",
"chars": 487,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestSkipSamples(t *testing.T) {\n\t_, "
},
{
"path": "software_resample_context.go",
"chars": 1838,
"preview": "package astiav\n\n//#include <libswresample/swresample.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/st"
},
{
"path": "software_resample_context_test.go",
"chars": 957,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestSoftwareResampleContext(t *testi"
},
{
"path": "software_scale_context.go",
"chars": 6461,
"preview": "package astiav\n\n//#include <libswscale/swscale.h>\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"unsafe\"\n)\n\n// https://ffmpeg.org/doxyg"
},
{
"path": "software_scale_context_flag.go",
"chars": 1813,
"preview": "package astiav\n\n//#include <libswscale/swscale.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/group__libsws.html#ggade"
},
{
"path": "software_scale_context_test.go",
"chars": 3417,
"preview": "package astiav\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestSoftwareScaleContext(t *te"
},
{
"path": "stream.go",
"chars": 5023,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\nimport \"unsafe\"\n\n// https://ffmpeg.org/doxygen/8.0/struct"
},
{
"path": "stream_event_flag.go",
"chars": 277,
"preview": "package astiav\n\n//#include <libavformat/avformat.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avformat_8h.html#ab3a5"
},
{
"path": "stream_test.go",
"chars": 2294,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestStream(t *testing.T) {\n\tfc, err "
},
{
"path": "strict_std_compliance.go",
"chars": 593,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/defs_8h.html#a96808e3862"
},
{
"path": "testdata/audio-s16le-bytes",
"chars": 27103,
"preview": "[61 254 101 0 68 254 135 255 100 254 242 254 174 254 186 254 45 255 168 254 215 255 143 254 154 0 148 254 79 1 199 254 2"
},
{
"path": "testdata/image-rgba-bytes",
"chars": 868086,
"preview": "[255 255 0 255 254 255 0 255 254 255 0 255 254 255 0 255 253 255 0 255 252 255 0 255 251 255 0 255 250 255 0 255 249 255"
},
{
"path": "testdata/image-rgba-struct",
"chars": 868126,
"preview": "&{Pix:[255 255 0 255 254 255 0 255 254 255 0 255 254 255 0 255 253 255 0 255 252 255 0 255 251 255 0 255 250 255 0 255 2"
},
{
"path": "thread_type.go",
"chars": 320,
"preview": "package astiav\n\n//#include <libavcodec/avcodec.h>\nimport \"C\"\n\n// https://ffmpeg.org/doxygen/8.0/avcodec_8h.html#a116c7fb"
},
{
"path": "time.go",
"chars": 1358,
"preview": "package astiav\n\n//#include <libavutil/avutil.h>\n//#include <libavutil/time.h>\nimport \"C\"\n\nconst (\n\t// https://ffmpeg.org"
},
{
"path": "time_test.go",
"chars": 597,
"preview": "package astiav\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestTime(t *testing.T) {\n\trequire.No"
}
]
// ... and 5 more files (download for full content)
About this extraction
This page contains the full source code of the asticode/go-astiav GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 197 files (28.3 MB), approximately 572.2k tokens, and a symbol index with 2255 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.