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 )
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)
Change History (4)
by , 15 months ago
| Attachment: | ffmpeg-20250506-205106.log added |
|---|
comment:1 by , 14 months ago
| Component: | undetermined → ffmpeg |
|---|---|
| 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 , 14 months ago
| Analyzed by developer: | set |
|---|---|
| Cc: | added |
| Summary: | [Regression] Incorrect parsing of metadata stream specifiers with a question mark → [Regression] Incorrect optional map parsing of metadata streams? |
͏ Spec for reference:
͏ https://ffmpeg.org/ffmpeg.html#Advanced-options
͏ "stream_specifier_parse" ":"
͏ https://github.com/FFmpeg/FFmpeg/blob/efa0c6252faa66ab90d0d5e60b0d4305474b7a8e/fftools/cmdutils.c#L1160
͏ The metadata name/value could contain literal "?", as well?
͏ https://trac.ffmpeg.org/ticket/11248#comment:2
͏ https://github.com/FFmpeg/FFmpeg/commit/9e68b26765ca8396050f4b58d4b4fdc53943d35f
comment:3 by , 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.



Full log output of attempted encode.