Anyone got Dahua camera to record to NFS share??

fixingstill

Young grasshopper
Apr 9, 2016
34
5
I played with my Dahua camera a bit this weekend. I also have a Hikvision camera, synology DS1815+, and a Windows server 2012R2.
I have my Hikvision camera set to record videos to my NFS share on my Windows 2012R2 server. It works perfectly. And I use iVMS to playback and view multiple Hikvision cameras.
Dahua cameras is supposed to work the same way.
However, I can't get the Dahua camera to record. After you enter the NAS (they should have called it NFS) server ip and the share, unlike Hikvision that you can then test and "format" the share, you can't tell if the Dahua camera sees the share.
I am deciding to use Hikvision or Dahua. It seems like Hikvision is doing better recording to NFS.
BTW, I prefer not to use FTP because I read that you can't recycle the storage. With FTP, recording will stop when share is full unless you use some sort of script to clean up the old files.

I understand one NFS share is meant for one camera and the size is supposed to be "not changing" so I created one partition on the hdd for one share and one camera only.

Anyone got Dahua camera to record to NFS share?? Can you please share how you do it?
Anyone got NFS sharing working on DD-WRT router using USB 3.0 port?

This doesn't help much:
https://dahuawiki.com/NASRecord

2016-07-11 11_05_10-Setup.jpg

2016-07-11 11_04_52-Setup.jpg


 
Hmmmm. I actually had it enabled. It did not work and I was just playing with the setting.
Anyone actually got Dahua saving videos to NFS working?
 
I tried to do this too, but unfortunately without success. Eventually I used SmartPSS which basically does the same thing imo (record on schedule to a specific partition). Or am i wrong and is there some kind of advantage of NFS recording over SmartPSS?

I'm curious though if you can accomplish the NFS recording (the info should be a sticky if you succeed).

Here are some resources I assembled:
https://www.ipcamtalk.com/showthrea...or-Camera-Events?p=37379&viewfull=1#post37379
https://dahuawiki.com/NASRecord
https://support.microsoft.com/en-us/kb/324089
 
Last edited by a moderator:
Randyth, you keep your SmartPSS constantly running on a PC taking up CPU power? That would also use full bandwidth to pull videos from your cameras 24x7 to analysize the motion. I think if the cameras have the power to do the video detection and record directly to a NAS NFS share, why not let them do the job.
Last night I got it working to a Windows NFS 100GB share finally recording constantly. Now I need to see if I can get the motion detect to work. Then I want to see if I can create a working NFS share on a DD-WRT router, and then on a Windows 10 NFS share using WinNFSd and HaneWin.
 
your better off using FTP, its simpler and less overhead.. you just need a local script that runs every day and deletes old files so it dont fill up the drive... NAS storage has yet to be proven reliable, I went over a year recording to FTP and it never failed.. search and you'll find ton of headaches from Hikvision NAS storage.
 
Last edited by a moderator:
Randyth, you keep your SmartPSS constantly running on a PC taking up CPU power? That would also use full bandwidth to pull videos from your cameras 24x7 to analysize the motion. I think if the cameras have the power to do the video detection and record directly to a NAS NFS share, why not let them do the job.
Last night I got it working to a Windows NFS 100GB share finally recording constantly. Now I need to see if I can get the motion detect to work. Then I want to see if I can create a working NFS share on a DD-WRT router, and then on a Windows 10 NFS share using WinNFSd and HaneWin.

I don't have SmartPSS running constantly. However I do have PC-NVR running as a background process (I only use SmartPSS to configure the PC-NVR/Cameras and for local playback. I use gDmss for mobile playback of the recordings). I'm using 24/7 recording without motion (as of yet) so the PC-NVR process has no noticeable CPU usage. My server is connected to the same poe-switch as my camera's so bandwidth usage is also not noticeable on the main network (no traffic is going through the main router).

I plan on adding recording on motion though (to complement the 24/7 recording), but through FTP (NFS seemed too difficult).

How did you get it working with Windows NFS share? Which windows application did you use as NFS server?

When I didn't have my server yet installed, I used asuswrt to run a ftp server and store snapshots on motion (on a connected usb stick). This did work as a temporary transition-solution. But I quickly found out that software motion isn't a reliable solution (too many false detections). So I installed a dekstop server to hold the 24/7 recorded videos. I want to use the motions now to quickly review the highlights of the day and the 24/7 recordings to see the details incase of an event/emergency.
 
Last edited by a moderator:
I am using an NFS share on a linux server to let the camera record onto it, by doing this I can also use the playback feature in SmartPSS to watch the recorded footage.
That is not possible by using FTP on the cameras.

I couldn't get the PC-NAS from SmartPSS working, the application is running but when I go to the PC-NVR tab of SmartPSS everything is greyed out, even the power button on the top right. There is also no IP etc. in the labels.
I have added the PC-NVR to the devices section, which also reports it as online.

By using PC-NVR you need to do video analyzation on the computer instead of the camera? I guess that's not gonna work out for me anyways, gonna run it on some old dual core.
 
I am using an NFS share on a linux server to let the camera record onto it, by doing this I can also use the playback feature in SmartPSS to watch the recorded footage.
That is not possible by using FTP on the cameras.

I couldn't get the PC-NAS from SmartPSS working, the application is running but when I go to the PC-NVR tab of SmartPSS everything is greyed out, even the power button on the top right. There is also no IP etc. in the labels.
I have added the PC-NVR to the devices section, which also reports it as online.

By using PC-NVR you need to do video analyzation on the computer instead of the camera? I guess that's not gonna work out for me anyways, gonna run it on some old dual core.

Mayby you have installed a version of smartpss without pc-nvr?
Try again with the latest version (choose custom to see in pc-nvr is checked to install).
I never knew it was possible to playback NFS recordings in SmartPSS.
 
Ok. so far I got pass the NFS recording....

Here is my scenario:
I have four Dahua IPC-HDBW2300R-Z and one synology DS215J at home. Synology has 1TB and its NFS is enabled, along with quota, permission stuff. All four cameras created folders in each of their own shares so it is recording. Locally a PC running Smart PSS (both the English and the international versions.) can liveview and playback.
Now I have the router open forwarding all set. Incoming traffic to port 37771 forwarded to port 37777 at the 1st camera, port 37772 forwarded to port 37777 at the 2nd camera, port, etc.
In the office, when I tried to use smart pss to remotely connect to all four cameras, I see all four online and I can liveview them but when I tried to playback, it will give me error message....

Can your Smart PSS remotely playback your cameras that record to their local NFS?

2016-07-26 17_11_27-SYNOLOGY - Synology DiskStation.jpg 2016-07-26 17_17_03-.jpg 2016-07-26 17_17_12-.jpg

2016-07-26 17_17_27-Setup.jpg 2016-07-26 17_18_14-Setup.jpg 2016-07-26 17_18_36-.jpg

2016-07-26 17_25_00-.jpg
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
  • Like
Reactions: Clipper
You should check what it's trying to access with Wireshark, at home and at work.
Though it'd be better if you set up a VPN on your home network so you can access them over that securely.

I don't have my camera at hand, I'll check it out later with Wireshark, I'm also interested whether it's accessing the NFS share directly or through the cameras.
 
Hi, is it possible to record video and audio over nfs or ftp using audio enabled cameras?

I just got a HDW5231R-Z from Andy, it records video and audio on sd card but video only over nfs (I didn't try ftp yet)

Also, it seems there's no way to change the folder structure from the menu? If not I will try to do that modifyng cam235's script.

Thanks
 
Correction: looking into idx files I found out this:

Event={"Action":"Start","Index":1,"Name":"AudioMutation"}
EncodeFormat={"Audio":{"Bitrate":64,"Channels":[0],"Compression":"G.711A","Depth":16,"Frequency":16000,"Mode":0,"Pack":"DHAV"},"AudioEnable":t
rue,"Video":{"BitRate":1792,"BitRateControl":"CBR","Compression":"H.264","CustomResolutionName":"1080P","FPS":25,"GOP":50,"Height":1080,"Pack"
:"DHAV","Priority":0,"Profile":"High","Quality":4,"QualityRange":6,"SVCTLayer":1,"Width":1920},"VideoEnable":true}

So there must be audio in the files, but mkvmerge won't detect it.
I also noticed mkvmerge sometime fails to convert the dav files or they get trunkated.
 
Hello
Can you tell me please how did you made Smart PSS to playback from NAS ?
It tells me ‘Channel IPC has no record !’
Thank you
 
Hi guys,
seem like i have added NFS mapping on the IP camera but its not connecting to shared drive on my ubuntu server.

could someone share with me their settings to enable NFS please ?

I have done this on the camera but its not creating any files on the network... i think i did something wrong... please someone share their settings ??
 

Attachments

  • Capture.JPG
    Capture.JPG
    19 KB · Views: 0
I have had no problem getting a cam on dahua firmware to write to an NFS server; however, I have not quite figured out the correct UID/GID to use so the cameras can delete from their NFS share. Still testing away, but the latter does effectively have to do with what the client (ie- the camera) is using for a UID/GID (whether you use those, or turn off id mapping -- accounts have to exist across client/server for the deletes to work), and since you don't have a lot of control over the cam's NFS client settings, this leaves you with getting your NFS server's settings spot on so a client cam can read/write/delete files/folders. Not a systems administrator or IT professional, then go learn up on NFS and how it works if you have little experience with it. Not sure many pro's are just gonna teach you for nothing.

Your mount should very least be owned by who is/will be exporting via NFS. That user also needs to be present on the client(s), otherwise, probably will be able to read and write to the NFS export, but not delete anything. Turning idmapping off can make this so it is based on username and group not UID/GID, and the user/group has to exist across client/server but the UID/GID does not have to match.

With out of box settings on most distros though that won't be the case, and a simple sort of working config that can do a basic write will look something like this in /etc/exports if we assume default ownership of nobody:nogroup

/mnt/2TB/nfs *(rw,sync,no_subtree_check) -- * is for any IP, use that for starters so any client can connect. The server must reachable from the camera. You should be able to tell if your server has any connected clients. It will probably write just fine, but your camera won't delete anything off the share if you set it to do so. Defaults are nobody:nogroup. No delete permission, most likely because UID/GID being used isn't present on the client cam, or missing a crucial NFS flag -- anonuid/anongid, hence the sort of working.

When you get to half-way there, you can try getting further with options like all_squash and the anonuid stuff, which attempt to help nfs not care so much about UID/GID and use a common account, so you have something a bit more like this...assuming the first user account on the camera might be UID/GID 1000 like most linux distros...but not entirely knowing for sure (because I am too lazy to deal with wireshark dumps right now to see what a client is using for NFS connect, it's the system user, but we don't know the uid/gid of that user)....so I just created a 'system' user on my server with UID/GID 1001, with no sudo, shell, or home directory, and purely for NFS use.

/mnt/2TB/nfs *(rw,sync,no_subtree_check,all_squash,anonuid=1001,anongid=1001) -- nfs folder should be owned by 1001:1001, ideally 1001 is present across clients and server but doesn't have to be, just server side -- then we should be able to auto manage storage and delete some files as that server user, and irregardless of user on the client desiring writing and deleting from the share. That's why people will pay for a web ui based NAS product. You really got to understand NFS well if your not going to use a polished NAS product, where getting settings correct is a little more boob proof and better documented. Otherwise, testing will/would be hard unless you got other NFS clients (not cameras) to test how the NFS share behaves on a client that may or may not have the same account UID/GID present and matched to that on the server.

Cheers.

*after much fiddling and a bit more research (thanks Redhat), the very first option appears it should work if you know or figure out actual UID/GID for system user dahua is using to connect, and it will preserve ownership of user group that creates on the share and allow any user to create and delete what they own without much fuss as long as the UID/GID exist on the server, UID/GID doesn't exist on the server, the files will be nobody nogroup and you can't delete them. If you intend to use NFS4, your NFS domain has to be set too. Set Domain = <ip address of server> in /etc/idmapd.conf on your server if you don't have working local DNS. The default on debian is localdomain but commented. Generally domain on client/server should match, and appears they do if you use server ip for your domain with a Dahua type camera.
**my recommended config is now the second option above, and any user can create/delete off it. Create a new user (preferably with no sudo or shell access, don't use root -- it's lazy and bad practice) on your server -- first user/group is 1000 on debian, so this is a second user I just called 'system' since apparently the text name of the dahua client account is system, but I do not know it's numerical UID/GID to try to match it without packet sniffing. With sudo or as root on the server, create a directory you intend to export and give ownership to that user 'system'. If you want NFS4 support, set the domain to the IP address as mentioned above. Result... any user trying to access the share creates and can delete files/folders that get written as user/group system:system (1001:1001 UID/GID). If you are a client and that system account doesn't exist locally, you will see ownership of 1001:1001 from the client side, but you can and will be able to write and delete as 1001:1001 irregardless of user you are on the client side. If you have your camera set to auto-manage files on storage, and the firmware you are on doesn't have a weird bug, the camera should be able to delete files x days old, and you shouldn't need to manually delete or manage them from elsewhere or as root on the server or client. Side note: Vendor supplied software does not appear to support dav playback from NAS, only local storage -- it can see dav files and find them in search, but can't do anything with them, and I think that has to do with all the accounts used on Dahua products or compatible to talk to NVRs and the like. Since that is the case, I use mplayer to review the raw dav files directly from the NFS share if I know I got an alert and/or motion detect and captured footage. If I need to convert anything to mp4 etc for sharing, I just use Dahua's software converter tool, which much quicker than ffmpeg, and can do batch processing.
 
Last edited: