If FFmpeg’s output options appear after a filename, they generally apply to the next file named, not the file that came before. FFmpeg parses the command in order: input options go before their -i, output options go before their output filename, and most options reset between files. So a command can finish without an error yet leave the intended AI short unchanged because the option was attached to a different output, or had no following output to affect.
Find the file each option belongs to
FFmpeg’s synopsis separates global options, input options followed by -i, and output options followed by an output URL. Its general rule is that an option applies to the next specified file. Global options are the exception: they affect the overall invocation and should be placed first. Most options are not global, and are reset between files.
A filename is therefore a useful boundary. For example, the documented output video-bitrate option -b:v 64k placed before short.mp4 is associated with that output. Put it after short.mp4 and before preview.mp4, and it is associated with the preview instead. This illustrates scope only; 64 kbit/s is not a recommendation for your video. Frame-rate options such as -r have input and output uses, so this example avoids using frame rate to demonstrate scope.
Mark the command in order
Use this four-step annotation before changing a command:
- Identify global options, such as a verbosity setting. Place them at the start; do not treat them as settings for one specific file.
- For each input, group its input options immediately before its
-iand filename. For example,-r 1 -i source.m2vplaces an input frame-rate option before that input. The documentation notes this input-rate example is valid for raw formats only; do not copy it blindly for an ordinary encoded video. - After the inputs, read left to right and mark each output URL. Put the options intended for an output before that URL, without crossing the preceding output URL. Several options can accumulate in that output’s option group; they do not have to be individually adjacent to its filename. The URL closes that group, and later non-global output options belong to the next output.
- Repeat the options needed by each later output. Do not rely on an earlier output’s
-c,-map, filter, or other non-global option carrying over.
For example, in ffmpeg -i source.mp4 -map 0:v -c:v libx264 short.mp4 -map 0:v -c copy preview.mp4, the first output maps video stream(s) from input 0 and encodes them with libx264; the second output maps video stream(s) separately and copies the selected video stream(s). Because both outputs use the explicit video-only mapping 0:v, this example intentionally produces no audio and is not a complete ready-to-use video export. It is an illustrative command structure, not a tested recipe for any particular source, codec, or delivery requirement.
Make a scope worksheet
Suppose, hypothetically, that you want an encoded short and a stream-copied review file from one AI-generated source. Read left to right and record what each option is meant to affect:
| Command segment | Scope | Intended target | Check before running |
|---|---|---|---|
-hide_banner | Global | This FFmpeg invocation | Is it a general display setting? |
-i source.mp4 | Input declaration | Input 0 | Is this the intended source file? |
-map 0:v -c:v libx264 | Output option group | Next output, short.mp4 | Keep this group before that URL and after the inputs |
short.mp4 | Output URL; closes first group | First output | Options after this URL cannot change this group |
-map 0:v -c copy | Output option group | Next output, preview.mp4 | Keep this repeated group after short.mp4 and before preview.mp4 |
preview.mp4 | Output URL; closes second group | Second output | Check this output independently |
This table describes intended scope, not a guarantee about output contents. -map controls stream selection, and stream selection and encoding are different decisions. FFmpeg may select streams automatically when no map is provided; inspect what each output contains rather than assuming that the first input’s video and audio both appear in every file.
Check what actually came out
Do not use “the command exited without an error” as the acceptance test. Inspect each output separately with a media probe or editor: note the container and stream list, codecs, dimensions and frame rate where relevant, and check whether the intended filter or other processing is visible. For a two-output command, check both filenames; one correct file does not prove the other received its options.
Here is a hypothetical diagnostic example, not a measured result: the short is expected to contain encoded video, while the review file should copy video. If a probe reports an H.264 video stream in short.mp4 and the source codec in preview.mp4, that is consistent with the intended split, but does not by itself prove the short’s visual quality or that other required streams survived. If both files report the same unexpected codec, revisit option placement and mapping before changing encoding values.
The FFmpeg stream-selection documentation explains automatic and explicit mapping. For a closer look at what a particular file contains, ffprobe’s official documentation describes reports for media streams and container data.
If the result is still wrong
Read the command from left to right and identify the next -i or output filename after the option in question. If the intended filename comes first, move the output option before that filename. If there are multiple outputs, repeat the options needed for each one. If the option is input-specific, put it before the corresponding -i, not among the output settings.
If placement is correct but the result is not, separate scope from effect. A correctly scoped option may still be incompatible with a format, may select a different stream than expected, or may not produce the creative result you wanted. Check FFmpeg’s reported stream mapping and output messages, then inspect the actual file. Stream copying does not decode frames for filtering; the FFmpeg documentation explains that filters require decoded frames. Do not assume that -c copy and a filtering request can perform the same processing path.
Common questions
Does every option after `-i` belong to the output?
No. Output options usually go after the inputs and before the output filename, but FFmpeg also has global options and other options with specific rules. Check the option’s category in the documentation; position alone is not a substitute for understanding what it does.
Why must I repeat `-c copy` for another output?
Because it is a non-global output option. FFmpeg’s examples place a separate -c copy before each output, even when the value is identical. Each output has its own option context.
Can a successful command prove the AI short was processed correctly?
No. A successful run establishes neither that an option targeted the intended file nor that the result meets creative or delivery needs. Verify each output’s streams and encoding, then review the relevant visual or audio result.
Sources and next step
This guide interprets public documentation and uses explicitly hypothetical acceptance examples, not application tests. Controls and availability can change; verify the cited manual against your installed version.
For work created in Imagild, carry the input requirements and acceptance checklist into the film workspace. The external software controls discussed above belong to their respective products.