Manual installation

Some users may wish to skip the package or AUR and compile FFmpeg themselves from its git master directly, and add /usr/local/lib to /etc/ld.so.conf. This can cause the /usr/bin/ffmpeg tool provided by ffmpeg to crash or work improperly due to the library version mismatch. (Frequently ffmpeg is still installed as a dependency.) One fix for this is to add /usr/lib to the rpath of /usr/bin/ffmpeg with a tool such as patchelf:

# patchelf --set-rpath /usr/lib /usr/bin/ffmpeg

This will be revoked whenever ffmpeg is reinstalled or upgraded, so adding a pacman hook might be prudent:

Here, the x264 codec with the fastest possible encoding speed is used. Other codecs can be used; if writing each frame is too slow (either due to inadequate disk performance or slow encoding), then frames will be dropped and video output will be choppy.

Here, the x264 codec with the fastest possible encoding speed is used. Other codecs can be used; if writing each frame is too slow (either due to inadequate disk performance or slow encoding), then frames will be dropped and video output will be choppy.

x264: constant rate factor

Used when you want a specific quality output. General usage is to use the highest -crf value that still provides an acceptable quality. Lower values are higher quality; 0 is lossless, 18 is visually lossless, and 23 is the default value. A sane range is between 18 and 28. Use the slowest -preset you have patience for. See the x264 Encoding Guide for more information.

Second pass

The second pass parses the stabilization parameters generated from the first pass and applies them to produce "output-stab_final". You will want to apply any additional filters at this point so as to aboid subsequent transcoding to preserve as much video quality as possible. The following example performs the following in addition to video stabilization:

unsharp is recommended by the author of vid.stab. Here we are simply using the defaults of 5:5:1.0:5:5:1.0

Tip: fade=t=in:st=0:d=4

fade in from black starting from the beginning of the file for four seconds

Tip: fade=t=out:st=60:d=4

fade out to black starting from sixty seconds into the video for four seconds

-c:a pcm_s16le XAVC-S codec records in pcm_s16be which is losslessly transcoded to pcm_s16le

Hardware video acceleration

Warning: Encoding may fail when using hardware acceleration, use software encoding as a fallback.

Encoding performance may be improved by using hardware acceleration API's, however only a specific kind of codec(s) are allowed and/or may not always produce the same result when using software encoding.