Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#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 TomTop, 12 months ago

Component: undeterminedffmpeg
Version: unspecified6.1

comment:2 by Gyan, 12 months ago

Resolution: invalid
Status: newclosed

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 and only the filter_complex stream would be included. 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:X for video and -af / -filter:a:X for audio where X is the output stream index of that type.

Last edited 12 months ago by Gyan (previous) (diff)
Note: See TracTickets for help on using tickets.