There are certain video or audio formats that your preferred video player might not support, so you might require to convert them into a compatible one.
Generally, PC users use different third-party dedicated video or audio converter programs for converting their media. However, if you are a Windows 10 user, you don’t require any external program for the format conversion.
To fix various Windows 10/11 problems, we recommend Outbyte PC Repair:
This software will repair common computer errors, protect you from file loss, malware damage, hardware failure, and optimise your computer for peak performance. In three simple steps, you can resolve PC issues and remove virus damage:
- Download Outbyte PC Repair Software
- Click Start Scan to detect Windows 10/11 issues that may be causing PC issues.
- Click Repair All to fix issues with your computer's security and performance.
This month, Outbyte has been downloaded by 23,167 readers.
If you are comfortable with the command-line interface rather than the graphical one, you can use the Command Prompt for converting your video or audio files.
In this post, we would discuss how to set up FFmpeg for using the Command Prompt to convert media files’ format.
Set Up the FFmpeg
By default, Command Prompt does not support the media file conversion. So before using the Command Prompt for conversions, you first need to set up the FFmpeg.
FFmpeg is an open-source, cross-platform utility tool that can be used for converting any audio or video file into almost any format. Here are the steps to set up the FFmpeg:
Open FFmpeg’s website by following this link.
Click on the Download button.
Under the “Get packages & executable files” heading, hover the mouse pointer over the Windows icon and choose any of the links for downloading the FFmpeg package.
Extract the package after it is downloaded.
Navigate to the drive where the Windows is installed. Generally, it is the C drive.
Create a new folder and name it “ffmpeg”
Paste all the files from the extracted folder to the “ffmpeg” folder.
Add FFmpeg’s Path to the System
Next, you have to add the FFmpeg’s path to the system.
- On the Windows search bar, type View advanced system settings and click on its icon to launch.
- Under the Advanced tab, click on Environment Variables.
- Select “Path” and click “Edit.“
- Click New and type this path: C:\ffmpeg\bin\
That’s it. You are ready with FFmpeg to use Command Prompt for media file conversion.
How to Convert a Video using Command Prompt?
FFmpeg allows you to convert almost any video format to any other format. For this post, we would convert ‘Sample.mp4’ into ‘Sample.avi.’ To convert the video using Command Prompt, follow these steps:
- Open the Command Prompt
- Using the cd command, reach the folder where your video file is present. Since Sample.mp4 is on Desktop, we would use the cd desktop command.
- Now use the following command to convert the Sample.mp4 to Sample.avi: ffmpeg -i sample.mp4 sample.mkv
- It would take some time to convert the file, depending on its size.
- The output file would be saved in the same folder where the original file is present.
How to convert an Audio file using Command Prompt?
For this post, we would convert ‘Audio-Sample.mp3’ to ‘Audio-Sample.wav.’ Here are the steps for that:
- Launch Command Prompt
- Reach to the source folder using cd desktop.
- Type the following command to start the conversion: ffmpeg -i Audio-Sample.mp3 Audio-Sample.wav
- The conversion would finish in a few moments.
How to extract Audio from Video using Command Prompt?
You can also use FFmpeg to extract audio from the video. Here we will extract the audio of ‘sample.mp4’ and convert it into ‘sample2.mp3’. Here are the steps for that:
- Open the Command Prompt
- Head to the location of the video file from which you want to extract audio using cd.
- Type this command to extract the audio from sample.mp4 video file: ffmpeg -i sample.mp4 -vn sample2.mp3
- A new file named sample2.mp3 will be generated in the same folder as the source.
Bottom Line
Though there are many third-party apps available for file conversions, using Command Prompt is the safest option. In the search for a third-party converter, you might install a malicious program on your system. Using FFmpeg is totally secure and easy. While using the command, you might get this error: “ffmpeg is not recognized as an internal or external command.” Verify that you have followed all the steps correctly, especially the step to create the FFmpeg’s path.
Peter is an Electrical Engineer whose primary interest is tinkering with his computer. He is passionate about Windows 10 Platform and enjoys writing tips and tutorials about it.