Info.txt	Source File		Tuesday 30th November 2010, 4:50pm.

Copyright 2010 George Smart, M1GEO <george.smart@ucl.ac.uk>

Written for the UNV Project, E&EE, University College London.

The program within this archive is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.

Based on
	http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html
	http://www.inb.uni-luebeck.de/~boehme/libavcodec_update.html
	http://www.ibm.com/developerworks/aix/library/au-unix-getopt.html

Libraries (all source files)
	avformat 
	avcodec
	avutil 
	avdevice 
	swscale

Compilation:
	This program needs to be compiled with C.  Although the final
	project will be written in C++, this code is not.  Obada Sawalha
	has managed to get this code to compile under C++ by editing the
	header files slightly, but it will be a later version where this
	is fully inclusive.  For now, use a C compiler, such as gcc.
	
	Compilation is done using the libraries above.  Use the following
	command:
	
	gcc -g -pg -Wall -std=gnu99 -lavformat -lavcodec -lavutil -lavdevice -lswscale -o "unv" "gs.c"
	
	This will give you 'unv'.  A binary program.  You can run this from
	your console by typing "./unv" at the prompt.  Help is available
	with "./unv --help".
	
Options
	As --help option shows, there are multiple options available.
	Usage:	"./unv [options]"
	
	SHORT				LONG							ACTION
	-----				----							------
	-h					--help							Prints this message
	-v					--verbose						Enable verbose output (also -vv for extra verboseness).
	(none)				--version						Print version information
	-f					--formats						Show supported codecs and drivers
	-s <n>				--save <n>						Save every <n>-th frame to disk
	-z <n>				--maxframes <n>					Stop after <n> frames
	-r <widthxheight>	--resolution <widthxheight>		Resolution of Webcam (V4L2 mode only)
	-m <mode>			--mode <mode>					Where <mode> is either:	
															FILE	Read file specified with -d option as video source
															V4L2	Open capture device specified by -d option (eg Webcam)
	-d <input path>		--device <input path>			Path to device (V4L2 mode) or file (FILE mode)
	-o <video path>		--video <input path>			Path of video to be output
	-p <port>			--port <port>					Where <port> is TCP port number
	
	Mode and Device options are mandatory.

Typical Usage
	Webcam to file, unlimited frames
		./unv -m v4l2 -d /dev/video0 -o webcam_output.mpg
	
	Webcam to TCP Port 9999, unlimited frames
		./unv -m v4l2 -d /dev/video0 -p 9999
		
	File to PPM images, 100 frames, save every tenth. (ensure frames/ folder exists or SIGSEGV)
		./unv -m file -d /path/to/video.avi -s 10 -z 100
	
	It is possible to combine these, and have writing to a file, saving images, and streaming to tcp ports.
	
End
	That's all, folks!
