Opened 2 years ago

Closed 18 months ago

#9588 closed defect (needs_more_info)

`-map_metadata:s:a -1` removes metadata other than audio

Reported by: powerman2206 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary + how to reproduce:

  • run:
    ffmpeg -i input -map 0 -map_metadata:s:a -1 output
    

on an input with streams other than just audio

  • version: git-2022-01-07-217c90a
  • the issue here is that taking the input (and all its streams) and stripping what's supposed to be the audio streams' metadata actually strips all streams' metadata
  • this brings up other issues that I'll probably put in another ticket
  • here are the ffprobes of the example input and output after running the input through
    ffmpeg -i removing_wrong_metadata.mkv -map 0 -map -0:t -map_metadata:s:a -1 -c copy out.mkv
    

(-map -0:t required for the previous issue I mentioned)

input:

...
    Metadata:
      ENCODER         : Lavc58.134.100 libx264
      DURATION        : 00:01:29.509000000
  Stream #0:1(jpn): Audio: vorbis, 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Japanese 2.0
      ENCODER         : Lavc58.134.100 libvorbis
      DURATION        : 00:01:29.503000000
  Stream #0:2(eng): Subtitle: ass (default)
    Metadata:
      title           : English
      ENCODER         : Lavc58.134.100 ssa
      DURATION        : 00:00:00.000000000
...

output:

...
    Metadata:
      DURATION        : 00:01:29.508000000
  Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 00:01:29.503000000
  Stream #0:2: Subtitle: ass (default)
    Metadata:
      DURATION        : 00:00:00.000000000
...
  • as can be seen, the metadata in the subtitle stream has been nuked even if it wasn't specified
  • the same happens if -map_metadata 0 is specified before -map_metadata:s:a -1
  • note: I also just noticed that the same happens when subtitle/video streams are specified in -map_metadata:s:X, so...

Attachments (1)

removing_wrong_metadata.mkv (2.3 MB ) - added by powerman2206 2 years ago.
Just took the opening of Cowboy Bebop since it's the quickest thing I came up with that has all the required components. Might be a bit loud.

Change History (2)

by powerman2206, 2 years ago

Attachment: removing_wrong_metadata.mkv added

Just took the opening of Cowboy Bebop since it's the quickest thing I came up with that has all the required components. Might be a bit loud.

comment:1 by Carl Eugen Hoyos, 18 months ago

Component: ffmpegundetermined
Resolution: needs_more_info
Status: newclosed
Note: See TracTickets for help on using tickets.