How to add ffmpeg to Travis?

question
plotting
travis

#1

In order to test Plots.jlgif creation in Travis, i.e. something like this:

using Base.Test, Plots
anim = @animate for i=1:2
    plot(rand(2))
end
name = tempname()*".gif"
gif(anim, name)
@test isfile(name)

we have to somehow add ffmpeg as a dependency (e.g. in the .travis.yml file, or via BinDeps.jl). Does anyone know exactly how this is done?


Travis woes: warning accessibility bus and segmentation fault
#2

Does adding something like

before_install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media/+files/ffmpeg_3.3.3~trusty2_amd64.deb ; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo dpkg -i ffmpeg_3.3.3~trusty2_amd64.deb ; fi

in travis.yml work?
Note that this is just a guess based on how Plots.jl installs wkhtmltox on travis for the tests. (See https://github.com/JuliaPlots/Plots.jl/blob/master/.travis.yml#L21 and https://github.com/JuliaPlots/Plots.jl/blob/master/test/install_wkhtmltoimage.sh)


#3

Interesting. But I got this error:

removed ‘/etc/apt/sources.list.d/basho_riak.list’
W: http://ppa.launchpad.net/couchdb/stable/ubuntu/dists/trusty/Release.gpg: Signature by key 15866BAFD9BCC4F3C1E0DFC7D69548E1C17EAB57 uses weak digest algorithm (SHA1)
W: Failed to fetch https://packagecloud.io/computology/apt-backport/ubuntu/dists/trusty/InRelease  Failed to connect to packagecloud.io port 443: Connection timed out
W: Failed to fetch https://packagecloud.io/github/git-lfs/ubuntu/dists/trusty/InRelease  Failed to connect to packagecloud.io port 443: Connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

I’ll see if I also can make a small bash file for ffmpeg, but how would one solve this for the mac Travis?


#4

You could also try something like

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

in the bash file. I have no idea about mac though.


#5

Fixed! Thanks @daschw!!!
I ended up using this:

#!/bin/sh

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

#6

Awesome!


#7

Am I to understand from this that Plots.jl is not supported on macs? :scream:


#8

This has been that way before I joind the JuliaPlots team - not sure why… I will take a look at what the issue with travis on mac is.


#9

I guess part of the problem is the installation of ffmpeg.


#10

This line in .travis.yml finally solved it:

  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ffmpeg cairo; fi