Installing and configuring FFmpeg

I am installing FFmpeg on windows 11 because I will often need it in the future for working with video and music files.

FFmpeg is an open source software project that provides a set of tools and libraries for recording, converting, and streaming many types of multimedia data (audio, video, subtitles, and related metadata). and is typically operated from the command line.

The main components are

  1. ffmpeg: a command line tool used for audio and video conversion, basic editing (clipping, resampling, etc.) and streaming.
  2. ffprobe: command line tool to examine media data for more detailed information.
  3. ffplay: A simple media player. It is operated from the command line.
  4. libavcodec, libavformat, libavfilter, libavdevice, libswresample, libswscale, etc.: These are libraries used internally by FFmpeg. They are also used by other software projects.

FFmpeg supports a large number of audio and video codecs, file formats, and protocols and is highly customizable. This flexibility and powerful feature set makes FFmpeg a popular choice for many professional multimedia applications as well as amateur projects.

https://ffmpeg.org/

The Windows version had two files.

The differences are as follows

The ffmpeg binaries for Windows are available in several different versions and configurations. ffmpeg-master-latest-win64-gpl-shared.zip and ffmpeg-master-latest-win64-gpl.zip have the following main The main differences are as follows.

  1. Shared vs. Static Libraries:
    • ffmpeg-master-latest-win64-gpl-shared.zip: This version contains “shared” libraries (DLL files). This is used to dynamically use (“link”) FFmpeg functionality from other programs.
    • ffmpeg-master-latest-win64-gpl.zip: This version contains the “static” library, which incorporates all of FFmpeg’s functionality into a single executable file. It is often used independently.
  2. GPL License:
    • Both are provided under the GPL license. This applies if FFmpeg is built with or with the option of using some GPL-licensed code.
  3. Use-Case:
    • The “shared” version is useful when you need to dynamically call FFmpeg functions from a specific application.
    • The “static” version is useful when FFmpeg is used by itself or transferred to another machine. This version is less sensitive to the environment because all dependent external libraries are contained in a single executable file.

Which version to download depends on your specific use case and requirements. If you are simply using the FFmpeg command line tool, ffmpeg-master-latest-win64-gpl.zip (the static version) will be easier and more manageable. On the other hand, if you want to use FFmpeg’s functionality with other software, the “shared” version is the way to go. I downloaded this one because I will need the latter in the future.

Unzip the file and check the operation while in the folder (bin) where ffmpeg.exe exists.

ffmpeg -version

However, an error occurred.

ffmpeg: The term ‘ffmpeg’ is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Suggestion [3,General]: The command ffmpeg was not found, but does exist in the current location. If you trust this command, instead type: “. \ffmpeg”. See “get-help about_Command_Precedence” for more details.

.\ffmpeg -version

As described in the description, I entered the above command and it worked fine.

ffmpeg version N-111859-g3c397a1d46-20230830 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.1.0 (crosstool-NG 1.25.0.196_227d99d)
configuration: –prefix=/ffbuild/prefix –pkg-config-flags=–static –pkg-config=pkg-config –cross-prefix=x86_64-w64-mingw32- –arch=x 86_64 –target-os=mingw32 –enable-gpl –enable-version3 –disable-debug –enable-shared –disable-static –disable-w32threads –enable- pthreads –enable-iconv –enable-libxml2 –enable-zlib –enable-libfreetype –enable-libfribidi –enable-gmp –enable-lzma –enable- fontconfig –enable-libvorbis –enable-opencl —disable-libpulse –enable-libvmaf —disable-libxcb —disable-xlib –enable-amf –enable- libaom –enable-libaribb24 –enable-avisynth –enable-chromaprint –enable-libdav1d –enable-libdavs2 –disable-libfdk-aac –enable- ffnvcodec –enable-cuda-llvm –enable-frei0r –enable-libgme –enable-libkvazaar –enable-libass –enable-libbluray –enable-libjxl — enable-libmp3lame –enable-libopus –enable-librist –enable-libssh –enable-libtheora –enable-libvpx –enable-libwebp –enable-lv2 — enable-libvpl –enable-openal –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libopenh264 –enable-libopenjpeg –enable- libopenmpt –enable-librav1e –enable-librubberband –enable-schannel –enable-sdl2 –enable-libsoxr –enable-libsrt –enable-libsvtav1 — enable-libtwolame –enable-libuavs3d —disable-libdrm —disable-vaapi –enable-libvidstab –enable-vulkan –enable-libshaderc –enable- libplacebo –enable-libx264 –enable-libx265 –enable-libxavs2 –enable-libxvid –enable-libzimg –enable-libzvbi –extra-cflags=- DLIBTWOLAME_STATIC –extra-cxxflags= –extra-ldflags=-pthread –extra-ldexeflags= –extra-libs=-lgomp –extra-version=20230830
libavutil 58. 17.100 / 58. 17.100
libavcodec 60. 23.100 / 60. 23.100
libavformat 60. 10.101 / 60. 10.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100

Next, add environment variables so that ffmpeg can be used in any folder.

There are several reasons to set environment variables (Environment Variables), but here are some common ones

  1. Centralization of settings: You can centrally manage the various settings needed by your application (e.g., database connection information, API keys, etc.).
  2. Portability: Using environment variables, software settings can be given externally. This makes it easy to run the same code base in different environments (development, test, production, etc.).
  3. Security: Hard-coding sensitive information such as passwords and API keys into the source code is a security risk. Using environment variables allows these information to be managed securely.
  4. Flexibility and extensibility: Using environment variables, you can easily change the behavior of your application depending on the environment in which it runs.
  5. Dependency isolation: For example, by setting database or external service connection information as environment variables, applications can be made independent of a specific environment.
  6. Aliases and shortcuts: Environment variables may also be used to give short names or specific settings to particular applications or commands. For example, the PATH environment variable determines where the system looks for commands.
  7. Data sharing among multiple applications: Environment variables are also used as a means of sharing data among multiple related applications or processes.

As mentioned above, environment variables play an important role in many aspects, including configuration, security, and portability, as well as for referencing applications.

The place to register them is in the Path of the system environment variable.

Environment variables are generally divided into “system environment variables” and “user environment variables. While these may seem similar, there are actually some important differences.

  1. System Environment Variables:.
    • Affects the entire system, i.e., all users.
    • Administrative privileges are usually required.
    • They are often read when the system starts or when a service is started.
    • Example: PATH environment variables are often set at the system level.
  2. User environment variables:.
    • Affects only a specific user.
    • Administrative privileges are usually not required.
    • They are loaded when a user logs in.
    • Example: often contains settings specific to software or services used by individual users.

Both types of environment variables are used to adjust the environment and settings in which the application runs, but they differ in their scope of influence and the permissions required to set them. The appropriate type of environment variable should be set for each application and its requirements.

Then, try entering the command in the appropriate folder.

However, an error occurs.

ffmpeg.exe: The term ‘ffmpeg.exe’ is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The problem worked fine after restarting PowerShell. In some cases, a reboot may be necessary for environment variable changes to take effect system-wide.

Please share if you like it!
TOC