Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
et:distancelab:wiredprogram [2015/03/26 10:48] heikopikneret:distancelab:wiredprogram [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 29: Line 29:
 Install the pre-requisites: Install the pre-requisites:
  
-$ sudo apt-get install g++ curl pkg-config libv4l-dev libjpeg-dev build-essential libssl-dev vim cmake imagemagick+  $ sudo apt-get install g++ curl pkg-config libv4l-dev libjpeg-dev build-essential libssl-dev vim cmake imagemagick
    
  
 Download mjpg-streamer Download mjpg-streamer
  
-$ wget https://github.com/shrkey/mjpg-streamer/raw/master/mjpg-streamer.tar.gz +  $ wget https://github.com/shrkey/mjpg-streamer/raw/master/mjpg-streamer.tar.gz 
-$ tar -xvf ./mjpg-streamer.tar.gz+  $ tar -xvf ./mjpg-streamer.tar.gz
    
  
 Compile the mjpg-streamer Compile the mjpg-streamer
  
-$ cd mjpg-streamer +  $ cd mjpg-streamer 
-$ make +  $ make 
-$ sudo make install+  $ sudo make install
    
  
 Run a test. Run a test.
  
-$ sudo ./mjpg_streamer -i “./input_uvc.so” -o “./output_http.so -w ./www”+  $ sudo ./mjpg_streamer -i “./input_uvc.so” -o “./output_http.so -w ./www”
  
 Seadista automaatne käivitumine Seadista automaatne käivitumine
Line 53: Line 53:
 Install the mjpg-streamer Install the mjpg-streamer
  
-$ sudo cp mjpg_streamer /usr/local/bin +  $ sudo cp mjpg_streamer /usr/local/bin 
-$ sudo cp output_http.so input_file.so /usr/local/lib/ +  $ sudo cp output_http.so input_file.so /usr/local/lib/ 
-$ sudo cp -R www /usr/local/www+  $ sudo cp -R www /usr/local/www
  
 If the MJPG-streamer needs to be started automatically at system startup, you can create the configuration file /etc/init/mjpg_streamer.conf for Upstart : If the MJPG-streamer needs to be started automatically at system startup, you can create the configuration file /etc/init/mjpg_streamer.conf for Upstart :
  
-description "MJPG-streamer /dev/video0" 
-start on runlevel [2345] 
-stop on runlevel [016] 
  
-script +  description "MJPG-streamer /dev/video0" 
-    export LD_LIBRARY_PATH=/usr/local/lib +  start on runlevel [2345] 
-    /usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so" -o "/usr/loca$ +  stop on runlevel [016] 
-end script+  script 
 +     /usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so" -o "/usr/local/lib/output_http.so -w /usr/local/www/www" >> /var/log/mjpg_streamer_upstart.log 2>&
 +  end script 
 + 
 +The script for starting a multiple cameras: 
 + 
 +  description "MJPG-streamer START" 
 +  start on runlevel [2345] 
 +  stop on runlevel [016] 
 +  script 
 +  /usr/local/bin/mjpg_streamer -b -i "/usr/local/lib/input_uvc.so -d /dev/video0 -r 1280x720" -o "/usr/local/lib/output_http.so -p 8080 -w /usr/local/www/www/" >> /var/log/mjpg_streamer_upstart.log 2>&1 
 +  /bin/sleep 5 
 +  /usr/local/bin/mjpg_streamer -b -i "/usr/local/lib/input_uvc.so -d /dev/video1 -r 1280x720" -o "/usr/local/lib/output_http.so -p 8081 -w /usr/local/www/www/" >> /var/log/mjpg_streamer_upstart.log 2>&
 +  /bin/sleep 5 
 +  /usr/local/bin/mjpg_streamer -b -i "/usr/local/lib/input_uvc.so -d /dev/video2 -r 1280x720" -o "/usr/local/lib/output_http.so -p 8082 -w /usr/local/www/www/" >> /var/log/mjpg_streamer_upstart.log 2>&
 +  /bin/sleep 5 
 +  /usr/local/bin/mjpg_streamer -b -i "/usr/local/lib/input_uvc.so -d /dev/video3 -r 1280x720" -o "/usr/local/lib/output_http.so -p 8083 -w /usr/local/www/www/" >> /var/log/mjpg_streamer_upstart.log 2>&
 +  /bin/sleep 5 
 +  end script 
 +   
 +The script must be executable: 
 + 
 +  sudo chmod u+x /etc/init/mjpg_streamer.conf   
 +   
 +===== Video streamer (Olemasolev süsteem) ===== 
 + 
 +Käivitusfail /etc/rc.local 
 + 
 +Faili sisu: 
 + 
 +  #!/bin/sh -e 
 +  # 
 +  # rc.local 
 +  # 
 +  # This script is executed at the end of each multiuser runlevel. 
 +  # Make sure that the script will "exit 0" on success or any other 
 +  # value on error. 
 +  # 
 +  # In order to enable or disable this script just change the execution 
 +  # bits. 
 +  # 
 +  # By default this script does nothing.   
 +  echo "scsi remove-single-device 2 0 0 0" > /proc/scsi/scsi  
 +  /sbin/rmmod uvcvideo 
 +  /sbin/modprobe uvcvideo 
 +  /bin/sleep 15 
 +  /usr/bin/mjpg_streamer -b -i "input_uvc.so -d /dev/video0 -y" -o "output_http.so -p 8090 -w /home/robot/mjpgs_compiled/mjpg-streamer-r63/www/"
 +  /bin/sleep 5 
 +  /usr/bin/mjpg_streamer -b -i "input_uvc.so -d /dev/video1 -y" -o "output_http.so -p 8091 -w /home/robot/mjpgs_compiled/mjpg-streamer-r63/www/"
 +  /bin/sleep 5 
 +  /usr/bin/mjpg_streamer -b -i "input_uvc.so -d /dev/video2 -y" -o "output_http.so -p 8092 -w /home/robot/mjpgs_compiled/mjpg-streamer-r63/www/"
 +  exit 0 
 + 
 + 
 +Faili sisu enne muutmist ja ilmselt veaga: 
 + 
 +  #!/bin/sh -e 
 +  # 
 +  # rc.local 
 +  # 
 +  # This script is executed at the end of each multiuser runlevel. 
 +  # Make sure that the script will "exit 0" on success or any other 
 +  # value on error. 
 +  # 
 +  # In order to enable or disable this script just change the execution 
 +  # bits. 
 +  # 
 +  # By default this script does nothing. 
 +  echo "scsi remove-single-device 2 0 0 0" > /proc/scsi/scsi  
 +  /sbin/rmmod uvcvideo 
 +  /sbin/modprobe uvcvideo 
 +  /bin/sleep 15 
 +  /usr/bin/mjpg_streamer -b -i "input_uvc.so -d /dev/video0 -y" -o "output_http.so -p 8090 -w /data/mjpg-streamer-r63/www/"
 +  /bin/sleep 5 
 +  /usr/bin/mjpg_streamer -b -i "input_uvc.so -d /dev/video1 -y" -o "output_http.so -p 8091 -w /data/mjpg-streamer-r63/www/"
 +  /bin/sleep 5 
 +  /usr/bin/mjpg_streamer -b -i "input_uvc.so -d /dev/video2 -y" -o "output_http.so -p 8092 -w /data/mjpg-streamer-r63/www/"
 +  exit 0 
 + 
 +   
 +=====   Võtmepaari genereerimine ===== 
 + 
 +Kui remote masinas pole enne tehtud, siis teha esmalt kataloog: 
 + 
 +  mkdir .ssh 
 + 
 +Kauglabori veebiserveris www-data kasutaja alt: 
 +  sudo -s 
 +  su www-data 
 +  bash 
 + 
 + 
 +(kui korra juba tehtud võib vahele jätta) 
 +  ssh-keygen -t rsa 
 +  cat ~/.ssh/id_rsa.pub | ssh [remote-kasutaja]@[remote-masin] "cat - >> ~/.ssh/authorized_keys" 
 +Kui key olemas, aga vana host, siis teha enne remove, nt: 
 +  ssh-keygen -f "/var/www/.ssh/known_hosts" -R usora-artica.noip.me 
 + 
 +Kontrollida, kas remote host õigused on paigas: 
 +Kataloogi õigus: 
 +  chmod 700 ~/.ssh 
 +faili õigus: 
 +  chmod 600 ~/.ssh/authorized_keys
  
  
et/distancelab/wiredprogram.1427366889.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0