Video recorder and streamer with wired IP camera via Wi-Fi

view/record what is viewed inside and/or around the RV at parking lot or while driving


Main components:
- IP-camera,
- a Wi-Fi router with a LAN port for the bridge, in this case TP-Link TL-WR841N (D) V. 10,
- the camper's NAS,
- the camper's router.

The IP camera has an image processor inside that does a lot of work with the data and then broadcasts the video over standard RTSP Protocol. As a result, the devices that receive this video may be without a powerful processor. To utilize this advantages, the settings (resolution, frame rate, etc.) of the camera and the streaming from it must be configured in the camera and must not be changed in the devices receiving this video. These parameters, as well as the IP address of the camera (it should be a single IP address in the camper’s local network), login and password, synchronization of the camera time with the computer, automatic restart, are easily set in the local network with ONVIF Device Manager.

Ideally, it should be wired connected the IP camera directly to the camper’s router (switch), if possible to organize wires inside the camper. If not - it's possible to transfer the stream from the IP camera via Wi-Fi (even if the camera does not have its own Wi-Fi module) and this case is described here. But one of the drawbacks of this case is that it is needed to reboot the camera router and then the camera itself, at any time, if the camper’s access point (router) reboots.

Streaming from the IP camera will be available on the camper's local network by IP. Video recording (archive) will be stored in the camper’s NAS and will also be available.

If the IP camera has no Wi-Fi on a board, then it needs a wireless Wi-Fi router with LAN port for wireless connection. In this case, the cheapest TP-Link TL-WR841N(D) v.10 router was utilized with flashed OS OpenWRT.

To configure the wireless bridge in TP-Link TL-WR841N (D), it was connected to a Windows PC via the RJ-45 patch cord. The PC has been with IP to the wired LAN. The web face of the TP-Link was on IP through the browser.

In some cases will need to switch off the PC firewall while this settings.


The OpenWRT core was flashed via the TP-Link TL-WR841N (D) web interface. After that the router TP-Link was on with login root and without password (or password 1234).


Then a new password for the administrator (root) was set.


Then in System.System menu the "Hostname" of the router was set (to "CA-Bridge" in this case), and "Sync with browser" next to "Local time" was clicked.


Then in System.Firmware menu the snapshot firmware OpenWRT was flashed.


Two relay packages should be installed for OpenWRT. It is easy to do with the help of WinSCP on PC. In WinSCP, a connection was established to the TP-Link router via SCP protocol by host name (IP), port 22, root username and password.


One (relayd) package and the other (luci-proto-relay) were copied via WinSCP to the /tmp router folder.

The "opkg update" command can be used via PuTTY on the router to determine the actual directories and file names of these packages on the Internet.


The "relayed" package was installed first on the System.Software web interface of the router. The path to the package file must be entered manually full using /tmp. Like this example: /tmp/relayd_2016-02-07-ad0b25ad-2_mips_24kc.ipk


The "luci-proto-relay" package was installed second on the System.Software web interface of the router. The path to the package file must be entered manually full using /tmp. Like this example: /tmp/luci-proto-relay_git-18.320.63580-3787301-1_all.ipk


Both of these packages files have been removed from the /tmp folder of the router because the router does not have so much memory.


In the Network.Wireless menu was pressed the "Edit" button next to the "OpenWRT" wireless controller.


Then it changed "ESSID" to "CA-Bridge", "Channel" to auto, "Network" to "lan". On the "Wireless Security" tab, was selected WPA2-PSK and installed Key. Then "Enable wireless network", "Save and apply".


Then in the Network.Wireless menu was clicked "Scan" next to the icon "radio0".


Then "Join network" next to the camper's wireless AP (in this case "CA-APR"). Then was set the password WPA for camper's wireless AP, inner OpenWRT name (in this case "wwan") and was selected "lan" in the field "Create/assign firewall zone", then was click on "Submit".


In the next tab were changed "Channel" to "auto", "ESSID" to "CA-APR", "BSSID" to blancked, "Network" to "lan" and to "wwan". Then "Save and apply".


(optional) In Network.Interfaces menu, was selected "LAN", and in opened tab were added custom DNS servers,,,
Then "Save and apply".


In the Network.Interfaces menu, was selected "Add new interface".


Then was set the name of the new inner OpenWRT interface (in this case "ca_ap_bridge"), was selected the "Relay bridge" protocol, then was "Submit".


Then were clicked both "lan" and "wwan" in the "Relay between networks", and then with "local IP" blank was "Save & Apply".


In the Network.Firewall menu was clicked "Add" for the new firewall zone.


In next tab were changed "Name" to "brgzone", "Forward" to "accept", "Masquerading" to On, "MSS clamping" to On, "Covered networks" to "ca_ap_bridge" and to "lan" and to "wwan", then "Save & Apply".

The TP-Link TL-WR841N (D) was powered off, disconnected to the PC used for installation, then the IP camera was connected to the LAN port of TP-Link TL-WR841N (D) and there was power on both devices.

All next settings were made via Windows PC. In some cases will need to switch off the PC firewall while settings.

From the PC was login as root in the camper’s NAS via PuTTY by NAS IP over port 22. Then was command:

nano /etc/exports

In the opened file, the full path of access to the camper's NAS shared folder (in this case, CA-NAS-shfld) from any NFS client within the camper's network was found. In this case, it was /export/CA-NAS-shfld.

In the camper's NAS shared folder, it was necessary to make a folder to archive video from the USB camera. Here the camera/folder name was outer_cam_01:


mkdir /export/CA-NAS-shfld/outer_cam_01

Then the FFmpeg package was installed within the camper's NAS computer:

apt-get install ffmpeg

Whereas in this case:

- camera IP,

- the user name of camera is admin without a password,

- the frame rate of RTSP streaming from the camera is 17 (the best choice is not to change the frame rate further as the camera resolution),

- the duration of the video for recording - 2 minutes,

commands were entered from PC via PuTTY terminal:

crontab -e

# in this case, "Joe's Own Editor" was opened

# the following line gives the command every 2 minutes to record 118 seconds of the stream from the camera to a file with the current date and time in name

*/2 * * * * ffmpeg -i rtsp:// -r 17 -t 118 -vcodec copy /media/58DA9B27DA9B0084/CA-NAS-shfld/outer_cam_01/`date +\%Y\%m\%d\%H\%M\%S`.avi > /dev/null 2>&1

# the following line gives the command every 6 minutes to delete the oldest files in the folder when the folder size exceeds 20000 MB

*/6 * * * * while [ $(du -sm /media/58DA9B27DA9B0084/CA-NAS-shfld/outer_cam_01 | cut -f1) -gt 20000 ]; do rm -f /media/58DA9B27DA9B0084/CA-NAS-shfld/outer_cam_01/"$(ls -1c /media/58DA9B27DA9B0084/CA-NAS-shfld/outer_cam_01/ | tail -n1)";done > /dev/null 2>&1

# and at least one empty line should be at the end of the file!

Ctrl+K, Ctrl+X

From this point, the streaming from the camera can be opened, for example, in VLC player by URL: rtsp://

The camera archive is located in the camper's local network /CA-NAS/CA-NAS-shfld/outer_cam_01/, has up to 20,000 MB of archives for 2 minutes, each of which has the date and time of the recording.

A software you can load from this site is free for a non-commercial use except for components for which their owners declared their own rights. Can be limited by local laws. No of your data will be collected with a software you can load from this site.

Subscribe for updates.

Mobirise free maker - Try it