Main menu

Pages

Convert video and audio formats using CMD on Windows

 There are hundreds of free and paid programs available on the Internet that help users convert video and audio file formats , including also online sites and tools that can be used to do the same thing from the browser only - without installing software on the computer. But did you know that it is also possible to use CMD commands in Windows to convert a video or song format to another? Some people don't know this, but if you prefer to deal with commands instead of graphical interfaces in regular programs, regardless of the reason, you can easily switch between file formats with a single command in the CMD. Let's review the method from the following lines in this article.


Convert video and audio formats using CMD on Windows

Initially, keep in mind that the Windows system does not provide the ability within the CMD command prompt to convert video and audio formats, but this can be achieved with the help of an external tool called FFmpeg which does not need installation, it is integrated with the system and then the user can use it through the CMD to execute a large number Among the tasks, in addition to converting video and audio files to almost any format, the tool can extract audio from the video, mute the audio in the video, modify the dimensions of the video, or cut a video into several small parts ... and others. The good thing about this tool is that it is completely free to use, and usable on other platforms such as Linux and Mac, and FFmpeg is an open source project, in fact, quite a number of format converting programs out there are now based on this tool.

 
Convert video and audio formats using CMD on Windows

At the beginning, all you have to do is go to the official website of FFmpeg  or this link to  download the latest version of the tool on your device, and note that the file that you get after the download is a zip file. So, after downloading FFmpeg, use WinRAR or another utility to decompress and extract the included folders named: bin, doc, include and lib. After that, go to Partition [: C:] where the Windows files are located and create a new folder named "FFmpegTool" to then move the folders included in the zip file to this new folder.

Convert video and audio formats using CMD on Windows

But so far, the FFmpeg tool is not ready to use, but one step remains to make sure it integrates well with Windows to work through the CMD. So, after finishing moving the folders, open the Run window [by pressing Win key + letter R together] and type the command “sysdm.cpl” and press Enter to open the System Properties window in which you go to the “Advanced” section and then press the “Environment” button. Variables "below. A new window will appear on the screen after that. All you have to do is select "Path" from the User variables menu, press the "Edit" button, and then press "New" to add a new path, which is [C: \ FFmpegTool \ bin] and then click OK to save the changes. . Thus, it is possible to use FFmpeg to convert file formats with CMD.


Convert video and audio formats using CMD on Windows

Whether you want to convert a video or audio file format, the command is almost the same as you use to make FFmpeg do the job, the command here is to convert the source file to the format you specify to create a second copy of the same file but in a different format. For example, if you want to convert a video format located in a folder anywhere on your device, just go to that folder and then click on the path bar at the top of the File Explorer window and type "cmd" and press Enter. When the command prompt window appears, enter the command listed below:

ffmpeg -i videoname . mp4 videoname . webm

However, before hitting Enter in order to execute the command, there are adjustments that must be made first. So start by replacing " videoname " with the name of the video whose format you want to convert, bearing in mind that the name of the video must not contain spaces, and if there are spaces you must modify it and replace the spaces with Under Score [_]. After that, replace  mp4 with the current video format and  webm with the format you want to convert the video to. To be clearer, in this example we want to convert the Landscapes.webm file format to mp4, so the command will look like this:

ffmpeg -i Landscapes.webm Landscapes.mp4

Convert video and audio formats using CMD on Windows

Once you have modified the command and added it in the CMD command prompt, press Enter and wait for the video format to be converted, which takes some time depending on the length and resolution of the video, knowing that the tool will also save the video in the new format in the same folder that contains the original video file. Finally, you can preview and play the video to find out that the format was successfully converted.

As for converting audio formats, the steps are the same without difference. You go to the folder that contains the audio files, press the path bar, then type "cmd" and press Enter to do the same command described above, but in this case you will use the audio formats instead of the video. For example, to convert the Clouds.wav audio file to mp3 the command would be as follows:

ffmpeg -i Clouds. wav Clouds. mp3

Other than converting file formats, FFmpeg is used for many purposes. For example, if you want to extract the audio from the video, you can do so using the following command, taking into account replacing videoname.mp4 with the name and format of the video you want to extract the audio from:

ffmpeg -i videoname.mp4 -vn extractedaudio.mp3

If you want to mute the video and have a "silent" copy of the original file, use the following command:

ffmpeg -i videoname.mp4 -an mutedvideo.mp4

To modify the dimensions of the video and make it appear larger or smaller, use the following command taking into account replacing "videoname.mp4" with the name and format of the video, as well as modifying "640" by the width and "480" in the length you want to set the video dimensions to:

ffmpeg -i videoname.mp4 -s 640 x 480 -c: a copy resizedvideo.mp4

There are many commands you can perform via CMD with the help of the FFmpeg tool to accomplish countless tasks, just type the command "ffmpeg -h" and you will get a long list of commands available to use.

Convert video and audio formats using CMD on Windows

Ultimately, this was the method for converting video and audio formats using CMD on Windows. Dealing with FFmpeg is somewhat easy since the commands that are executed are short and easy to remember, and the result is excellent, but keep in mind that the tool during any operation you perform consumes the processor almost completely, as is clear, during our experience to convert a video format to a format Other The processor is 100% consumed, which in turn makes it difficult to use the computer for anything else until the conversion process is finished. Usually, in format converting programs such as FormatFactory, there is no significant impact on the device's resources by performing the required operations, but the situation is different with FFmpeg. But since it is free and offers excellent results, in addition to the fact that dealing with commands is somewhat enjoyable, there is no objection to trying it.


reactions

Comments