R:exifr: read_exif Does not extract data from 4K .MP4 files

Started by MangroveWatch, February 20, 2020, 07:43:33 PM

Previous topic - Next topic

MangroveWatch

Hello,
I have been a long time user of ExifTool and have recently switched over to using ExifTool in R using exifr::read_exif. I have used the following code to extract EXIF data from SONY m2ts/MTS, but the new Sony 4K .MP4 files don't work. Examining the output of all EXIF tags, I see the error: End of processing at large atom (LargeFileSupport not enabled)
I can only seem to find reference to how to fix this in CommandPrompt, not R, "adding -api largefilesupport=1 to your command", https://exiftool.org/forum/index.php?topic=9845.0.
How can this same command be implemented in R::exifr?

Example R code;
#Set Video File Location
survey.videos <- "Video_for_Analysis/EOD_2019/" #Folder with videos

#Get EXIF information

files2 <- list.files(survey.videos, pattern = NULL, recursive = FALSE, full.names = TRUE)
dat <- read_exif(files2, tags=c("directory", "filename", "DateTimeOriginal",
                                "Duration"))

Unfortunately the .MP4 videos in question are far too big to upload.

Many thanks in advance.
Jock

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

MangroveWatch

Thank you  :)
It worked, sort of.
But.....
after editing the config file ExifTool_config (attached) and placing it into the R::exifr library directory eg: C:\Users\Jock\Documents\R\win-library\3.6\exifr\exiftool where exiftool.pl is located,
I can see the Duration tag, but not other tags like DateTimeOriginal. Although there is a tag CreationDateValue for MP4 - seems odd that these would be named differently.

I have attached a csv output of "dat" with tags for a combination of MTS, m2ts and MP4 video after using the following:

#Set File Locations
survey.videos <- "Video_for_Analysis/EOD_2019/" #Folder with videos
#Get EXIF information
files2 <- list.files(survey.videos, pattern = NULL, recursive = FALSE, full.names = TRUE)
dat <- read_exif(files2)

Any suggestions? Or do I just need to work around this in R to extract the Video date and start times when using a combination of video file types, which is easy enough to do?


StarGeek

Quote from: MangroveWatch on February 20, 2020, 08:49:06 PM
I can see the Duration tag, but not other tags like DateTimeOriginal. Although there is a tag CreationDateValue for MP4 - seems odd that these would be named differently.

Do you see a DateTimeOriginal when you check the file with exiftool on the command line?

Usually, DateTimeOriginal is an EXIF tag and there is no standard for putting EXIF metadata in a video file.  Though that doesn't stop some companies from cramming it in there.  There is a Quicktime:DateTimeOriginal tag, but I don't think I've ever seen it used.

If I recall correctly, mts type files don't allow for any embedded metadata.  Exiftool just returns the various properties of the file.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

MangroveWatch

Quote from: StarGeek on February 20, 2020, 09:37:16 PM
Do you see a DateTimeOriginal when you check the file with exiftool on the command line?

No DateTimeOriginal data is available from CMD prompt either:
exiftool.pl -directory -filename -DateTimeOriginal -Duration  -T -r -n

See attached .txt file output.


Phil Harvey

Usually MP4 files do not contain DateTimeOriginal.  For these files use CreateDate instead.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).