NOTE: I have since updated ffmpeg (previously I had the outdated version of avconv from the Ubuntu repositories).
Now @slhck's -map_metadata -1 works perfectly.
I recommend @slhck's solution because it's less typing and up to date. I'm leaving this here for anyone using an outdated version.
The easiest way to do this is to set -map_metadata to use one of the input streams, rather than using global metadata. 99% of the time this should work. NOTE: I'm using avconv, because that's in the Ubuntu 12.04 repositories; this will probably be drop-in compatible with ffmpeg, since their syntax always is in my experience.
avconv -i input.mp4 -map 0 -map_metadata 0:s:0 -c copy output.mp4
This will take the metadata from the first data stream (normally the video stream) and use that to replace the global metadata of the container file. This works because most of the time, the data streams have no meaningful metadata written to them; however, sometimes they do, and you want to completely get rid of that metadata. Unfortunately, the only way I can think of to do this used a pipe and two avconv processes.
avconv -i input.mp4 -f wav - | avconv -i - -i input.mp4 -map 1 -map_metadata 0 -c copy output.mp4
This takes advantage of the fact that WAV files can't contain metadata (since the format was created before metadata tags existed).
Both of these methods blanked all metadata on a file I just tested them on - all that exiftool reported on was the codec information, and avprobe reported no metadata to me. Using a pipe for this is pretty ugly, and the first method will work in 99% of cases, so that should be preferred.
movormp4files, creation date is an integer field in the movie header and track headers (expressed as seconds since 1904). Although you could set it to 0 or some other fixed value, there is no way to remove it and still have a validmovormp4file. – mark4o Dec 18 '12 at 07:34-metadata creation_time=2012-12-17T21:30:00(UTC). – mark4o Dec 18 '12 at 07:46-metadata title="Some Value". Or, for a file, something like this for an MP4 file:ffmpeg -i "$file" -map_metadata -1 -c copy -metadata title="$file" "${file%%*.mp4}-new.mp4– slhck Jun 15 '14 at 13:25encoder : Lavf58.76.100for my m4a file. You can avoid theencoderfield by adding-fflags +bitexact -flags:v +bitexact -flags:a +bitexactto the command. – wisbucky Jun 25 '21 at 07:18-map 0(select all streams from the input) and-c:s copy(don't convert subtitles, sometimes it's best to leave this out). So the whole command would be:ffmpeg -i in.mkv -map 0 -map_metadata -1 -c:v copy -c:a copy -c:s copy -fflags +bitexact -flags:v +bitexact -flags:a +bitexact -flags:s +bitexact out.mkv– glomad Sep 12 '23 at 00:00