Created
August 15, 2023 12:56
-
-
Save tcarreira/dafb338cca57ad657a3e54162007a900 to your computer and use it in GitHub Desktop.
rename every video file with timestamp from metadata
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
# oneliner: | |
ls videos | xargs -I{} sh -c 'cp "videos/{}" $(exiftool -createdate -S "videos/{}" | cut -d " " -f2- | sed "s/[: ]//g")_$(printf "%05d.mp4" $RANDOM)' | |
# ### script mode: | |
# for video in $(ls videos/); do | |
# createdate=$(exiftool -createdate -S "videos/${video}" | cut -d " " -f2- | sed "s/[: ]//g") | |
# fname=$(printf "%s_%05d.mp4" ${createdate} ${RANDOM}) | |
# cp "videos/$video" "$fname" | |
# done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment