Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #205969

Help with video editing with ffmpeg

From Gerardo Ballabio <gerardo.ballabio@gmail.com>
Newsgroups linux.debian.user
Subject Help with video editing with ffmpeg
Date 2019-03-03 18:40 +0100
Message-ID <xxDfH-74E-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hello all,
I have a video that was filmed under bad lighting conditions, the
background is too bright and people in the foreground are dark. I'm
trying to use ffmpeg to correct it. Please kindly help me.

Here you can find a snippet:
https://drive.google.com/drive/folders/1aG04znyHdDio7cvgaQlovYTb8bX8NTLL?usp=sharing

video1.mts is the original file. video2.mp4 was created by a friend of
mine using proprietary software on Windows. I've been trying to
reproduce that. video3.mts is the best result I obtained (see below)
but the contrast is still too high and the colors aren't quite right.

I've tried several of ffmpeg's effects but maybe there are some better
ones that I missed?

- "eq=brightness=..." turns black into grey and gives the video a
"foggy" look, no good
- "colorlevels=..." I tried many parameter sets but couldn't do much
better, in the end I concluded that probably linear scaling isn't good
enough and I need nonlinear
- "curves=..." was indeed better but when I stretched the curve beyond
a certain point I obtained distorted colors
- I tried "geq=..." too but it doesn't seem to work, I always get an
error like this:

ffmpeg -i video1.mts -vf geq='r=r(X,Y):g=g(X,Y):b=b(X,Y)' video3.mts
[Parsed_geq_0 @ 0x55a01bb0aa60] [Eval @ 0x7ffd3d63afb0] Missing ')' or
too many args in 'r(X'
[AVFilterGraph @ 0x55a01bb09e80] Error initializing filter 'geq' with
args 'r=r(X'
Error opening filters!

These are the commands that I used to produce video3.mts:

ffmpeg -i video1.mts -vf colorlevels=romax=0.8:gomax=1.0:bomax=0.9 -b
12M temp.mts
ffmpeg -i temp.mts -vf curves=r='0/0.05 0.1/0.25 1/0.8':g='0/0.05
0.1/0.25 1/0.8':b='0/0.05 0.1/0.25 1/0.8' -b 12M video3.mts

Thanks
Gerardo

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Help with video editing with ffmpeg Gerardo Ballabio <gerardo.ballabio@gmail.com> - 2019-03-03 18:40 +0100
  Re: Help with video editing with ffmpeg Gerardo Ballabio <gerardo.ballabio@gmail.com> - 2019-03-06 12:10 +0100
    Re: Help with video editing with ffmpeg mick crane <mick.crane@gmail.com> - 2019-03-06 13:30 +0100
    Re: Help with video editing with ffmpeg rhkramer@gmail.com - 2019-03-06 17:30 +0100
    Re: Help with video editing with ffmpeg Gerardo Ballabio <gerardo.ballabio@gmail.com> - 2019-03-13 10:40 +0100
      Re: Help with video editing with ffmpeg mick crane <mick.crane@gmail.com> - 2019-03-13 16:40 +0100
  Re: Help with video editing with ffmpeg Dan Ritter <dsr@randomstring.org> - 2019-03-06 15:20 +0100

csiph-web