Veho Muvi Pro - setting timestamp on OSX

Veho Muvi I have a Veho Muvi camera which I can use when cycling, just in case I ever need to show what happened in an incident. The battery life is about 90 minutes. This means that in practice, I often forget to charge it and then bring it along (but that's my fault). The helmet fixings are shockingly bad, consisting of a few straps (the Exposure Joystick Maxx light on the other hand is a model of excellent helmet fixing).

With vibrations, there is some 'waviness' onscreen. This is because, I think, the camera doesn't capture all the pixels at once, it writes them out line by line, so that when there is movement the camera is pointing in a different place at the end of the frame compared to the start. This means that if it's bouncing up and down, the picture looks somewhat 'elastic' as it squashes and stretches. However, it was one of the cheapest options on the market - and its purpose is to provide a record of a commute, not broadcast quality footage.

One other thing with this camera, when deleting files, it is imperative to remember to empty the trash or you won't save any space. (To delete without going via trash, use terminal and the 'rm' command).

This camera is that it has a timestamp visible on screen. You can't turn it off, as far as I know, and if this is incorrectly set, it's rather annoying.

This internal clock on the device can be easily set via a small PC application. For me, that's a pain in the backside, as I'm on a Mac. Fortunately, I came across this advice. It's so simple, I am amazed that Veho did not put it into their documentation, and that they couldn't tell me when asked.

Create a file called time.txt in the root of the Muvi filesystem (alongside the DCIM directory) with the following contents:

YYYY.MM.DD HH:MM:SS Unmount the device and turn it off and on, the file should be consumed and the time should be now set.

I've taken the advice and automated it.

Now, just before eject, I just have to open 'terminal' and type 'muvi'. Then I drag the camera icon to trash to dismount, unplug it and switch it off and on again. What follows may appear more complicated than editing a text file by hand, but once done, I only have to type 'muvi' into terminal, and it's done - a small extra effort now saves seconds down the line.

If you take an extra step, you can do this with a click of the mouse.

This is how I did it.

I have a directory called 'scripts'. I opened terminal, typed

[sourcecode language="bash" light="true"]cd ~/scripts[/sourcecode]

Then I created a file called 'muvi' and made it executable.

[sourcecode language="bash" light="true"]touch muvi chmod 755 muvi[/sourcecode]

Then I edited muvi in my text editor of choice. I use vi (type 'i' to go to edit mode, type [escape] q ! [enter] to quit, type [escape] w q [enter] to save and quit)

[sourcecode language="bash" light="true"]vi muvi[/sourcecode]

Then, in the file, I put the following script (note, updated version below)

[sourcecode language="bash"]#!/bin/sh

cd /Volumes/"Murk VID" #edit this to reflect the name of your camera date +"%Y.%m.%d %H:%M:%S" > time.txt echo "Unmount the Muvi (drag to trash). Unplug. Then turn it off, count two, then on again" echo "Don't forget to turn it off again!"[/sourcecode]

Note, the quote marks in the 'cd' line are because I have a space in the volume name of the camera.

Don't forget to change the 'cd' line. If you're not sure what your camera is called, then on the command prompt, type:

[sourcecode language="bash" light="true"]ls -la /Volumes[/sourcecode]

To run the script, just type

[sourcecode language="bash" light="true"]./muvi[/sourcecode]

into terminal. If you're not in the scripts directory, type

[sourcecode language="bash" light="true"]~/scripts/muvi[/sourcecode]

(adjusting the path to reflect where you've stored the script).

The best option is to edit the path so you can just type:

[sourcecode language="bash" light="true"]muvi[/sourcecode]

regardless of where you are within terminal.

Do this by editing the file ~/.bash_profile - this is a hidden file, open it by typing

[sourcecode language="bash" light="true"]vi ~/.bash_profile[/sourcecode]

Add the following line to this file (obviously ensuring the path chosen is correct) :

[sourcecode language="bash" light="true"]export PATH=/Users/YOURUserName/path/to/scripts/:$PATH[/sourcecode]

To make it clickable, type

[sourcecode language="bash" light="true"]mv muvi muvi.command[/sourcecode] (note, now you'd have to type muvi.command at the terminal prompt)

Note, if your camera is not plugged in, you will create 'time.txt' elsewhere, in ~ for the clickable version, and whereever you happen to be for the terminal version.

I didn't like this, I didn't want copies of time.txt all over my hard drive (even if it is a small file). Therefore I've modified my script (and copied this to muvi.command to make it clickable). In this version of the script, I first check to see if the camera is plugged in.

[sourcecode language="bash"]#!/bin/sh

if [ -d "/Volumes/Murk VID" ]; then cd "/Volumes/Murk VID" date +"%Y.%m.%d %H:%M:%S" > time.txt echo "Unmount the Muvi, and turn it off, then on again." echo "Finally: If storing, don't forget to turn it off." else echo "Is the camera plugged in and switched on? [hit return]" read fi[/sourcecode]

(Again, don't forget to change the path to your camera, i.e. edit "/Volumes/Murk VID" twice).

I should really refine this to store the camera name as a variable, so I am only explicitly entering it once, thus making modification less likely to go wrong - however, for a script this size this steps past the point of cost in time versus benefit accrued later.

I could use a similar technique to make a script to permanently delete the movies at a click (testing first that I was in the right place, then doing rm -rf *.avi). I haven't yet as using rm in a script like this is potentially dangerous if there is a bug in the script. It's a very powerful command if used badly.

One more modification: If you want to set the time closer to reality, you need to allow for the time it takes you do dismount the drive, unplug it, and power cycle it. If this takes 20 seconds, then amend the 'date' line as follows:

[sourcecode language="bash" light="true"]date -v +20S +"%Y.%m.%d %H:%M:%S" > time.txt[/sourcecode]

Adjust the +20s to reflect whatever delay works for you. You can test the synchronisation by filming a clock you trust, and then comparing timestamps. For best accuracy, it needs to be switched on again a little ahead of the time you specified.

I decided to give myself a slightly longer delay, but tell myself exactly when to turn the camera on. In my case, I must turn the camera on four seconds ahead of the time in the file (this could conceivably differ for different batches of cameras).

I've also automatically dismounted the drive - note that if the dismount fails, you should not unplug. Just stop whatever programme is accessing the drive (quicktime usually in my case), and then run the script again.

[sourcecode language="bash"]#!/bin/sh

if [ -d "/Volumes/Murk VID" ]; then cd "/Volumes/Murk VID" date -v +26S +"%Y.%m.%d %H:%M:%S" > time.txt echo "For best results, switch the Muvi back on at:" date -v +22S +" %H:%M and %S seconds" echo "Unmount the Muvi. WAIT. Unplug. Turn it off, then on again at the time shown above" echo "I will attempt to unmount for you" cd ~ # if I don't do this, the dismount won't work diskutil unmount "/Volumes/Murk VID" echo "If the disk did not dismount, you probably have a something looking at it (quicktime?)" else echo "Is the camera plugged in and switched on? [hit return]" read fi[/sourcecode]

Note, the volume name must be updated in three places.

(Update, 5th August) I didn't like the layout of the user feedback in the above script, so I've made one more modification, changing the order of the 'echo' statements. I also check to see if the 'unmount' was successful, and print a warning if it was not.

[sourcecode language="bash"]


if [ -d "/Volumes/Murk VID" ]; then cd "/Volumes/Murk VID" echo "Unmount the Muvi. WAIT. Unplug. Turn it off, then on again at the time shown below" echo "I will attempt to unmount for you. If it does not dismount, then you have something" echo "else which is accessing it. Quicktime is a prime candidate" echo " " date -v +26S +"%Y.%m.%d %H:%M:%S" > time.txt echo "For best results, switch the Muvi back on at:" date -v +22S +" %H:%M and %S seconds" echo " " cd ~ diskutil unmount "/Volumes/Murk VID" if [ $? -eq 0 ]; then echo "Dismounted Successfully" else echo "WARNING - CAMERA STILL MOUNTED!" fi else echo "Is the camera plugged in and switched on? [hit return]" read fi [/sourcecode]