start time of video on Garmin VFAT camera

David Fletcher dave at
Wed Jan 20 14:59:01 UTC 2016

On Wed, 2016-01-20 at 14:02 +0000, Adam Funk wrote:
> What I want to do now is write something in bash or python to copy
> files off the camera but rename the destination file to include the
> start time of the recording.  From looking at the `stat` output on the
> files, I get the impression that the "change" timestamp could well be
> when the recording started & the "modify" one could be when it
> finished.  Has anyone else corroborated this sort of thing?

This is what I wrote some years ago to to just this with raw files from
my camera, etc:-


# Use the ls command to output the date and time stamp of each file
# and awk to pick out the date and time string and the filename
for datetimefilename in $(ls --time-style=+%Y%m%d%H%M%S -l *.jpg *.JPG
*.RAF *.PEF *.AVI *.WAV | awk '{ print $6$7 }')
  echo $datetimefilename
# Split off the file name so that I can use it for the rename operation
  echo $origfilename
  mv $origfilename t$datetimefilename

More information about the ubuntu-users mailing list