Motion - Motion Jpeg Viewer




A http GUI written in PHP. Motion creates jpegs. This php files creates a GUI that you can navigate in the jpegs using a timeline. You can step forward, backwards and also play forward and backward. Click on the timeline it gives you the image next to the time you clicked. You can also see the live feed.

During playback the php script "streams" the jpegs to the browser in a mjpeg format. It supports use of cambozola with the attached modified version and "browser" mode if using a browser with builtin mjpeg support.

Attached Files

Attached tar contains all the PHP files and a modified cambozola that supports callback to javascript that it have a new image. It also support to change the url without unload/load.


Untar the attached tar file into you apache web directory. In you have to Specify where motion saves jpeg files What cameras you have, name to show, directory relative "base" path where this camera stores pictures.

In you can also specify is you want to use Cambozola or use it in "browser" mode.

In motion you have to save files with following rules:
  • All cameras must have a own directory.
  • Every day must have a new directory under the camera directory. It must be named %Y%m%d.
  • All jpeg files must begin with %H%M%S
    • Recomended: %H%M%S-%q - e.g. jpeg_filename cam1/%Y%m%d/%H%M%S-%q

Don't forget to password protect your web pages if you have a public access to it.

Comments and Bug Reports

Is there a way to write %Y and not to have VERBATIM in the TWiki?
  • Yes. The problem is that %Y% becomes DONE. It is a predefined TWiki Variable. Just put some <nop> to prevent TWiki from seeing it as variables. The browser will ignore these nops. Thanks for the contribution -- KennethLavrsen

Just helped one other to get it working. Found that I have missed in some places to use <?php and not only <? that was OK on my setup, but not at his. It also may need some configuration in apache and php to get it to work. In the webserver you may have to add image/jpeg and image/pnp types e.g.
    AddType image/jpeg .jpg
    AddType image/png .png
And in php.ini you may have to add gd support e.g.
and open_basedir must be left empty or point to the cameras base directory e.g.
open_basedir = /home/:/tmp/:/usr/share/pear/:/motioncaps/
In v1.0.1 is also added some checks that the camera directory can be opened.
If you don't get any camera "buttons" the usual misstake/error is that the camera directory can't be read of any reason.
If you don't get any timeline, php may missing gd support.

-- DagErlandsson - 20 Sep 2007

I've followed this installation precisely on a new install of Ubuntu 8.04. I get the app to launch and it shows the timeline gif image with 'no feed'. The date drop-down is showing all of the date directories with images, but the frame number field is blank and no images are displayed. Any suggestions

-- BradC - 04 Jun 2008

I've read in the IRC log that you had it working by using browser mode instead of applet mode. Did you use the attached modified cambozola?

-- DagErlandsson - 08 Jun 2008

I don't really know what it's running. I unpacked the project file into the doc root file /var/www and configured the After switching to browser mode it started working and I was pretty satisfied with it.

Now I'm trying to work out what looks like apache permission issues so it can read from a images root directory on a remote server.

I really like the app. Pretty much meets my needs but I wish it had a feature to cleanup/delete date directories after they've been reviewed. I don't need anything automated, just something to let me do periodic cleanup. Thanks for a great little app.

-- BradC - 16 Jul 2008

RelatedProjectsForm edit

ProjectSummary A http gui to Motion genereated jpegs. Support step, play etc. Writtent in PHP.
ProjectStatus Beta
ProjectSubmitter DagErlandsson
Topic attachments
I Attachment Action Size Date Who Comment
MotionJpegViewer.JPGJPG MotionJpegViewer.JPG manage 66 K 02 Sep 2007 - 17:25 DagErlandsson  
motionjpegviewer.tartar motionjpegviewer.tar manage 277 K 02 Sep 2007 - 18:02 DagErlandsson v1.0.0 All php files and a slightly modified cambozola.
motionjpegviewer_v1.0.1.tartar motionjpegviewer_v1.0.1.tar manage 500 K 20 Sep 2007 - 20:09 DagErlandsson v1.0.1
Topic revision: r7 - 16 Jul 2008, BradC
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.