Skip to content

Instantly share code, notes, and snippets.

@knishioka
Created August 30, 2020 11:55
Show Gist options
  • Save knishioka/1d1d959eaed4ce32531e164c7b42b3ac to your computer and use it in GitHub Desktop.
Save knishioka/1d1d959eaed4ce32531e164c7b42b3ac to your computer and use it in GitHub Desktop.
subtract 9hours from creation time
target_dir=creation_time_changed
mkdir "$target_dir"
for movie in *.MP4; do
creation_time=$(TZ=0 gdate -d "$(ffprobe -v quiet -select_streams v:0 -show_entries stream_tags=creation_time -of default=noprint_wrappers=1:nokey=1 $movie | sed 's/Z/+09:00/')" "+%Y-%m-%dT%T.000000Z")
ffmpeg -i $movie -metadata creation_time="$creation_time" -c copy "${target_dir}/${movie}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment