Home

Awesome

avpack

avpack is a fast C library that can pack and unpack data to/from the popular multimedia container formats.

avpack code is header-only (.h-only) and doesn't need to be built into .a/.so/.dll before use - you just include .h file and that's all.

avpack is used by fmedia (github.com/stsaz/fmedia) - a fast media player/recorder/converter. avpack is now the only suitable library for reading and writing multimedia files for the asynchronous and economical file I/O which fmedia implements.

Contents:

Features

PurposeInclude Files
Audio file formats:
.aac readaac-read.h
.ape readape-read.h
.avi readavi-read.h
.caf readcaf-read.h
.flac readflac-read.h
.mkv readmkv-read.h
.mp3 read/writemp3-read.h, mp3-write.h
.mp4/.m4a/.mov read/writemp4-read.h, mp4-write.h
.mpc readmpc-read.h
.ogg(FLAC) readflac-ogg-read.h
.ogg/.opus read/writeogg-read.h, ogg-write.h
.ts readts-read.h
.wav read/writewav-read.h, wav-write.h
.wv read/writewv-read.h
Audio streams:
ICY stream readicy.h
MPEG-1 stream readmpeg1-read.h
Playlists:
.cue readcue.h
.m3u read/writem3u.h
.pls readpls.h
MM Tags:
APETAG readapetag.h
ID3v1 & ID3v2 read/writeid3v1.h, id3v2.h
Vorbis tags read/writevorbistag.h
Graphics:
.bmp read/writebmp-read.h, bmp-write.h
.jpg readjpg-read.h
.png readpng-read.h

It doesn't contain code that reads or writes files - this is user's responsibility.

How to use

  1. Clone repos:

     git clone https://github.com/stsaz/ffbase
     git clone https://github.com/stsaz/avpack
    
  2. Set compiler flags in your build script:

     -IFFBASE_DIR -IAVPACK_DIR
    

where FFBASE_DIR is your ffbase/ directory, and AVPACK_DIR is your avpack/ directory.

  1. And then just use the necessary files, e.g.:

     #include <avpack/mp4-read.h>
     #include <avpack/mp4-write.h>
    

Reader interface

Each format reader has a similar set of functions:

Writer interface

Each format writer has a similar set of functions:

Test

git clone https://github.com/stsaz/ffbase
git clone https://github.com/stsaz/avpack
cd avpack/test
make
./avpack-test all

License

This code is absolutely free.