Package: ffmpeg
Version: 7:5.1.3-1
Severity: normal

While developing my own software that parses file metadata (via exiftool in
my case), I noticed that ffmpeg does not preserve timestamps in metadata,
turning them into '0000:00:00 00:00:00'. Demonstrating with a video from my
Olympus OM-D E-M5 II:

    michael@joyola:/tmp/ffbug$ exiftool 1110-mvi.mov|grep Date
    File Modification Date/Time     : 2023:08:22 15:40:21+08:00
    File Access Date/Time           : 2023:08:22 15:40:38+08:00
    File Inode Change Date/Time     : 2023:08:22 15:40:21+08:00
    Create Date                     : 2013:06:14 12:13:13
    Modify Date                     : 2013:06:14 12:13:13
    Track Create Date               : 2013:06:14 12:13:13
    Track Modify Date               : 2013:06:14 12:13:13
    Media Create Date               : 2013:06:14 12:13:13
    Media Modify Date               : 2013:06:14 12:13:13
    michael@joyola:/tmp/ffbug$ ffprobe 1110-mvi.mov 2>&1|grep time
        creation_time   : 2013-06-14T12:13:13.000000Z
          creation_time   : 2013-06-14T12:13:13.000000Z
          creation_time   : 2013-06-14T12:13:13.000000Z
    michael@joyola:/tmp/ffbug$ ffmpeg -i 1110-mvi.mov -c:v copy output.mov
    ffmpeg version 5.1.3-1 Copyright (c) 2000-2022 the FFmpeg developers
      built with gcc 12 (Debian 12.2.0-14)
      configuration: --prefix=/usr --extra-version=1 --toolchain=hardened 
--libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu 
--arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa 
--enable-libaom --enable-libass --enable-libbluray --enable-libbs2b 
--enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d 
--enable-libflite --enable-libfontconfig --enable-libfreetype 
--enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm 
--enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg 
--enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq 
--enable-librist --enable-librubberband --enable-libshine --enable-libsnappy 
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh 
--enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab 
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 
--enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq 
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl 
--enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl 
--enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 
--enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r 
--enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
      libavutil      57. 28.100 / 57. 28.100
      libavcodec     59. 37.100 / 59. 37.100
      libavformat    59. 27.100 / 59. 27.100
      libavdevice    59.  7.100 / 59.  7.100
      libavfilter     8. 44.100 /  8. 44.100
      libswscale      6.  7.100 /  6.  7.100
      libswresample   4.  7.100 /  4.  7.100
      libpostproc    56.  6.100 / 56.  6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1110-mvi.mov':
      Metadata:
        major_brand     : qt
        minor_version   : 537331968
        compatible_brands: qt  CAEP
        creation_time   : 2013-06-14T12:13:13.000000Z
      Duration: 00:00:02.93, start: 0.000000, bitrate: 26595 kb/s
      Stream #0:0[0x1](eng): Video: h264 (Constrained Baseline) (avc1 / 
0x31637661), yuvj420p(pc, smpte170m/bt709/bt709, progressive), 1280x720, 25884 
kb/s, 30 fps, 30 tbr, 3k tbn (default)
        Metadata:
          creation_time   : 2013-06-14T12:13:13.000000Z
          vendor_id       : [0][0][0][0]
      Stream #0:1[0x2](eng): Audio: pcm_s16le (sowt / 0x74776F73), 44100 Hz, 
mono, s16, 705 kb/s (default)
        Metadata:
          creation_time   : 2013-06-14T12:13:13.000000Z
          vendor_id       : [0][0][0][0]
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
    Press [q] to stop, [?] for help
    Output #0, mov, to 'output.mov':
      Metadata:
        major_brand     : qt
        minor_version   : 537331968
        compatible_brands: qt  CAEP
        encoder         : Lavf59.27.100
      Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), 
yuvj420p(pc, smpte170m/bt709/bt709, progressive), 1280x720, q=2-31, 25884 kb/s, 
30 fps, 30 tbr, 12k tbn (default)
        Metadata:
          creation_time   : 2013-06-14T12:13:13.000000Z
          vendor_id       : [0][0][0][0]
      Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, 
fltp, 69 kb/s (default)
        Metadata:
          creation_time   : 2013-06-14T12:13:13.000000Z
          vendor_id       : [0][0][0][0]
          encoder         : Lavc59.37.100 aac
    frame=   88 fps=0.0 q=-1.0 Lsize=    9297kB time=00:00:02.94 
bitrate=25827.5kbits/s speed=35.4x
    video:9268kB audio:25kB subtitle:0kB other streams:0kB global headers:0kB 
muxing overhead: 0.041738%
    [aac @ 0x5619bb344480] Qavg: 623.405
    michael@joyola:/tmp/ffbug$ ffprobe output.mov 2>&1|grep time
    michael@joyola:/tmp/ffbug$ exiftool output.mov |grep Date
    File Modification Date/Time     : 2023:08:22 15:46:39+08:00
    File Access Date/Time           : 2023:08:22 15:56:16+08:00
    File Inode Change Date/Time     : 2023:08:22 15:46:39+08:00
    Create Date                     : 0000:00:00 00:00:00
    Modify Date                     : 0000:00:00 00:00:00
    Track Create Date               : 0000:00:00 00:00:00
    Track Modify Date               : 0000:00:00 00:00:00
    Media Create Date               : 0000:00:00 00:00:00
    Media Modify Date               : 0000:00:00 00:00:00

Notice that ffmpeg itself reports the correct timestamps for output.mov in
its output, however the creation_time values are absent from the file.  The
same issue occurs when outputting to an MP4 container.  With MKV or AVI
container, timestamp metadata is of course missing altogether.  Including
'-movflags use_metadata_tags' also doesn't help either.

It'd be good to avoid having to muck about with exiftool to push missing
metadata back into output files.

-- System Information:
Debian Release: 12.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'oldstable-updates'), (500, 'oldstable-security'), (500, 'stable'), (500, 
'oldstable'), (490, 'testing'), (400, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-9-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC, TAINT_WARN
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ffmpeg depends on:
ii  libavcodec59    7:5.1.3-1
ii  libavdevice59   7:5.1.3-1
ii  libavfilter8    7:5.1.3-1
ii  libavformat59   7:5.1.3-1
ii  libavutil57     7:5.1.3-1
ii  libc6           2.36-9+deb12u1
ii  libpostproc56   7:5.1.3-1
ii  libsdl2-2.0-0   2.26.5+dfsg-1
ii  libswresample4  7:5.1.3-1
ii  libswscale6     7:5.1.3-1

ffmpeg recommends no packages.

Versions of packages ffmpeg suggests:
pn  ffmpeg-doc  <none>

-- debconf-show failed

-MD

-- 
-----------------------------------------------------------------------------
Michael Deegan               Hugaholic              https://www.deegan.id.au/
------------------------  Jung, zr jbeel?  ----------------------------------

Reply via email to