How to Copy Video, Covert All Audio Streams to AC3, and Only Keep Subtitles in English Using FFmpeg

Abstract: Resolve FFmpeg command errors when copying video, converting audio to AC3, and filtering for English subtitles only.

Created: 2026-08-03 by

To copy the video stream, convert all audio tracks to AC3, and retain only English subtitles using FFmpeg, you must use specific mapping flags. The command ffmpeg -i input.mp4 -c:v copy -c:a ac3 -map 0:v:0 -map 0:a? -map -0:s? -map -0:s? -map 0:s:m:language:eng achieves this efficiently. This approach ensures video quality is preserved while strictly filtering subtitle streams.

The Command Structure Explained

The core of this operation relies on precise stream selection. Many users attempt simple conversion commands that inadvertently strip non-English subtitles or fail to transcode audio correctly. The correct syntax requires explicit mapping instructions for each stream type. First, we define the input file with -i input.mp4. Next, we specify the codec for the video stream. Using -c:v copy tells FFmpeg to copy the video stream without re-encoding it. This preserves the original quality and drastically reduces processing time. It is crucial not to change the video codec unless necessary, as re-encoding can introduce artifacts and loss of fidelity. For the audio streams, we use -c:a ac3. This flag instructs FFmpeg to encode all selected audio streams into the AC3 format (Dolby Digital). AC3 is widely supported by hardware players, set-top boxes, and streaming devices, making it a robust choice for compatibility. Note that if your source audio is already AC3, FFmpeg may still re-encode it depending on the bitstream settings, but the output will be standardized.

Mapping Video and Audio Streams

Stream mapping is where most errors occur. We need to explicitly tell FFmpeg which streams to include in the output container. Use -map 0:v:0 to select the first video stream from the input. This ensures that even if multiple video streams exist, only the primary one is carried over. If you have multiple video tracks and want to keep them all, you might adjust this, but for standard transcoding, selecting the main track is sufficient. For audio, the flag -map 0:a? selects all audio streams present in the input file. The question mark indicates "optional," meaning if no audio streams are found, the command will not fail. This is safer than -map 0:a, which would throw an error if the input lacks audio. By combining this with -c:a ac3, every selected audio stream is converted to AC3.

Filtering Subtitles Correctly

Retaining only English subtitles requires a two-step mapping process. First, we must remove all subtitle streams, and then we selectively add back only the English ones. Start by stripping all subtitles with -map -0:s?. This negative map removes any stream labeled as a subtitle from the default selection. If you have multiple subtitle tracks in different languages, they are all discarded at this stage. Next, we add the English subtitles back using -map 0:s:m:language:eng. This complex map selector looks for subtitle streams that have the metadata language tag set to "eng". This is more reliable than guessing stream indices because language tags are often embedded in the file header. If your subtitles do not have proper language metadata, this method will fail to find them. In such cases, you may need to identify the specific stream index using ffprobe and map it directly, e.g., -map 0:s:1. It is important to note that some containers, like MP4, have limitations regarding AC3 audio. While modern MP4 containers support AC3, older players might struggle. For maximum compatibility, consider using a MKV container instead. To do this, simply change the output filename extension to .mkv. MKV supports virtually all codecs and metadata structures without restriction.

Handling Metadata and Compatibility

When copying video and converting audio, metadata handling becomes critical. FFmpeg copies metadata by default, but sometimes you want to clean it up or ensure consistency. You can use -movflags +faststart if you are outputting to MP4 to optimize web playback. However, if you switch to MKV, this flag is unnecessary. Another common issue is the presence of forced subtitles. Sometimes, a single subtitle track contains both normal dialogue and forced translations (e.g., for foreign songs). If you want to keep forced subtitles, you should not use -map -0:s? followed by -map 0:s:m:language:eng blindly. Instead, you might need to filter based on the "forced" attribute. However, for most general use cases, keeping all English-language subtitles is the desired outcome. If you encounter warnings about unsupported bitstreams, check your FFmpeg version. Older versions may not support AC3 encoding natively. Ensure you are using a recent build that includes libavcodec support for AC3. You can verify this by running ffmpeg -encoders | grep ac3. If it appears in the list, your installation is capable. For related tasks, such as adding background music or censoring audio, see our guides on Adding Random Music for Multiple Videos with FFmpeg and Creating a Modern Bleep Censor for Audio and Video. These resources expand on audio manipulation techniques that complement this workflow.

Troubleshooting Common Errors

Users often face issues when the language tag is missing. If the command produces an output with no subtitles, it is likely because the source file does not label the English subtitles as "eng". Use ffprobe -v quiet -print_format json -show_streams input.mp4 to inspect the stream details. Look for the tags section within the subtitle stream data. If the language is listed as "en" instead of "eng", you may need to remap using the stream index or update the metadata before processing. Another error involves the output container rejecting the AC3 stream. As mentioned, MP4 has strict standards. If you receive an error like "Invalid argument" or "Codec not supported", switch to MKV. The command remains identical except for the output filename. MKV is a matroska container that acts as a universal wrapper for almost any combination of codecs. Finally, always test with a short clip before processing full-length movies. Transcoding audio can be CPU-intensive, and verifying the output quickly saves hours of wasted time. Check the duration, audio bitrate, and subtitle presence in a media player like VLC or MPC-HC.

Frequently Asked Questions

Can I keep the original audio format instead of converting to AC3?

Yes, replace -c:a ac3 with -c:a copy to preserve the original audio codec. However, this means the audio will not be converted to Dolby Digital, which might affect compatibility with certain legacy devices that require AC3.

What if my subtitles are not tagged as "eng"?

If the language metadata is incorrect or missing, you cannot rely on the language filter. You must identify the stream index using ffprobe and map it manually, for example, -map 0:s:2. Alternatively, you can rename the subtitle files externally and burn them into the video using subtitles filters.

Why did my output file become very large?

AC3 audio typically uses bitrates between 192kbps and 640kbps. If you have multiple audio tracks, each is converted separately, increasing the total size. Additionally, if you accidentally re-encoded the video instead of copying it, the file size will increase significantly. Always verify -c:v copy is active.

Does this command work for HEVC/H.265 videos?

Yes, the stream mapping logic applies regardless of the video codec. As long as your FFmpeg build supports HEVC decoding and you are using -c:v copy, the video stream will be preserved intact while audio and subtitles are processed.

How do I remove forced subtitles specifically?

To exclude forced subtitles, you can use a more complex filter graph. However, a simpler approach is to map all English subtitles and then use -map -0:s:m:force_default:no if your FFmpeg version supports it, or manually exclude the specific stream index identified via ffprobe that carries the forced flag.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More