[FFmpeg-trac] #9588(ffmpeg:new): `-map_metadata:s:a -1` removes metadata other than audio

FFmpeg trac at avcodec.org
Fri Jan 7 19:16:54 EET 2022


#9588: `-map_metadata:s:a -1` removes metadata other than audio
-------------------------------------+-------------------------------------
             Reporter:               |                     Type:  defect
  powerman2206                       |
               Status:  new          |                 Priority:  normal
            Component:  ffmpeg       |                  Version:  git-
                                     |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 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 `ffprobe`s 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...
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9588>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list