Skip to content

Instantly share code, notes, and snippets.

@cuibonobo
Last active December 17, 2015 19:59
Show Gist options
  • Save cuibonobo/5664009 to your computer and use it in GitHub Desktop.
Save cuibonobo/5664009 to your computer and use it in GitHub Desktop.
Terminal command to batch rename an image sequence from a movie to the format XXm_XXs_XX.png, assuming 4 fps and .png filename
count=0; for i in *.png; do let countmin=$count/240; let countsec=$count-240\*$countmin; mv $i $(printf '%02dm_%02ds_%02dm'.png $countmin $(( $countsec / 4 )) $(( $count % 4 ))); (( count++ )); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment