FFmpeg is a powerful command-line tool that allows you to manipulate audio and video files. In this article, we will guide you on how to copy a video, convert all audio streams to AC3, and only keep subtitles in English using FFmpeg.
Step 1: Download FFmpeg
Before we begin, you need to download FFmpeg. Visit the official FFmpeg website (https://ffmpeg.org/) and download the version compatible with your operating system. Once downloaded, extract the files to a location of your choice.
Step 2: Open Command Prompt
Next, open the Command Prompt on your computer. You can do this by pressing the Windows key + R, typing "cmd" in the Run dialog, and then clicking "OK."
Step 3: Navigate to FFmpeg Directory
Using the Command Prompt, navigate to the directory where you extracted the FFmpeg files. You can do this by typing the following command and pressing Enter:
cd C:\path\to\ffmpeg
Replace "C:\path\to\ffmpeg" with the actual path to the FFmpeg directory on your computer.
Step 4: Copy Video and Convert Audio Streams
To copy the video and convert all audio streams to AC3, use the following command:
ffmpeg -i input.mp4 -map 0 -c copy -c:a ac3 output.mp4
Replace "input.mp4" with the path to your input video file and "output.mp4" with the desired name and location for your output file.
This command will copy the video stream from the input file and convert all audio streams to AC3 format. The resulting output file will have the same video content as the input file but with AC3 audio streams.
Step 5: Keep Only English Subtitles
If your input video file has multiple subtitle streams and you only want to keep the subtitles in English, use the following command:
ffmpeg -i input.mp4 -map 0 -c copy -scodec mov_text -s:s:0 eng output.mp4
Replace "input.mp4" with the path to your input video file, "output.mp4" with the desired name and location for your output file, and "eng" with the language code for English (you can find language codes in the table below).
This command will copy the video and audio streams as before, but it will also keep only the English subtitles using the "-s:s:0 eng" option.
Step 6: Wait for the Conversion
Once you have entered the appropriate FFmpeg command, press Enter and wait for the conversion process to complete. The time it takes will depend on the size and complexity of your input video file.
Once the conversion is finished, you will have a new video file with the desired changes.
Conclusion
FFmpeg is a powerful tool for manipulating audio and video files. In this article, we have shown you how to copy a video, convert audio streams to AC3, and keep only English subtitles using FFmpeg. By following these steps, you can easily customize your video files to suit your needs.
References
| Language | Language Code |
|---|---|
| English | eng |
| Spanish | spa |
| French | fra |
| German | ger |
| Italian | ita |
| Japanese | jpn |