AVI videos always get date/time of import as timestamp

Hi,


currently I am importing some videos into Photos for MacOS. Videos from two of my cameras do not get the correct date when importing. They always get the date and time of the import as a timestamp. Imported photos from these cameras get the correct timestamp and maker/model information.


It seems that no EXIF information is read at all for these video files. Not even the Camera maker/model is shown by "Get info".

User uploaded file


When I check the EXIF information of the file with exiftool they are correct:

[EXIF:IFD0] Make : CASIO COMPUTER CO.,LTD.

[EXIF:IFD0] Camera Model Name : EX-FH100

[EXIF:ExifIFD] Date/Time Original : 2011:04:09 14:49:47

[EXIF:ExifIFD] Create Date : 2011:04:09 14:49:47


I tried:

- starting with a new library

- setting file creation and modification date to the correct timestamp prior to import


but still no correct date (or maker/model) after import.


I am using

macOS High Sierra 10.13.3 and

Photos Version 3.0 (3251.12.190)


I know that I can manually set date/time with Image->Adjust Date and Time...

but would like to refrain from doing that if it is a bug in Photos that will be fixed.

And still the maker/model would not be set.


Any help greatly appreciated.


Regards


jay

iMac (Retina 5K, 27-inch, Late 2014), macOS High Sierra (10.13.3)

Posted on Feb 1, 2018 2:04 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 3, 2018 3:02 AM

In reply to my original question and to help others stumbling over this issue.

I ended up converting all my AVI files into Quicktime format. This sounds tedious but it isn't.


Photos is able to import relevant meta data from Quicktime files. As my AVI files contain creation date, camera make and model I only had to convert the AVIs to quicktime without loosing this metadata. The following shell script does exactly that for my two camera models producing AVIs. To run the script you need two freeware tools installed on your Mac:

1. exiftool

2. ffmpeg

To make the script work for your camera model(s) you need to change the string(s) after the case statement to the model of your camera and maybe adjust the convertOptions. In the example script the camera models are named

EX-FH100

and

FinePix F601 ZOOM (Please notice that blanks have to be preceded by a "\")


After the conversion an additional Quicktime file should be in the same directory as your original AVI. The Quicktime file has the extension ".mov". If you like you can put the script in an Automator service and call it with a right click on the AVI file.


Hope this helps.


-jay


#Script starts with the next line

#!/bin/bash

if [ $# -eq 0 ]

then

echo "Converts an AVI video file to a MOV (QuickTime) video file. Transfers metadata for CreateDate, Make and Model from the source file."

echo "usage: $0 filename(s)"

fi


for fullpath in "$@"

do

# Strip longest match of */ from start

filename="${fullpath##*/}"



# Substring from 0 thru pos of filename

dir="${fullpath:0:${#fullpath} - ${#filename}}"


# Strip shortest match of . plus at least one non-dot char from end

base="${filename%.[^.]*}"


# Substring from len of base thru end

ext="${filename:${#base} + 1}"


# If we have an extension and no base, it's really the base

if [[ -z "$base" && -n "$ext" ]]; then

base=".$ext"

ext=""

fi


echo -e "$fullpath:\n\tdir = \"$dir\"\n\tbase = \"$base\"\n\text = \"$ext\""


# Get tags from source file

createDateTag=$(exiftool -d '%Y-%m-%d %H:%M:%S' -p '$createdate' "$fullpath")

makeTag=$(exiftool -p '$make' "$fullpath")

modelTag=$(exiftool -p '$model' "$fullpath")

echo -e "$fullpath --> $outFullpath\n\tCreateDate: $createDateTag\n\tMake: $makeTag\n\tModel: $modelTag"


# Set remux options according to camera model

case $modelTag in

EX-FH100)

convertOptions="-c:v copy -q:a 0"

outFullpath="$dir$base.mov"

;;

FinePix\ F601\ ZOOM)

convertOptions="-c:v mjpeg -q:v 0 -q:a 0"

outFullpath="$dir$base.mov"

;;

*)

echo "No EX-FH100 or FinePix F601 ZOOM input file found"

exit 1

esac


# Convert movie

ffmpeg -i "$fullpath" $convertOptions -metadata "make=$makeTag" -metadata "model=$modelTag" -metadata "creation_time=$createDateTag" "$outFullpath"

done


# Script ended the line before this line

15 replies
Question marked as Top-ranking reply

Mar 3, 2018 3:02 AM in response to jay.a.h

In reply to my original question and to help others stumbling over this issue.

I ended up converting all my AVI files into Quicktime format. This sounds tedious but it isn't.


Photos is able to import relevant meta data from Quicktime files. As my AVI files contain creation date, camera make and model I only had to convert the AVIs to quicktime without loosing this metadata. The following shell script does exactly that for my two camera models producing AVIs. To run the script you need two freeware tools installed on your Mac:

1. exiftool

2. ffmpeg

To make the script work for your camera model(s) you need to change the string(s) after the case statement to the model of your camera and maybe adjust the convertOptions. In the example script the camera models are named

EX-FH100

and

FinePix F601 ZOOM (Please notice that blanks have to be preceded by a "\")


After the conversion an additional Quicktime file should be in the same directory as your original AVI. The Quicktime file has the extension ".mov". If you like you can put the script in an Automator service and call it with a right click on the AVI file.


Hope this helps.


-jay


#Script starts with the next line

#!/bin/bash

if [ $# -eq 0 ]

then

echo "Converts an AVI video file to a MOV (QuickTime) video file. Transfers metadata for CreateDate, Make and Model from the source file."

echo "usage: $0 filename(s)"

fi


for fullpath in "$@"

do

# Strip longest match of */ from start

filename="${fullpath##*/}"



# Substring from 0 thru pos of filename

dir="${fullpath:0:${#fullpath} - ${#filename}}"


# Strip shortest match of . plus at least one non-dot char from end

base="${filename%.[^.]*}"


# Substring from len of base thru end

ext="${filename:${#base} + 1}"


# If we have an extension and no base, it's really the base

if [[ -z "$base" && -n "$ext" ]]; then

base=".$ext"

ext=""

fi


echo -e "$fullpath:\n\tdir = \"$dir\"\n\tbase = \"$base\"\n\text = \"$ext\""


# Get tags from source file

createDateTag=$(exiftool -d '%Y-%m-%d %H:%M:%S' -p '$createdate' "$fullpath")

makeTag=$(exiftool -p '$make' "$fullpath")

modelTag=$(exiftool -p '$model' "$fullpath")

echo -e "$fullpath --> $outFullpath\n\tCreateDate: $createDateTag\n\tMake: $makeTag\n\tModel: $modelTag"


# Set remux options according to camera model

case $modelTag in

EX-FH100)

convertOptions="-c:v copy -q:a 0"

outFullpath="$dir$base.mov"

;;

FinePix\ F601\ ZOOM)

convertOptions="-c:v mjpeg -q:v 0 -q:a 0"

outFullpath="$dir$base.mov"

;;

*)

echo "No EX-FH100 or FinePix F601 ZOOM input file found"

exit 1

esac


# Convert movie

ffmpeg -i "$fullpath" $convertOptions -metadata "make=$makeTag" -metadata "model=$modelTag" -metadata "creation_time=$createDateTag" "$outFullpath"

done


# Script ended the line before this line

Feb 2, 2018 1:27 AM in response to jay.a.h

When I want to adjust the date and time and other metadata of videos, I am using this Apple Script:

Script: Lift and Stamp all Metadata from one Photo to Other Photos

I select a photo (taken at the same time at the same place) and the videos that need adjusting, and the script will copy the date and time and the GPS coordinates , titles, etc. to the selected video(s).

this will save a lot of copy and paste and clicking.

Feb 1, 2018 11:48 PM in response to Old Toad

I am using exiftool V10.77 downloaded two days ago. So we are both on recent versions.

To prepend the tag names I used the command: exiftool -G0:1 <filename>


Maybe there is a difference between video files recorded by a video camera and a stills camera. I was using a stills camera, Casio EX-FH100, that seems to embed all necessary EXIF tags in the video files. Please see complete exiftool output at the end of the reply.


Video files from other stills cameras (e.g. extensions .mp4) are imported with date/time information although maker/model is missing in "Get info...".

User uploaded file

So Photos is capable of dealing with date/time info for video files. I guess they are extracted from EXIF information and not filesystem information. Because when I change "creation and/or modification date" of the video file in the filesystem (using SetFile) before import, the imported file still gets the correct date.


Maybe it is just not working for AVI files. My other camera, a FujiFilm F601 Zoom, is also producing AVI files. BTW all my imported AVI files can be viewed with Photos, like the other video files. So there seems to be no general problem with AVI not treated as video file.

All videos recorded with iPhones/iPads even get the model information correct.


Do your other video files get correct date/time and model information after import? And what extension do those files have?


Thanks for your help and regards


-jay


This is the complete output for the AVI file (exiftool -G0:1 CIMG0746.AVI):

[ExifTool] ExifTool Version Number : 10.77

[File:System] File Name : CIMG0746.AVI

[File:System] Directory : .

[File:System] File Size : 11 MB

[File:System] File Modification Date/Time : 2011:04:09 14:49:46+02:00

[File:System] File Access Date/Time : 2018:02:01 09:34:32+01:00

[File:System] File Inode Change Date/Time : 2018:02:01 09:32:32+01:00

[File:System] File Permissions : rwxrwxrwx

[File] File Type : AVI

[File] File Type Extension : avi

[File] MIME Type : video/x-msvideo

[File] BMP Version : Windows V3

[File] Image Width : 1280

[File] Image Height : 720

[File] Planes : 1

[File] Bit Depth : 24

[File] Compression : MJPG

[File] Image Length : 2764800

[File] Pixels Per Meter X : 0

[File] Pixels Per Meter Y : 0

[File] Num Colors : Use BitDepth

[File] Num Important Colors : All

[RIFF] Frame Rate : 29.97

[RIFF] Max Data Rate : 3705 kB/s

[RIFF] Frame Count : 96

[RIFF] Stream Count : 2

[RIFF] Stream Type : Video

[RIFF] Video Codec : mjpg

[RIFF] Video Frame Rate : 29.97

[RIFF] Video Frame Count : 96

[RIFF] Quality : 10000

[RIFF] Sample Size : Variable

[RIFF] Audio Codec : .

[RIFF] Audio Sample Rate : 21.61

[RIFF] Audio Sample Count : 69

[RIFF] Encoding : Intel IMA/DVI-ADPCM

[RIFF] Num Channels : 2

[RIFF] Sample Rate : 44100

[RIFF] Avg Bytes Per Sec : 44251

[RIFF] Bits Per Sample : 4

[EXIF:IFD0] Make : CASIO COMPUTER CO.,LTD.

[EXIF:IFD0] Camera Model Name : EX-FH100

[EXIF:IFD0] Orientation : Horizontal (normal)

[EXIF:IFD0] X Resolution : 72

[EXIF:IFD0] Y Resolution : 72

[EXIF:IFD0] Resolution Unit : inches

[EXIF:IFD0] Software : 1.00

[EXIF:IFD0] Modify Date : 2011:04:09 14:49:47

[EXIF:IFD0] Y Cb Cr Positioning : Centered

[EXIF:ExifIFD] Exposure Time : 1/100

[EXIF:ExifIFD] F Number : 16.1

[EXIF:ExifIFD] Exposure Program : Program AE

[EXIF:ExifIFD] Date/Time Original : 2011:04:09 14:49:47

[EXIF:ExifIFD] Create Date : 2011:04:09 14:49:47

[EXIF:ExifIFD] Exposure Compensation : 0

[EXIF:ExifIFD] Metering Mode : Multi-segment

[EXIF:ExifIFD] Light Source : Unknown

[EXIF:ExifIFD] Focal Length : 43.0 mm

[EXIF:ExifIFD] Exposure Mode : Auto

[EXIF:ExifIFD] White Balance : Auto

[EXIF:ExifIFD] Digital Zoom Ratio : undef

[EXIF:ExifIFD] Focal Length In 35mm Format : 240 mm

[EXIF:ExifIFD] Gain Control : None

[EXIF:ExifIFD] Contrast : Normal

[EXIF:ExifIFD] Saturation : Normal

[EXIF:ExifIFD] Sharpness : Normal

[MakerNotes:Casio] Firmware Date : 2010:02:26 14:05

[MakerNotes:Casio] Record Mode : Movie

[MakerNotes:Casio] Focus Mode : Single-Area Auto Focus

[MakerNotes:Casio] Best Shot Mode : Expression CS

[MakerNotes:Casio] Auto ISO : On

[MakerNotes:Casio] Color Mode : Off

[MakerNotes:Casio] Enhancement : Off

[MakerNotes:Casio] Color Filter : Off

[MakerNotes:Casio] Art Mode : Normal

[MakerNotes:Casio] Image Stabilization : Best Shot

[MakerNotes:Casio] Lighting Mode : Off

[MakerNotes:Casio] Portrait Refiner : Off

[MakerNotes:Casio] Capture Frame Rate : 30

[MakerNotes:Casio] Video Quality : HD (720p)

[Composite] Aperture : 16.1

[Composite] Duration : 3.20 s

[Composite] Image Size : 1280x720

[Composite] Megapixels : 0.922

[Composite] Scale Factor To 35 mm Equivalent: 5.6

[Composite] Shutter Speed : 1/100

[Composite] Circle Of Confusion : 0.005 mm

[Composite] Field Of View : 8.6 deg

[Composite] Focal Length : 43.0 mm (35 mm equivalent: 240.0 mm)

[Composite] Hyperfocal Distance : 21.33 m

Feb 7, 2018 4:01 AM in response to seanandmel

Videos do not have an embedded capture date tag. The EXIF standard does not list such a convention. It is not documented by Apple, how Photos handles the dates of videos. When I save a video from QUickTime Player, photos usually will use the "Date Modified", when I import the video.

But for videos copied from other sources, fro example, videos received by Mail, I am getting completely random dates in Photos.

See the example below: The video has been imported today, but Photos is showing November 27, 2013. The file creation date and date modified are from February 1, 2018:

User uploaded file

User uploaded file

Mar 1, 2018 6:07 AM in response to AppleMKH

I can indeed import by drag and drop mts files to Photos but I am having the same problem as with the mpg files, the import date is used instead of the creation date. In this case here both the mpg and mts files are from my Sony Camcorder which records in AVCHD, just happens that the jpg files are correct. What I really meant was that Photos 3.0 no longer sees the mts files when it connects to the device, in this case a Sony Camcorder, Photos 1.5 was able to see them.


Here are some other tests I have done (with files I had before the upgrade to High Sierra):

-mp4 file converted from an mts file with the Sony PlayMemoriesHome software and the creation date is correct

-with Photos 1.5 I was able to connect directly to the Camcorder and it imported the mts files as mov files with the correct creation date. I have exported to disk this file in both the mov and m4v formats to later import to Photos 3.0 with the correct creation date.

Feb 2, 2018 12:37 AM in response to jay.a.h

Do you know why the relevant information is not imported in the first place?

It has been this way since I used Apple Software to import videos. we are not allowed to speculate in these forums.

But there is no EXIF standard for videos for the capture date like for photos. The manufacturers are handling the capture date of videos differently. It will depend on your camera model, how the correct capture time can be found. For example, when I import a video from my Panasonic Lumix cameras, I will find a still frame photo with all exif tags for each video, and I can lift and stamp the capture date from this still frame, because Photos handles the date of the still frames correctly. Apple handles the date and time of videos taken with an Apple device correctly, because it manufactured those devices and rely on the way the EXIF tags are set there. But for other camera models it is a big task to keep the software current every camera make and model, just like for the RAW support.

Feb 7, 2018 3:17 AM in response to léonie

I still don't understand why Photos wouldn't use the date created attribute of the original file being imported rather than the import date as the timestamp for the avi file. Surely the original files date created attribute is more likely to better represent the data the video was taken and therefore would be better for arranging the video in the librarys timeline?

Feb 28, 2018 8:28 PM in response to AppleMKH

I have a similar problem. I was using Photos version 1.5 until today whereby I upgraded to High Sierra with Photos version 3.0 and now when I upload mpeg-2 files the date and time of the videos in Photos is that of the import and not the creation date. Another problem I have is that Photos cannot recognize mts file extension.


I have just started recently to use Photos and liked it so much that I have been importing everything into it. I have been preparing all day today for a big import of mpg and mts files, experimenting with a few files before doing the massive import, all went very well with Photos version 1.5. I realized Photos needed an update so I did and now things don't work very well as described above.

Feb 1, 2018 10:40 AM in response to jay.a.h

jay.a.h wrote:


It seems that no EXIF information is read at all for these video files. Not even the Camera maker/model is shown by "Get info".

That's because video files do not have EXIF fields like photos do. I ran an old video of mine thru exiftool and got this:

Last login: Thu Feb 1 10:19:16 on ttys000

Toad-Hall-2:~ $ exiftool /Users/toad/Desktop/2005-08-26-140.avi

ExifTool Version Number : 10.78

File Name : 2005-08-26-140.avi

Directory : /Users/toad/Desktop

File Size : 2028 kB

File Modification Date/Time : 2005:08:26 11:25:22-07:00

File Access Date/Time : 2018:02:01 10:29:54-08:00

File Inode Change Date/Time : 2018:02:01 10:29:54-08:00

File Permissions : rwxr-xr-x

File Type : AVI

File Type Extension : avi

MIME Type : video/x-msvideo

Frame Rate : 15

Max Data Rate : 422.2 kB/s

Frame Count : 120

Stream Count : 2

Stream Type : Video

Video Codec : mjpg

Video Frame Rate : 15

Video Frame Count : 120

Quality : 10000

Sample Size : Variable

BMP Version : Windows V3

Image Width : 320

Image Height : 240

Planes : 1

Bit Depth : 24

Compression : MJPG

Image Length : 230400

Pixels Per Meter X : 0

Pixels Per Meter Y : 0

Num Colors : Use BitDepth

Num Important Colors : All

Audio Codec :

Audio Sample Rate : 11024

Audio Sample Count : 88192

Encoding : Microsoft PCM

Num Channels : 1

Sample Rate : 11024

Avg Bytes Per Sec : 11024

Bits Per Sample : 8

Date/Time Original : 2005:08:26 10:25:22

Software : CanonMVI01

Duration : 8.00 s

Image Size : 320x240

Megapixels : 0.077

Toad-Hall-2:~ $

There are none of the usual EXIF info fields about the movie, i.e. camera, etc. that photos have. Therefore Photos uses the file metadata.


What exiftool shows is the date of creation and the software used to manage the file in the camera (see bold type above). There are none of the fields that Photos is capable of viewing. Even another exif data viewer, EXIF Viewer, won't even open movie files.


I'm not getting the same field titles that you show in your post. The exiftool I used was downloaded today so is the latest version.

User uploaded file

Feb 13, 2018 4:11 AM in response to jay.a.h

Greetings. I have read this string. Some of the posts are consistent with my experiences; some are not. I often import videos from my Sony camcorder (FDR-AX33) onto my MacBook Pro. Up until my recent upgrade to High Sierra, each video would properly be assigned the date and time of the video capture on my camcorder, and not the date and time of the import onto my laptop. After my upgrade to High Sierra, each video imported from my camcorder would unfortunately be assigned the date and time of the import. This is quite bothersome to me because I have neither the time nor the desire to manually correct each video I import. This is obviously a recent glitch in Mac Photos; after all, Mac Photos worked just fine in this regard prior to High Sierra.


In working on this issue with an Apple senior technician, we recognized that the mislabeled date and time occurs when the video I am importing is in AVCHD format. However, when I change the format to the larger XAVC S 4K, the video I am importing is correctly assigned the date and time of the video capture on my camcorder. The technician recommended that, for now, I should shoot and import video in the larger XAVC S 4K format until Apple resolves this issue.


XAVC S 4K is twice as large as AVCHD, which will drastically limit my hard drive space. And, even this fairly new MacBook Pro does not have 4K. So, I am not really enjoying the benefit of having the larger files on my laptop anyway. Hopefully, Apple gets this big fixed shortly.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

AVI videos always get date/time of import as timestamp

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.