Current Wave Data

I used the command prompt to convert my media files on Windows, here's how you can too

By Pranav Bhardwaj

I used the command prompt to convert my media files on Windows, here's how you can too

Windows Command Prompt is a powerful tool commonly used for system management, folder management, network configuration, troubleshooting, and more. But did you know you can also convert your media files to another format with it?

FFmpeg is an open-source multimedia framework that allows you to easily transform your images, audio, and video files into various formats through the Command Prompt. It is pretty lightweight and doesn't require a GUI to run. I set it up and used it to convert media files, and here's the process I followed.

2:53

Related

New to the Windows command line? These 10 useful commands are a great way to get started

You can use your keyboard alone for all kinds of things

Posts 2

Setup FFmpeg on your system

Download and install FFmpeg

FFmpeg is a free and open-source software tool that supports various operating systems. Before using it for file conversion, you first need to download and set up FFmpeg on your system. Here's how to install it on Windows.

Visit the official FFmpeg website and click the Download button.

Under Get packages & executable files, click on Windows.

Click one of the links to redirect to the download page. Download the latest ffmpeg-git-full version under the 64-bit or 32-bit section based on your system architecture.

Once downloaded, extract the FFmpeg ZIP file using File Explorer or a tool like WinRAR or 7-Zip.

Now, open your system drive (usually C:) and create a new folder named ffmpeg. Move the content of the extracted folder to this newly created folder.

Add FFmpeg path to Windows Environment Variables

To use FFmpeg globally in the Command Prompt, you must add its path to the system's Environment Variables.

Open the folder where FFmpeg files are extracted. Go to the "bin" folder, right-click on the address bar, and select Copy Address. The path should look like C:\ffmpeg\bin. Now, press Win + S, type "environment variables," and click Edit the system environment variables.

In the System Properties window, click the Environment Variables button at the bottom.

Under System variables, find and select Path, then click Edit.

Next, click New, paste the copied FFmpeg bin path, and press Enter.

Click OK to save changes.

Finally, launch the command prompt and use the ffmpeg -version command to verify the successful installation of FFmpeg.

After applying the above action, you are ready to convert your media files using FFmpeg at the command prompt.

Use FFmpeg to convert media files through the Command Prompt

Convert an image from one format to another

FFmpeg can effortlessly convert images between formats like JPG, PNG, BMP, etc. Now that FFmpeg is set up let's explore how to convert images, audio, and videos with it.

Launch Command Prompt or Windows PowerShell with administrative rights from the Start Menu. Use the cd command to reach the location of the folder where your source images are stored. For example: cd "E:\Samples to Convert"

Now use ffmpeg -i Image.OrginalFormat Image.NewFormat command to convert your image file from one format to another. For example: ffmpeg -i SampleImage.jpg SampleImage.png will convert SampleImage.jpg to SampleImage.png. You can choose any name and format for your output image. For example: ffmpeg -i OriginalImage.jpg ConvertedImage.gif

The file will be converted within seconds and saved to the folder where the original file is stored.

Open the folder and check for the converted image file.

Convert an audio file from one format to another

Similarly, you can convert the audio file between multiple formats such as WAV, AAC, OGG, and others.

Open Command Prompt or PowerShell with administrative rights and use the cd command to reach the folder of your audio file. Similar to image conversion, you can use the ffmpeg -i Audio.OrginalFormat Audio.NewFormat command to convert your image file from one format to another. For example: ffmpeg -i SampleAudio.mp3 SampleAudio.wav. You can choose a different name for the output file. For example: ffmpeg -i OriginalAudio.mp3 ConvertedAudio.wav

It will take seconds to minutes to complete the conversion, depending on the file size.

Check the output file in the same folder as the source file.

Convert a video file to another format

FFmpeg lets you convert video files to various formats, such as MOV to MP4, MKV, AVI, etc.

Open Command Prompt or PowerShell with administrative rights and use the cd command to navigate to the folder of your video file. Use the ffmpeg -i Video.OrginalFormat Video.NewFormat command to convert your video to another format. For example: ffmpeg -i SampleVideo.avi SampleVideo.mp4. There could be a different name for the output file. For example: ffmpeg -i OriginalVideo.avi ConvertedVideo.mp4

Depending on the file size, it could take seconds to minutes to complete the conversion.

The converted file will be saved to the original file's folder.

Extract audio from a video

If you like to extract audio from a video file, you can do that easily through the command prompt:

Open Command Prompt with elevated rights and use the cd command to reach the folder of your source video file. Use the ffmpeg -i Video.OrginalFormat Audio.NewFormat to extract audio from the video. For example: ffmpeg -i SampleVideo.avi ExtractedAudio.mp3.

It could take a while to complete the extraction process. The extracted audio file will be saved to the original file's location.

Formats supported by FFmpeg

Image Formats

JPG/JPEG, PNG, TIFF, BMP, GIF, WebP, ICO, PPM, PGM, PBM, TGA

Audio Formats

MP3, AAC, WAV, OGG, FLAC, AC3, ALAC, WMA, AMR, AIFF, Opus, MP2, PCM, M4A, DTS

Video Formats

MP4, MKV, AVI, MOV, WMV, FLV, WebM, MPEG, OGG, 3GP, RM, TS, M2TS, VOB, DIVX, HEVC

Fix the "ffmpeg is not recognized as an internal or external command" error

Get rid of that annoying error

While converting your media files, if you are getting the "ffmpeg is not recognized as an internal or external command" error, that means either you have not added the FFmpeg's "Bin" folder path to Environment Variables or you have added the wrong path to it.

Add the Bin folder path to Environment Variables by following the steps listed at the beginning of the guide. If you have already added it, re-check whether you have inserted the correct path. Remember, not even a single character should be missed (or added extra) when adding the path.

Turn the Windows command prompt into a media conversion tool

Using the command prompt to convert media files might seem challenging, but after the initial setup of FFmpeg and adding the path to Environment Variables, the process is a breeze and takes just a simple single-line command. Whether you're converting images, audio, or videos or extracting audio from video, the step-by-step instructions in this guide ensure you can get the job done without relying on third-party applications. So, go ahead and turn your system's command prompt into a file conversion utility.

Previous articleNext article

POPULAR CATEGORY

corporate

4475

tech

4744

entertainment

5557

research

2494

misc

5822

wellness

4441

athletics

5822