Last active
November 8, 2020 14:10
-
-
Save knishioka/57aea8a0926865a721740d3ca1116c9a to your computer and use it in GitHub Desktop.
Add datetime prefix to MP4 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.MP4; do | |
new_file_name=$(date -v+9H -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