Skip to content

Instantly share code, notes, and snippets.

@Xantios
Created January 12, 2021 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xantios/85d075cec005e394f44a54e503f5994b to your computer and use it in GitHub Desktop.
Save Xantios/85d075cec005e394f44a54e503f5994b to your computer and use it in GitHub Desktop.
Hacking around with FFmpeg

Whut?

So first things first, there is/was a fork of FFMPeg called LibAV. if you looking for docs on that, good luck!

libav (the actual code that makes ffmpeg tick) is a C library so we have to tinker with some low-level stuff

Install

first off, install pkg-config brew install pkgconfig should fix that for you. ofcrouse you can install ffmpeg the same way if you did not do so already

now run: which ffmpeg which should result to something like: /usr/local/bin/ffmpeg

When we inspect this by running: ls -la /usr/local/bin/ffmpeg we'll see this is a symlink. on my machine the result is ../Cellar/ffmpeg/4.3.1-with-options_6/bin/ffmpeg

So the path we want is /usr/local/Cellar/ffmpeg/4.3.1-with-options_6/ when we go there we'll see lib/pkgconfig which is where we want to point pkg-config to

I added the following to my zshrc:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/ffmpeg/4.3.1-with-options_6/lib/pkgconfig

Now reload your shell (or source the file) run pkg-config --cflags libavutil and it should return -I/usr/local/...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment