#10801 closed defect (invalid)
-map + filter causes two copies of a stream in recent versions
| Reported by: | TomTop | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | ffmpeg |
| Version: | 6.1 | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
In recent versions of FFmpeg (eg. 6.1), the following command line will not work as it did with older versions (eg. 4.4):
% ffmpeg -i input -map 0:0 -map 0:1 -filter_complex "[0:0]scale=1280:-1" ... output
Usually this would result in a file where stream 0 is scaled to width 1280 and stream 1 is the audio. In newer versions of FFmpeg, the result holds the two expected streams and an unexpected copy of the original video, most likely due to the -map 0:0 argument.
Is this a bug or a change in how FFmpeg works?
Change History (2)
comment:1 by , 3 years ago
| Component: | undetermined → ffmpeg |
|---|---|
| Version: | unspecified → 6.1 |
comment:2 by , 3 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Version 0, edited 3 years ago by (next)
Note:
See TracTickets
for help on using tickets.



It was the earlier behaviour that was buggy. A stream exiting a complex filtergraph has to be included in an output file. Earlier, if such a stream was unlabelled, any explicitly mapped stream of the same media type would be ignored. That was fixed in 6.0.
See the chapter on Stream selection.
The correct way to filter a mapped stream is to specify a simple filterchain. This is done via
-vf / -filter:v:Xfor video and-af / -filter:a:Xfor audio where X is the output stream index of that type.