Skip to content
C++ wrapper for FFmpeg
C++ CMake Other
Branch: master
Clone or download
Latest commit 7da2645 Aug 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android Complex refactoring Dec 4, 2013
catch2 @ f0b7b0c Add Catch2 submodule Jun 10, 2019
ci/travis WA to build with CMake 3.11 (Travis OSX provide it) Jun 11, 2019
cmake Fix cmake reconfiguration fails Feb 15, 2019
example Remove compilation warnings Aug 30, 2018
src CMake: Add namespace-like AvCpp::AvCpp alias to use with Jun 11, 2019
tests WA to build with CMake 3.11 (Travis OSX provide it) Jun 11, 2019
.gitignore Complex refactoring Dec 4, 2013
.gitmodules Add Catch2 submodule Jun 10, 2019
.travis.yml
CMakeLists.txt WA to build with CMake 3.11 (Travis OSX provide it) Jun 11, 2019
CONTRIBUTING.md Create CONTRIBUTING.md Mar 29, 2019
LICENSE-bsd.txt Add ability to use under BSD License Mar 7, 2017
LICENSE-lgpl2.txt Add ability to use under BSD License Mar 7, 2017
LICENSE.md Add links to the licesense files to LICENSE.md Mar 7, 2017
README.md

README.md

AvCpp Build Status Language grade: C/C++ PRs Welcome

Wrapper for the FFmpeg that simplify usage it from C++ projects.

Currently covered next functionality:

  • Core helper & utility classes (AVFrame -> av::AudioSample & av::VideoFrame, AVRational -> av::Rational and so on)
  • Container formats & contexts muxing and demuxing
  • Codecs & codecs contexts: encoding and decoding
  • Streams (AVStream -> av::Stream)
  • Filters (audio & video): parsing from string, manual adding filters to the graph & other
  • SW Video & Audio resamplers

Requirements

  • FFmpeg >= 2.0
    • libavformat >= 54.x.x
    • libavcodec >= 54.x.x
    • libavfilter >= 3.x.x
    • libavutil >= 51.x.x
    • libswscale >= 2.x.x
    • libswresample >= 0.x.x
    • libpostproc >= 52.x.x
  • GCC >= 5.0 (C++11 is required)

Debian

You should install FFmpeg packages from the deb-multimedia.org site:

sudo apt-get install libavformat-dev \
                     libavcodec-dev \
                     libavutil-dev \
                     libavfilter-dev \
                     libswscale-dev \
                     libswresample-dev \
                     libpostproc-dev

Note 1: I did not test building on Debian.

Note 2: Debian Wheezy repo contains only FFmpeg 1.0.8. I tested building only with 2.x. So it is strongly recoment use Wheezy back-ports repo.

Ubuntu and Linux Mint

You should add ffmpeg-3 PPA:

sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
sudo add-apt-repository ppa:jonathonf/tesseract -y
sudo apt update && sudo apt upgrade
sudo apt install libavcodec-dev \
                 libavdevice-dev \
                 libavfilter-dev \
                 libavformat-dev \
                 libavresample-dev \
                 libavutil-dev \
                 libpostproc-dev \
                 libswresample-dev \
                 libswscale-dev

Also, you can use ffmpeg-4 PPA if needed. Instruction mostly same. Just change PPA name.

Build

git clone --recurse-submodules https://github.com/h4tr3d/avcpp.git avcpp-git
cd avcpp-git
mkdir build
cd build
cmake ..
make -j8

If your Git version so old (refer to the SO for clarification) you can just replace --recurse-submodules with pair of git submodule init && git submodule update.

If FFmpeg located in non-standard place:

cmake -DPC_FFMPEG_LIBRARY_DIRS=<some_path> -DPC_FFMPEG_INCLUDE_DIRS=<some_path> ..

To point install prefix:

cmake -DCMAKE_INSTALL_PREFIX=/usr ..

Install:

sudo make install

or (for packaging)

sudo make DESTDIR=<some_prefix> install

Refer to CMake documentation for more details that can cover some special cases.

You can’t perform that action at this time.