Monday 18 November 2013

Summary

I am still updating the scripts when time permits but for the most part I think the dash cam is done.
One last thing to do is have NTP sync with the GPS time. The difference between the two can become
quite considerable even only after an hour.

The Pi camera still interferes with the GPS unit a lot. The only thing that works well is having the
GPS away from the Pi but I do not want more wires coming out of the box. It would be nice to try
a USB or Bluetooth GPS to see if this would work better.

I also tried a cheap detachable widescreen lens on the camera. It works fairly well but you do lose some
of the image sharpness. The video can also be affected by lighting conditions much more.



Some other recent updates were adding a global resource file (global.rc), which can be used to change
many of the default settings. I also included some audio recording stuff using arecord. I haven't tested it
that much but it seems to work okay, at least, using the built-in microphone on my USB camera.
I moved all the script logging into one file (status.txt). This makes things a little clearer instead of
having to dig it out from the system data. I still need to tidy up the GPS C program. It started as
a small addition but now kind of controls everything and has become very messy.

I've been asked for information on file sizes. These can vary a fair bit depending on the action but these
are my averages :-

Pi Cam
1920 / 1080 - 2Gb per 17 mins. (120Mb p/m | 7.2Gb p/h)
  960 / 540 - 650Mb per 17 mins. (38Mb p/m | 2.2Gb p/h)

USB camera (HD-3000)
512 / 288 - 40Mb per 10min (4Mb p/m | 240Mb p/h).

Audio
Signed 16 bit Little Endian, Rate 44100 Hz, Stereo - 120Mb per 12min (10Mb p/m | 600Mb p/h)
Signed 16 bit Little Endian, Rate 16000 Hz, Stereo - 46Mb per 12min (3.8Mb p/m | 228Mb p/h)

So...
I think the Pi can be a viable dash cam solution particularly if you have many of the parts to hand.
If you are buying everything from scratch then it can be costly (around €150+) which could easily
get you a decent purpose built unit. They both have a few advantages over each other. For example
the Pi is very configurable and flexible, if I don't like the USB camera it's easy to change or if want
to disable the GPS or LED's then it's easily done. But I did not build it with a battery and to close the
last video file properly the Pi has to be shutdown gracefully. Not very helpful if you forget to press the
shutdown button and your ignition switch turns off the power immediately to the Pi.

It would be really great to have the GPS information overlaid on the Pi video. From what I've read
this is not easily achievable but I am hoping it is only a question of time. For now I am going to start
playing with my UDOO which has been somewhat neglected since it arrived.

2 comments:

  1. I solved the gps issue with a arduino making the dirty job (preprocessing of gps data) and send it to the RPi by USB.
    A python script reads the USB port and send the data to motion daemon by the 'text_left/right' variable.

    ReplyDelete
    Replies
    1. Sounds great. Do you have a video of it in action?

      Delete