FFmpeg

FFmpeg is a software to manipulate audio and video files. FFprobe is a software to gather information from multimedia streams and prints it in human- and machine-readable fashion.

Install FFmpeg and FFprobe on a Scalingo Application

To install FFmpeg and FFprobe on a Scalingo application, you need to make use of the APT buildpack. This buildpack should be used as part of a multi-buildpack.

Add the .buildpacks file

First you need to create a .buildpacks file at the root of your project. Then add the apt buildpack on the first line:

echo "https://github.com/Scalingo/apt-buildpack" > .buildpacks

After the apt buildpack, add the buildpack of the technology that your application use. For example, for a PHP application you would need to add:

echo "https://github.com/Scalingo/php-buildpack" >> .buildpacks

In the end, the .buildpacks file should looks like this:

https://github.com/Scalingo/apt-buildpack
https://github.com/Scalingo/php-buildpack

Add the Aptfile

You need to instruct the APT buildpack to install the ffmpeg package. So you need to create a Aptfile at the root of your project with the following content:

ffmpeg

Add the LD_LIBRARY_PATH environment variable

You also need to define the environment variable LD_LIBRARY_PATH:

scalingo --app my-app env-set LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/app/.apt/usr/lib/x86_64-linux-gnu/pulseaudio:/app/.apt/usr/lib/x86_64-linux-gnu/blas:/app/.apt/usr/lib/x86_64-linux-gnu/lapack'

Trigger a new deployment

Commit .buildpacks and Aptfile files, then redeploy your application.

Check that FFmpeg and FFprobe are installed

You can make sure that FFmpeg and FFprobe are installed by running a one-off container:

$ scalingo --app my-app run bash

[00:00] Scalingo ~ $ ffmpeg
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Suggest edits

FFmpeg

©2024 Scalingo