Ticket #1471 (closed defect: fixed)

Opened 11 months ago

Last modified 7 months ago

The creation time in Android video is reported incorrectly.

Reported by: andreasg Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov creation_time
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

The reported creation time for video taken with a Nexus Galaxy phone (Android 4.0.2) is off by 66 years. As far as I can tell, this is due to the fact that the start of the epoch is assumed to be Jan 1, 1904 while the phone reports it as Jan 1, 1970.

In libformat/mov.c in function mov_read_mvhd, the version is 0 and the 32-bit creation time is 1340225911. In function mov_metadata_creation_time, the difference between the two epochs is subtracted from the time.

It is possible that the Android video just doesn't correctly encode the time but I still want to report this issue.

How to reproduce:

% ffprobe VID_20120620_135828.mp4 
ffprobe version N-40739-ge556121 Copyright (c) 2007-2012 the FFmpeg developers
  built on May 16 2012 11:07:59 with gcc 4.6.3 20120306 (Red Hat 4.6.3-2)
  configuration: 
  libavutil      51. 53.100 / 51. 53.100
  libavcodec     54. 21.101 / 54. 21.101
  libavformat    54.  5.100 / 54.  5.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 74.100 /  2. 74.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20120620_135828.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 1946-06-20 20:58:31
  Duration: 00:00:02.24, start: 0.000000, bitrate: 9159 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 8460 kb/s, SAR 65536:65536 DAR 16:9, 29.75 fps, 30 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 1946-06-20 20:58:31
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, s16, 96 kb/s
    Metadata:
      creation_time   : 1946-06-20 20:58:31
      handler_name    : SoundHandle

Attachments

VID_20120620_135828.mp4 Download (2.4 MB) - added by andreasg 11 months ago.
Android video

Change History

Changed 11 months ago by andreasg

Android video

comment:1 Changed 11 months ago by michael

  • Status changed from new to closed
  • Reproduced by developer set
  • Component changed from undetermined to avformat
  • Version changed from unspecified to git-master
  • Keywords mp4 added
  • Resolution set to fixed

Added a workaround

comment:2 Changed 7 months ago by cehoyos

  • Keywords mov added; mp4 removed

comment:3 Changed 7 months ago by cehoyos

  • Keywords creation_time added
Note: See TracTickets for help on using tickets.