* PIL
* motion
* ffmpeg
- * v4l2-utils
+ * v4l-utils
On a debian-based system you could run:
- apt-get install python-tornado python-jinja2 python-imaging motion ffmpeg v4l2-utils
+ apt-get install python-tornado python-jinja2 python-imaging motion ffmpeg v4l-utils
## Browser Compatibility ##
MOTION_BIN=/usr/bin/motion
UV4L_BIN=/usr/bin/uv4l
JPEG_QUALITY=85
+ARGS="$*"
+
+function config_full_path() {
+ dir="$1"
+ read file
+ if [ "${file:0:1}" != "/" ]; then
+ file="$dir/$file"
+ fi
+ echo "$file"
+}
function list_config_files() {
prev_arg=""
if [ -r "$config_file" ];then
echo "$config_file"
- cat motion.conf | grep thread | cut -d ' ' -f 2
+ cat motion.conf | grep thread | cut -d ' ' -f 2 | config_full_path $(dirname "$config_file")
fi
}
w=$(cat "$file" | grep width | cut -d ' ' -f 2)
h=$(cat "$file" | grep height | cut -d ' ' -f 2)
if [ -n "$w" ] && [ -n "$h" ]; then
+ width=$w
+ height=$h
+
break
fi
done
# start motion binary with preloaded .so
export LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so
exec ${MOTION_BIN} $*
+
/* error and load handlers */
cameraImg.error(function () {
this.error = true;
+ this.loading = false;
+
cameraImg.addClass('error');
cameraImg.height(Math.round(cameraImg.width() * 0.75));
cameraPlaceholder.css('opacity', 1);
});
cameraImg.load(function () {
this.error = false;
+ this.loading = false;
+
cameraImg.removeClass('error');
cameraImg.css('height', '');
cameraPlaceholder.css('opacity', 0);
}
function refreshCameraFrame(cameraId, img, fast) {
+ if (img.loading) {
+ return; /* still loading the previous image */
+ }
+
var timestamp = new Date().getTime();
if (!fast) {
timestamp /= 500;
}
timestamp = Math.round(timestamp);
img.src = '/picture/' + cameraId + '/current/?_=' + timestamp;
+ img.loading = true;
}
var cameraFrames;