Webcam video surveillance via mjpg-streamer Optware

If you own a webcam from this list than you can attach it to one of routers usb port and see in real time images from it, like babyroom, garage, courtyard...

This version is for mipsel devices like RT-N16, RT-N66U, RT-AC66U...

We need an usb-flash formatted EXT2 or an usb-hdd formated EXT3, will not work on FAT32 or NTFS.
1 - Install Optware from here

2 - Download and install Mjpg-Streamer

ipkg update && ipkg upgrade
wget -c -O /tmp/mjpg-streamer_r63-2_mipsel.ipk http://goo.gl/FPkhES
ipkg install /tmp/mjpg-streamer_r63-2_mipsel.ipk
rm /opt/etc/init.d/K99webcam
wget -c -O /opt/etc/init.d/S99webcam http://goo.gl/rdHeDe
chmod 755 /opt/etc/init.d/S99webcam

3 - Download and load UVC modules (if modules not working you must to compile them for your firmware)

wget -c -O /opt/tmp/uvc_modules_2.6.22.19-378.50b2-mipsel.tar http://goo.gl/goAIjc
cd /
tar -zxf /opt/tmp/uvc_modules_2.6.22.19-378.50b2-mipsel.tar
wget -c -O /opt/etc/webcam/videomod.sh http://goo.gl/tD4Q1p
chmod a+rx /opt/etc/webcam/videomod.sh
/opt/etc/webcam/videomod.sh load
/opt/etc/init.d/S99webcam start

4 - Go to web browser and type: 192.168.1.1:9999/stream_simple.html default username admin and password admin

You can change username, password, resolution, fps...

ipkg install nano
/opt/etc/init.d/S99webcam stop
nano /opt/etc/init.d/S99webcam

Find this two lines and replace with desired login
mjpg-pass
• Save with CTRL-O / Enter / and exit with CTRL-X

5  - To start mjpg-streamer automatically on every router reboot we have to create S99webcam script

nano /jffs/scripts/post-mount

Add this lines

#!/bin/sh
/opt/etc/init.d/S99webcam start

• Save with CTRL-O / Enter / and exit with CTRL-X

chmod a+rx /jffs/scripts/post-mount

6 - If you want to access the webcam from wan, we have to create another script that open the port 9999

nano /jffs/scripts/firewall-start

Add this lines

#!/bin/sh
iptables -I INPUT -p tcp --destination-port 9999 -j ACCEPT

• Save with CTRL-O / Enter / and exit with CTRL-X

chmod a+rx /jffs/scripts/firewall-start

7 - Start mjpg server

/opt/etc/init.d/S99webcam start

8 - Now type your_wan_ip adress:9999/stream_simple.html in browser and should see your webcam
If you have dynamic ip, better set a dynamic dns 192.168.1.1/Advanced_ASUSDDNS_Content.asp

Tested successfully with Logitech C270 webcam
c270

Video HERE...
youtube

  • Max380

    Not working
    /mjpg_streamer: can't resolve symbol '_dl_map_cache'

    • TeHashX

      Which router, firmware?
      Try to load modules multiple times
      /opt/etc/webcam/videomod.sh load

      • Max380

        Firmware:380.58 Asus merlin

        /opt/etc/webcam/videomod.sh load

        Yes loading

      • Max380

        Sorry for my english , I'm from Russia

    • Max380

      When you start , not what happens

      Apr 21 23:28:46 kernel: usb 1-1.1: new high speed USB device using ehci_hcd and address 8
      Apr 21 23:28:46 kernel: usb 1-1.1: configuration #1 chosen from 1 choice
      Apr 21 23:28:46 kernel: uvcvideo: Found UVC 1.00 device A4 TECH USB2.0 PC Camera E (0ac8:3450)
      Apr 21 23:28:46 kernel: input: A4 TECH USB2.0 PC Camera E as /class/input/input3
      Apr 21 23:29:32 MJPG-streamer [2671]: starting application
      Apr 21 23:29:32 MJPG-streamer [2671]: MJPG Streamer Version.: 2.0
      Apr 21 23:30:08 MJPG-streamer [2680]: starting application
      Apr 21 23:30:08 MJPG-streamer [2680]: enabling daemon mode
      Apr 21 23:30:08 MJPG-streamer [2682]: MJPG Streamer Version.: 2.0
      Apr 21 23:30:43 MJPG-streamer [2694]: starting application
      Apr 21 23:30:43 MJPG-streamer [2694]: enabling daemon mode
      Apr 21 23:30:43 MJPG-streamer [2696]: MJPG Streamer Version.: 2.0
      Apr 21 23:30:46 MJPG-streamer [2707]: starting application
      Apr 21 23:30:46 MJPG-streamer [2707]: enabling daemon mode

  • DarkHorizon

    Hi TeHashX, I thoroughly enjoy your posts and all the work you do!

    I know I am late to the party, but is there anywhere I can find compatible S99webcam build for RT-N66R, running firmware 3.0.0.4.378_9313-g53ab20f?

    Any help or clues would be greatly appreciated, thank you!

    DarkHorizon

  • Lockon

    Installed in RT-N16, using Logitech C160; works great. Edited config to increase resolution to supported one (640x480) - works OK. Router CPU is offloaded / cold. Tried increasing FPS rate from 5 to 25, but no go; best achieved is 12, anything above that will invoke stream tearing. According to online posts, it has to do with 'auto-exposure' feature of webcam (device decrease FPS rate as it increase exposure time, specifically for scenes in less lighting) which is set on as default. Next step should include a kind a support for UVCDYNCTRL in command line so webcam can be fine tuned.

  • Evgeniy

    Hi. I tried connect my logitec c310 to Dlink 620 with tomato by shibby. When i did it a few month ago it worked, i did it on old tutorial. I reset settings router, but when i tried to set on new firmware i have problem, Starting mjpg_streamer . [ OK ], but then it crashes

  • Axel_Alt

    Please make an "how to" for ac68u

    • Could be possible from chrooted debian

  • Pasquale Cardillo Giuliano

    is perfect with merlin 376.48_beta3 and rt-n66u.. (PaxSat)

  • Please share feedback if you managed or not to install mjpg-streamer, thanks

    • Sergei

      cannot install mjpg-streamer on AC68U . It fails with the following error:

      admin@RT-AC68U:/tmp/home/root# ipkg install /tmp/mjpg-streamer_r63-2_mipsel.ipk
      Clearing state_want and state_flag for pkg=mjpg-streamer (arch_priority=0 flag=16 want=2)
      Nothing to be done
      An error ocurred, return value: 4.
      Collected errors:
      Cannot find package mjpg-streamer.
      Check the spelling or perhaps run 'ipkg update'

      I did run ipkg update and ipkg upgrade before running install command

      Any ideas? :(

      Thx!

      • It's written in red, only for mipsel devices!!!
        I don't have uvc modules for arm, sorry.

SoftEther VPN Running on AsusWRT Routers
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Nginx Web Server with PHP Support through Optware-NG
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Spreed WebRTC server and web client
Asterisk VoIP Server running on AsusWRT Routers
SoftEther VPN Running on AsusWRT Routers
NZBGet through Entware
Minidlna UPnP Media Server through Debian Jessie Arm
NetData System Monitor Entware

SUBSCRIBE

To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...