Hikvision NVR getting pictures from archive by every 1 hour by 1 camera

Apr 21, 2023
2
1
Ukraine
Hello to everyone.
I trying to find solution for one no simple task. Need to do Snapshots of 40 cameras from 1 february until now for every1 hour from archive. Its should be like this: camera one - 1 feb 00.00 - 1 snapshot, camera on - 1 feb 01.00 snapshot, camera one - 1 feb 02.00 - 1 snapshot. How to get video stream from arhive i know, but how to get image from archive i dont know.
Any variants of this url " " already been tried, but with out resalt.

Maybe some one have some solution for this task
 
Withe the caveat that I have not tried this - but I've done the opposite, creating video from snaphots - maybe experiment with ffmpeg to do what you need.
It's a powerful tool with a large number of controls.
Example :
 
Maybe some one have some solution for this task
Out of curiosity I tried this, on a short video extract from an NVR, as opposed to on the NVR playback of recorded video.
The source video is 15 seconds duration, the extracted snapshots were 1 snapshot at 1.5 second intervals.
Commandline : ffmpeg -i video.mp4 -vf fps=1/1.5 %04d.jpeg
This could also be timed snapshots.

Code:
alastair@PC-I5 ~/cctv/other/tmp/snapshots $ ll
total 16548
drwxrwxr-x 2 alastair alastair     4096 Apr 21 16:47 ./
drwxrwxr-x 5 alastair alastair     4096 Apr 21 16:44 ../
-rw-rw-r-- 1 alastair alastair 16935056 Jul 25  2018 video.mp4
alastair@PC-I5 ~/cctv/other/tmp/snapshots $ mediainfo video.mp4
General
Complete name                            : video.mp4
Format                                   : MPEG-PS
File size                                : 16.2 MiB
Duration                                 : 15 s 179 ms
Overall bit rate                         : 8 926 kb/s
FileExtension_Invalid                    : mpeg mpg m2p vob vro pss evo

Video
ID                                       : 224 (0xE0)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Duration                                 : 15 s 179 ms
Width                                    : 2 048 pixels
Height                                   : 1 536 pixels
Display aspect ratio                     : 4:3
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Color range                              : Full
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 192 (0xC0)
Format                                   : MPEG Audio
Duration                                 : 15 s 127 ms
Compression mode                         : Lossy
Delay relative to video                  : -15 s 700 ms


alastair@PC-I5 ~/cctv/other/tmp/snapshots $ ffmpeg -i video.mp4 -vf fps=1/1.5 %04d.jpeg
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers

<snip>

Input #0, mpeg, from 'video.mp4':
  Duration: 00:00:30.88, start: 65400.009000, bitrate: 4387 kb/s
  Stream #0:0[0x1e0]: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 2048x1536, 90k tbr, 90k tbn
  Stream #0:1[0x1c0]: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
Output #0, image2, to '%04d.jpeg':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Video: mjpeg, yuvj420p(pc, bt709, progressive), 2048x1536, q=2-31, 200 kb/s, 0.67 fps, 0.67 tbn
    Metadata:
      encoder         : Lavc58.134.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=   10 fps=5.8 q=24.8 Lsize=N/A time=00:00:15.00 bitrate=N/A speed= 8.7x   
video:3643kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
alastair@PC-I5 ~/cctv/other/tmp/snapshots $ ll
total 20208
drwxrwxr-x 2 alastair alastair     4096 Apr 21 16:48 ./
drwxrwxr-x 5 alastair alastair     4096 Apr 21 16:44 ../
-rw-rw-r-- 1 alastair alastair   453904 Apr 21 16:48 0001.jpeg
-rw-rw-r-- 1 alastair alastair   509115 Apr 21 16:48 0002.jpeg
-rw-rw-r-- 1 alastair alastair   482292 Apr 21 16:48 0003.jpeg
-rw-rw-r-- 1 alastair alastair   430637 Apr 21 16:48 0004.jpeg
-rw-rw-r-- 1 alastair alastair   393174 Apr 21 16:48 0005.jpeg
-rw-rw-r-- 1 alastair alastair   339141 Apr 21 16:48 0006.jpeg
-rw-rw-r-- 1 alastair alastair   305092 Apr 21 16:48 0007.jpeg
-rw-rw-r-- 1 alastair alastair   272015 Apr 21 16:48 0008.jpeg
-rw-rw-r-- 1 alastair alastair   275369 Apr 21 16:48 0009.jpeg
-rw-rw-r-- 1 alastair alastair   269651 Apr 21 16:48 0010.jpeg
-rw-rw-r-- 1 alastair alastair 16935056 Jul 25  2018 video.mp4
alastair@PC-I5 ~/cctv/other/tmp/snapshots $

Video and sample snapshot attached.
 

Attachments

  • 0005.jpeg
    0005.jpeg
    384 KB · Views: 6
Thank you very much. It's really helped us. Few work examples on the below:
ffmpeg -i 'rtsp:/user:password@11.10.3.1:554/Streaming/tracks/101?starttime=20230401T102241Z' -frames:v 1 10.jpg --- some times image is broken
ffmpeg -rtsp_transport tcp -i 'rtsp:/user:password@11.10.3.1:554/Streaming/tracks/101?starttime=20230401T102241Z' -frames:v 1 -vf "select=eq(pict_type\,I)" -vsync vfr -q:v 2 20.jpg ----- image is good
 
  • Like
Reactions: alastairstevenson