[FFmpeg-user] metadata: 'date' behavior in avi/mp4 vs mkv containers

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Dec 4 09:34:46 EET 2020


On Wed, Dec 2, 2020 at 9:26 AM Mathieu Malaterre
<mathieu.malaterre at gmail.com> wrote:
>
> Hi there,
>
> I am trying to find the documentation for a specific metadata tag:
> 'date'. According to the following page:
>
> * https://wiki.multimedia.cx/index.php/FFmpeg_Metadata

Here is a small reproducer. Let's consider the following reference:

* https://www.matroska.org/technical/tagging.html#temporal-information

In particular the line:

"DATE_RECORDED UTF-8 The time that the recording began. This is akin
to the TDRC tag in ID3."

Steps:

$ wget http://samples.mplayerhq.hu/A-codecs/lossless/luckynight.flac
$ ffmpeg -i luckynight.flac test1.mp3
$ ffmpeg -i test1.mp3 test2.mkv

Gives:

$ exiftool -v3  -l test1.mp3| grep -1 TDRC
  | RecordingTime = 1995
  | - Tag 'TDRC' (6 bytes):
  |     0101: 03 31 39 39 35 00                               [.1995.]

While:

$ exiftool -v3  -l test2.mkv| grep -3 1995
  | | | | TagName = DATE
  | | | | - Tag 0x05a3 (4 bytes):
  | | | |     1292: 44 41 54 45                                     [DATE]
  | | | | TagString = 1995
  | | | | - Tag 0x0487 (4 bytes):
  | | | |     1299: 31 39 39 35                                     [1995]
  | | | + [SimpleTag directory, 21 bytes]
  | | | | TagName = GENRE
  | | | | - Tag 0x05a3 (5 bytes):

So in summary ID3:TDRC is being copied to Matroska:SimpleTag:DATE,
however the specification seems to indicate that in this case
'DATE_RECORDED' should be prefered.

> ffmpeg has a built-in mechanism for tag: 'title'. I also see that my
> ffmpeg version has the same  property for tag 'date' but only for a
> round trip mp4 ⇔ avi. This property does not work with an mkv
> container.
>
> Is this pure luck that tag 'date' is transferred from avi to mp4 & mp4
> to avi ? Should it work the same way for mkv container ?
>
> Thanks for clarification,
>
> For reference:
>
> ./ffmpeg -version
> ffmpeg version N-100064-g3c92268 Copyright (c) 2000-2020 the FFmpeg developers
> built with gcc 8 (Debian 8.3.0-6)
> configuration: --prefix=/home/mathieu/ffmpeg_build
> --pkg-config-flags=--static
> --extra-cflags=-I/home/mathieu/ffmpeg_build/include
> --extra-ldflags=-L/home/mathieu/ffmpeg_build/lib
> --extra-libs='-lpthread -lm' --bindir=/home/mathieu/bin --enable-gpl
> --enable-gnutls --disable-libaom --enable-libass --enable-libfdk-aac
> --enable-libfreetype --enable-libmp3lame --enable-libopus
> --disable-libsvtav1 --enable-libvorbis --enable-libvpx
> --enable-libx264 --enable-libx265 --enable-nonfree
> libavutil      56. 61.100 / 56. 61.100
> libavcodec     58.113.100 / 58.113.100
> libavformat    58. 64.100 / 58. 64.100
> libavdevice    58. 11.103 / 58. 11.103
> libavfilter     7. 91.100 /  7. 91.100
> libswscale      5.  8.100 /  5.  8.100
> libswresample   3.  8.100 /  3.  8.100
> libpostproc    55.  8.100 / 55.  8.100

The above steps where run using:

$ ffmpeg -version
ffmpeg version N-100132-g53b4550bdd Copyright (c) 2000-2020 the FFmpeg
developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/home/mathieu/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/mathieu/ffmpeg_build/include
--extra-ldflags=-L/home/mathieu/ffmpeg_build/lib
--extra-libs='-lpthread -lm' --bindir=/home/mathieu/bin --enable-gpl
--enable-gnutls --enable-libaom --enable-libass --enable-libfdk-aac
--enable-libfreetype --enable-libmp3lame --enable-libopus
--disable-libsvtav1 --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libx265 --enable-nonfree
libavutil      56. 61.100 / 56. 61.100
libavcodec     58.114.100 / 58.114.100
libavformat    58. 64.100 / 58. 64.100
libavdevice    58. 11.103 / 58. 11.103
libavfilter     7. 91.100 /  7. 91.100
libswscale      5.  8.100 /  5.  8.100
libswresample   3.  8.100 /  3.  8.100
libpostproc    55.  8.100 / 55.  8.100


--
Mathieu


More information about the ffmpeg-user mailing list