astiav是一个 Golang 库,为 ffmpeg 提供 C 绑定
Go to file
Cacsjep 063a68b631
Enhance Codec Iteration and Checking of HardwareConfigMethodFlags (#40)
* Add IterateCodecs, Add codec.HasHardwareConfigMethodFlag

* Remove HasHardwareConfigMethodFlag test because git worklow does not support hw

HasHardwareConfigMethodFlag is tested on my local device but does not work in git

* Review Changes

Remove unused arg in HardwareConfigs
Add mehtod to get all codecs
Update test

* Remove codecporcessor type
2024-01-30 11:06:22 +01:00
.github/workflows Added FrameData 2023-09-02 17:26:25 +02:00
examples Enhance Codec Iteration and Checking of HardwareConfigMethodFlags (#40) 2024-01-30 11:06:22 +01:00
internal/cmd/flags Implementation for SWS scale (#33) 2024-01-30 10:25:15 +01:00
testdata Added real file scaling to scale tests 2024-01-30 11:02:15 +01:00
.gitignore Initial commit 2022-02-13 19:08:18 +01:00
astiav_!windows.go Added github action 2023-08-13 10:42:10 +02:00
astiav_test.go Fixed tests 2024-01-24 14:44:43 +01:00
astiav_windows.go Added github action 2023-08-13 10:42:10 +02: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 github action 2023-08-13 10:42:10 +02:00
channel_layout_test.go Bumped ffmpeg version to n5.1.2 2023-03-23 14:59:40 +01:00
channel_layout.go Removed pointer on ChannelLayout + now cloning channel layouts in getters 2023-09-28 15:21:32 +02: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 FrameData 2023-09-02 17:26:25 +02:00
codec_context.go Added codec context pixel format callback 2024-01-26 15:13:23 +01:00
codec_hardware_config_method_flag.go Minor changes 2024-01-24 18:29:35 +01:00
codec_hardware_config.go Implementation for HW Context (#32) 2024-01-24 18:23:12 +01:00
codec_id_test.go Initial commit 2022-02-13 19:08:18 +01:00
codec_id.go add H265 to codecid (#35) 2024-01-23 10:13:28 +01:00
codec_parameters_test.go Added FrameData 2023-09-02 17:26:25 +02:00
codec_parameters.go Removed pointer on ChannelLayout + now cloning channel layouts in getters 2023-09-28 15:21:32 +02:00
codec_tag.go Initial commit 2022-02-13 19:08:18 +01:00
codec_test.go Enhance Codec Iteration and Checking of HardwareConfigMethodFlags (#40) 2024-01-30 11:06:22 +01:00
codec.go Enhance Codec Iteration and Checking of HardwareConfigMethodFlags (#40) 2024-01-30 11:06:22 +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 Disabled filter graph tests for windows 2023-08-14 11:02:13 +02: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 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 Added github action 2023-08-13 10:42:10 +02: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 Disabled filter graph tests for windows 2023-08-14 11:02:13 +02: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
flags_test.go Implementation for SWS scale (#33) 2024-01-30 10:25:15 +01:00
flags.go Implementation for SWS scale (#33) 2024-01-30 10:25:15 +01:00
format_context_ctx_flag.go Initial commit 2022-02-13 19:08:18 +01:00
format_context_flag.go Bumped ffmpeg version to n5.1.2 2023-03-23 14:59:40 +01:00
format_context_test.go Added FrameData 2023-09-02 17:26:25 +02:00
format_context.go Bumped ffmpeg version to n5.1.2 2023-03-23 14:59:40 +01:00
format_event_flag.go Initial commit 2022-02-13 19:08:18 +01:00
frame_data_internal_test.go Unexported NewFrameData and FrameDataFrame 2024-01-26 13:25:08 +01:00
frame_data_test.go Unexported NewFrameData and FrameDataFrame 2024-01-26 13:25:08 +01:00
frame_data.go Unexported NewFrameData and FrameDataFrame 2024-01-26 13:25:08 +01:00
frame_side_data_type.go Added frame side data 2022-09-18 17:48:10 +02:00
frame_side_data.go Added github action 2023-08-13 10:42:10 +02:00
frame_test.go Added FrameData 2023-09-02 17:26:25 +02:00
frame.go Unexported NewFrameData and FrameDataFrame 2024-01-26 13:25:08 +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 Implementation for HW Context (#32) 2024-01-24 18:23:12 +01:00
hardware_device_type_test.go Implementation for HW Context (#32) 2024-01-24 18:23:12 +01:00
hardware_device_type.go Implementation for HW Context (#32) 2024-01-24 18:23:12 +01:00
input_format_test.go Unexported NewFrameData and FrameDataFrame 2024-01-26 13:25:08 +01:00
input_format.go Add avdevice support (#29) 2023-07-27 17:59:18 +02: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 Not using io/ioutil anymore 2023-03-31 16:35:15 +02: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 Bumped ffmpeg version to n5.1.2 2023-03-23 14:59:40 +01:00
Makefile Added github action 2023-08-13 10:42:10 +02: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 Added FrameData 2023-09-02 17:26:25 +02:00
packet.go Added github action 2023-08-13 10:42:10 +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 Renamed ration ToDouble() to Float64() 2024-01-26 11:41:37 +01:00
rational.go Renamed ration ToDouble() to Float64() 2024-01-26 11:41:37 +01:00
README.md Implementation for SWS scale (#33) 2024-01-30 10:25:15 +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
software_scale_context_flag.go Implementation for SWS scale (#33) 2024-01-30 10:25:15 +01:00
software_scale_context_test.go Added real file scaling to scale tests 2024-01-30 11:02:15 +01:00
software_scale_context.go Added real file scaling to scale tests 2024-01-30 11:02:15 +01:00
stream_event_flag.go Initial commit 2022-02-13 19:08:18 +01:00
stream_test.go Added FrameData 2023-09-02 17:26:25 +02:00
stream.go Added github action 2023-08-13 10:42:10 +02: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 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
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.