Video storage method based on face recognition
Through the video storage method based on face recognition, the video clips related to the face recognition event are identified and saved, which solves the problem of waste of storage resources and inconvenient search in the hard disk video recorder in the face recognition scenario, and achieves efficient video storage and management.
Patent Information
- Application Number
- CN202310166930.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
When combined with face recognition, existing hard disk video recorders are unable to accurately store and quickly find specific video clips, resulting in a waste of storage resources and inconvenience in information retrieval.
Adopt a video storage method based on face recognition, by establishing a face photo base, combining IPC cameras and face recognition algorithms to identify and save specific video streams, retaining only the 10 seconds of video related to the recognition event, and using the streaming media server Use RTSP protocol to save short-term videos, and display identification records and videos through the business server.
It effectively reduces the amount of video storage, improves the convenience of video search and management flexibility, is suitable for monitoring scenarios with low human traffic, and supports scheduled tasks to delete old records.
Smart Images

Figure CN118555356A
Abstract
Description
Technical Field
[0001] The present invention relates to a video storage method, and more specifically, to a video storage method based on face recognition, belonging to the field of video storage. Background Art
[0002] At present, the most commonly used video storage technology is to use hard disk recorders for storage. Hard disk recorders can be set to record 24*7 non-stop, and can also set time periods to store videos. However, when combined with face recognition, it is not possible to record based on the person recognized; face recognition identifies people through cameras, and currently only provides snapshots of the time when recognition is performed. In some special occasions, it is necessary to save videos of these recognized people. If the function of a hard disk recorder is used, only all or part of the video can be saved. In this case, the disadvantages are: a large amount of storage resources is required, and it is inconvenient to find a certain video clip; furthermore, when combined with face recognition scenarios, most of the videos that need special attention are the time period videos when the face is recognized. Other video segments are not very useful in most cases and are prone to occupying memory. Summary of the invention
[0003] In order to solve the above-mentioned problems in the prior art, the present invention provides a video storage method based on face recognition, which has the technical characteristics of being able to avoid saving a large amount of useless videos and accurately viewing the video scenes of events.
[0004] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0005] A video storage method based on face recognition, the video storage method comprising the following steps:
[0006] Step 1: Create a face photo database; import the information of the person to be monitored and their photos. The photos are verified by the face recognition algorithm. If the photos do not meet the face requirements, they cannot be included in the database. Photos that meet the face requirements can be included in the database.
[0007] Step 2: Connect the IPC camera video stream to the face recognition algorithm;
[0008] Step 3: Install the IPC camera at the entrance and exit of the passage, and adjust the angle to an appropriate position to capture the faces of passers-by;
[0009] Step 4: When a person in the face photo base database passes by the IPC camera, the video stream is analyzed and the person is identified by the face recognition algorithm, and the identification record is saved after the identification, and the identification record includes the information of the identified person, the captured photo, and the identification time;
[0010] When a face that is not in the face photo database passes by the IPC camera, the face recognition algorithm classifies it as a stranger and retains the captured photo and capture time as an identification record. Only one record of the stranger is retained during the entire process of the stranger passing by the IPC camera to avoid repeated capture and information duplication;
[0011] Step 5: The streaming media server pulls the video stream of the IPC camera through the RTSP protocol and saves the video stream for a short time, so as to obtain a short-term 1-minute video through the video streaming service;
[0012] Step 6: When face recognition identifies a person, it is necessary to obtain and save the 10-second video before and after the recognition from the saved 1-minute video. Under the condition of saving the 10-second video before and after, the scheduled task needs to wait for 20 seconds when the person is recognized, and then obtain the 20-second video from the saved 1-minute video according to the recognition time point to avoid the situation where the video that needs to be saved is not formed when obtaining the video;
[0013] Step: 7: Associate the acquired 20-second video with the identification record, and display the identification record list through the business layer of the business server so that the 20-second video at that time can be viewed at the same time.
[0014] Preferably, in step 2, the video encoding mode adopts H.264, the resolution adopts 1920*1080, and the IPC camera video time is synchronized with the current time.
[0015] Preferably, it comprises a face recognition module, a video processing module and a video playback module, and the face recognition module, the video processing module and the video playback module are communicatively connected with each other.
[0016] Preferably, the face recognition module includes an IPC camera and a storage module, the storage module stores information of persons to be monitored and their face photos, and the IPC camera is used in combination with a face recognition algorithm to perform recognition and recording.
[0017] Preferably, the video processing module stores the video through steps 5 and 6.
[0018] Preferably, the video playback module includes a display, and video playback is achieved through step 7.
[0019] Beneficial effects: It effectively reduces the amount of video storage. If an IPC camera stores data 24 hours a day, the required storage space is about 43200M. However, an IPC camera that recognizes 100 times a day only needs 1G of storage space. Therefore, it can be used in scenes with low traffic but need to be monitored. It is convenient and quick to view videos for identification events, which is much more convenient than looking for the video on the recorder and is very targeted. It is very convenient to manage videos, and scheduled tasks can be used to delete records that have been there for a long time, which is very flexible and convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of the method of the present invention.
[0021] Figure 2 It is a schematic diagram of the connection of each module of the present invention.
[0022] Figure 3 It is the principle block diagram of the face recognition module.
[0023] Figure 4 It is the principle block diagram of the video processing module.
[0024] Figure 5 It is the principle block diagram of the video playback module. DETAILED DESCRIPTION
[0025] The present invention will be further described below in conjunction with the accompanying drawings, but the present invention is not limited to the following embodiments.
[0026] like Figure 1-5 The figure shows a specific embodiment of a video storage method based on face recognition. The present invention saves the video when a person is recognized through a triggering event of face recognition, thereby providing a method for avoiding the storage of a large amount of useless videos and accurately viewing the video scene of the event.
[0027] In order to achieve the above object, the present invention adopts the following technical solutions:
[0028] The specific process includes the following steps:
[0029] (1) Create a face database: Create a face photo database; import the information of the people to be monitored and their photos. The photos are verified for eligibility through a face recognition algorithm. Photos that do not meet the face requirements cannot enter the database, while photos that meet the face requirements can enter the database.
[0030] (2) Set up the recognition camera: Connect the IPC camera video stream to the face recognition algorithm, use H.264 video encoding mode, 1920*1080 resolution, and synchronize the IPC camera video time with the current time. Install the IPC camera at the entrance and exit of the passage, and adjust the angle to an appropriate position to capture the face of the person passing by.
[0031] (3) Obtaining identification photos: When a person in the facial photo database passes by the IPC camera, the facial recognition algorithm analyzes the video stream and identifies the person. After identification, the identification record is saved. The identification record includes the information of the identified person (such as name, gender, etc.), the captured photo, the identification time, etc. When a face that is not in the facial photo database passes by the IPC camera, the facial recognition algorithm classifies it as a stranger, and at the same time retains the captured photo and the capture time as the identification record. When a stranger passes by the IPC camera, only one record of the stranger is retained during the entire process, and no repeated capture will cause information duplication.
[0032] (4) Downloading videos based on the time of photo recognition: The streaming media service pulls the IPC camera video stream through the RTSP protocol and saves the video stream for a short period of time. If the purpose is to store the recognition video before and after 10 seconds, generally 1 minute of IPC camera video stream is stored. This 1 minute of video refers to 1 minute from the current time. Storage requires about 30M of hard disk space.
[0033] (5) Save the video and identification information in correspondence:
[0034] Scheduled task: When face recognition identifies a person, it is necessary to obtain the 10 seconds of video before and after the recognition from the saved 1 minute video;
[0035] Save video: Under the condition of saving the video 10 seconds before and after, the scheduled task needs to wait for 20 seconds when the person is identified, and then save it from the saved 1-minute video according to the identification time point. For example, if the person is identified at 10:21:12, the scheduled task needs to be based on the saving conditions at 10:21:32, according to the start time 10:21:02 seconds, and the end time 10:21:22 seconds, and finally get 20 seconds of video from the existing 1-minute video. Because the identified video has not occurred at the time of identification, it is necessary to wait for a certain period of time to obtain it when the video has occurred and has been saved. The reason for obtaining the video at the scheduled time of 20 seconds instead of 10 seconds is that there will be a certain delay when the 1-minute video is saved. If it is obtained at a scheduled time of 10 seconds, the video at that time does not really exist. Delaying 10 seconds to obtain it can ensure that the video has been formed. Associate the obtained 20-second video with the identification record;
[0036] Click on the video in the recognition record to play the video at the time of recognition:
[0037] Check the business layer of the business server to display the recognition records, and you can also view the 20-second video at the time.
[0038] Finally, it should be noted that the present invention is not limited to the above embodiments, and there are many variations. All variations that can be directly derived or associated with the content disclosed by ordinary technicians in this field should be considered as the protection scope of the present invention.
Claims
1. A video storage method based on face recognition, characterized in that The video storage method comprises the following steps: Step 1: Create a face photo database; import the information of the person to be monitored and their photos. The photos are verified by the face recognition algorithm. If the photos do not meet the face requirements, they cannot be included in the database. Photos that meet the face requirements can be included in the database. Step 2: Connect the IPC camera video stream to the face recognition algorithm; Step 3: Install the IPC camera at the entrance and exit of the passage, and adjust the angle to an appropriate position to capture the faces of passers-by; Step 4: When a person in the face photo base database passes by the IPC camera, the video stream is analyzed and the person is identified by the face recognition algorithm, and the identification record is saved after the identification, and the identification record includes the information of the identified person, the captured photo, and the identification time; When a face that is not in the face photo database passes by the IPC camera, the face recognition algorithm classifies it as a stranger and retains the captured photo and capture time as an identification record. Only one record of the stranger is retained during the entire process of the stranger passing by the IPC camera to avoid repeated capture and information duplication; Step 5: The streaming media server pulls the video stream of the IPC camera through the RTSP protocol and saves the video stream for a short time, so as to obtain a short-term 1-minute video through the video streaming service; Step 6: When face recognition identifies a person, it is necessary to obtain and save the 10-second video before and after the recognition from the saved 1-minute video. Under the condition of saving the 10-second video before and after, the scheduled task needs to wait for 20 seconds when the person is recognized, and then obtain the 20-second video from the saved 1-minute video according to the recognition time point to avoid the situation where the video that needs to be saved is not formed when obtaining the video; Step: 7: Associate the acquired 20-second video with the identification record, and display the identification record list through the business layer of the business server so that the 20-second video at that time can be viewed at the same time.
2. The video storage method based on face recognition according to claim 1, characterized in that: In step 2, the video encoding mode uses H.264, the resolution uses 1920*1080, and the IPC camera video time is synchronized with the current time.
3. The video storage method based on face recognition according to claim 1, characterized in that: It includes a face recognition module, a video processing module, and a video playback module, and the face recognition module, the video processing module, and the video playback module are communicatively connected.
4. The video storage method based on face recognition according to claim 3 is characterized in that: The face recognition module includes an IPC camera and a storage module. The storage module stores the information of the person to be monitored and their face photos, and the IPC camera is used in combination with a face recognition algorithm to perform recognition and recording.
5. The video storage method based on face recognition according to claim 4 is characterized in that: The video processing module stores the video through steps 5 and 6.
6. The video storage method based on face recognition according to claim 3 is characterized in that: The video playback module includes a display, and video playback is achieved through step 7.
