user12052: I video record my university lectures using an iPhone 6 and then export them to OS X. The files can often become up to 4 GB/hour in size.
I'm looking to create or use a pre-existing solution that can do the following for my video files:

Amplify the audio
Normalize or level the audio
Audio click removal (optional)
Compress video to save disk space
Do the above by running a script or shell command (for batches of files if possible)

I'm assuming that FFmpeg can be helpful for running existing scripts, or creating a new one.
How should I go about to meet these objectives?
I have also looked at other alternatives like Handbrake but didn't find that it can do the audio adjustments adequately – let me know if I'm wrong.

user12052: This is what I have come up with so far. Feel free to improve this answer liberally, with the objective of cleaning up and encoding lecture notes, within a streamlined process.
The command is run in the working directory, e.g. cd /Users/me/Downloads, and will encode all .MOV files present.
for i in *.MOV; do ffmpeg -i "$i" -c:v libx265 -preset veryslow -crf 23 -af "volume=25dB, highpass=f=200, equalizer=f=50:width_type=h:width=100:g=-15" -c:a aac -strict experimental -b:a 192k "${i%.MOV}-ENCODED.MOV"; done

The individual settings:

Video codec: libx265 (HEVC). This codec is unorthodox because it's still in development, but it's many times better than its predecessor in keeping file sizes low. VLC supports this codec for viewing the video.
Encoding speed vs. compression density: -preset veryslow. Converting videos with this preset takes very long time, but may reduce file size with around 20 % compared to the fastest setting. If you want quicker encoding, use ultrafast, fast, medium or slow.
Video quality: -crf 23. Quite good quality. Decreasing this number will increase quality but also logarithmically increase file size. This setting strikes an okay balance between file size and quality. 18 is visually lossless but takes up much space.
Volume gain: volume=25dB
High pass filter >200 Hz: highpass=f=200
EQ notch filter @ 50Hz±100Hz (this should be mitigated by the high pass filter already, but for some reason this seems to remove background noise: equalizer=f=50:width_type=h:width=100:g=-15
Audio codec: aac
Audio quality: -b:a 192k

Optional:

Lighten video curves: -vf "curves=preset=lighter"

Ideas for improvement:

A good way to gate audio to filter out background noise and keep only the talky bits.


12052: <p>I video record my university lectures using an iPhone 6 and then export them to OS X. The files can often become up to 4 GB/hour in size.</p>

<p>I'm looking to create or use a pre-existing solution that can do the following for my video files:</p>

<ul>
<li>Amplify the audio</li>
<li>Normalize or level the audio</li>
<li>Audio click removal (optional)</li>
<li>Compress video to save disk space</li>
<li>Do the above by running a script or shell command (for batches of files if possible)</li>
</ul>

<p>I'm assuming that FFmpeg can be helpful for running existing scripts, or creating a new one.</p>

<p>How should I go about to meet these objectives?</p>

<p>I have also looked at other alternatives like Handbrake but didn't find that it can do the audio adjustments adequately – let me know if I'm wrong.</p>
 12052: <p>This is what I have come up with so far. Feel free to improve this answer liberally, with the objective of cleaning up and encoding lecture notes, within a streamlined process.</p>

<p>The command is run in the working directory, e.g. <code>cd /Users/me/Downloads</code>, and will encode all .MOV files present.</p>

<pre><code>for i in *.MOV; do ffmpeg -i "$i" -c:v libx265 -preset veryslow -crf 23 -af "volume=25dB, highpass=f=200, equalizer=f=50:width_type=h:width=100:g=-15" -c:a aac -strict experimental -b:a 192k "${i%.MOV}-ENCODED.MOV"; done
</code></pre>

<p>The individual settings:</p>

<ul>
<li>Video codec: <code>libx265</code> (HEVC). This codec is unorthodox because it's still in development, but it's many times better than its predecessor in keeping file sizes low. <a href="https://www.videolan.org/vlc/index.html" rel="nofollow">VLC</a> supports this codec for viewing the video.</li>
<li>Encoding speed vs. compression density: <code>-preset veryslow</code>. Converting videos with this preset takes <em>very</em> long time, but may reduce file size with around 20 % compared to the fastest setting. If you want quicker encoding, use <code>ultrafast</code>, <code>fast</code>, <code>medium</code> or <code>slow</code>.</li>
<li>Video quality: <code>-crf 23</code>. Quite good quality. Decreasing this number will increase quality but also logarithmically increase file size. This setting strikes an okay balance between file size and quality. <code>18</code> is visually lossless but takes up much space.</li>
<li>Volume gain: <code>volume=25dB</code></li>
<li>High pass filter >200 Hz: <code>highpass=f=200</code></li>
<li>EQ notch filter @ 50Hz±100Hz (this should be mitigated by the high pass filter already, but for some reason this seems to remove background noise: <code>equalizer=f=50:width_type=h:width=100:g=-15</code></li>
<li>Audio codec: <code>aac</code></li>
<li>Audio quality: <code>-b:a 192k</code></li>
</ul>

<p><strong>Optional</strong>:</p>

<ul>
<li>Lighten video curves: <code>-vf "curves=preset=lighter"</code></li>
</ul>

<p><strong>Ideas for improvement:</strong></p>

<ul>
<li>A good way to gate audio to filter out background noise and keep only the talky bits.</li>
</ul>
