Skip to content

Instantly share code, notes, and snippets.

@tksst
Created October 23, 2016 03:16
Show Gist options
  • Save tksst/4f43085fd852b73f875863b66c0a558c to your computer and use it in GitHub Desktop.
Save tksst/4f43085fd852b73f875863b66c0a558c to your computer and use it in GitHub Desktop.
SONYのビデオカメラで撮影してPlayMemories Homeで取り込んだとき、4GB超えるファイルが結合されるが、その更新時刻をEXIF時刻に変更する。
#!/bin/bash
touch_date=$( exif --ifd=EXIF --tag=0x9003 -i -m "$1.THM" | perl -pe 's/(\d+):(\d+):(\d+) (\d+):(\d+):(\d+)/$1$2$3$4$5.$6/' )
target_file="$1.mp4"
echo "target file: ${target_file}"
echo "date: ${touch_date}"
touch -t "$touch_date" "$target_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment