开源软件名称:giorgisio/goav开源软件地址:https://github.com/giorgisio/goav开源编程语言:Go 100.0%开源软件介绍:Deprecation NoticeThis repository is no longer maintained. goavGolang binding for FFmpeg A comprehensive binding to the ffmpeg video/audio manipulation library. Usageimport "github.com/giorgisio/goav/avformat"
func main() {
filename := "sample.mp4"
// Register all formats and codecs
avformat.AvRegisterAll()
ctx := avformat.AvformatAllocContext()
// Open video file
if avformat.AvformatOpenInput(&ctx, filename, nil, nil) != 0 {
log.Println("Error: Couldn't open file.")
return
}
// Retrieve stream information
if ctx.AvformatFindStreamInfo(nil) < 0 {
log.Println("Error: Couldn't find stream information.")
// Close input file and free context
ctx.AvformatCloseInput()
return
}
//...
} Libraries
Installationsudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev
sudo apt install -y libavdevice-dev libavfilter-dev libswscale-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev
sudo apt-get install yasm
export FFMPEG_ROOT=$HOME/ffmpeg
export CGO_LDFLAGS="-L$FFMPEG_ROOT/lib/ -lavcodec -lavformat -lavutil -lswscale -lswresample -lavdevice -lavfilter"
export CGO_CFLAGS="-I$FFMPEG_ROOT/include"
export LD_LIBRARY_PATH=$HOME/ffmpeg/lib
More ExamplesCoding examples are available in the examples/ directory. Note
Contribute
TODO
LicenseThis library is under the MIT License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论