← Back to team overview

py3exiv2-team team mailing list archive

date from MP4 and MOV files

 

It seems that py3exiv2 does not handle timestamps in movies correctly; they are 66 years off. That is; on my system: Ubuntu 15.10 on Dell XPS13, Python 3.4.3 and my camera's: Nikon P340, P7800 and D5100 and Samsung MV800. These all return a date for movies that is in Macintosh format with epoch 1904/1/1 whereas Python uses the Unix 1970/1/1 epoch. (The jpeg and raw images return an ISO date string.) Doing: datetime.fromtimestamp(metadata['Xmp.video.MediaCreateDate']).value on a *.mov or *.mp4 taken today gives the date in 2081. Correcting with (datetime(1970, 1, 1) - datetime(1904, 1, 1)).total_seconds() gives the correct date and time of the movie.
My misunderstanding of pyexiv2 or a bug?