[FFmpeg-user] Setting "reation_time" in metadata gives strange result

Denys Kuzmenko dart at solonet.org.ua
Mon Jun 27 17:08:17 CEST 2016


Hi everyone,

Can someone tell me whether it's a bug or feature that creation_time I
set is always exactly one hour earlier in resulting output file.
Sample video file from here: http://techslides.com/demos/sample-videos/small.mp4
FFmpeg from ppa:mc3man/trusty-media:
ffmpeg version N-80283-g84efdab Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg
--mandir=/usr/share/man --enable-avresample --disable-debug
--enable-nonfree --enable-gpl --enable-version3
--enable-libopencore-amrnb --enable-libopencore-amrwb
--disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse
--enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265
--enable-libfdk-aac --enable-libvorbis --enable-libmp3lame
--enable-libopus --enable-libvpx --enable-libspeex --enable-libass
--enable-avisynth --enable-libsoxr --enable-libxvid
--enable-libvidstab
libavutil      55. 24.100 / 55. 24.100
libavcodec     57. 46.100 / 57. 46.100
libavformat    57. 37.101 / 57. 37.101
libavdevice    57.  0.101 / 57.  0.101
libavfilter     6. 46.101 /  6. 46.101
libavresample   3.  0.  0 /  3.  0.  0
libswscale      4.  1.100 /  4.  1.100
libswresample   2.  0.101 /  2.  0.101
libpostproc    54.  0.100 / 54.  0.100


Input file:
$ ffprobe small.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2010-03-20 21:29:11
    encoder         : HandBrake 0.9.4 2009112300
  Duration: 00:00:05.57, start: 0.000000, bitrate: 551 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr,
90k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
mono, fltp, 83 kb/s (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11


Conversion:
$ ffmpeg -i small.mp4 -c copy -metadata "creation_time=2010-03-20
21:29:11" small_conv.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2010-03-20 21:29:11
    encoder         : HandBrake 0.9.4 2009112300
  Duration: 00:00:05.57, start: 0.000000, bitrate: 551 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr,
90k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
mono, fltp, 83 kb/s (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
[mp4 @ 0x2c6cb80] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mp4, to 'small_conv.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2010-03-20 21:29:11
    encoder         : Lavf57.37.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021),
yuv420p(tv, bt709), 560x320, q=2-31, 465 kb/s, 30 fps, 30 tbr, 90k
tbn, 90k tbc (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000
Hz, mono, 83 kb/s (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  166 fps=0.0 q=-1.0 Lsize=     377kB time=00:00:05.56 bitrate=
554.5kbits/s speed= 254x
video:315kB audio:56kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 1.595274%


Resulting file:
$ ffprobe small_conv.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small_conv.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2010-03-20 20:29:11
    encoder         : Lavf57.37.101
  Duration: 00:00:05.57, start: 0.000000, bitrate: 554 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr,
90k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2010-03-20 20:29:11
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
mono, fltp, 83 kb/s (default)
    Metadata:
      creation_time   : 2010-03-20 20:29:11
      handler_name    : SoundHandler



So I try to set 21:29, it's reported that 21:29 will be written into
the output file but the actual result is 20:29.
And it doesn't look like it's some timezone problem since I currently
have GMT+2, file date is in GMT+1 (March in Central European Time) but
I also tried GMT+2 dated files (April) and the result was that same.
Also tried latest statically built FFmpeg, and the version which comes
with Debian Stable - always the same result.


Best Regards, Denys Kuzmenko.


More information about the ffmpeg-user mailing list