Download recording with API

Have some questions or having issues with your DVR/NVR(s), Post them here for the mods and other users to assist you with.
Post Reply
mrchocoborider
Posts: 3
Joined: Tue Jun 27, 2023 4:36 pm

Download recording with API

Post by mrchocoborider »

I've already written Amcrest support about this but I was curious if anyone else has run into this issue.

I have a situation where I frequently want to download recordings programmatically via the API using start and end times.

I have a NV4416E-AI NVR and this works beautifully, never have any issues.

I have several NV4108E-A2 NVRS and they pretty much all have the problem of being very inconsistent with this. About 60-70% of the time it works, but the rest of the time I either get a clip that is not the times I asked for, offset by a couple minutes on both ends, or I get a read timeout error because the connection was closed at 0 bytes.

I also tried downloading files by filename, but I got the read timeout error literally every time I tried.

Has anyone else encountered this?
User avatar
Revo2Maxx
Site Admin
Posts: 5906
Joined: Sat Jun 15, 2019 3:05 pm

Re: Download recording with API

Post by Revo2Maxx »

Not sure if you are talking about using a command like this or if you are using something else. However to be honest I have not tried it on my A2 NVR's and up to now only used it on my 4216E-AI NVR. Don't like that they save as a CGI file. Anyway I use it to pull footage from my NVR on my Sub Channel.
http: //10.0.0.223/cgi-bin/loadfile.cgi?action=startLoad&channel=1&startTime=2024-1-25%2013:00:01&endTime=2024-1-25%2014:00:01&subtype=1

I did just setup my A2 to record full time on one of my cameras. Up to this point it was only setup to send Emails and record IVS events for my AI cameras. I will try to dL from my A2 in a couple of hours after some footage records. IF that isn't the command you are using it would be helpful to know what one I should try to see if there is anything of the same. Again mine is for Sub Channel so might be different because it is lower Encoded Video..

1 Last thing, Are your cameras in H.265 or H.264H? It might have something to do with that as well? Not sure to be honest I have not had an issue
Be Safe.
mrchocoborider
Posts: 3
Joined: Tue Jun 27, 2023 4:36 pm

Re: Download recording with API

Post by mrchocoborider »

Thanks for your response Revo, yes I'm using a very similar command, but pulling from the main channel (default subtype).

This is the command I use (I also use the Python requests library but that's a bit more involved), this will output it as a .dav and not a cgifile. Then you can convert to .mp4 using VLC.

wget --user=admin --password=<password> --read-timeout=20 'http://<ip address>/cgi-bin/loadfile.cgi?action=startLoad&channel=3&startTime=2024-01-15%2013:59:59&endTime=2024-01-15%2014:05:01' -O output.dav

This works about 70% of the time on the A2, but for my purposes it needs to be 100% consistent. The failure is usually an incomplete read error / the download will stop at 0 bytes. Occasionally it will download successfully but the times will be way off (+- several minutes).

This works 100% on the NV4416E-AI as I mentioned.

We got a NV5208E recently to test a newer 8 channel POE model and so far that is working consistently.

Cameras are all in H.264, both on the working NVRs (4416, 5208) and the non-working (4108E-A2). I have a suspicion that it is related to the older ONVIF server version on the 4108E-A2, I will ask Amcrest support if there is any way to upgrade that.
User avatar
Revo2Maxx
Site Admin
Posts: 5906
Joined: Sat Jun 15, 2019 3:05 pm

Re: Download recording with API

Post by Revo2Maxx »

So tested your string and it don't want to work with my normal password on my A2. Even going as far as adding in the single and double quotes to parse out my special CHAR.. So I made a different admin account and adding in the same line this time with new user name and password with just letters and numbers I was able to DL from my A2.. Might be worth a try
Be Safe.
Post Reply