Opened 7 years ago

Closed 7 years ago

#1739 closed defect (fixed)

ffmpeg no longer accepts ISO8601 creation_time

Reported by: MarkZV Owned by:
Priority: important Component: avformat
Version: git-master Keywords: creation_time regression strptime
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

ffmpeg no longer accepts creation_time metadata in its own format
(YYYY-mm-dd HH:MM:SS) or in ISO 8601 format (YYYY-mm-ddTHH:MM:SS)
as it did previously. It looks like the problem was introduced by:
http://git.videolan.org/?p=ffmpeg.git;a=commit;f=libavformat/utils.c;h=29e972f67c914d35417bc7368493d2617abdd26e

$ ffmpeg -i in.mp4 -metadata creation_time=2012-09-09T17:45:00 -vcodec copy -acodec copy -t 5 out.mp4
ffmpeg version 0.11.1.git-2de8877 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 15 2012 21:47:55 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-libfaac
  libavutil      51. 72.100 / 51. 72.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 26.101 / 54. 26.101
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 16.103 /  3. 16.103
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: M4V M4A mp42isom
    creation_time   : 2012-09-09 17:44:36
  Duration: 01:25:48.74, start: 0.000000, bitrate: 2981 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 9:8 DAR 3:2], 2894 kb/s, SAR 10:10 DAR 4:3, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc
    Metadata:
      creation_time   : 2012-09-09 17:44:36
      handler_name    : ?Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 83 kb/s
    Metadata:
      creation_time   : 2012-09-09 17:44:37
      handler_name    : ?Apple Alias Data Handler
Output #0, mp4, to 'out.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: M4V M4A mp42isom
    creation_time   : 2012-09-09T17:45:00
    encoder         : Lavf54.26.101
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 10:10 DAR 4:3], q=2-31, 2894 kb/s, 29.97 fps, 2997 tbn, 2997 tbc
    Metadata:
      creation_time   : 2012-09-09 17:44:36
      handler_name    : ?Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 83 kb/s
    Metadata:
      creation_time   : 2012-09-09 17:44:37
      handler_name    : ?Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  150 fps=0.0 q=-1.0 Lsize=    1488kB time=00:00:05.01 bitrate=2431.5kbits/s
video:1423kB audio:60kB subtitle:0 global headers:0kB muxing overhead 0.372907%
$
$ ffprobe out.mp4
ffprobe version 0.11.1.git-2de8877 Copyright (c) 2007-2012 the FFmpeg developers
  built on Sep 15 2012 21:47:55 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-libfaac
  libavutil      51. 72.100 / 51. 72.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 26.101 / 54. 26.101
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 16.103 /  3. 16.103
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2011-12-31 00:00:00
    encoder         : Lavf54.26.101
  Duration: 00:00:05.01, start: 0.000000, bitrate: 2431 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 9:8 DAR 3:2], 2330 kb/s, 29.99 fps, 29.97 tbr, 2997 tbn, 59.94 tbc
    Metadata:
      creation_time   : 2011-12-31 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 97 kb/s
    Metadata:
      creation_time   : 2011-12-31 00:00:00
      handler_name    : SoundHandler
$

Note: creation_time was specified as 2012-09-09T17:45:00 but ffprobe
shows 2011-12-31 00:00:00. The same command worked as expected in
earlier builds of ffmpeg.

It works if the creation_time is specified as "2012 - 09 - 09T17:45:00".

Change History (2)

comment:1 Changed 7 years ago by cehoyos

  • Keywords regression added; strptime removed
  • Priority changed from normal to important
  • Status changed from new to open

comment:2 Changed 7 years ago by saste

  • Analyzed by developer set
  • Keywords strptime added
  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from open to closed

Should be fixed in:

commit 85c93d90dfae17d2ccff21aec5a55ca3029be83c
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Sun Sep 16 15:22:31 2012 +0200

    lavu/parseutils: fix av_small_strptime() whitespace directive parsing
    
    According to POSIX, strptime() should consume whitespaces in the date
    string everytime a whitespace conversion specification is found in the
    date format specification. Make av_small_strptime() conform with this
    behavior.
    
    In particular, should fix trac ticket #1739.

Thanks for reporting.

Note: See TracTickets for help on using tickets.