google takeout places parentheses wrongly in json file name?

Started by gflyer, September 28, 2021, 02:40:23 PM

Previous topic - Next topic

gflyer

Hello. Thank you again for your help.
I have tried the command below but I get this error.
Am I doing something wrong?
the "PhotoTakenTimeTimestamp" tag is from the json file.

exiftool -ext MPG -d %s -TagsFromFile %d%f.%e.json "-createdate<PhotoTakenTimeTimestamp" MOV00789.MPG

Error: Writing of MPG files is not yet supported - MOV00789.MPG
0 image files updated
1 files weren't updated due to errors



exiftool -a -G1 -s MOV00789.MPG.json

[ExifTool]      ExifToolVersion                 : 12.31
[System]        FileName                        : MOV00789.MPG.json
[System]        Directory                       : .
[System]        FileSize                        : 1725 bytes
[System]        FileModifyDate                  : 2021:09:27 10:39:18+02:00
[System]        FileAccessDate                  : 2021:09:29 14:39:10+02:00
[System]        FileInodeChangeDate             : 2021:09:29 18:04:16+02:00
[System]        FilePermissions                 : -rw-r--r--
[File]          FileType                        : JSON
[File]          FileTypeExtension               : json
[File]          MIMEType                        : application/json
[JSON]          CreationTimeFormatted           : Mar 31, 2016, 6:02:13 PM UTC
[JSON]          CreationTimeTimestamp           : 1459447333
[JSON]          Description                     :
[JSON]          GeoDataAltitude                 : 0.0
[JSON]          GeoDataLatitude                 : 0.0
[JSON]          GeoDataLatitudeSpan             : 0.0
[JSON]          GeoDataLongitude                : 0.0
[JSON]          GeoDataLongitudeSpan            : 0.0
[JSON]          GeoDataExifAltitude             : 0.0
[JSON]          GeoDataExifLatitude             : 0.0
[JSON]          GeoDataExifLatitudeSpan         : 0.0
[JSON]          GeoDataExifLongitude            : 0.0
[JSON]          GeoDataExifLongitudeSpan        : 0.0
[JSON]          ImageViews                      : 37
[JSON]          PhotoLastModifiedTimeFormatted  : Sep 11, 2021, 3:33:26 AM UTC
[JSON]          PhotoLastModifiedTimeTimestamp  : 1631331206
[JSON]          PhotoTakenTimeFormatted         : Dec 31, 2012, 10:47:58 AM UTC
[JSON]          PhotoTakenTimeTimestamp         : 1356950878
[JSON]          Title                           : MOV00789.MPG




Quote from: StarGeek on September 29, 2021, 01:05:55 PM
Your command would be along these lines
exiftool -ext mp4 -d %s -TagsFromFile %d%f.%e.json "-createdate<creationdatetimestamp" /path/to/files/

You can run exiftool directly on the json file (use the command in FAQ #3) to see what names exiftool gives for each of the json tags.

gflyer

I have used the command below and it seems to work. Apple photo now get the correct date :)

exiftool -ext MPG -d %s -TagsFromFile %d%f.%e.json "-FileModifyDate<PhotoTakenTimeTimestamp" MOV00789.MPG 

StarGeek

Quote from: gflyer on September 29, 2021, 03:19:34 PM
My question was related to video files because in the error message it says that exiftool cannot write mpg

See the Supported File Types table.  Mpeg files are read only.  You can't write any data to them with exiftool.

I believe most, if not all, Mpegs can be losslessly converted to mp4 with a program such as FFMPeg.  An example command would be
ffmpeg -i input.mpg -map_metadata 0 -c copy output.mp4
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

gflyer

I was able to write the FileModifyDate and when I import in Apple Photo date is correct now.


exiftool -a -G1 -s MOV00789.MPG

[ExifTool]      ExifToolVersion                 : 12.31
[System]        FileName                        : MOV00789.MPG
[System]        Directory                       : .
[System]        FileSize                        : 303 MiB
[System]        FileModifyDate                  : 2012:12:31 10:47:58+01:00
[System]        FileAccessDate                  : 2012:12:31 10:47:58+01:00
[System]        FileInodeChangeDate             : 2021:09:29 22:11:58+02:00
[System]        FilePermissions                 : -rw-r--r--
[File]          FileType                        : MPEG
[File]          FileTypeExtension               : mpg
[File]          MIMEType                        : video/mpeg
[MPEG]          MPEGAudioVersion                : 1
[MPEG]          AudioLayer                      : 2
[MPEG]          AudioBitrate                    : 64 kbps
[MPEG]          SampleRate                      : 32000
[MPEG]          ChannelMode                     : Single Channel
[MPEG]          ModeExtension                   : Bands 4-31
[MPEG]          CopyrightFlag                   : True
[MPEG]          OriginalMedia                   : True
[MPEG]          Emphasis                        : None
[MPEG]          ImageWidth                      : 640
[MPEG]          ImageHeight                     : 480
[MPEG]          AspectRatio                     : 1:1
[MPEG]          FrameRate                       : 30 fps
[MPEG]          VideoBitrate                    : Variable
[Composite]     ImageSize                       : 640x480
[Composite]     Megapixels                      : 0.307



Quote from: StarGeek on September 29, 2021, 04:07:59 PM
Quote from: gflyer on September 29, 2021, 03:19:34 PM
My question was related to video files because in the error message it says that exiftool cannot write mpg

See the Supported File Types table.  Mpeg files are read only.  You can't write any data to them with exiftool.

I believe most, if not all, Mpegs can be losslessly converted to mp4 with a program such as FFMPeg.  An example command would be
ffmpeg -i input.mpg -map_metadata 0 -c copy output.mp4