Exporting Metadata from MP4 to CSV

Started by drax22, October 31, 2021, 01:40:50 AM

Previous topic - Next topic

drax22

I am trying to extract the Metadata from an MP4 to a CSV file, but the CSV file has only one line (see attached CSV file).

exiftool -ee -t -csv test1.mp4 > test1.csv

How do I get more that one row in the CSV file? I am looking for the latitude, longitude and GPSTime.

If I don't have the CSV option, then I get several rows of data like below (this is a subset of all the rows of data).

exiftool -ee -t test1.mp4

Acceleration    -0.12060546875 -0.972412109375 -0.033203125
Sample Time     0:02:54
Sample Duration 0.00 s
Angular Velocity        -0.05326322093606 -0.0649811327457428 0.0170442312955856
Sample Time     0:02:54
Sample Duration 0.00 s
Acceleration    -0.116455078125 -0.97998046875 -0.0341796875
Sample Time     0:02:54
Sample Duration 0.00 s
GPS Date/Time   2021:10:27 19:23:02.899392Z
GPS Measure Mode        3-Dimensional Measurement
GPS Latitude    31 deg 28' 49.52" N
GPS Longitude   97 deg 18' 50.16" W
GPS Altitude    172 m
GPS Horizontal Accuracy 1.11000001430511
GPS Vertical Accuracy   1.11000001430511
GPS Velocity East       -0.420529305934906
GPS Velocity North      -0.00469933077692986
GPS Velocity Up 0
GPS Speed Accuracy      0
Sample Time     0:02:54
Sample Duration 0.00 s
GPS Date/Time   2021:10:27 19:23:02.899423Z
GPS Measure Mode        3-Dimensional Measurement
GPS Latitude    31 deg 28' 49.52" N
GPS Longitude   97 deg 18' 50.16" W
GPS Altitude    172 m
GPS Horizontal Accuracy 1.27999997138977
GPS Vertical Accuracy   1.27999997138977
GPS Velocity East       -0.420529305934906
GPS Velocity North      -0.00469933077692986
GPS Velocity Up 0
GPS Speed Accuracy      0
Sample Time     0:02:54
Sample Duration 0.00 s
GPS Date/Time   2021:10:27 19:23:02.899429Z
GPS Measure Mode        3-Dimensional Measurement
GPS Latitude    31 deg 28' 49.52" N
GPS Longitude   97 deg 18' 50.16" W
GPS Altitude    172 m
GPS Horizontal Accuracy 1.27999997138977
GPS Vertical Accuracy   1.27999997138977
GPS Velocity East       -0.420529305934906
GPS Velocity North      -0.00469933077692986
GPS Velocity Up 0
GPS Speed Accuracy      0
Sample Time     0:02:54
Sample Duration 0.00 s
Angular Velocity        -0.0511326938867569 -0.0649811327457428 0.015978965908289
Sample Time     0:02:54
Sample Duration 0.00 s
Acceleration    -0.1083984375 -0.989013671875 -0.037353515625
Sample Time     0:02:54
Sample Duration 0.00 s

Camera: Insta360 Pro 2
OS: Windows 10
Exiftool 12.32

sevy

hello,
i'm not an expert in ExifTool but it seems to be normal to have only one line in your csv file as you specify one - and only one - file : test1.mp4
If you have a directory with various mp4 files, you may try :
exiftool -ee -csv -ext mp4 . > test1.csv
-ext mp4 : select the mp4 files
. : the dot = the current directory
to get the lat., long.  and altitude, you may try to add :
-GPSLatitude -GPSLongitude -GPSAltitude
exiftool -ee -csv to get the lat., long.  and altitude, you may try to add :
-GPSLatitude -GPSLongitude -GPSAltitude -ext mp4 . > test1.csv

Phil Harvey

The -csv option doesn't work like with the -ee option like this.  Instead, you need to use the -p option:

exiftool -n -p "$gpsdatetime,$gpslatitude,$gpslongitude,$gpsaltitude" -ee test1.mp4 > test1.csv

- 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 ($).

drax22

Thanks to Phil and Sevy for your help. Command sent my Phil worked perfectly. I was assuming that since the -ee -t tags showed several rows of metadata, I thought adding the -csv tag can be used to direct the output to a CSV file.

Great tool Phil, beer sent your way.

Cheers

Phil Harvey

Great.  I got the beer, thanks. :)

- 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 ($).