Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-18-2015, 06:22 PM   #1
Bret W
Registered: Jan 2015
Posts: 33

Rep: Reputation: Disabled
Can ffmpeg, mencoder, handbrake fix fluctuating audio like VLC can?


I have some video files where audio dialogue is low but action scenes are loud. I was searching the web on how I can fix this and I found this link

It is an excellent tutorial from lifehacker.

I was wondering if ffmpeg, mplayer/mencoder, handbrake or other commandline program can do the same of increasing the low audio dialogue while keeping the loud action scenes the same audio level? Thanks

Last edited by Bret W; 02-18-2015 at 06:29 PM.
Old 02-18-2015, 06:28 PM   #2
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,957

Rep: Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522Reputation: 4522
The solution that immediately comes to mind is to use one of those tools to demux the audio track into a separate file, use audacity to dynamic-range-compress that audio file, and then use that tool to mux the audio and video back together.

If the video file has a surround sound track and you're playing it on a surround sound setup, then a better solution would be to turn up the levels on your center speakers.

(Personally, I consider dynamic range compression to be the devil).

Last edited by dugan; 02-18-2015 at 06:32 PM.
Old 02-18-2015, 06:47 PM   #3
Bret W
Registered: Jan 2015
Posts: 33

Original Poster
Rep: Reputation: Disabled
I did that before awhile back. I used ffmpeg to separate the audio track and then use audacity to tweak the audio. But, I am not an audio engineer to know how to use those effects filter tools in audacity except for the basics like normalize, amplified and equalizer which increased the low audio, but made the action scenes even louder

I can increase the volume in the video files with ffmpeg and mencoder but it affects the entire audio of the video and I just want the low dialogues to be affected by the increase.

I guess I'll have to use the VLC method above or practice with audacity. I think I'll try the compressor filter in audacity and test.

Thanks dugan

Last edited by Bret W; 02-18-2015 at 06:49 PM.
Old 02-19-2015, 02:39 PM   #4
Bret W
Registered: Jan 2015
Posts: 33

Original Poster
Rep: Reputation: Disabled
UPDATE: I've used the compressor effect filter in audacity using the default settings and the audio dialogue or the dynamic range is much better. I then use ffmpeg to combine the new audio with the video copy ( no audio version ) and everything is in sync and audio dialogue is much louder.

I guess this is good enough for me now. However, I would love to do dynamic range increases using the commandline. I am a commandline fanatic.

- later
Old 07-09-2015, 01:44 PM   #5
LQ Newbie
Registered: Jul 2015
Posts: 1

Rep: Reputation: Disabled
yes use mencoder -af hrtf or -af volnorm or even -af pan if you want to change the volumes on different channels.

ffmpeg has -af volume
and probably more, best check ffmpeg documentation.
Old 07-09-2015, 11:21 PM   #6
Registered: Mar 2008
Posts: 20,525

Rep: Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295Reputation: 3295
Good link to lifehacker page.

VLC offers command line tools so basically you should be able to convert this all in a command line with vlc.
Old 07-10-2015, 08:16 AM   #7
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
I tend to demux and remux the streams. Although with avconv (debian) which is a fork of ffmpeg. There's the -an (no audio), -sn (no subtitles), and -vn (no video) options plus the -codec:a copy and -codec:v copy options. With avprobe (or ffprobe) to identify what the streams codecs are. It's a bit of a storage waste to do this as you can end up with 4x's the usage. Original, Original audio and video only extracts, Edited audio and video only extracts, the New remuxed media file.

The sox application can do various edits and effects on the CLI. But I tend to use audacity as you can see what the file needs before doing an edit. My flow of sorts might looks like:

$ avprobe media.mkv

$ avconv -i media.mkv -an -sn -codec:v copy -y video_only.mkv
$ avconv -i media.mkv -vn -sn -codec:a copy -y audio_only.aac
$ faad -o audio.wav audio_only.aac
$ audacity audio.wav

$ avconv -i video_only.mkv -i edited_audio.wav \
         -codec:v copy -codec:a aac -b:a 128k \
         -y new_media.mkv
Dynamic range compression is pretty evil / unnatural. If it's only a few LOUD parts you can select the not loud parts and amplify them per part for a more natural sounding result. You can also use audacity's amplify with negative numbers to make things softer too. With 0 being the loudest, -6 being what videos should be normalized to, and -50 being silent. Or some such with that there dB / decibel stuffs.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does handbrake encodes videos faster than ffmpeg? linuxhater Linux - Software 4 11-17-2012 12:08 AM
ffmpeg and mencoder slice mp4 video audio out of sync lindylex Linux - Software 5 01-10-2010 04:26 AM
Help me in installing ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encod mitesh.ever Red Hat 5 05-16-2009 01:14 PM
Audio completely out of sync with video playback. (FFmpeg/Xine/VLC) 12.2/ camphor Slackware 9 02-17-2009 02:20 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration