astiav是一个 Golang 库,为 ffmpeg 提供 C 绑定
Go to file
2024-05-21 10:10:26 +02:00
.github/workflows Fixed install-ffmpeg for empty patch 2024-03-30 11:26:53 +01:00
examples Added frame data example to demuxing/decoding example 2024-05-19 15:51:33 +02:00
internal Fixed png tests failing for arm/7 2024-03-30 09:37:53 +01:00
testdata Fixed png tests failing for arm/7 2024-03-30 09:37:53 +01:00
.gitignore Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
astiav_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
bit_stream_filter_context_test.go Renamed bit stream filter in parameters 2024-05-17 11:04:01 +02:00
bit_stream_filter_context.go Renamed bit stream filter in parameters 2024-05-17 11:04:01 +02:00
bit_stream_filter_test.go Add bit stream filter support (#61) 2024-05-14 18:14:20 +02:00
bit_stream_filter.go Add bit stream filter support (#61) 2024-05-14 18:14:20 +02:00
buffersink_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
buffersrc_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
bytes_test.go Initial commit 2022-02-13 19:08:18 +01:00
bytes.go Added extra data to codec context 2024-04-13 10:30:20 +02:00
channel_layout_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
channel_layout.go Replaced cULong/cLong with C.size_t/C.ptrdiff_t 2024-03-29 09:14:27 +01:00
chroma_location.go Initial commit 2022-02-13 19:08:18 +01:00
class_category.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
class_test.go Added AllocIOContext 2024-05-07 16:11:03 +02:00
class.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
codec_context_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
codec_context_test.go Added extra data to codec context 2024-04-13 10:30:20 +02:00
codec_context.go Added extra data to codec context 2024-04-13 10:30:20 +02:00
codec_hardware_config_method_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
codec_hardware_config.go Added filter thread methods 2024-05-21 10:10:26 +02:00
codec_id_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
codec_id.go add H265 to codecid (#35) 2024-01-23 10:13:28 +01:00
codec_parameters_test.go Added extra data to codec context 2024-04-13 10:30:20 +02:00
codec_parameters.go Added extra data to codec context 2024-04-13 10:30:20 +02:00
codec_tag.go Initial commit 2022-02-13 19:08:18 +01:00
codec_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
codec.go Minor codec hardware config changes 2024-01-30 11:10:59 +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
device_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
device.go Add avdevice support (#29) 2023-07-27 17:59:18 +02:00
dictionary_entry.go Initial commit 2022-02-13 19:08:18 +01:00
dictionary_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
dictionary_test.go Initial commit 2022-02-13 19:08:18 +01:00
dictionary.go Replaced cULong/cLong with C.size_t/C.ptrdiff_t 2024-03-29 09:14:27 +01:00
display_matrix_test.go Added some setters + missing display matrix methods 2024-03-13 16:14:36 +01:00
display_matrix.go Added some setters + missing display matrix methods 2024-03-13 16:14:36 +01:00
error_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
error.go Initial commit 2022-02-13 19:08:18 +01:00
filter_command_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
filter_context.go Updated max array size computation 2024-03-29 10:38:44 +01:00
filter_graph_test.go Added filter thread methods 2024-05-21 10:10:26 +02:00
filter_graph.go Added filter thread methods 2024-05-21 10:10:26 +02: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 Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
filter.go Initial commit 2022-02-13 19:08:18 +01:00
flags_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
flags.go Implementation for SWS scale (#33) 2024-01-30 10:25:15 +01:00
format_context_ctx_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
format_context_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
format_context_test.go Added AllocIOContext 2024-05-07 16:11:03 +02:00
format_context.go Added custom io demuxing + writable to AllocIOContext 2024-05-16 17:16:53 +02:00
format_event_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
frame_data_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
frame_data.go Replaced cULong/cLong with C.size_t/C.ptrdiff_t 2024-03-29 09:14:27 +01:00
frame_side_data_type.go Added frame side data 2022-09-18 17:48:10 +02:00
frame_side_data.go Replaced cULong/cLong with C.size_t/C.ptrdiff_t 2024-03-29 09:14:27 +01:00
frame_test.go Added AllocIOContext 2024-05-07 16:11:03 +02:00
frame.go Replaced cULong/cLong with C.size_t/C.ptrdiff_t 2024-03-29 09:14:27 +01:00
go.mod Moved bit flags to astikit 2023-10-03 12:20:41 +02:00
go.sum Moved bit flags to astikit 2023-10-03 12:20:41 +02:00
hardware_device_context.go Added filter thread methods 2024-05-21 10:10:26 +02:00
hardware_device_type_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
hardware_device_type.go Implementation for HW Context (#32) 2024-01-24 18:23:12 +01:00
input_format_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
input_format.go Add avdevice support (#29) 2023-07-27 17:59:18 +02:00
int_read_write_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
int_read_write.go Initial commit 2022-02-13 19:08:18 +01:00
io_context_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
io_context_test.go Added custom io demuxing + writable to AllocIOContext 2024-05-16 17:16:53 +02:00
io_context.c Added AllocIOContext 2024-05-07 16:11:03 +02:00
io_context.go Added custom io demuxing + writable to AllocIOContext 2024-05-16 17:16:53 +02:00
io_context.h Added AllocIOContext 2024-05-07 16:11:03 +02:00
io_format_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
io_interrupter_test.go IOInterrupter is now an interface (again :D) 2024-03-18 08:46:25 +01:00
io_interrupter.go IOInterrupter is now an interface (again :D) 2024-03-18 08:46:25 +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 Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
log.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
Makefile Fixed install-ffmpeg for empty patch 2024-03-30 11:26:53 +01:00
mathematics_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
mathematics.go Initial commit 2022-02-13 19:08:18 +01:00
media_type_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
media_type.go Initial commit 2022-02-13 19:08:18 +01:00
output_format_test.go Added find output format 2024-04-14 11:13:42 +02:00
output_format.go Added find output format 2024-04-14 11:13:42 +02:00
packet_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
packet_side_data_type.go Initial commit 2022-02-13 19:08:18 +01:00
packet_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
packet.go Replaced cULong/cLong with C.size_t/C.ptrdiff_t 2024-03-29 09:14:27 +01:00
picture_type_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
picture_type.go Initial commit 2022-02-13 19:08:18 +01:00
pixel_format_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +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 Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
rational.go Renamed ration ToDouble() to Float64() 2024-01-26 11:41:37 +01:00
README.md Added custom io demuxing + writable to AllocIOContext 2024-05-16 17:16:53 +02:00
rounding.go Initial commit 2022-02-13 19:08:18 +01:00
sample_format_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
sample_format.go Initial commit 2022-02-13 19:08:18 +01:00
seek_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
software_scale_context_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
software_scale_context_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
software_scale_context.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
stream_event_flag.go Now using int64 for flags 2024-03-29 10:38:44 +01:00
stream_test.go Added some setters + missing display matrix methods 2024-03-13 16:14:36 +01:00
stream.go Replaced cULong/cLong with C.size_t/C.ptrdiff_t 2024-03-29 09:14:27 +01:00
strict_std_compliance.go Initial commit 2022-02-13 19:08:18 +01:00
thread_type.go Added filter thread methods 2024-05-21 10:10:26 +02:00
time_test.go Added Classer + now logs returns a Classer + tests are now done in astiav package 2024-02-28 18:05:36 +01:00
time.go Added time test 2024-02-21 12:05:48 +01:00

GoReportCard GoDoc Test Coveralls

astiav is a Golang library providing C bindings for ffmpeg

It's only compatible with ffmpeg n5.1.2.

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
BitStream Filtering see X
Custom IO Demuxing see see
Demuxing/Decoding see see
Filtering see see
Hardware Decoding see see
Remuxing see see
Scaling 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/n5.1.2/lib/",
export CGO_CFLAGS="-I{{ path to your working directory }}/tmp/n5.1.2/include/",
export PKG_CONFIG_PATH="{{ path to your working directory }}/tmp/n5.1.2/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.