0

I cannot adjust a video using avconv or ffmpeg with Gamma correction. I use Debian Jessie, so I first suspected that avconv was incomplete, so following this question, I built ffmpeg myself.

Using this blog post, I assumed the following filter would be fine (to apply a Gamma of 0.5):

ffmpeg -i in.mp4 -vf mp=eq2=0.5:1:1:1:1:1:1:1 out.mp4

However, it just says

[AVFilterGraph @ 0x1faf6a0] No such filter: 'mp'
Error opening filters!

Has the filter been renamed? How do I apply a Gamma correction? So I looked at this documentation and it seems I should be using the eq filter instead. Try:

ffmpeg -i in.mp4 -vf eq=gamma=0.5 out.mp4

No success:

[AVFilterGraph @ 0x23466a0] No such filter: 'eq'
Error opening filters!

2 Answers2

1

It seems that by default several filters are missing because ffmpeg folks don't like the GPL license... So here is what I did step-by-step:

(1) install dependencies

sudo apt-get install yasm nasm \
            build-essential automake autoconf \
            libtool pkg-config libcurl4-openssl-dev \
            intltool libxml2-dev libgtk2.0-dev \
            libnotify-dev libglib2.0-dev libevent-dev \
            checkinstall

(2) clone repository

git clone git://git.videolan.org/ffmpeg.git

(3) compile with GPL enabled:

cd ffmpeg
./configure --enable-gpl --prefix=/usr
time make -j 8
sudo mkdir /usr/share/ffmpeg
sudo checkinstall

In the last step you are asked to enter package information. I added the version information, but that should be optional.


Then it works:

ffmpeg -i in.mp4 -vf "eq=gamma=0.5" out.mp4

Edit: Unfortunately the above gives you still a vanilla ffmpeg without any useful codec such as libx264. After spending hours on this, I concluded that the only way to make it work is forget about compiling from source, and adding deb-multimedia as is suggested in the linked answer.

0

I regularly build ffmpeg from the git repo with 30+ libs and these work for me, as the ffmpeg documentation for examples is terrible

simple way, look up one of the default curves

ffmpeg -i file.mp4 -codec:v blahblahblah -filter:v curves=preset=strong_contrast -codec:a copy dump_file.mp4

use the lut

ffmpeg -i file.mp4 -codec:v blahblahblah -filter:v lutyuv=y=val*1.3 -codec:a copy dump_file.mp4

go balls out and define all min/max for rgb, this will lighten

ffmpeg -i file.mp4 -codec:v blahblahblah -filter:v colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.95:gimax=0.94:bimax=0.93 -codec:a copy dump_file.mp4

I confirmed with ffplay command still works with

ffplay movie.mp4 -vf eq=gamma=1.5