Skip to content

Instantly share code, notes, and snippets.

@charliecm
Last active November 13, 2023 23:43
Show Gist options
  • Save charliecm/3562285d23b1ab4f57db to your computer and use it in GitHub Desktop.
Save charliecm/3562285d23b1ab4f57db to your computer and use it in GitHub Desktop.

Revisions

  1. charliecm revised this gist Nov 16, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions exiftool-snippets.bash
    Original file line number Diff line number Diff line change
    @@ -7,10 +7,10 @@ exiftool -TagsFromFile a.jpg b.jpg
    # Photos — change CreateDate metadata
    exiftool "-CreateDate=2017:05:17 12:00:00" IMG.jpg

    # Videos — change date to "Creation Date" (written by iOS)
    # Videos — change date to "Creation Date" (written by DSLRs)
    exiftool -ext m4v -ext mp4 -ext mov "-CreationDate>CreateDate" -"CreationDate>FileCreateDate" "-CreationDate>FileModifyDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreationDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreationDate" "-CreationDate>MediaModifyDate" .

    # Videos — change date to "Create Date" (written by digital cameras)
    # Videos — change date to "Create Date" (written by iOS)
    exiftool -ext m4v -ext mp4 -ext mov "-CreateDate>FileCreateDate" "-CreateDate>FileModifyDate" "-CreateDate>ModifyDate" "-CreateDate>TrackCreateDate" "-CreateDate>TrackModifyDate" "-CreateDate>MediaCreateDate" "-CreateDate>MediaModifyDate" .

    # Batch renaming --------------------------------------------------------------
  2. charliecm renamed this gist Oct 9, 2017. 1 changed file with 11 additions and 4 deletions.
    15 changes: 11 additions & 4 deletions batch-rename.bash → exiftool-snippets.bash
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    # Add -r to perform operations recursively (for subfolders)
    # Changing metadata -----------------------------------------------------------

    # Photo — rename files to date (e.g., 2015-10-Oct-28-10-28-31.jpg)
    # Replace -testname with -filename to confirm change
    exiftool -ext jpg -ext png -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
    # Copy tags from one file to another
    # http://thomer.com/howtos/copy_exif.html
    exiftool -TagsFromFile a.jpg b.jpg

    # Photos — change CreateDate metadata
    exiftool "-CreateDate=2017:05:17 12:00:00" IMG.jpg
    @@ -13,6 +13,13 @@ exiftool -ext m4v -ext mp4 -ext mov "-CreationDate>CreateDate" -"CreationDate>Fi
    # Videos — change date to "Create Date" (written by digital cameras)
    exiftool -ext m4v -ext mp4 -ext mov "-CreateDate>FileCreateDate" "-CreateDate>FileModifyDate" "-CreateDate>ModifyDate" "-CreateDate>TrackCreateDate" "-CreateDate>TrackModifyDate" "-CreateDate>MediaCreateDate" "-CreateDate>MediaModifyDate" .

    # Batch renaming --------------------------------------------------------------
    # Add -r to perform operations recursively (for subfolders)

    # Photo — rename files to date (e.g., 2015-10-Oct-28-10-28-31.jpg)
    # Replace -testname with -filename to confirm change
    exiftool -ext jpg -ext png -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .

    # Videos — rename files to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -ext m4v -ext mp4 -ext mov -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
  3. charliecm revised this gist May 17, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion batch-rename.bash
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ exiftool -ext jpg -ext png -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDa
    exiftool "-CreateDate=2017:05:17 12:00:00" IMG.jpg

    # Videos — change date to "Creation Date" (written by iOS)
    exiftool -ext m4v -ext mp4 -ext mov "-CreationDate>CreateDate" -"CreationDate>FileCreationDate" "-CreationDate>FileModifyDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreationDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreationDate" "-CreationDate>MediaModifyDate" .
    exiftool -ext m4v -ext mp4 -ext mov "-CreationDate>CreateDate" -"CreationDate>FileCreateDate" "-CreationDate>FileModifyDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreationDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreationDate" "-CreationDate>MediaModifyDate" .

    # Videos — change date to "Create Date" (written by digital cameras)
    exiftool -ext m4v -ext mp4 -ext mov "-CreateDate>FileCreateDate" "-CreateDate>FileModifyDate" "-CreateDate>ModifyDate" "-CreateDate>TrackCreateDate" "-CreateDate>TrackModifyDate" "-CreateDate>MediaCreateDate" "-CreateDate>MediaModifyDate" .
  4. charliecm revised this gist May 17, 2017. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions batch-rename.bash
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,18 @@
    # Change video date to "Creation Date" (written by iOS)
    # Affected files will have a version with _original suffix
    exiftool -ext m4v -ext mp4 -ext mov "-CreationDate>FileModifyDate" "-CreationDate>CreateDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreateDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreateDate" "-CreationDate>MediaModifyDate" .
    # Add -r to perform operations recursively (for subfolders)

    # Change video file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Photo — rename files to date (e.g., 2015-10-Oct-28-10-28-31.jpg)
    # Replace -testname with -filename to confirm change
    exiftool -ext m4v -ext mp4 -ext mov -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
    exiftool -ext jpg -ext png -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .

    # Change CreateDate metadata of an image
    exiftool "-CreateDate=2016:07:10 12:00:00" IMG.jpg
    # Photos — change CreateDate metadata
    exiftool "-CreateDate=2017:05:17 12:00:00" IMG.jpg

    # Change JPG file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -ext jpg -ext png -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
    # Videos — change date to "Creation Date" (written by iOS)
    exiftool -ext m4v -ext mp4 -ext mov "-CreationDate>CreateDate" -"CreationDate>FileCreationDate" "-CreationDate>FileModifyDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreationDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreationDate" "-CreationDate>MediaModifyDate" .

    # Add -r to perform operations recursively
    # Videos — change date to "Create Date" (written by digital cameras)
    exiftool -ext m4v -ext mp4 -ext mov "-CreateDate>FileCreateDate" "-CreateDate>FileModifyDate" "-CreateDate>ModifyDate" "-CreateDate>TrackCreateDate" "-CreateDate>TrackModifyDate" "-CreateDate>MediaCreateDate" "-CreateDate>MediaModifyDate" .

    # Videos — rename files to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -ext m4v -ext mp4 -ext mov -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
  5. charliecm revised this gist Dec 6, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions batch-rename.bash
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    # Change video date to "Creation Date" (written by iOS)
    # Affected files will have a version with _original suffix
    exiftool -ext m4v -ext mp4 "-CreationDate>FileModifyDate" "-CreationDate>CreateDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreateDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreateDate" "-CreationDate>MediaModifyDate" .
    exiftool -ext m4v -ext mp4 -ext mov "-CreationDate>FileModifyDate" "-CreationDate>CreateDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreateDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreateDate" "-CreationDate>MediaModifyDate" .

    # Change video file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -ext m4v -ext mp4 -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
    exiftool -ext m4v -ext mp4 -ext mov -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .

    # Change CreateDate metadata of an image
    exiftool "-CreateDate 2016:07:10 12:00:00" IMG.jpg
    exiftool "-CreateDate=2016:07:10 12:00:00" IMG.jpg

    # Change JPG file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
  6. charliecm revised this gist Sep 10, 2016. No changes.
  7. charliecm revised this gist Jul 11, 2016. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions batch-rename.bash
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,16 @@
    # Change video date to "Creation Date" (written by iOS)
    # Affected files will have a version with _original suffix
    exiftool -r -ext m4v -ext mp4 "-CreationDate>FileModifyDate" "-CreationDate>CreateDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreateDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreateDate" "-CreationDate>MediaModifyDate" .
    exiftool -ext m4v -ext mp4 "-CreationDate>FileModifyDate" "-CreationDate>CreateDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreateDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreateDate" "-CreationDate>MediaModifyDate" .

    # Change video file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -r -ext m4v -ext mp4 -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
    exiftool -ext m4v -ext mp4 -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .

    # Change CreateDate metadata of an image
    exiftool "-CreateDate 2016:07:10 12:00:00" IMG.jpg

    # Change JPG file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -r -ext jpg -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
    exiftool -ext jpg -ext png -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .

    # Add -r to perform operations recursively
  8. charliecm renamed this gist Dec 28, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. charliecm created this gist Dec 28, 2015.
    11 changes: 11 additions & 0 deletions batch-rename.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # Change video date to "Creation Date" (written by iOS)
    # Affected files will have a version with _original suffix
    exiftool -r -ext m4v -ext mp4 "-CreationDate>FileModifyDate" "-CreationDate>CreateDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreateDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreateDate" "-CreationDate>MediaModifyDate" .

    # Change video file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -r -ext m4v -ext mp4 -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .

    # Change JPG file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
    # Replace -testname with -filename to confirm change
    exiftool -r -ext jpg -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .