
For example, the following command will convert the first 10 seconds of the input.mp4 to MKV format. In this situation, you need to use the -t value to specify the time.

In addition to converting the format of the entire video, FFmpeg also allows you to convert a specific part of the video or audio format when needed. You can also set the output format (MP4 in this case) as other supported formats.įfmpeg -i input.mp4 -an mute-output.mp4 6. FFmpeg Remove AudioĪlso, you can remove the audio stream and keep the video stream with FFmpeg using the command below. The following command will remove the video stream from a video file, letting you extract audio from video.įfmpeg -i input.mp4 -vn output.mp3 5. In addition to converting the video/audio file to a different format, FFmpeg can also remove the video part or the audio part separately. FFmpeg Extract Audio (Convert Video to Audio) For example, FFmpeg will convert WAV to MP3 with the following command.įfmpeg -i input.wav -vn -ar 44100 -ac 2 -b:a 192k output.mp3 4. Similarly, you can transcode audio files with FFmpeg by specifying the output format. For example, to convert MOV to MP4 with FFmpeg, run the command below. FFmpeg MOV to MP4 (Convert Video/Audio to Another Format)įFmpeg is extremely useful to convert your video file to another format. If you want to preview or test a media file before or after dealing with it, you can play it with ffplay by performing the following command:Īdd "-fs" to the command to enter fullscreen mode. Preview or Test Video or Audio FilesįFmpeg framework consists of FFmpeg itself, ffprobe, and ffplay, the FFmpeg library-based media player. The "hide_banner" flag helps hide FFmpeg banners and other details, and only shows the media file information. Normally it will require to specify the input file and output file, but in this case, the output file can be omitted since we only need to get some basic information. FFmpeg Get Video Infoįirst, you can easily get the information of a given media file (say input.mp4) using FFmpeg. Here at VideoProc, we also prepare you a step-by-step tutorial about how to install FFmpeg.

If you are just getting started, first you'll need to download the source code or a build from the official download page, and install it on your device.

So here in this post, I will introduce 31 most commonly used FFmpeg commands with examples to perform various tasks like converting media formats, trimming videos, extracting audio/video streams, etc. You will need to type commands with your keyboard to transcode multimedia files and streams. It packs many encoders and decoders, making it powerful enough to support almost all common and uncommon multimedia formats.įFmpeg comes with a learning curve especially if you are new to a command line tool.

FFmpeg is a free and open-source command line-based tool to handle video, audio, and other multimedia files.
