Created
December 13, 2017 16:51
-
-
Save maxsvetlik/4aa337e76ec4ec4c17bc6c70fbc72c9a to your computer and use it in GitHub Desktop.
This script renames sequential time (epoch time) timestamped images to a format that avconv can read and use to create a video file.
This file contains hidden or 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
#!/bin/bash | |
#This script renames images named as a sequential timestamp to a standardized format used for avconv | |
a=0 | |
ls vision_data/*.jpg | sed 's/^\([^0-9]*\)\([0-9]*\)/\1 \2/' | sort -k2,2n | tr -d ' ' | | |
while read filename; do | |
echo $filename | |
new=$(printf "%04d.JPG" ${a}) #04 pad to length of 4 | |
ln ${filename} ${new} | |
echo ${i} | |
let a=a+1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment