by makuab » Tue May 07, 2013 10:52 pm
Okay I think I got it working pretty well.
Credits to grayman4hire for some of it
Install
$this->bbcode_second_pass_code('', '
pacman -S motion x264 fswebcam
')
When using mkdir -p /var/run/motion the directory doesn't have proper rights and motion throws an error when you try to start it
$this->bbcode_second_pass_code('', '[0] Exit motion, cannot create process id file (pid file) /var/run/motion/motion.pid: Permission denied
')
And I couldn't get the rights to stick, every time I would reboot they would reset back to what they were.
to fix the error I edited a line in /etc/motion/motion.conf
Add a ";" before the second line in $this->bbcode_second_pass_code('', '# File to store the process ID, also called pid file. (default: not defined)
process_id_file /var/run/motion/motion.pid')
so it looks like $this->bbcode_second_pass_code('', '# File to store the process ID, also called pid file. (default: not defined)
;process_id_file /var/run/motion/motion.pid')
I then edited the height and width in /etc/motion/motion.conf with $this->bbcode_second_pass_code('', 'sed -i 's:width 320:width 640:' /etc/motion/motion.conf
sed -i 's:height 240:height 480:' /etc/motion/motion.conf')
and I ran $this->bbcode_second_pass_code('', 'fswebcam -r 320x240 -d /dev/video0 -v /dev/null')
I then made a directory for pictures and videos $this->bbcode_second_pass_code('', 'mkdir -p /home/cam1') and changed $this->bbcode_second_pass_code('', 'target_dir /usr/local/apache2/htdocs/cam1') in /etc/motion/motion.conf to my new directory
I didn't change the localhost in /etc/motion/motion.conf because I am accessing it through a SSH tunnel.
But if you want to access it without SSH you can use what grayman4hire shared $this->bbcode_second_pass_code('', 'sed -i 's:webcam_localhost on:webcam_localhost off:' /etc/motion/motion.conf')
and then use motion to start it and access it in your web browser with the ip and port.
you can also change the max fps that you will see in the stream by changing $this->bbcode_second_pass_code('', 'webcam_maxrate 1') in /etc/motion/motion.conf 1 being the fps you wish to see on the stream.
I think those are all of the steps I used. It stutters quite a bit when it detects motion because it saves images, so I would like to know how to solve that.