Help installing FFmpeg

Hello! Inspired by the VCV Recorder module, I’m hoping to use ffmpeg to save and load audio files in my modules. I’m currently using dr_wav, which is fine, but I’d like to switch to a new library. However, I’m having some trouble understanding how to include FFmpeg in my project.

Copying VCV Recorder’s approach, I added

extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}

Next step, put those folders in place. I’ve downloaded the source for FFmpeg and have everything unzipped and untarred. But where do I put the files? Sorry, I know this is a very basic question. I tried searching these forums with terms like, “installing C++ libraries” but nothing turned up. Thanks!!

You have to build the library. Take a look at VCV Recorder‘s Makefile how to do it. I hardly know anything about FFmpeg so I can’t help you with the build options…

1 Like

Ah, excellent. Thanks for the lead. I may be able to get it working from here. :wink:

Important information you should mention:

  1. What platform are you developing on?
  2. Check the build instructions Each platform is a little different.

If (as I suspect) you’re on Windows you don’t need to build FFMPEG, you can just install the libraries (and coincidentally the useful command line tools) for FFMPEG

Using ffmpeg for WAV encoding is ridiculously overpowered. Even using ffmpeg for general audio encoding/decoding is overpowered. Use something like http://www.mega-nerd.com/libsndfile/ instead. Think smart, not hard.

1 Like

Thanks for the heads up. I ended up trying AudioFile.h, which is treating me well so far and is hopefully lighter weight.

Haven’t heard of that one, but as long as your plugin is GPLv3, it looks like it will work.