Download ArticleDownload Article

This How.com.vn teaches you how to use FFmpeg to convert video and audio from your computer's Command Prompt (Windows) or Terminal (Mac, Linux).

Method 1
Method 1 of 3:

Using Windows

Download Article
  1. How.com.vn English: Step 1 Install FFmpeg...
    Install FFmpeg if it isn't already installed. You can install FFmpeg on your Windows computer for free, though the installation process itself can be tricky.
    • You'll need to be on an administrator account to install FFmpeg.
  2. How.com.vn English: Step 2 Find a video or song to convert.
    You can use FFmpeg to change both videos and songs into different compatible formats (i.e., you can change a video into another video format or an audio file into another audio format).
    • You can also turn video files into audio files by using FFmpeg.
    Advertisement
  3. How.com.vn English: Step 3 Copy the video or song.
    Select the song, then press Ctrl+C.
    • You'll do this so that you have a backup copy of the original file in case something goes wrong.
  4. How.com.vn English: Step 4 Place the video or song on your desktop.
    Go to your computer's desktop, then press Ctrl+V.
    • By doing this, your file will be in an easily accessible place when you go to convert it.
  5. How.com.vn English: Step 5 Determine your file's current format.
    You can do this by right-clicking the file, clicking Properties, and reviewing the format in parentheses next to the "Type of file" heading.
    • You'll need to know your file's current format in order to tell FFmpeg which file to convert.
  6. How.com.vn English: Step 6 Figure out what you want to convert the file into.
    You can convert video-to-video, video-to-audio, and audio-to-audio using the following formats:[1]
    • Video - MP4, MOV, WEBM, FLV, AIFF, and AVI are all common video formats which are supported by FFmpeg.
    • Audio - MP3, WAV, WMA, M4A, AAC, and OGG are all common audio formats which are supported by FFmpeg.
  7. How.com.vn English: Step 7 Note your file's name.
    Click your file once to see its full name. You'll need to enter the file's full name into FFmpeg.
    • You might consider renaming your file to a one-word name in order to make the conversion process easier. You can do this by right-clicking the file, clicking Rename, and entering a new name.
  8. How.com.vn English: Step 8 Open Command Prompt.
    Command Prompt comes installed on all Windows computers. To open it, do the following:
    • Click Start
      How.com.vn English: Windows Start
    • Type in command prompt
    • Click
      How.com.vn English: Windows cmd
      Command Prompt
  9. How.com.vn English: Step 9 Switch your command line to the Desktop.
    Type in cd Desktop and press Enter. This will tell Command Prompt to look for any files that you mention in the Desktop folder.
  10. How.com.vn English: Step 10 Enter the conversion command.
    The conversion command starts with ffmpeg -i and then includes your file's current name and file type as well as whatever you want the converted file name and file type to be.
    • For example, to convert an MP4 video called "Kitties" into a WAV file called "Cats", you would type in ffmpeg -i Kitties.mp4 Cats.wav here.
    • Be sure to keep your file name exactly as it appears (for example, if your file name uses a capital letter, enter it using the capital letter in the command line).
    • If your file name uses spaces, you can place the video's name and extension in quotes. For example, YouTube Drama.mp4 would become "YouTube Drama.mp4" (placing underscores doesn't work if they aren't in the title).
  11. How.com.vn English: Step 11 Press ↵ Enter.
    As long the file into which you're converting the original file is a valid format—and your original file's name is correct—the file will begin converting.
    • Converting files (especially videos) can take a large amount of time. If you're converting a large video or audio file, just be sure to keep Command Prompt open until you see the "C:\Users\Name\Desktop>" line appear.
  12. How.com.vn English: Step 12 View your converted file.
    Once your file finishes converting, you'll see it on the Desktop under the name that you entered for it.
  13. Advertisement
Method 2
Method 2 of 3:

Using Mac

Download Article
  1. How.com.vn English: Step 1 Make sure that FFmpeg is installed.
    Unlike on a Windows computer, FFmpeg is easiest to install as part of the Homebrew package manager, which you can quickly install via Terminal:[2]
    • Go to https://brew.sh/ in your browser.
    • Copy the code below the "Install Homebrew" heading by selecting it and then pressing Command+C.
    • Open Spotlight
      How.com.vn English: Mac Spotlight
      , type in terminal, and double-click Terminal
    • Paste in the copied code by pressing Command+V.
    • Press Return, then wait for the installation to complete.
    • Type in brew install ffmpeg and press Return.
  2. How.com.vn English: Step 2 Find a video or song to convert.
    You can use FFmpeg to change both videos and songs into different compatible formats (i.e., you can change a video into another video format or an audio file into another audio format).
  3. How.com.vn English: Step 3 Copy the video or song.
    Select the file and then press Command+C to do so.
    • You'll do this so that you have a backup copy of the original file in case something goes wrong.
  4. How.com.vn English: Step 4 Place the video or song on your desktop.
    Go to your computer's desktop, then press Command+V. You should see the file appear here.
    • By doing this, your file will be in an easily accessible place when you go to convert it.
  5. How.com.vn English: Step 5 Determine your file's current format.
    You can do this by clicking the file to select it, clicking File, clicking Get Info, and looking at the extension on the end of the file name (e.g., ".mp4").
  6. How.com.vn English: Step 6 Figure out a target format.
    You can convert video-to-video, video-to-audio, and audio-to-audio using the following formats:
    • Video - MP4, MOV, WEBM, FLV, AIFF, and AVI are all common video formats which are supported by FFmpeg.
    • Audio - MP3, WAV, WMA, M4A, AAC, and OGG are all common audio formats which are supported by FFmpeg.
  7. How.com.vn English: Step 7 Note your file's name.
    Click your file once to see its full name. You'll need to enter the file's full name into FFmpeg.
  8. How.com.vn English: Step 8 Open Terminal.
    If you closed Terminal after installing FFmpeg, you can re-open it by clicking Spotlight
    How.com.vn English: Mac Spotlight
    , typing in terminal, and double-clicking
    How.com.vn English: Mac Terminal
    Terminal.
  9. How.com.vn English: Step 9 Switch your command line to the Desktop.
    Type in cd desktop and press Return. This will tell Terminal to look for any files that you mention in the Desktop folder.
  10. How.com.vn English: Step 10 Enter the conversion command.
    The conversion command starts with ffmpeg -i and then includes your file's current name and file type as well as whatever you want the converted file name and file type to be.
    • For example, to convert an MP4 video called "Kitties" into a WAV file called "Cats", you would type in ffmpeg -i Kitties.mp4 Cats.wav here.
    • Be sure to keep your file name exactly as it appears (for example, if your file name uses a capital letter, enter it using the capital letter in the command line).
    • If your file name uses spaces, you can place the video's name and extension in quotes. For example, YouTube Drama.mp4 would become "YouTube Drama.mp4" (placing underscores doesn't work if they aren't in the title).
  11. How.com.vn English: Step 11 Press ⏎ Return.
    As long as the formats are compatible and the file name for the original file is correct, doing so will prompt FFmpeg to begin converting your file.
    • Converting files (especially videos) can take a large amount of time. If you're converting a large video or audio file, just be sure to keep Terminal open until a new, blank line appears at the bottom.
  12. How.com.vn English: Step 12 View your converted file.
    Once your file finishes converting, you'll see it on the Desktop under the name that you entered for it.
  13. Advertisement
Method 3
Method 3 of 3:

Using Linux

Download Article
  1. How.com.vn English: Ubuntu open terminal.png
    1
    Open the terminal. How to do this varies across the different Linux distributives, but you usually need to find a program that has a dark screen with some bright characters on it as an icon. It is usually labelled as something like "Terminal" or "Console".
    • On a few systems, you can open it by pressing Ctrl+Alt+T.
  2. How.com.vn English: Check ffmpeg installation.png
    2
    Make sure that FFmpeg is installed. If you're not sure whether you have it installed, type ffmpeg -version into the terminal. If this raises an error, you don't have FFmpeg installed. In that case, the easiest option is to use your package manager to install it.
    • On Debian, Ubuntu and other systems that use APT, type sudo apt-get install ffmpeg.
  3. 3
    Figure out a target format. You can convert video-to-video, video-to-audio, and audio-to-audio using the following formats:
    • Video - MP4, MOV, WEBM, FLV, AIFF, and AVI are all common video formats which are supported by FFmpeg.
    • Audio - MP3, WAV, WMA, M4A, AAC, and OGG are all common audio formats which are supported by FFmpeg.
  4. How.com.vn English: Find video convert directory.png
    4
    Locate the file that you want to convert. If you approximately know where it is, you can navigate into the directory using cd dir_name for changing into a directory and ls for listing the contents of the current directory.
  5. How.com.vn English: Convert video ffmpeg.png
    5
    Enter the conversion command. The conversion command follows the format ffmpeg -i source_file target_file. Be prepared to wait a long time, especially if you're converting a long and/or high-quality video.
    • For example, to convert an MP4 video called "Kitties" into an OGG video called "Cats", you would type ffmpeg -i Kitties.mp4 Cats.ogg.
    • If you want to convert video to audio, add the -vn option to tell FFmpeg that you don't need a video. Try also adding the option -acodec copy to avoid audio quality loss, although that may not always be possible. For example, to convert an MP4 video called "Kitties" into a WAV audio file called "Kitty-sounds", you would type ffmpeg -i Kitties.mp4 -vn -acodec copy Kitty-sounds.wav.
    • By default, FFmpeg outputs a lot of text during the conversion. If you don't want to see it, you can add the -loglevel panic option to tell FFmpeg to only print serious errors and questions.
    • Be sure to keep your file name exactly as it appears (for example, if your file name uses a capital letter, enter it using the capital letter in the command line). The Linux terminal is case-sensitive, so it won't open your file otherwise. If your file name uses spaces, you can place the video's name and extension in quotes. For example, YouTube Drama.mp4 would become "YouTube Drama.mp4" (placing underscores doesn't work if they aren't in the title).
  6. How.com.vn English: Ffmpeg converted video result.png
    6
    View your converted file.
    • To open the new file from the terminal, try mpv file_name, vlc file_name or totem file_name. These are some common video players for Linux, although it is possible that you don't have any of these installed. If you know how to open any other video player from the terminal, you can also use that.
    • You can also open the file manager, navigate to the directory where the original and now also the converted file is, and double-click on the converted file. This should open it with the default video player of the system.
  7. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn English: Jack Lloyd
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for How.com.vn. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 307,933 times.
      How helpful is this?
      Co-authors: 18
      Updated: January 12, 2020
      Views: 307,933
      Categories: Media Software
      Article SummaryX

      1.Install FFmpeg.
      2.Navigate to a song in your file browser.
      3.Press Control + C to copy it.
      4.Go to your desktop and press Control + V to paste it.
      5.Open the command prompt.
      6.Type "cd desktop" and press Enter.
      7.Type "ffmpeg_i originalfilename newfilename" and press Enter.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 307,933 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement