What Does the FFmpeg -strict -2 Flag Mean?

This article explains the purpose and history of the -strict -2 flag in legacy FFmpeg builds. You will learn what this command-line option represents, why it was historically required for processing certain audio formats like AAC, and its relevance in modern versions of the multimedia framework.

Understanding the -strict Parameter

In FFmpeg, the -strict (or -strictness) flag is used to specify how strictly the software should adhere to standards compliance and safety standards. FFmpeg categorizes its encoders, decoders, and demuxers into different stability levels. By default, FFmpeg only allows the use of codecs and features that are deemed fully stable and standardized.

The -strict flag accepts several numeric and named values to adjust this behavior: * very (2): Strictly conform to all the things in the spec. * strict (1): Strictly conform to all the things in the spec. * normal (0): Default behavior. * unofficial (-1): Allow unofficial extensions. * experimental (-2): Allow experimental and unstable features.

Therefore, -strict -2 is the numeric equivalent of writing -strict experimental.

Why Was -strict -2 Widely Used?

For many years, the most common reason users encountered -strict -2 was to enable FFmpeg’s native Advanced Audio Coding (AAC) encoder.

Historically, FFmpeg’s built-in AAC encoder was considered experimental and incomplete compared to external libraries like FDK-AAC (libfdk_aac). Because it was classified as experimental, FFmpeg would throw an error and halt execution if a user tried to encode AAC audio without explicitly granting permission to use experimental code.

Adding -strict -2 (or -strict experimental) to the command line was the official workaround that signaled to FFmpeg that the user accepted the risks of using an unfinished, experimental encoder.

Is -strict -2 Still Necessary Today?

In December 2015, with the release of FFmpeg 3.0, the native AAC encoder was officially declared stable and fit for general use. As a result, the requirement for -strict -2 was removed for standard AAC encoding.

In modern versions of FFmpeg, you do not need to use -strict -2 for routine audio and video conversions. However, the flag remains useful today if you are working with legacy scripts, older FFmpeg installations, or if you want to test newly developed, cutting-edge codecs that are still marked as experimental by the FFmpeg developer community.