astiav是一个 Golang 库,为 ffmpeg 提供 C 绑定
Go to file
2023-02-16 14:37:17 +01:00
examples Oops 2 2022-04-23 09:08:44 +02:00
internal/cmd/flags Initial commit 2022-02-13 19:08:18 +01:00
testdata Initial commit 2022-02-13 19:08:18 +01:00
.gitignore Initial commit 2022-02-13 19:08:18 +01:00
astiav_test.go Initial commit 2022-02-13 19:08:18 +01:00
buffersink_flag.go Initial commit 2022-02-13 19:08:18 +01:00
buffersrc_flag.go Initial commit 2022-02-13 19:08:18 +01:00
bytes_test.go Initial commit 2022-02-13 19:08:18 +01:00
bytes.go Added FindPixelFormatByName + frame.AllocSamples 2022-02-20 11:23:28 +01:00
channel_layout_test.go Initial commit 2022-02-13 19:08:18 +01:00
channel_layout.go Initial commit 2022-02-13 19:08:18 +01:00
chroma_location.go Initial commit 2022-02-13 19:08:18 +01:00
codec_context_flag.go Initial commit 2022-02-13 19:08:18 +01:00
codec_context_test.go Added codec context qmin 2023-02-16 14:37:17 +01:00
codec_context.go Added codec context qmin 2023-02-16 14:37:17 +01:00
codec_id_test.go Initial commit 2022-02-13 19:08:18 +01:00
codec_id.go Initial commit 2022-02-13 19:08:18 +01:00
codec_parameters_test.go Added missing audio setters to codec parameters 2022-06-03 14:13:47 +02:00
codec_parameters.go Added missing audio setters to codec parameters 2022-06-03 14:13:47 +02:00
codec_tag.go Initial commit 2022-02-13 19:08:18 +01:00
codec_test.go Initial commit 2022-02-13 19:08:18 +01:00
codec.go Initial commit 2022-02-13 19:08:18 +01:00
color_primaries.go Initial commit 2022-02-13 19:08:18 +01:00
color_range.go Initial commit 2022-02-13 19:08:18 +01:00
color_space.go Initial commit 2022-02-13 19:08:18 +01:00
color_transfer_characteristic.go Initial commit 2022-02-13 19:08:18 +01:00
dictionary_entry.go Initial commit 2022-02-13 19:08:18 +01:00
dictionary_flag.go Initial commit 2022-02-13 19:08:18 +01:00
dictionary_test.go Initial commit 2022-02-13 19:08:18 +01:00
dictionary.go Initial commit 2022-02-13 19:08:18 +01:00
display_matrix_test.go Oops 2022-03-26 11:47:14 +01:00
display_matrix.go Oops 2022-03-26 11:47:14 +01:00
error_test.go Initial commit 2022-02-13 19:08:18 +01:00
error.go Initial commit 2022-02-13 19:08:18 +01:00
filter_command_flag.go Initial commit 2022-02-13 19:08:18 +01:00
filter_context.go Initial commit 2022-02-13 19:08:18 +01:00
filter_graph_test.go Initial commit 2022-02-13 19:08:18 +01:00
filter_graph.go Added FindPixelFormatByName + frame.AllocSamples 2022-02-20 11:23:28 +01:00
filter_in_out.go Initial commit 2022-02-13 19:08:18 +01:00
filter_link.go Initial commit 2022-02-13 19:08:18 +01:00
filter_test.go Initial commit 2022-02-13 19:08:18 +01:00
filter.go Initial commit 2022-02-13 19:08:18 +01:00
flag_test.go Initial commit 2022-02-13 19:08:18 +01:00
flag.go Initial commit 2022-02-13 19:08:18 +01:00
flags_test.go Initial commit 2022-02-13 19:08:18 +01:00
flags.go Initial commit 2022-02-13 19:08:18 +01:00
format_context_ctx_flag.go Initial commit 2022-02-13 19:08:18 +01:00
format_context_flag.go Initial commit 2022-02-13 19:08:18 +01:00
format_context_test.go Initial commit 2022-02-13 19:08:18 +01:00
format_context.go Now using MaxInt32 for array size 2022-08-19 09:30:49 +02:00
format_event_flag.go Initial commit 2022-02-13 19:08:18 +01:00
frame_side_data_type.go Added frame side data 2022-09-18 17:48:10 +02:00
frame_side_data.go Added frame side data 2022-09-18 17:48:10 +02:00
frame_test.go Added frame alloc image 2022-10-10 11:52:15 +02:00
frame.go Added frame alloc image 2022-10-10 11:52:15 +02:00
go.mod Initial commit 2022-02-13 19:08:18 +01:00
go.sum Initial commit 2022-02-13 19:08:18 +01:00
input_format.go Initial commit 2022-02-13 19:08:18 +01:00
int_read_write_test.go Initial commit 2022-02-13 19:08:18 +01:00
int_read_write.go Initial commit 2022-02-13 19:08:18 +01:00
io_context_flag.go Initial commit 2022-02-13 19:08:18 +01:00
io_context_test.go Initial commit 2022-02-13 19:08:18 +01:00
io_context.go Initial commit 2022-02-13 19:08:18 +01:00
io_format_flag.go Initial commit 2022-02-13 19:08:18 +01:00
level.go Initial commit 2022-02-13 19:08:18 +01:00
LICENSE Initial commit 2022-02-13 19:08:18 +01:00
log_test.go Added fmt to log callback 2022-03-24 15:35:37 +01:00
log.go Added fmt to log callback 2022-03-24 15:35:37 +01:00
Makefile Fixed Makefile 2022-12-03 12:34:11 +01:00
mathematics_test.go Initial commit 2022-02-13 19:08:18 +01:00
mathematics.go Initial commit 2022-02-13 19:08:18 +01:00
media_type_test.go Initial commit 2022-02-13 19:08:18 +01:00
media_type.go Initial commit 2022-02-13 19:08:18 +01:00
output_format.go Initial commit 2022-02-13 19:08:18 +01:00
packet_flag.go Initial commit 2022-02-13 19:08:18 +01:00
packet_side_data_type.go Initial commit 2022-02-13 19:08:18 +01:00
packet_test.go Packet FromData() now handles empty data 2022-10-21 14:57:59 +02:00
packet.go Packet FromData() now handles empty data 2022-10-21 14:57:59 +02:00
picture_type_test.go Initial commit 2022-02-13 19:08:18 +01:00
picture_type.go Initial commit 2022-02-13 19:08:18 +01:00
pixel_format_test.go Added FindPixelFormatByName + frame.AllocSamples 2022-02-20 11:23:28 +01:00
pixel_format.go Added FindPixelFormatByName + frame.AllocSamples 2022-02-20 11:23:28 +01:00
profile.go Initial commit 2022-02-13 19:08:18 +01:00
rational_test.go Initial commit 2022-02-13 19:08:18 +01:00
rational.go Initial commit 2022-02-13 19:08:18 +01:00
README.md Added https to goreportcard 2023-02-07 11:19:29 +01:00
rounding.go Initial commit 2022-02-13 19:08:18 +01:00
sample_format_test.go Initial commit 2022-02-13 19:08:18 +01:00
sample_format.go Initial commit 2022-02-13 19:08:18 +01:00
seek_flag.go Initial commit 2022-02-13 19:08:18 +01:00
stream_event_flag.go Initial commit 2022-02-13 19:08:18 +01:00
stream_test.go Initial commit 2022-02-13 19:08:18 +01:00
stream.go Initial commit 2022-02-13 19:08:18 +01:00
strict_std_compliance.go Initial commit 2022-02-13 19:08:18 +01:00
thread_type.go Initial commit 2022-02-13 19:08:18 +01:00
time.go Initial commit 2022-02-13 19:08:18 +01:00

GoReportCard Go Reference Coveralls

astiav is a Golang library providing C bindings for ffmpeg

It's only compatible with ffmpeg n4.4.1.

Its main goals are to:

  • provide a better GO idiomatic API
    • standard error pattern
    • typed constants and flags
    • struct-based functions
    • ...
  • provide the GO version of ffmpeg examples
  • be fully tested

Examples

Examples are located in the examples directory and mirror as much as possible the ffmpeg examples.

name astiav ffmpeg
Demuxing/Decoding see see
Filtering see see
Remuxing see see
Transcoding see see

Tip: you can use the video sample located in the testdata directory for your tests

Install ffmpeg from source

If you don't know how to install ffmpeg, you can use the following to install it from source:

$ make install-ffmpeg

ffmpeg will be built from source in a directory named tmp and located in you working directory

For your GO code to pick up ffmpeg dependency automatically, you'll need to add the following environment variables:

(don't forget to replace {{ path to your working directory }} with the absolute path to your working directory)

export CGO_LDFLAGS="-L{{ path to your working directory }}/tmp/n4.4.1/lib/",
export CGO_CXXFLAGS="-I{{ path to your working directory }}/tmp/n4.4.1/include/",
export PKG_CONFIG_PATH="{{ path to your working directory }}/tmp/n4.4.1/lib/pkgconfig",

Why astiav?

After maintaining for several years the most starred fork of goav, I've decided to write from scratch my own C bindings to fix most of the problems I still encountered using goav.