曾经需要从您个人计算机上的某个视频中提取音频文件吗?或者也许想将视频文件从一种格式转换为另一种格式?如果不是这两个,您肯定希望将视频文件压缩为特定大小或以不同的分辨率播放。
所有这些以及许多其他与音频-视频相关的操作都可以通过使用称为FFmpeg的简单命令行工具来执行。不幸的是,安装FFmpeg并不像使用它那么容易,但这就是我们的用武之地。下面(Below)是有关如何在您的个人计算机上安装多功能工具的分步指南。
什么是 FFmpeg?(What is FFmpeg? )
在我们引导您完成安装过程之前,让我们快速了解一下FFmpeg的真正含义以及该工具可以派上用场的不同场景。
FFmpeg(代表Fast Forward Moving Picture Experts Group)是一个非常流行的开源多媒体项目,可在各种操作系统上使用,并且能够对任何和所有音频格式和视频格式执行过多的操作。甚至是古代的。该项目包含多个软件套件和库,使其能够执行各种视频和音频编辑。该程序非常强大,以至于它可以进入许多流行的应用程序,例如VLC 媒体播放器(VLC media player),以及大多数在线视频转换服务的核心,以及Youtube和 iTunes 等流媒体平台。
使用该工具可以对各种音频和视频格式执行编码、解码、转码、转换格式、复用、解复用、流、过滤、提取、修剪、缩放、连接等任务。
此外,作为命令行工具意味着可以直接从Windows命令提示符使用非常简单的单行命令执行操作(本文末尾提供了其中一些命令)。这些命令非常通用,因为它们在不同的操作系统上保持不变。但是,在您的个人计算机上安装程序时,缺少图形用户界面会使事情变得有些复杂(稍后您应该会看到)。
如何在 Windows 10 上安装 FFmpeg?(How to install FFmpeg on Windows 10?)
如前所述,在Windows 10上安装(Windows 10)FFmpeg并不像安装任何其他常规应用程序那么简单。虽然大多数应用程序可以通过简单地左键单击它们各自的 .exe 文件并按照屏幕上的提示/说明进行安装,但在您的系统上安装FFmpeg需要更多的努力,因为它是一个命令行工具。整个安装过程分为三大步骤;每个包含多个子步骤。
安装过程(逐步)(The installation process (Step by step))
尽管如此,这就是我们在这里的原因,以易于遵循的分步方式指导您完成整个过程,并帮助您在 Windows 10 PC 上安装 FFmpeg。 (install FFmpeg on your Windows 10 PC. )
第 1 部分:下载 FFmpeg 并移动到正确的位置(Part 1: Downloading FFmpeg and moving to the correct location)
第 1 步:(Step 1: )很明显,我们需要几个文件才能开始。因此,请访问官方 FFmpeg 网站(official FFmpeg website),选择最新的可用版本,然后选择您的操作系统和处理器架构(32 位或 64 位),然后在链接下选择“静态” 。(‘Static’ )重新检查您的选择,然后单击右下方显示“下载构建”(‘Download Build’ )的蓝色矩形按钮开始下载。
(如果您不知道您的处理器架构,请按Windows key + EWindows文件资源管理器,转到“这台电脑(This PC)”并单击左上角的“属性” 。在属性对话框中,您可以找到您的(‘Properties’ )“系统类型”(‘System type’ )标签旁边的处理器架构。下面屏幕截图中的“基于 x64 的处理器”表示处理器是 64 位的。)
第 2 步:(Step 2:)根据您的网速,下载文件只需几分钟甚至几秒钟。下载后,打开计算机上的“下载”(‘Downloads’ )文件夹并找到文件(除非您下载到特定目标,在这种情况下,请打开特定目标文件夹)。
找到后,右键单击(right-click)zip 文件并选择“提取到...(Extract to…) ”以将所有内容提取到同名的新文件夹中。
第 3 步:(Step 3:)接下来,我们需要将文件夹从“ffmpeg-20200220-56df829-win64-static”重命名为“FFmpeg”。为此,请右键单击新提取的文件夹并选择“重命名”(‘Rename’ )(或者,您可以尝试选择文件夹并按键盘上的F2或fn + F2仔细(Carefully)输入FFmpeg并按回车键保存。
第 4 步:(Step 4:)对于第 1 部分的最后一步,我们将把“ FFmpeg ”文件夹移动到我们的Windows安装驱动器。该位置很重要,因为只有在正确的语言环境中存在FFmpeg(FFmpeg)文件时,命令提示符才会执行我们的命令。
右键单击(Right-click)FFmpeg文件(FFmpeg)夹并选择复制(Copy )(或选择文件夹并按键盘上的Ctrl + C)。
现在,在Windows 资源管理器(Windows Explorer)(Windows键 + E)中打开 C 驱动器(或默认的Windows安装驱动器),右键单击空白区域并选择粘贴(Paste )(或 ctrl + V)。
打开粘贴的文件夹一次,确保里面没有FFmpeg子文件夹,如果有则将所有文件(bin、doc、presets、LICENSE.txt和README.txt)移动到根文件夹并删除子文件夹。这就是FFmpeg文件夹内部的样子。
另请阅读:(Also Read:) 如何在 Windows 10 中安装或卸载 OneDrive(How to Install or Uninstall OneDrive in Windows 10)
第 2 部分:在 Windows 10 上安装 FFmpeg(Part 2: Installing FFmpeg on Windows 10)
第 5 步:(Step 5:)我们首先访问系统属性。(System Properties. )为此,请打开 Windows 资源管理器(Windows键 + E 或单击桌面上的文件资源管理器图标),转到此 PC 并单击左上角的属性(白色背景上的红色勾号)。
第6步:(Step 6:)现在,单击右侧面板中的高级系统设置以打开相同的。(Advanced System Settings)
或者,您也可以按键盘上的Windows键并直接搜索“编辑系统环境变量(Edit the system environment variables)”。找到后,按回车键打开。
第 7 步:(Step 7:)接下来,单击高级系统属性对话框右下方的“环境变量... ”。(Environmental Variables…)
第 8 步:(Step 8:)进入Environment Variables后,通过左键单击 [username] 列的用户(User)变量下选择“路径” 。(‘Path’ )发布(Post)选择,单击Edit。
第 9 步:(Step 9:)单击对话框右上角的新建(New )以输入新变量。
步骤 10:(Step 10:)小心输入C:\ffmpeg\bin\ 然后 OK 保存更改。
第十一步:(Step 11:)成功进入后,环境变量中的Path标签会是这样的。
如果没有,您可能在上述步骤之一中搞砸了,或者错误地重命名并将文件传输到您的Windows目录,或者必须将文件完全复制到错误的目录。重复(Reiterate)上述步骤以解决所有问题。
另请阅读:(Also Read:) 如何在 Windows 10 上安装 Internet Explorer(How to install Internet Explorer on Windows 10)
虽然,如果看起来确实如此,那么您已经在 Windows 10 PC 上成功安装了FFmpeg ,并且一切顺利。(FFmpeg)按(Press)OK 关闭环境变量(Environment Variables)并保存我们所做的所有更改。
第 3 部分:在命令提示符中验证 FFmpeg 安装(Part 3: Verify FFmpeg installation in Command Prompt)
最后一部分与安装过程没有任何关系,但有助于验证您是否能够在您的个人计算机上正确安装FFmpeg 。
第 12 步:(Step 12:) 按(Press)键盘上的Windows键或单击任务栏中的开始并搜索命令提示符(command prompt)。找到后,右键单击它并选择“以管理员身份运行”。(Run)
第 13 步:(Step 13:)在命令窗口中,输入“ ffmpeg -version ”并回车。如果您成功地在您的个人计算机上安装了FFmpeg,命令窗口应显示构建、FFmpeg版本、默认配置等详细信息。请查看下图以供参考。
如果您无法正确安装FFmpeg,命令提示符将返回以下消息:
'ffmpeg' 不是内部或外部命令、可运行程序或批处理文件。(‘ffmpeg’ is not recognized as an internal or external command, operable program or batch file.)
在这种情况下,请再次彻底阅读上述指南,并纠正您在遵循该过程时可能犯的任何错误。或者在下面的评论部分与我们联系,我们随时为您提供帮助。
如何使用 FFmpeg?(How to use FFmpeg?)
如果您不知道如何使用这个多功能工具,这一切都可能是徒劳的。幸运的是,使用FFmpeg比安装程序本身要简单得多。您需要做的就是以管理员(command prompt as administrator)或PowerShell的身份打开命令提示符,然后在命令行中键入您要执行的任务。以下(Below)是人们可能希望执行的各种音频-视频操作的命令行列表。
要使用FFmpeg(FFmpeg)执行任何类型的编辑,您需要在包含您要使用的文件的文件夹中打开命令提示符或Powershell。打开包含文件的文件夹,在空白区域按住 shift 并右键单击,然后从选项列表中选择“在此处打开 Powershell 窗口(Open Powershell window here)”。
假设您要将特定视频文件的格式从 .mp4 更改为 .avi
为此,请在命令提示符中仔细键入以下行,然后按 Enter:
ffmpeg -i 示例.mp4 示例.avi(ffmpeg -i sample.mp4 sample.avi)
将“(Replace ‘) sample”替换为您要转换的视频文件的名称。转换可能需要一些时间,具体取决于文件大小和您的 PC 硬件。转换完成后,.avi 文件将在同一文件夹中可用。
其他流行的 FFmpeg 命令包括:(Other popular FFmpeg commands include:)
Get audio/video file information: ffmpeg -i sample.mp4
Convert video file to audio file: ffmpeg -i input.mp4 -vn output.mp3
Change video resolution: ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4
Compress an audio file: ffmpeg -i input.mp3 -ab 128 output.mp3
Remove audio from a video file: ffmpeg -i input.mp4 -an output.mp4
Preview a video: ffplay sample.mp4
注意:记住(Remember)用各自的文件名替换'sample'、'input'、'output'
推荐:(Recommended:) 在您的 PC 上安装 Pubg 的 3 种方法 (3 Ways to Install Pubg on your PC )
因此,希望通过上述步骤,您将能够在 Windows 10 上安装 FFmpeg( install FFmpeg on Windows 10)。但是,如果您仍有任何疑问或建议,请随时在评论部分与我们联系。
Step-by-Step Guide to install FFmpeg on Windows 10
Eνer needed to extract the aυdio file from a сertain video you had оn your personal computer? Or perhaps wanted to convert a video file from one format to another? If not these two, you surely must have desired to compress а video file tо be a specifiс size or playback in a different resolution.
All of these and many other audio-video related operations can be performed by using a simple command-line tool known as FFmpeg. Unfortunately, installing FFmpeg is not as easy as using it but that is where we come in. Below is a step by step guide on how to install the multipurpose tool on your personal computers.
What is FFmpeg?
Before we walk you through the installation process, let’s have a quick look at what FFmpeg really is and what are the different scenarios in which the tool can come in handy.
FFmpeg (stands for Fast Forward Moving Picture Experts Group) is a very popular open-source multimedia project available on a variety of operating systems and is capable of performing a plethora of operations on any and all audio formats & video formats out there. Even the archaic ones. The project contains multiple software suites and libraries enabling it to perform a variety of video and audio edits. The program is so powerful that it finds its way into many popular applications such as VLC media player and in the core of most online video converting services along with streaming platforms like Youtube and iTunes.
Using the tool one can do tasks like encoding, decoding, transcoding, converting formats, mux, demux, stream, filter, extract, trim, scale, concatenate, etc. on various audio and video formats.
Also, being a command-line tool implies that one can perform operations right from the Windows command prompt using very simple single-line commands (Some of which are provided at the end of this article). These commands are quite versatile as they remain the same over different operating systems. However, the lack of a graphical user interface makes things a little complicated (as you should see later on) when it comes to installing the program on your personal computer.
How to install FFmpeg on Windows 10?
As mentioned earlier, installing FFmpeg on Windows 10 is not as simple as installing any other regular application. While most applications can be installed by simply left-clicking on their respective .exe files and following the on-screen prompts/instructions, installing FFmpeg on your system requires a little more effort because of it being a command-line tool. The whole installation process is divided into three big steps; each containing multiple sub-steps.
The installation process (Step by step)
Nevertheless, that’s why we are here, to guide you through the entire process in an easy to follow step by step manner and help you install FFmpeg on your Windows 10 PC.
Part 1: Downloading FFmpeg and moving to the correct location
Step 1: As obvious, we will need a couple of files to get going. So head over to the official FFmpeg website, select the latest available version followed by your operating system & processor architecture (32 bit or 64 bit), and ‘Static’ under Linking. Recheck your selection and click on the rectangular blue button on the bottom right side that reads ‘Download Build’ to start downloading.
(In case you are unaware of your processor architecture, open Windows file explorer by pressing Windows key + E, go to ‘This PC’ and click on ‘Properties’ in the top left corner. In the properties dialog box, you can find your processor architecture next to the ‘System type’ label. The ‘x64-based processor’ in the below screenshot implies the processor is 64-bit.)
Step 2: Depending on your internet speed, the file should only take a couple of minutes or even seconds to download. Once downloaded, open the ‘Downloads’ folder on your computer and locate the file (unless you downloaded to a specific destination, in that case, open the specific destination folder).
Once located, right-click on the zip file and choose ‘Extract to…’ to extract all the contents to a new folder of the same name.
Step 3: Next, we will need to rename the folder from ‘ffmpeg-20200220-56df829-win64-static’ to just ‘FFmpeg’. To do so, right-click on the newly extracted folder and select ‘Rename’ (Alternatively, you could try selecting the folder and pressing F2 or fn + F2 on your keyboard to rename). Carefully type in FFmpeg and hit enter to save.
Step 4: For the final step of part 1, we will be moving the ‘FFmpeg’ folder to our Windows installation drive. The location is important as the command prompt will only execute our commands if the FFmpeg files are present in the correct locale.
Right-click on the FFmpeg folder and select Copy (or select the folder and press Ctrl + C on keyboard).
Now, open your C drive (or your default Windows installation drive) in the Windows Explorer (Windows key + E), right-click on a blank area and select Paste (or ctrl + V).
Open the pasted folder once and make sure there are no FFmpeg subfolders inside, if there are then move all the files (bin, doc, presets, LICENSE.txt and README.txt ) to the root folder and delete the subfolder. This is how the insides of the FFmpeg folder should look like.
Also Read: How to Install or Uninstall OneDrive in Windows 10
Part 2: Installing FFmpeg on Windows 10
Step 5: We start off by accessing System Properties. To do so open windows explorer (Windows key + E or clicking on the file explorer icon on your desktop), go to This PC and click on Properties (red tick on a white background) in the top left corner.
Step 6: Now, click on Advanced System Settings in the right-hand side panel to open the same.
Alternatively, you could also press the Windows key on your keyboard and directly search for ‘Edit the system environment variables’. Once found, hit enter to open.
Step 7: Next, click on ‘Environmental Variables…’ at the bottom right of the advanced system properties dialog box.
Step 8: Once inside Environment Variables, select ‘Path’ under the User variables for [username] column by left-clicking on it. Post selection, click on Edit.
Step 9: Click on New on the top right-hand side of the dialog box to be able to enter a new variable.
Step 10: Carefully enter C:\ffmpeg\bin\ followed by OK to save changes.
Step 11: After successfully making the entry, the Path label in environment variables will look like this.
If it doesn’t, you probably messed up in one of the above steps or have incorrectly renamed and transferred the file to your Windows directory or must have copied the file to a wrong directory altogether. Reiterate through the above steps to resolve any and all issues.
Also Read: How to install Internet Explorer on Windows 10
Although, if it does look this then voila you have successfully installed FFmpeg on your Windows 10 PC and are good to go. Press OK to close Environment Variables and save all the changes we made.
Part 3: Verify FFmpeg installation in Command Prompt
The final part does not have anything to do with the installation process but will help verify if you were able to correctly install FFmpeg on your personal computer.
Step 12: Press the Windows key on your keyboard or click on start in the taskbar and search for command prompt. Once located, right-click on it and select to ‘Run as administrator.’
Step 13: In the command window, type ‘ffmpeg -version’ and hit enter. If you managed to successfully install FFmpeg on your personal computer, the command window should display details such as build, FFmpeg version, default configuration, etc. Have a look at the below image for reference.
In case you weren’t able to install FFmpeg properly, the command prompt will return the following message:
‘ffmpeg’ is not recognized as an internal or external command, operable program or batch file.
In such a scenario, go through the above guide thoroughly once again and rectify any mistakes you might have committed to following the process. Or come connect with us in the comments section below, we are always there to help you out.
How to use FFmpeg?
It all might as well be for nothing if you don’t know how to use this multipurpose tool. Fortunately, using FFmpeg is much simpler than installing the program itself. All you need to do is open command prompt as administrator or PowerShell and type in the command line for the task you wish to execute. Below is a list of command lines for various audio-video operations that one might wish to perform.
To perform any kind of edits using FFmpeg, you will need to open the command prompt or Powershell in the folder containing the files you wanna work with. Open the folder with your files in it, hold shift & right-click in an empty area and from the list of options select ‘Open Powershell window here’.
Let’s say you want to change the format of a particular video file from .mp4 to .avi
To do so, type the below line carefully in the command prompt and press enter:
ffmpeg -i sample.mp4 sample.avi
Replace ‘sample’ with the name of the video file you wish to convert. The conversion may take some time depending on the file size and your PC hardware. The .avi file will be available in the same folder after the conversion has finished.
Other popular FFmpeg commands include:
Get audio/video file information: ffmpeg -i sample.mp4
Convert video file to audio file: ffmpeg -i input.mp4 -vn output.mp3
Change video resolution: ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4
Compress an audio file: ffmpeg -i input.mp3 -ab 128 output.mp3
Remove audio from a video file: ffmpeg -i input.mp4 -an output.mp4
Preview a video: ffplay sample.mp4
Note: Remember to replace ‘sample’, ‘input’, ‘output’ with respective file names
Recommended: 3 Ways to Install Pubg on your PC
So, hopefully, by following the above steps you will be able to install FFmpeg on Windows 10. But if you still have any queries or suggestions then feel free to reach out in the comment section.