Configuring video recording to an FTP server from IP cameras and Dahua DVRs

I recently configured the next IP camera Dahua DH-IPC-HFW1320SP-W and decided to use an FTP server for recording.
Since the menu is basically the same on Dahua cameras and DVRs, the FTP entry is configured the same way.

Open the device interface, for example by typing an IP address in the browser.
Open the “Setting” tab, then “Storage” – “Destination”, in the “Path” tab, where “Motion Detection” and “Alarm”, I marked the FTP checkboxes, by the way I could choose only one thing, or “Local ( write to a memory card or HDD) “,” FTP “or” NAS “. After the selection, click “Save” to save the changes.

Now go to the tab “FTP”, tick the “Enable” and specify the connection parameters in “Server Address”, “Username”, “Password” and press “Save” to save the changes.

After that, the device began to write video to the FTP server in mp4 format, however it was impossible to view the history entries via the mobile application and the camera interface.
Files on FTP are sorted into folders by date and time, as a variant of the video can be viewed through any FTP client from a computer or phone, if the camera writes for motion detection, accordingly if there is no motion detection, then there will be no folders and records.

Required! In the “Storage” – “Record Control” menu, you need to select “Stop” in “Disk Full”, if “Overwrite” is selected, then after restarting the camera, in my case, all records from the FTP server were deleted.

If the FTP server is running on Linux, you can, for example, add to Cron a command that will delete the directory older than 30 days so that the disk does not overflow:

find /srv/ftp/ipcam/SNCAM/ -type d -mtime +30 -exec rm -rfv {} \; >> /srv/ftp/ipcam/remove.log

See also my articles:
Using and configuring CRON
Programs for viewing video from DVR DVRs
Installing and Configuring ProFTPd in Ubuntu
Installing and Configuring Pure-FTPd in Ubuntu
Configuring an FTP server on Windows Server 2008 R2
Configuring an FTP server on MikroTik Router OS

Firmware Update Dahua IPC-HFW1320S-W

For the test, I will update the firmware on the IP camera Dahua IPC-HFW1320S-W.

Let’s see what firmware is installed, open the web interface of the device, select the “Setting” tab, on the left the “Information” – “Version” menu.

In my case, the Russian version of the firmware was installed:

System Version 2.400.0001.11.R, Build Date: 2017-04-01
WEB Version
ONVIF Version 2.42

Let’s see a new firmware on the official site and download it

The firmware file is usually in the archive, so unpack it.

In the web interface of the device, open the “Setting” tab, on the left in the “System” menu – “Upgrade”.
Press the “Browse…” button, select the file of the new firmware unpacked from the archive and press the “Upgrade” button to start the update process, which will last about 5 minutes, at this time you can not turn off the power of the device.

I was flashing with the English firmware, after the firmware in the “Information” – “Version” menu, the following was displayed:

System Version 2.400.0000000.16.R, Build Date: 2017-08-31
WEB Version
ONVIF Version 16.12(V2.3.1.458331)