Imaging solutions with Free Software &
Open Hardware

Who's online

There are currently 0 users online.

Camera software

From ElphelWiki

 
(8 intermediate revisions not shown)
Line 3: Line 3:
== Introduction ==
== Introduction ==
-
All the camera software is provided on the terms of GNU General Public License. All the source code is available inside the camera but you may want to visit [http://www.elphel.com Elphel web site] for the latest version.
+
All the camera software is provided under the terms of the GNU General Public License. All the source code is available inside the camera but you may want to visit [http://www.elphel.com Elphel web site] for the latest version.
== Software Architecture of Elphel 3x3 cameras ==
== Software Architecture of Elphel 3x3 cameras ==
-
Software in the Elphel cameras started from [http://developer.axis.com/ Axis Developer Boards Software] and was amended for the camera specific functions. It was modified to work with newer hardware (models 303-313/323-333), support more features and now it seems to be a good time to make a major redesign instead of applying incremental changes.
+
Software in the Elphel cameras started from [http://developer.axis.com/ Axis Developer Boards Software] and was amended for the camera specific functions. It was modified to work with newer hardware (models 303-313/323-333), support more features and now seems to be a good time to make a major redesign instead of applying incremental changes.
-
Some discussion already started in Russian here - [[Nc3x3]]
+
Some discussion has already started in Russian here - [[Nc3x3]]
-
Related to the architecture are the [[#Camera Interface]] and the [[#Client Software]]
+
Related to the architecture are the [[#Camera Interface| Camera Interface]] and the [[#Client Software| Client Software]]
=== Camera Interface ===
=== Camera Interface ===
-
 
+
The camera can be accessed from client-software using the [[Video API]] (compatible with [[AxisAPI|Axis network cameras]]), or using the more ancient [[ccam.cgi]] interface. The user must [[Change API|select the interface]] that he wishes to use. If the [[ccam.cgi]] interface is [[Change API|selected]], an AJAX web-interface will allow simple access to the camera, by visiting the cameras IP-address (default: 192.168.0.9) with a web-browser.
-
=== Client Software ===
+
-
See [[Live CD]]
+
=== Video Server ===
=== Video Server ===
-
PC-based video server that will archive incoming Ogg Theora incoming streams from several cameras and transcode them on the fly to lower resolution (binary decimation, windowing) and frame rate (i.e. using only key frames) presenting multiple streams (real time and recorded) to the operator. The external interface of the server might be one of the industry standard and compatible with 3-rd party legacy software.
+
PC-based video server that will archive incoming Ogg Theora incoming streams from several cameras and transcode them on the fly to lower resolution (binary decimation, windowing) and frame rate (i.e. using only key frames) presenting multiple streams (real time and recorded) to the operator. The external interface of the server might be one of the industry standards and compatible with 3rd party legacy software.
-
== See also ==
+
=== See also ===
[[Roadmap#Software Architecture of Elphel 3x3 cameras]]
[[Roadmap#Software Architecture of Elphel 3x3 cameras]]
 +
 +
== Client Software ==
 +
Folowed software are included in the [[Live CD]]
 +
 +
=== Common software for video ===
 +
==== mplayer ====
 +
This is a movie player. It can play files and streams with many different video and audio formats.
 +
 +
To watch an rtp stream from our cameras you may use the following command:
 +
mplayer rtsp://camera-ip:554/
 +
Where '''camera-ip''' is the ip address of the camera.
 +
 +
To play a file recorded with mencoder or any other videofile you may use the following command:
 +
mplayer path-to-file
 +
 +
Or you may use the KDE menu to run mplayer in dialog mode
 +
 +
You can use the keyboard to control playing
 +
*'''space''' pause/continue
 +
*'''Q''' quit
 +
 +
See the mplayer man page and [http://www.mplayerhq.hu/homepage/design7/info.html site] for more information.
 +
 +
==== mencoder ====
 +
This program is included in the mplayer package.
 +
It can transcode video and audio to and from many different formats.
 +
For more about this see the man page. Type:
 +
man mencoder
 +
To record the rtp stream from our cameras it is better to use mencoder in copy mode (without reencoding):
 +
mencoder rtsp://camera.ip:554 -ovc copy -fps <fps> -o filename.avi
 +
where:
 +
*'''camera.ip''' - DNS name or IP address of the camera;
 +
*'''<fps>''' - approximate value of the frame frequency (this parameter is mandatory);
 +
*'''filename.avi''' - the name of an output file.
 +
Close the terminal window or press Ctrl+C to finish recording.
 +
 +
The following program written in unix shell will split recording video into blocks with the specified number of frames:
 +
while true ; do
 +
f=`date -Iseconds`
 +
mencoder rtsp://camera.ip:554 -ovc copy -fps <fps> -frames 1000 -o $f.avi
 +
done
 +
You can enter these strings "as is" at the command prompt.
 +
 +
==== ElphelOgm ====
 +
A receiver for the multicast RTP stream. It generates ogg/mjpeg stream on stdout.
 +
You can use it with mplayer or another video player to watch the RTP stream from the camera:
 +
ElphelOgm -a <multicast address> -p <multicast port> | mplayer -nocache -
 +
Or to record stream to a file:
 +
ElphelOgm -a <multicast address> -p <multicast port> -f <fps> > video.ogm
 +
Other tested players: VLC(some performance).
 +
 +
See also [[Recorder| detailed description and roadmap]]
 +
 +
==== ogm2mov ====
 +
This program is used to recode ogg/mjpeg file to QuickTime .mov format.
 +
Usage:
 +
ogm2mov -o <output file name> <input_file_name or "-" for stdin>
 +
The program cannot write to a pipe, only to a file.
 +
 +
==== GenReS plugin for Firefox ====
 +
This is a plugin for Mozilla/Firefox to allow embedding of external applications like mplayer in the browser window.
 +
 +
See also [[GenReS|description for javascript programmers]].
 +
 +
 +
=== Special software ===
 +
==== netcardconfig ====
 +
netcardconfig is an improved version of knoppix network configurator.
 +
It needs root privileges.
 +
It has two modes: interactive and batch.
 +
 +
...
 +
 +
It is called from the startup script on our Live CD.
 +
If you have installed netcardconfig-knoppix separately from our distro, it is possible you need to insert a call to the script in a system startup script.
 +
Our version uses arping to check the IP address.
 +
 +
==== netcamconfig ====
 +
Run "netcamconfig" as user "root" to apply additional network settings and some kernel parameters.
 +
 +
This script adds aliases for network cards with the most popular LAN ip adresses,
 +
adds route records for multicast ip addresses
 +
and changes kernel parameters to prevent long i/o operations blocking the hard drive,
 +
 +
It is called from the startup script on our Live CD after netcardconfig.
 +
If you have installed elphel-pack separately from our distro, you possibly need to insert a call for the script in a system startup script.
 +
==== camsearch ====
 +
This shell script scans the LAN using broadcast ping and detects elphel cameras.
 +
It creates the file "cameras.html" in the current directory with links to found cameras and information about
 +
software versions.
 +
It is called from the system startup script after network configuration and can be restarted using the "Find cameras again" link on the KDE desktop.
 +
 +
==== flashit ====
 +
This program uses Axis low-level Ethernet packets [http://www.axis.com/techsup/dev/flash-howto.htm see "Theory"] (some details do not apply to the camera) to communicate with a network bootloader hard-wired in the CPU internal ROM. This makes firmware upgrade a safe process - even if the process was interrupted and the camera was left in non-bootable state, it is always possible to start over again.
 +
 +
When the program is started without arguments (e.g. by just clicking the icon on the desktop) it offers a choice of images available on the DVD. You may also download flash image files (elphel3?3*-flash.tar.bz2) from the files section on [https://sourceforge.net/projects/elphel Elphel project page at SourceForge.net], save them and use as an argument to flashit (i.e. drag-and-drop the file icon over flashit).
 +
 +
To use the flashit utility, the camera should be started in firmware updgrade mode - the green button on the back panel should be held pressed down when the power is applied to the camera. You may do this in any sequence - if the program was started first, you will see the program output messages immediately after the camera is started in this special mode. The flashing process takes several minutes - both LEDs on the network connector stay on until it is over.
 +
 +
==== sdp-helper ====
 +
This script is designed for calling from a browser. It accepts a temporary "sdp" file downloaded from camera and calls [[#mplayer|mplayer]] to view the stream or [[#mencoder|mencoder]] to record it.
 +
On the CD it processes files with the mime type text/sdp. The script deletes the given temporary file.
 +
----
----
''Free Software and Open Hardware. Elphel, Inc., 2005''
''Free Software and Open Hardware. Elphel, Inc., 2005''
 +
 +
[[Category:Software]]

Latest revision as of 16:17, 22 December 2008

Elphel Network Cameras Manual

353/363 | Using the cameras | Camera software | Live CD | Camera hardware | Diagnostic & repair | Development documentation | 333 prices | Information | FAQ | About Elphel, Inc


Contents

Introduction

All the camera software is provided under the terms of the GNU General Public License. All the source code is available inside the camera but you may want to visit Elphel web site for the latest version.

Software Architecture of Elphel 3x3 cameras

Software in the Elphel cameras started from Axis Developer Boards Software and was amended for the camera specific functions. It was modified to work with newer hardware (models 303-313/323-333), support more features and now seems to be a good time to make a major redesign instead of applying incremental changes.

Some discussion has already started in Russian here - Nc3x3

Related to the architecture are the Camera Interface and the Client Software

Camera Interface

The camera can be accessed from client-software using the Video API (compatible with Axis network cameras), or using the more ancient ccam.cgi interface. The user must select the interface that he wishes to use. If the ccam.cgi interface is selected, an AJAX web-interface will allow simple access to the camera, by visiting the cameras IP-address (default: 192.168.0.9) with a web-browser.

Video Server

PC-based video server that will archive incoming Ogg Theora incoming streams from several cameras and transcode them on the fly to lower resolution (binary decimation, windowing) and frame rate (i.e. using only key frames) presenting multiple streams (real time and recorded) to the operator. The external interface of the server might be one of the industry standards and compatible with 3rd party legacy software.

See also

Roadmap#Software Architecture of Elphel 3x3 cameras

Client Software

Folowed software are included in the Live CD

Common software for video

mplayer

This is a movie player. It can play files and streams with many different video and audio formats.

To watch an rtp stream from our cameras you may use the following command:

mplayer rtsp://camera-ip:554/

Where camera-ip is the ip address of the camera.

To play a file recorded with mencoder or any other videofile you may use the following command:

mplayer path-to-file

Or you may use the KDE menu to run mplayer in dialog mode

You can use the keyboard to control playing

  • space pause/continue
  • Q quit

See the mplayer man page and site for more information.

mencoder

This program is included in the mplayer package. It can transcode video and audio to and from many different formats. For more about this see the man page. Type:

man mencoder

To record the rtp stream from our cameras it is better to use mencoder in copy mode (without reencoding):

mencoder rtsp://camera.ip:554 -ovc copy -fps <fps> -o filename.avi

where:

  • camera.ip - DNS name or IP address of the camera;
  • <fps> - approximate value of the frame frequency (this parameter is mandatory);
  • filename.avi - the name of an output file.

Close the terminal window or press Ctrl+C to finish recording.

The following program written in unix shell will split recording video into blocks with the specified number of frames:

while true ; do
f=`date -Iseconds`
mencoder rtsp://camera.ip:554 -ovc copy -fps <fps> -frames 1000 -o $f.avi
done

You can enter these strings "as is" at the command prompt.

ElphelOgm

A receiver for the multicast RTP stream. It generates ogg/mjpeg stream on stdout. You can use it with mplayer or another video player to watch the RTP stream from the camera:

ElphelOgm -a <multicast address> -p <multicast port> | mplayer -nocache -

Or to record stream to a file:

ElphelOgm -a <multicast address> -p <multicast port> -f <fps> > video.ogm

Other tested players: VLC(some performance).

See also detailed description and roadmap

ogm2mov

This program is used to recode ogg/mjpeg file to QuickTime .mov format. Usage:

ogm2mov -o <output file name> <input_file_name or "-" for stdin>

The program cannot write to a pipe, only to a file.

GenReS plugin for Firefox

This is a plugin for Mozilla/Firefox to allow embedding of external applications like mplayer in the browser window.

See also description for javascript programmers.


Special software

netcardconfig

netcardconfig is an improved version of knoppix network configurator. It needs root privileges. It has two modes: interactive and batch.

...

It is called from the startup script on our Live CD. If you have installed netcardconfig-knoppix separately from our distro, it is possible you need to insert a call to the script in a system startup script. Our version uses arping to check the IP address.

netcamconfig

Run "netcamconfig" as user "root" to apply additional network settings and some kernel parameters.

This script adds aliases for network cards with the most popular LAN ip adresses, adds route records for multicast ip addresses and changes kernel parameters to prevent long i/o operations blocking the hard drive,

It is called from the startup script on our Live CD after netcardconfig. If you have installed elphel-pack separately from our distro, you possibly need to insert a call for the script in a system startup script.

camsearch

This shell script scans the LAN using broadcast ping and detects elphel cameras. It creates the file "cameras.html" in the current directory with links to found cameras and information about software versions. It is called from the system startup script after network configuration and can be restarted using the "Find cameras again" link on the KDE desktop.

flashit

This program uses Axis low-level Ethernet packets see "Theory" (some details do not apply to the camera) to communicate with a network bootloader hard-wired in the CPU internal ROM. This makes firmware upgrade a safe process - even if the process was interrupted and the camera was left in non-bootable state, it is always possible to start over again.

When the program is started without arguments (e.g. by just clicking the icon on the desktop) it offers a choice of images available on the DVD. You may also download flash image files (elphel3?3*-flash.tar.bz2) from the files section on Elphel project page at SourceForge.net, save them and use as an argument to flashit (i.e. drag-and-drop the file icon over flashit).

To use the flashit utility, the camera should be started in firmware updgrade mode - the green button on the back panel should be held pressed down when the power is applied to the camera. You may do this in any sequence - if the program was started first, you will see the program output messages immediately after the camera is started in this special mode. The flashing process takes several minutes - both LEDs on the network connector stay on until it is over.

sdp-helper

This script is designed for calling from a browser. It accepts a temporary "sdp" file downloaded from camera and calls mplayer to view the stream or mencoder to record it. On the CD it processes files with the mime type text/sdp. The script deletes the given temporary file.



Free Software and Open Hardware. Elphel, Inc., 2005