0

I just tried the (static) ffmpeg build from https://johnvansickle.com/ffmpeg/ and I also tried the ffmpeg build that comes with my Linux Mint 21.2 distro and they both were able to remove the metadata using "-map_metadata -1"

The below examples are when using my compiled ffmpeg:

BEFORE: ffmpeg -i input.avi

...
Input #0, avi, from 'input.avi':
  Metadata:
    software        : Lavf59.37.100
  Duration: 00:49:27.20, start: 0.000000, bitrate: 966 kb/s
  Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 352x260 [SAR 1:1 DAR 88:65], 793 kb/s, 25 fps, 25 tbr, 25 tbn
  Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 160 kb/s
    Metadata:
      title           : Audio Stream

AFTER: ffmpeg -i input.avi -map_metadata -1 -map 0:0 -map 0:1 -c:v copy -c:a copy output.avi

...
Input #0, avi, from 'output.avi':
  Metadata:
    software        : Lavf60.18.100
  Duration: 00:49:27.20, start: 0.000000, bitrate: 966 kb/s
  Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 352x260 [SAR 1:1 DAR 88:65], 793 kb/s, 25 fps, 25 tbr, 25 tbn
  Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 160 kb/s
    Metadata:
      title           : Audio Stream

The problem is:

When I use my compiled version of ffmpeg, it does NOT remove any metadata.

I've compiled ffmpeg using the (general) guide on https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu many times before and except for this issue with "-map_metadata -1" not working, everything else works great with my ffmpeg, encoding, decoding, video, audio, ...

So, is there a configure option or an --enable-*** switch, when building ffmpeg, that is missing in the https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu guide, so that my (compiled) ffmpeg will work with "-map_metadata -1" to remove metadata.?

(My compiled) ffmpeg -version

ffmpeg version N-112838-g7212466e73 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
configuration: --prefix=/home/user/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --extra-libs='-lpthread -lm' --extra-libs=-lpthread --ld=g++ --bindir=/home/user/bin --enable-gpl --enable-gnutls --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-librav1e --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil      58. 32.100 / 58. 32.100
libavcodec     60. 34.100 / 60. 34.100
libavformat    60. 17.100 / 60. 17.100
libavdevice    60.  4.100 / 60.  4.100
libavfilter     9. 13.100 /  9. 13.100
libswscale      7.  6.100 /  7.  6.100
libswresample   4. 13.100 /  4. 13.100
libpostproc    57.  4.100 / 57.  4.100

Also,

(My compiled) ffmpeg --help | grep -i metadata

...
-map_metadata outfile[,metadata]:infile[,metadata]  set metadata information of outfile from infile
-metadata string=string  add metadata

...everything looks to be there switch-wise, regarding metadata removal, and yet it does not work.?

4
  • What metadata are you trying to remove? In your example, the Title metadata has been removed. Are you trying to remove the Software? Except for that, I don't believe that anything else in your output is removable.
    – StarGeek
    Commented Dec 14, 2023 at 15:49
  • @StarGeek I modified the exmples to show that "-map_metadata -1" does NOT remove the Title metadata.
    – BongoR
    Commented Dec 14, 2023 at 23:43
  • Is there any dedicated "ffmpeg" forums, groups, ..., where I can post my questions, ...?
    – BongoR
    Commented Dec 14, 2023 at 23:56
  • You might try reddit on the /r/ffmpeg/ subreddit.
    – StarGeek
    Commented Dec 15, 2023 at 4:47

1 Answer 1

0

As you have created a map for the audio stream and you want to erase its metadata, try specifying the metadata mapping after the -map option or set an empty title metadata.

ffmpeg -i somefile.mp4 \
       -map 0:v:0 -map 0:a:0 -map_metadata -1 \
       -c copy \
       outputfile.mp4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .