Ffmpeg Map
You use ffmpeg map to pick which video, audio, and subtitle streams enter your output file. Instead of taking one default track per type, this feature lets you route exact streams by index. Media teams often run these jobs on shared build servers with broad host roles. When server permissions are too wide, one bad command can overwrite source files or leak customer media. How the ffmpeg map workflow routes media streams Every media container holds multiple internal tracks, such as video feeds
Map: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You use ffmpeg map to pick which video, audio, and subtitle streams enter your output file. Instead of taking one default track per type, this feature lets you route exact streams by index. Media teams often run these jobs on shared build servers with broad host roles. When server permissions are too wide, one bad command can overwrite source files or leak customer media.
How the ffmpeg map workflow routes media streams
Every media container holds multiple internal tracks, such as video feeds, language audio, and closed captions. When you process a file without custom routing, the tool picks a single track for each type. It chooses the highest resolution video track and the audio track with the most channels. All other audio languages or commentary tracks get dropped from the final file.
To keep specific tracks, you define stream routing rules in your job setup. You identify each input file by a number, starting at zero for the first file. Next, you point to the stream type and the specific track index inside that file. You can pull video from the first file and pair it with audio from a second file.
You can also use negative mapping rules to drop unwanted tracks from a bulk transfer. First, you tell the tool to copy all streams from the source container. Then, you add a negative rule that strips out a specific data track or subtitle stream. The engine reads these rules in order and builds the output file layout to match.
What native stream routing solves and where gaps remain
Native stream selection gives engineers full control over complex multi-track media files. You can build multi-language outputs, strip broken metadata tracks, or merge separate audio and video recordings. It prevents silent track loss during automated batch jobs across large media libraries.
Still, media processing tools do not manage host security or audit who runs which job. Engineers often log in to media servers using shared admin keys to fix broken encoding pipelines. Once a user logs in, the operating system lets them read any file in the storage bucket. Native OS permissions decide who can log in, not what individual commands do in flight.
Map: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
If an engineer points an output path to the wrong folder, they can overwrite master video assets. Also, media files or subtitle tracks sometimes hold sensitive data like emails or phone numbers. Standard server logs do not show which person ran a specific media job or inspected raw files.
Securing media processing commands on production servers
To run media workflows safely, teams must separate server login rights from individual command execution. Instead of handing out permanent server keys, teams should require approval before a user runs shell tasks. Every media command should link back to a single verified person in the central audit log.
Teams also need controls that inspect outputs when scripts read text tracks or database records. When a job pulls metadata containing card numbers or national IDs, masking rewrites matched fields in results. This keeps sensitive text out of terminal screens while letting engineers fix broken media pipelines.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
What happens if you do not specify stream routing rules?
The tool selects only one video, one audio, and one subtitle track for the output file. It ignores any extra language tracks or secondary video angles present in the source file.
How do you copy all streams from an input file at once?
You reference the input file index by itself without naming a single stream type or track number. This tells the engine to carry every video, audio, and subtitle track into the new container.
Can you combine streams from two different source files?
Yes, you can load multiple input files and reference their unique file numbers in your routing rules. This lets you pair the video track from file zero with the audio track from file one.
Related guides
In this post