MODERATOR NOTE:
for installing FFmpeg on Linux see this post,
https://community.wolfram.com/groups/-/m/t/2188963
for installing on MacOS see this post
https://community.wolfram.com/groups/-/m/t/2189605
Video object and video processing functions were introduced in Wolfram Language 12.1. To read from and write to video files, video functionality uses media libraries provided by operating systems as well as a limited version of FFmpeg that is shipped with the language and can be immediately used. Details and examples showing how to import and export video files can be found in the Importing & Exporting Video tutorial. The Codec Support section in that tutorial describes the limitations of the FFmpeg shipped with the language and shows how installing the full version of FFmpeg gets you a better support for audio and video codecs.
Without FFmpeg installed, the first time a video function is called a message is displayed, suggesting to install FFmpeg for a more complete codec support. Here is the list of supported video decoders available before having FFmpeg installed. At the end of this post we will compare the list with the supported decoders after FFmpeg is installed.
In[1]:= Length /@ $VideoDecoders
During evaluation of In[1]:= General::sysffmpeg: Using a limited version of FFmpeg. Install FFmpeg to get more complete codec support.
Out[1]= <|"AVI" -> 37, "Matroska" -> 55, "MP4" -> 13, "Ogg" -> 1, "QuickTime" -> 23, "VideoFormat" -> 83|>
In this post I will show how to install and configure FFmpeg on Windows 10.
First, download a 64-bit shared (not static) build of FFmpeg 4.0.0 or later. Links to Windows builds are available at https://ffmpeg.org/download.html#build-windows. Get a zip file with win64-gpl-shared suffix (any file with that suffix will work, but here I want to install the latest stable version):
Once the zip file is downloaded, we need to extract its contents to a home directory. There will be four subdirectories in the extracted FFmpeg directory: bin, doc, include and lib. FFmpeg is now installed.
In the final step we need to modify Path environment variable. Open the Start Search, type in "env", and choose Edit environment variables for your account:
Then, select Path environment variable and click Edit...:
Finally, Click New and add a path to your FFmpeg directory including bin subdirectory: Click OK and restart Wolfram Language. When you evaluate $VideoDecoders
again, you should see the list that contains many codecs not available before:
In[1]:= Length /@ $VideoDecoders
Out[1]= <|"AVI" -> 160, "Matroska" -> 260, "MP4" -> 34, "Ogg" -> 1, "QuickTime" -> 70, "VideoFormat" -> 327|>
Another way to confirm that the full version of FFmpeg is used by Wolfram Language:
In[2]:= FFmpegTools`$SystemFFmpegQ
Out[2]= True