Opened 15 months ago

Last modified 14 months ago

#11577 new defect

[Regression] Incorrect optional map parsing of metadata streams?

Reported by: Mive Owned by:
Priority: normal Component: ffmpeg
Version: 7.1 Keywords: cmdutils
Cc: Mive, MasterQuestionable Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes

Description (last modified by Mive)

Summary of the bug:
When specifying a stream with metadata stream specifiers that include a ? at the end, an error is raised Stream map '' matches no streams. No error is raised when removing the ?. This issue does not present itself when using normal stream speficiers like -map 0:s?. This issue is also not present in ffmpeg 7.0

More specifically, function stream_specifier_parse only specifies : as the value termniator instead of :? or similar, and thus the resulting key:value pair looks like this key:value? when a ? is present.

How to reproduce:
Get a video file with tracks containing language metadata and try to use a metadata stream specifier with a ? eg. -map 0:s:m:language:eng?

% ffmpeg -i input.mkv -map 0:V -map 0:s:m:language:eng? ... output.mkv

Attachments (1)

ffmpeg-20250506-205106.log (29.5 KB ) - added by Mive 15 months ago.
Full log output of attempted encode.

Download all attachments as: .zip

Change History (4)

by Mive, 15 months ago

Attachment: ffmpeg-20250506-205106.log added

Full log output of attempted encode.

comment:1 by Mive, 14 months ago

Component: undeterminedffmpeg
Description: modified (diff)
Keywords: cmdutils added
Summary: Incorrect parsing of metadata stream specifiers with a question mark[Regression] Incorrect parsing of metadata stream specifiers with a question mark

comment:2 by MasterQuestionable, 14 months ago

Analyzed by developer: set
Cc: MasterQuestionable added
Summary: [Regression] Incorrect parsing of metadata stream specifiers with a question mark[Regression] Incorrect optional map parsing of metadata streams?

comment:3 by Mive, 14 months ago

I see, when I set it as -map 0:s:m:language:eng:?, it works as intended. In that case, the "optional map" example at https://ffmpeg.org/ffmpeg.html#Advanced-options should probably be updated to reflect the updated syntax, or add an additional example "optional map by language", as the -map 0:a? syntax still seems to work.

Note: See TracTickets for help on using tickets.