# Add ffmpeg either as a build or to CI

**URL:** <https://discourse.julialang.org/t/add-ffmpeg-either-as-a-build-or-to-ci/16079>\
**Category:** General Usage\
**Tags:** question, build, ci\
**Created:** [October 9, 2018, 3:10pm UTC](https://discourse.julialang.org/t/add-ffmpeg-either-as-a-build-or-to-ci/16079 "2018-10-09T15:10:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [October 9, 2018, 3:10pm UTC](https://discourse.julialang.org/t/add-ffmpeg-either-as-a-build-or-to-ci/16079/1 "2018-10-09T15:10:41Z")

</div>

**tl;dr:** Anyone know how to add `ffmpeg` to the CI tests or, better yet, as a build for a package?

I’m writing a package that relies on video IO. Since the [VideoIO.jl](https://github.com/kmsquire/VideoIO.jl) package is not completely v1 ready (but in the process as much as I understand), I want to add `ffmpeg` as a dependency to my package and then I just shell-out when video IO is needed in my package.

The ideal would be to get it as an actual build dependency. I think that might be too complicated for me (unless someone has already done this and has working code I can just copy-paste). Short of that, I’d love to at least add it to the tests on Travis and apveyor. I used to be able to do it with something like [this](https://discourse.julialang.org/t/how-to-add-ffmpeg-to-travis/9366/2). But _that_ doesn’t work anymore (using the recommended travis and appveyor templates).

Any help appreciated!

---

<div class="post-metadata">

**Author:** ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)\
**Post date:** [October 9, 2018, 3:51pm UTC](https://discourse.julialang.org/t/add-ffmpeg-either-as-a-build-or-to-ci/16079/2 "2018-10-09T15:51:51Z")

</div>

[https://github.com/kmsquire/VideoIO.jl/issues/120](https://github.com/kmsquire/VideoIO.jl/issues/120)

EDIT: I don’t think we’ve made any progress recently, but I’ve got a few builder repos on my Github for dependencies which still are not building for some/many/most platforms. If we can get YasmBuilder working, it’ll make a lot of other things fall into place.

That said, I don’t know if anyone has started on the actual builder for ffmpeg itself, so if you feel like taking a shot at it, feel free. I’m sure many of us would be happy to help 😃

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [October 9, 2018, 5:38pm UTC](https://discourse.julialang.org/t/add-ffmpeg-either-as-a-build-or-to-ci/16079/3 "2018-10-09T17:38:18Z")

</div>

Is there anything a monkey randomly typing on a keyboard can do?

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [October 9, 2018, 5:52pm UTC](https://discourse.julialang.org/t/add-ffmpeg-either-as-a-build-or-to-ci/16079/4 "2018-10-09T17:52:48Z")

</div>

Looking for `ffmpeg` in [juliaobserver.com](https://juliaobserver.com/searches?utf8=%E2%9C%93&term=ffmpeg) shows there are 11 packages that depend on `ffmpeg` functionalities (e.g. Makie, VideoIO, Plots, Reel, EdgeCameras, etc), so I think solving this would be quite useful.

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [October 9, 2018, 8:27pm UTC](https://discourse.julialang.org/t/add-ffmpeg-either-as-a-build-or-to-ci/16079/5 "2018-10-09T20:27:32Z")

</div>

Well, the following worked out for me in the end, but only the CI way (so no build). Writing it down here, in case this proves useful to any future users:

in `appveyor.yml`:

```nohighlight
install:
  - cinst ffmpeg

```

in `.travis.yml`:

```nohighlight
before_install:
    - if [["$TRAVIS_OS_NAME" == "linux"]]; then ./test/install_ffmpeg.sh ; fi
    - if [["$TRAVIS_OS_NAME" == "osx"]]; then brew install ffmpeg; fi

```

where `install_ffmpeg.sh` is:

```nohighlight
#!/bin/sh

sudo add-apt-repository -y ppa:mc3man/trusty-media
sudo apt-get -qq update
sudo apt-get install -y ffmpeg

```

~~I suspect `install_ffmpeg.sh` can be simplified.~~

Of course this is suboptimal – it allows for CI, but users will still need to manually install `ffmpeg` on their systems for you package to work. The real work is the stuff mention above and worked on by @jpsamaroo and the good folks on that issue.
