Skip to content

Instantly share code, notes, and snippets.

@jnx
Forked from jmuspratt/mediaName
Created February 23, 2021 07:49
Show Gist options
  • Select an option

  • Save jnx/5d0655e6f40416b2b984018fe2e7b2c3 to your computer and use it in GitHub Desktop.

Select an option

Save jnx/5d0655e6f40416b2b984018fe2e7b2c3 to your computer and use it in GitHub Desktop.

Revisions

  1. @jmuspratt jmuspratt revised this gist Mar 14, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Exiftool Canonize
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # Video files require a different, so we run exiftool 3 times:
    # 1. Exclude MOV files and rename the image files with <CreateDate>.
    # 2. Target MOV files and rename them with MediaCreateDate (for iPhone videos).
    # 3. Target MOV files and rename them with DateTimeOriginal, (for Fuji camera videos).
    # 3. Target MOV files and rename them with DateTimeOriginal (for Fuji camera videos).

    # Requirements: install the package manager Homebrew (http://brew.sh), then install exiftool (type brew install exiftool in Terminal.app).
    # Now open Terminal.app, cd to the relevant directory, and run the command.
  2. @jmuspratt jmuspratt revised this gist Mar 14, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Exiftool Canonize
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    # Files shot within the same second get copy number added (-1,-2, etc.).
    # Video files require a different, so we run exiftool 3 times:
    # 1. Exclude MOV files and rename the image files with <CreateDate>.
    # 2. Target MOV files and rename them with ContentCreateDate (for iPhone videos).
    # 2. Target MOV files and rename them with MediaCreateDate (for iPhone videos).
    # 3. Target MOV files and rename them with DateTimeOriginal, (for Fuji camera videos).

    # Requirements: install the package manager Homebrew (http://brew.sh), then install exiftool (type brew install exiftool in Terminal.app).
    @@ -14,4 +14,5 @@
    # http://ninedegreesbelow.com/photography/exiftool-commands.html#rename
    # http://www.polaine.com/2015/01/fixing-photo-and-video-file-metadata-with-exiftool/

    # Note: --ext EXCLUDES files with the extension, while -ext INCLUDES files with that extension
    exiftool --ext MOV '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<ContentCreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<DateTimeOriginal' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
  3. @jmuspratt jmuspratt revised this gist Aug 30, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Exiftool Canonize
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,8 @@
    # 2. Target MOV files and rename them with ContentCreateDate (for iPhone videos).
    # 3. Target MOV files and rename them with DateTimeOriginal, (for Fuji camera videos).

    # To use, install exiftool, open Terminal.app, cd to the relevant directory, and run the command.
    # Requirements: install the package manager Homebrew (http://brew.sh), then install exiftool (type brew install exiftool in Terminal.app).
    # Now open Terminal.app, cd to the relevant directory, and run the command.

    # References:
    # http://www.sno.phy.queensu.ca/~phil/exiftool/
  4. @jmuspratt jmuspratt renamed this gist May 15, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @jmuspratt jmuspratt revised this gist May 1, 2015. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,10 @@
    # Rename image and MOV files according to EXIF capture date, using YYYY-MM-DD-HH-MM-SS.ext
    format.
    # Files shot within the same second get copy number added (-1,-2, etc.).
    # Since iPhone video files appear to use GMT in CreateDate instead of local time, we run the command twice, the first time excluding MOV files and the second time targeting them and extracting ContentCreateDate instead of CreateDate. The third command also targets MOV files, but extracts DateTimeOriginal, which seems to be the best optino for Fuji camera videos.
    # Video files require a different, so we run exiftool 3 times:
    # 1. Exclude MOV files and rename the image files with <CreateDate>.
    # 2. Target MOV files and rename them with ContentCreateDate (for iPhone videos).
    # 3. Target MOV files and rename them with DateTimeOriginal, (for Fuji camera videos).

    # To use, install exiftool, open Terminal.app, cd to the relevant directory, and run the command.

  6. @jmuspratt jmuspratt revised this gist May 1, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,4 @@
    # http://ninedegreesbelow.com/photography/exiftool-commands.html#rename
    # http://www.polaine.com/2015/01/fixing-photo-and-video-file-metadata-with-exiftool/

    exiftool --ext MOV '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<ContentCreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<DateTimeOriginal' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
    exiftool --ext MOV '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<ContentCreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<DateTimeOriginal' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
  7. @jmuspratt jmuspratt revised this gist Apr 25, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # Rename image and MOV files according to EXIF capture date, using YYYY-MM-DD-HH-MM-SS.ext
    format.
    # Files shot within the same second get copy number added (-1,-2, etc.).
    # Since iPhone video files appear to use GMT in CreateDate instead of local time, we run the command twice, the first time excluding MOV files and the second time targeting them and extracting ContentCreateDate instead of CreateDate.
    # Since iPhone video files appear to use GMT in CreateDate instead of local time, we run the command twice, the first time excluding MOV files and the second time targeting them and extracting ContentCreateDate instead of CreateDate. The third command also targets MOV files, but extracts DateTimeOriginal, which seems to be the best optino for Fuji camera videos.

    # To use, install exiftool, open Terminal.app, cd to the relevant directory, and run the command.

    @@ -10,4 +10,4 @@
    # http://ninedegreesbelow.com/photography/exiftool-commands.html#rename
    # http://www.polaine.com/2015/01/fixing-photo-and-video-file-metadata-with-exiftool/

    exiftool --ext MOV '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<ContentCreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
    exiftool --ext MOV '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<ContentCreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<DateTimeOriginal' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
  8. @jmuspratt jmuspratt revised this gist Mar 30, 2015. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,13 @@
    # Rename JPG, CR2, and MOV files according to EXIF capture date in YYYY-MM-DD-HH-MM-SS
    # Rename image and MOV files according to EXIF capture date, using YYYY-MM-DD-HH-MM-SS.ext
    format.
    # Files shot within the same second get copy number added (-1,-2, etc.).
    # Since iPhone video files appear to use GMT in CreateDate instead of local time,
    # we extract MediaModifyDate instead of CreateDate.
    # Since iPhone video files appear to use GMT in CreateDate instead of local time, we run the command twice, the first time excluding MOV files and the second time targeting them and extracting ContentCreateDate instead of CreateDate.

    # To use, install exiftool, open Terminal.app, cd to the relevant directory, and run the command.

    # References:
    # http://www.sno.phy.queensu.ca/~phil/exiftool/
    # http://ninedegreesbelow.com/photography/exiftool-commands.html#rename
    # http://www.polaine.com/2015/01/fixing-photo-and-video-file-metadata-with-exiftool/

    exiftool -ext CR2 '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext JPG '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<MediaModifyDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
    exiftool --ext MOV '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<ContentCreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
  9. @jmuspratt jmuspratt revised this gist Mar 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    format.
    # Files shot within the same second get copy number added (-1,-2, etc.).
    # Since iPhone video files appear to use GMT in CreateDate instead of local time,
    # we extract MediaModifyDate instead.
    # we extract MediaModifyDate instead of CreateDate.

    # References:
    # http://www.sno.phy.queensu.ca/~phil/exiftool/
  10. @jmuspratt jmuspratt revised this gist Mar 30, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,8 @@
    # Rename JPG, CR2, and MOV files according to EXIF capture date in YYYY-MM-DD-HH-MM-SS format. Files shot within the same second get copy number added (-1,2). Since iPhone video files appear to use GMT in CreateDate instead of local time, we extract MediaModifyDate instead.
    # Rename JPG, CR2, and MOV files according to EXIF capture date in YYYY-MM-DD-HH-MM-SS
    format.
    # Files shot within the same second get copy number added (-1,-2, etc.).
    # Since iPhone video files appear to use GMT in CreateDate instead of local time,
    # we extract MediaModifyDate instead.

    # References:
    # http://www.sno.phy.queensu.ca/~phil/exiftool/
  11. @jmuspratt jmuspratt revised this gist Mar 30, 2015. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,8 @@
    // Based on http://ninedegreesbelow.com/photography/exiftool-commands.html#rename
    exiftool '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
    # Rename JPG, CR2, and MOV files according to EXIF capture date in YYYY-MM-DD-HH-MM-SS format. Files shot within the same second get copy number added (-1,2). Since iPhone video files appear to use GMT in CreateDate instead of local time, we extract MediaModifyDate instead.

    # References:
    # http://www.sno.phy.queensu.ca/~phil/exiftool/
    # http://ninedegreesbelow.com/photography/exiftool-commands.html#rename
    # http://www.polaine.com/2015/01/fixing-photo-and-video-file-metadata-with-exiftool/

    exiftool -ext CR2 '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext JPG '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<MediaModifyDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .
  12. @jmuspratt jmuspratt created this gist Mar 29, 2015.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    // Based on http://ninedegreesbelow.com/photography/exiftool-commands.html#rename
    exiftool '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .