• Sun. Jul 3rd, 2022

The way to Convert Media Information With FFmpeg – thekoffeetable

Read Time:6 Minute, 44 Second


FFmpeg is a really highly effective and nice command line instrument used for performing numerous conversion operations on audio and video recordsdata. The advantage of this instrument is that it’s completely free to make use of. It’s out there for Home windows, Linux and Mac working methods.

Not everybody is aware of the right way to use it although and for that objective, I’ve give you this information on the right way to use FFmpeg for Home windows OS. From the very first step of downloading this system to cropping an audio file, this tutorial goals that will help you cowl the fundamentals, so to mess around extra afterward.

Downloading FFmpeg for Home windows

To obtain the instrument, click on right here to go to the webpage. When you’ve performed that find the obtain possibility, as proven beneath. The obtain possibility highlighted in inexperienced is for 32-bit Home windows OS whereas the opposite possibility in crimson is for 64-bit Home windows OS.

download ffmpeg

To confirm in case your OS is 32-bit or 64-bit, click on on the Begin icon on the left facet of your desktop then kind Run in search bar and in run write the command of dxdiag and press the Enter key.

Underneath the heading of ‘System Info’, you possibly can simply discover the identify of the OS and the model getting used (32-bit or 64-bit).

Extracting the recordsdata

After getting downloaded FFmpeg, you’ll need to extract the recordsdata from the .zip folder. For this objective, you must have a zipper extractor put in. You’ll be able to obtain a free zip extractor known as 7-zip from right here.

convert media files ffmpegconvert media files ffmpeg

After extracting the recordsdata, choose the entire recordsdata, create a folder in C drive named FFmpegTool and paste all of the recordsdata on this folder as proven beneath. It is very important word that you must preserve the folder identify and drive the identical to keep away from any issues in executing instructions to carry out conversions.

convert media files ffmpegconvert media files ffmpeg

Beginning FFmpeg

Go to Run, kind cmd and press the Enter key. A command line window will seem as proven right here.

convert media files ffmpegconvert media files ffmpeg

Sort cd and press the Enter key. It ought to seem as beneath.

convert media files ffmpegconvert media files ffmpeg

Now kind cd FFmpegTool, this command will assist you to enter into the FFmpegTool folder which we’ve got created earlier (watch out with the spelling as any spelling mistake in command will trigger an error).

convert media files ffmpegconvert media files ffmpeg

Sort cd bin and press the Enter key to entry the content material within the bin folder. It’s best to see the next.

convert media files ffmpegconvert media files ffmpeg

Lastly, kind ffmpeg.exe and press the Enter key. It is going to take 1 or 2 seconds to execute the command and you must have the ability to see the outcome proven beneath.

convert media files ffmpegconvert media files ffmpeg

In case you see textual content traces written in your display (as per the above picture) then it means the instrument is working wonderful and able to use.

Some vital FFmpeg instructions

Now, we’ll undergo a number of the vital instructions for FFmpeg. Copy the video within the bin folder on which you’ll carry out the operations. I’ve copied a video known as samplevideo and can use this video all through the rest of this publish.

1. Extracting audio-only from video file

After getting examined that FFmpeg is working wonderful then kind within the following command:

ffmpeg -i yourvideoname.mp4 -vn -ab 128 outputaudio.mp3

convert media files ffmpegconvert media files ffmpeg

Right here -vn is used to extract audio and -ab is used to save lots of audio as 128Kbps MP3 file. You’ll be able to change the bit price to 256Kbps or one thing else. Simply change the worth after -ab. All the output recordsdata shall be saved routinely within the bin folder.

2. Extracting video whereas muting audio

Within the command written beneath, -an is used to take away the audio from the video file. The command ought to appear like so:

ffmpeg -i yourvideoname.mp4 -an mutevideo.mp4

convert media files ffmpegconvert media files ffmpeg
3. Resizing video file

Within the command written beneath, -s is used to resize the video file.The command is:

ffmpeg -i yourvideoname.mp4 -s 640x480 -c:a replica resizedvideo.mp4

convert media files ffmpegconvert media files ffmpeg
4. Including poster picture to an audio file

You’ll be able to add a poster picture to your audio file simply and the output could be a video file with a picture being displayed within the entrance and audio within the background. That is actually helpful when importing MP3 recordsdata to video internet hosting and sharing websites.

You could copy the picture within the bin folder. Then execute this command:

ffmpeg -loop 1 -i inputimage.jpg -i inputaudio.mp3 -c:v libx264 -c:a -strict experimental -b:a 192k -shortest outputfile.mp4

convert media files ffmpegconvert media files ffmpeg
5. Minimize video file right into a smaller clip

The -ss defines the beginning time stamp (right here beginning time is the forty fifth second) and -t tells the whole time period for the clip. So, -t 40 means 40 second period. The command ought to like this:

ffmpeg -i yourvideoname.mp4 -ss 00:00:45 -codec copy -t 40 outputclip.mp4

convert media files ffmpegconvert media files ffmpeg
6. Break up a video file into a number of elements

Many of the internet hosting servers solely permits for a particular measurement of file to be uploaded. To beat this difficulty, you possibly can use the break up command to separate a big video file into smaller elements, which is:

ffmpeg -i yourvideoname.mp4 -t 00:00:59 -c copy part1.mp4 -ss 00:00:59 -codec copy part2.mp4

convert media files ffmpegconvert media files ffmpeg

Right here -t 00:00:59 represents a component that’s created from the beginning of the video to the 59th second of video. -ss 00:00:59 reveals the beginning time stamp for the video. It signifies that the 2nd half will begin from the 59th second and can proceed as much as the top of the unique video file.

7. Convert a video file from one format to a different

You’ll be able to see the entire codecs supported by FFmpeg by utilizing the next command:

ffmpeg -formats

To transform a video file from one format to a different format, the next command is used:

ffmpeg -i yourvideoname.mp4 -c:v libx264 outputfilename.wmv

The command beneath is an instance of when changing a .mp4 file right into a .wmv file.

convert media files ffmpegconvert media files ffmpeg
8. Be a part of (merge) a number of video recordsdata

FFmpeg also can be part of a number of video or audio recordsdata with the identical codecs. Create a .txt file together with an inventory of all of the enter video recordsdata which might be purported to be merged. The key phrase file is adopted by identify, path and the format of the video recordsdata. Add the entire recordsdata in the identical means within the created .txt file and save this .txt file within the bin folder.

convert media files ffmpegconvert media files ffmpeg

Now kind the next command to affix the video recordsdata:

ffmpeg -f concat -i file-list.txt -c copy outputfile.mp4

convert media files ffmpegconvert media files ffmpeg
9. Cropping and audio file

To crop a part of an audio file, the next command could be utilized:

ffmpeg -ss 00:00:15 -t 45 -i sampleaudio.mp3 croppedaudio.mp3

Right here, -ss 00:00:15 is the staring time and -t 45 is the period of the cropped file.

convert media files ffmpegconvert media files ffmpeg

Alternatively…

Whereas FFmpeg is nice, this free instrument nonetheless might have some limitations that wouldn’t do what it is advisable to do.

WinX HD Video Converter, on the opposite facet, is a GPU-accelerated HD video converter that not solely converts media recordsdata but in addition lets you lower/merge, resize movies, and so forth. Do test it out.

convert media files ffmpegconvert media files ffmpeg

Conclusion

We’ve lined downloading and putting in FFmpeg in addition to a number of the helpful instructions that you should utilize. You’ll be able to discover the remainder of the instructions through the assistance possibility of FFmpeg. Simply kind in ffmpeg -h in command line. This can checklist all of the out there choices and instructions for these choices. So why don’t you attempt it out for your self?

Was this post helpful?

The 6 Best Ring Lights for Home Studio Photography in 2022 Best Laptop for Creatives or Designers