Skip to content

Instantly share code, notes, and snippets.

@knishioka
Last active November 8, 2020 14:10
Show Gist options
  • Save knishioka/6468b8648e152340d7a0d899c6a1450d to your computer and use it in GitHub Desktop.
Save knishioka/6468b8648e152340d7a0d899c6a1450d to your computer and use it in GitHub Desktop.
Add datetime prefix to GoPro files
for file in GH*.MP4; do
new_file_name=$(date -j -f "%Y-%m-%dT%H:%M:%S.000000Z" "$(ffprobe -v quiet -select_streams v:0 -show_entries stream_tags=creation_time -of default=noprint_wrappers=1:nokey=1 $file)" "+%Y-%m-%d %H%M%S_$file")
cp "$file" "$new_file_name"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment