Video recording method and system for supporting event stream recording based on digital retina terminal
By acquiring and parsing audio and video data streams on a digital retina terminal, structured video files are generated, solving the problems of data security and low retrieval efficiency in video storage, and achieving rapid location and efficient retrieval.
Patent Information
- Application Number
- CN202511707955.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-10
AI Technical Summary
Existing video storage technologies lack data encryption protection, video files are easily damaged and difficult to recover under abnormal conditions, and video files lack structured event stream information, resulting in low retrieval efficiency and waste of computing resources.
By acquiring audio and video data streams from a digital retina terminal and adding timestamps and encoding type identifiers, target event parsing is performed to generate event stream data, a recording list is constructed and encapsulated, including encryption and keyframe indexing, to form a structured recording file.
It enables accurate retrieval and rapid location of video files, reduces computing costs, improves user experience and retrieval efficiency, and avoids the duplication and waste of computing resources.
Smart Images

Figure CN121509599A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of audio and video data processing technology, and in particular relates to a recording method, system, device and storage medium based on digital retinal terminal supporting event stream recording. Background Technology
[0002] With the explosive growth of the video security industry, the access of hundreds of millions of devices has become the norm, and traditional video surveillance systems face severe challenges from massive amounts of unstructured data. To address these challenges, digital retina technology has emerged. This technology performs high-quality video encoding and visual feature extraction encoding at the camera end, stores the compressed video stream locally and uploads it to the cloud on demand, while simultaneously synchronizing the compact feature stream to the cloud in real time. This ensures efficient storage while conveniently supporting big data query and analysis. The digital retina system integrates technologies such as audio-visual monitoring, communication, computer networks, and system integration to build a new generation of visual big data perception, analysis, and processing system with functions including information acquisition, transmission, control, storage, processing, and display. It adopts an edge-cloud collaborative computing architecture to achieve real-time feature aggregation, on-demand video retrieval, and flexible function definition in its application mode.
[0003] However, while digital retina technology has brought new ideas to video data processing, existing video storage technologies still have many shortcomings in practical applications: First, traditional video systems mainly store audio and video data, lacking encryption protection and posing data security risks; second, video files are easily damaged and difficult to recover under abnormal conditions such as power outages, leading to the loss of important monitoring data; third, existing video files lack structured event stream information integration, requiring a full scan and processing of the entire video file for offline or online AI analysis, resulting in long processing cycles, high computational costs, and low indexing efficiency when retrieving specific events from massive amounts of video data; furthermore, traditional video file formats cannot effectively correlate the spatiotemporal relationship between AI-detected events and audio and video data, making it difficult for users to quickly locate key event segments during playback, and hindering the platform from efficiently utilizing existing AI detection results during secondary analysis, resulting in redundant waste of computing resources. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the purpose of the invention is to provide a video recording method and system based on a digital retina terminal that supports event stream recording.
[0005] The first aspect of this invention provides a video recording method based on a digital retina terminal supporting event stream recording, comprising:
[0006] S1. Acquire audio and video data streams and store them in the audio and video buffer to obtain buffered audio and video data;
[0007] S2. Analyze the target events in the real-time scene to obtain event stream data;
[0008] S3. Generate a recording list based on the buffered audio and video data and the event stream data;
[0009] S4. Based on the video recording list, encapsulate the buffered audio and video data and the event stream data to obtain a video recording file.
[0010] According to the video recording method based on a digital retina terminal supporting event stream recording provided by the present invention, step S1 further includes:
[0011] S11. Obtain a video frame sequence and an audio sampling sequence, and perform compression encoding on the video frame sequence and the audio sampling sequence respectively by an encoder to obtain a video encoded stream and an audio encoded stream;
[0012] S12. After adding timestamp identifiers and encoding type identifiers to the video encoded stream and the audio encoded stream, write them into the audio and video buffer to obtain buffered audio and video data.
[0013] According to the video recording method based on a digital retina terminal supporting event stream recording provided by the present invention, step S2 further includes:
[0014] S21. Analyze real-time video frames using motion detection algorithms, human detection algorithms, and deep learning models to identify target events of preset types;
[0015] S22. When the target event is detected, the event trigger time is recorded, and the consecutively triggered target events of the same type are smoothed to obtain the event start time and event end time.
[0016] S23. Construct event information based on the event type identifiers of the event start time, the event end time, and the target time, and write the event information into the local event list in chronological order to form event stream data.
[0017] According to the video recording method based on digital retinal terminal supporting event stream recording provided by the present invention, the target events of the preset type in step S21 include face recognition events, license plate capture events, area intrusion events and sound detection events.
[0018] According to the video recording method based on digital retina terminal supporting event stream recording provided by the present invention, the video recording list in step S3 includes: video file identifier, duration parameter, encoding format and event type tag set.
[0019] According to the present invention, a recording method based on a digital retina terminal supporting event stream recording is provided, wherein the recording file in step S4 includes file header information, event stream information segment, video keyframe index table, and audio and video data segment;
[0020] The file header information includes a global spatiotemporal identifier, encoding format, location information of the video keyframe index table, and location information of the event stream information segment.
[0021] According to the video recording method based on a digital retina terminal supporting event stream recording provided by the present invention, step S4 further includes:
[0022] S41. Read the event stream data, organize the event stream data according to a preset format, and write it into the event stream information segment;
[0023] S42. Read the buffered audio and video data in time stamp order, identify key frames and record the offset positions, and construct a video key frame index table.
[0024] S43. Encrypt the buffered audio and video data using the device key to obtain encrypted audio and video data, and write the encrypted audio and video data into the audio and video data segment in an alternating manner of audio frames and video frames.
[0025] S44. Write the header information to the video file to complete the encapsulation.
[0026] A second aspect of the present invention provides a video recording system based on a digital retina terminal supporting event stream recording, comprising:
[0027] Acquisition module: Used to acquire audio and video data streams and store them in the audio and video buffer to obtain buffered audio and video data;
[0028] Parsing module: Used to parse target events in real-time scenes and obtain event stream data;
[0029] Generation module: used to generate a recording list based on the buffered audio and video data and the event stream data;
[0030] Encapsulation module: used to encapsulate the buffered audio and video data and the event stream data according to the video recording list to obtain a video file.
[0031] A third aspect of the present invention provides a video recording device based on a digital retina terminal supporting event stream recording, comprising:
[0032] A memory and at least one processor, wherein the memory stores instructions;
[0033] At least one of the processors invokes the instructions in the memory to cause a recording device based on a digital retina terminal supporting event stream recording to perform a recording method based on a digital retina terminal supporting event stream recording as described in any of the preceding claims.
[0034] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement a recording method based on an event stream recording supported by a digital retina terminal as described in any of the preceding claims.
[0035] This invention firstly provides a precise time reference and format identification basis for subsequent data encapsulation and retrieval by adding encoding type identifiers and timestamps during the audio and video data stream acquisition stage and storing them in a buffer. This enables accurate location of audio and video segments at any time in the recording file, significantly reducing the time overhead of retrieving events within a specific time period. Secondly, this invention uses an event detection algorithm to parse target events in real-time scenes and generate structured event information containing event type, trigger time, and duration. This event information is stored in a local event list to form event stream data, allowing AI detection results to be stored in a structured form in association with audio and video data. This avoids the problem of traditional recording systems requiring full AI parsing of the entire recording file when performing event retrieval, significantly shortening the processing cycle of offline and online AI analysis and reducing computational costs. Thirdly, this invention generates information containing... The video file list, which includes file identifiers, duration parameters, encoding formats, and event type tag sets, allows clients and platforms to quickly filter video files containing specific event types without reading the main content of the video file, thus improving retrieval efficiency. Furthermore, this invention encapsulates buffered audio and video data and event stream data using a preset file format, organically organizing file header information, event stream information segments, video keyframe index tables, and audio and video data segments within the same video file. The keyframe index table enables rapid navigation and location, while the event stream information segments visually display the distribution of events within the video file. Users can directly jump to key event segments during playback without replaying the entire video, greatly enhancing user experience and the convenience of event location. Simultaneously, it provides an efficient data foundation for secondary analysis, retrieval, and editing on the platform, fully utilizing existing AI detection results and avoiding redundant waste of computing resources. Attached Figure Description
[0036] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. It is obvious that the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings.
[0037] Figure 1 This is a schematic flowchart of a video recording method based on a digital retina terminal supporting event stream recording, provided in an embodiment of the present invention.
[0038] Figure 2 This is a schematic diagram of the structure of a video recording system based on a digital retina terminal that supports event stream recording, provided in an embodiment of the present invention. Detailed Implementation
[0039] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0040] Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts disclosed in this invention.
[0041] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The terms "installed," "connected," and "linked" should be interpreted broadly; for example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0042] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with some aspects of the invention as detailed in the appended claims.
[0043] To better understand this invention, the technical terms appearing in the embodiments of this invention will be explained below.
[0044] Digital Retina System: A new generation of visual big data perception, analysis and processing system that integrates technologies such as audio and video monitoring, communication, computer networks, and system integration. It adopts the application mode of real-time feature aggregation, on-demand video retrieval, flexible function definition, and online model updating. It has functions such as information acquisition, transmission, control, storage, processing and display, and features unified spatiotemporal information, multi-level data representation, multiple data stream parallelism and a scalable edge-cloud collaborative computing architecture.
[0045] Subsystem: An organic whole composed of several closely related functional units or services combined according to certain logic, which can be used as part of a system.
[0046] End-subsystem: A subsystem with functions such as data acquisition, processing, analysis, and transmission, mainly used for scene information perception.
[0047] Edge subsystem: A subsystem with functions such as multi-channel data access, processing, storage and forwarding, used to complete resource collaborative scheduling and data collaborative calculation and analysis within a local area (T / AI116.1-2021).
[0048] Cloud subsystem: A subsystem with functions such as system collaboration and interaction, data aggregation, processing, storage, and management, used to complete collaborative data computing, analysis, mining, and decision-making on a global scale.
[0049] Video stream: A sequence of video data transmitted according to a certain format and protocol.
[0050] Feature stream: A sequence of feature data transmitted according to a certain format and protocol.
[0051] Modelstream: A sequence of algorithm model data transmitted according to a certain format and protocol.
[0052] Result stream: A sequence of result data transmitted according to a certain format and protocol.
[0053] Global Spatiotemporal ID: A unified terminal information set, including device information such as time, space, and device UID code.
[0054] Event Stream: Information triggered by alarm events on digital retinal terminals, forming a data stream of event information that continues to be triggered over time.
[0055] The embodiments of the present invention are described below with reference to the figures.
[0056] like Figure 1 As shown, the present invention provides a video recording method based on a digital retina terminal supporting event stream recording, comprising:
[0057] S1. Acquire audio and video data streams and store them in the audio and video buffer to obtain buffered audio and video data.
[0058] Step S1 further includes:
[0059] S11. Obtain the video frame sequence and the audio sampling sequence, and perform compression encoding processing on the video frame sequence and the audio sampling sequence respectively through the encoder to obtain the video encoded stream and the audio encoded stream.
[0060] Further, in step S11, the present invention continuously acquires scene images at a preset frame rate using a camera sensor, generating a video frame sequence arranged in chronological order, with each video frame being raw image data in RGB or YUV format. Simultaneously, the present invention continuously acquires sound signals at a preset sampling rate using a microphone, generating an audio sampling sequence, with each sampling point being raw audio data in PCM format. Subsequently, the present invention inputs the video frame sequence into a video encoder. The encoder first divides the current frame into macroblocks, performs intra-frame prediction or inter-frame prediction on each macroblock to generate predicted values, calculates the residual between the original pixel values and the predicted values, performs discrete cosine transform and quantization operations on the residuals, and finally compresses the quantization coefficients into a bitstream using entropy coding to generate a video encoded stream. Simultaneously, the present invention inputs the audio sampling sequence into an audio encoder. The encoder performs a modified discrete cosine transform on the audio signal to convert the time-domain signal into frequency-domain coefficients, performs quantization processing on the frequency-domain coefficients to reduce the data volume, and encapsulates the quantized coefficients into a bitstream to generate an audio encoded stream.
[0061] S12. After adding timestamp identifiers and encoding type identifiers to the video encoded stream and the audio encoded stream, write them into the audio and video buffer to obtain buffered audio and video data.
[0062] In step S12, the present invention first obtains the current system time and appends this time value as a timestamp to the frame header of each encoded frame of the video encoded stream. The timestamp is represented by an integer value with millisecond precision. Simultaneously, the present invention generates an encoding type identifier based on the encoder type: if the video encoder is H.264, the identifier value is 0x01; if it is H.265, the identifier value is 0x02. This encoding type identifier is written to the frame header of the video encoded stream. Subsequently, the present invention adds a timestamp and encoding type identifier to each encoded frame of the audio encoded stream in the same manner, keeping the audio timestamp synchronized with the corresponding video timestamp. Following this, the present invention writes the identified video encoded stream frame by frame into the video queue of the audio-video buffer, and writes the identified audio encoded stream frame by frame into the audio queue of the audio-video buffer, ultimately forming buffered audio-video data containing the timestamp and encoding type identifiers.
[0063] S2. Analyze the target events in the real-time scene to obtain event stream data.
[0064] Step S2 further includes:
[0065] S21. Analyze real-time video frames using motion detection algorithms, human detection algorithms, and deep learning models to identify target events of preset types.
[0066] Further, in step S21, the present invention extracts the real-time video frame at the current moment from the video frame sequence and inputs the real-time video frame into the motion detection algorithm module. The motion detection algorithm calculates the difference in grayscale values between the corresponding pixel positions of the current frame and the previous frame. When the proportion of pixels with a difference value exceeding a preset motion threshold exceeds a preset region threshold, it is identified as a motion detection event. Simultaneously, the present invention inputs the real-time video frame into the human detection algorithm module. The human detection algorithm extracts the edge contour features in the video frame and performs shape matching between the contour features and a preset human body template. When the matching degree exceeds a preset human body threshold, it is identified as a human body detection event. Subsequently, the present invention inputs the real-time video frame into a deep learning model, which includes a face recognition model, a license plate recognition model, a region intrusion detection model, and a sound classification model. The face recognition model extracts facial feature vectors through multi-layer convolution and calculates similarity with a face feature database. When the similarity exceeds a preset face threshold, it is identified as a face recognition event. The license plate recognition model locates the license plate region through an object detection network and extracts the license plate number through a character recognition network, identifying it as a license plate capture event. The area intrusion detection model uses a target tracking algorithm to determine whether a target has entered a preset warning area, identifying it as an area intrusion event. The sound classification model performs spectral analysis on audio signals to extract acoustic features, and uses a classifier to determine whether it is a specific sound signal, identifying it as a sound detection event.
[0067] The target events in step S21 include face recognition events, license plate capture events, area intrusion events, and sound detection events.
[0068] S22. When the target event is detected, the event trigger time is recorded, and the same type of target events that are triggered continuously are smoothed to obtain the event start time and event end time.
[0069] In step S22, when the algorithm or model in step S21 outputs the target event detection result, the present invention immediately reads the current system time as the event trigger time and temporarily stores the event trigger time and event type identifier in the event cache queue. Subsequently, the present invention initiates smoothing processing, and the smoothing processing module continuously monitors the event sequence in the event cache queue. The present invention traverses the event cache queue, extracts consecutive events with the same event type identifier, and calculates the time interval between the trigger times of two adjacent events. When the time interval is less than a preset threshold, the present invention determines that these events belong to consecutive triggers of the same event, marks the trigger time of the first event as the event start time, and continuously updates the trigger time of the latest event as the event end time. When the time interval is greater than the preset threshold or different types of events are detected, the present invention determines that the previous event has ended, and finally outputs a merged event containing the event start time and event end time.
[0070] S23. Construct event information based on the event type identifiers of the event start time, the event end time, and the target time, and write the event information into the local event list in chronological order to form event stream data.
[0071] In step S23, the present invention obtains merged events with determined start and end times from the smoothing processing module, and extracts the event start time, event end time, and event type identifier of the merged event. Subsequently, the present invention creates an event information data structure containing three fields: the first field stores the event type identifier, the second field stores the event start time, and the third field stores the event end time. Next, the present invention inserts the constructed event information into a local event list, which is a linked list structure arranged in ascending order of timestamps. The present invention traverses the local event list, compares the start time of the event information to be inserted with the start time of existing event information in the list, and inserts the event information to be inserted before the first node with a timestamp greater than the event start time, maintaining the temporal order of the list. As the detection process continues, the event information accumulated in the local event list eventually constitutes event stream data in chronological order.
[0072] S3. Generate a recording list based on the buffered audio and video data and the event stream data.
[0073] The video recording list in step S3 includes: video file identifier, duration parameter, encoding format, and event type tag set.
[0074] In step S3, the present invention first starts the recording management thread, which reads the current system time and the device UID code of the digital retina terminal. Then, the present invention formats the system time into a string of year, month, day, hour, minute, and second, and concatenates it with the device UID code to generate a recording file identifier. The recording file identifier adopts the naming format "Device UID_Year Month Day Hour Minute Second". Subsequently, the present invention reads the encoding type identifier field from the buffered audio and video data, extracts the video encoding format and audio encoding format, and stores the encoding format information as an encoding format field. Simultaneously, the present invention initializes the duration parameter field, setting the initial value of the duration parameter to 0. The recording management module uses a timer thread to increment the duration parameter by 1 every second to accumulate the duration.
[0075] Furthermore, this invention creates a data structure for an event type tag set, which is a dynamic array structure, initially empty. The video recording management module periodically reads event stream data from the local event list, traverses the event information to extract event type identifiers, and appends unique event type identifiers to the event type tag set array using a deduplication mechanism. Subsequently, this invention combines four fields—video file identifier, duration parameter, encoding format, and event type tag set—to form video list entries. Each video list entry is a structure containing four member variables. Following this, this invention writes the video list entries to a video list file, which is an index file stored in local memory. Each video list entry occupies a fixed-length data block, completing the generation of the video list.
[0076] S4. Based on the video recording list, encapsulate the buffered audio and video data and the event stream data to obtain a video recording file.
[0077] In step S4, the recorded file includes file header information, event stream information segment, video keyframe index table, and audio / video data segment; the file header information includes a global spatiotemporal identifier, encoding format, location information of the video keyframe index table, and location information of the event stream information segment.
[0078] Step S4 further includes:
[0079] S41. Read the event stream data, organize the event stream data according to a preset format, and write it into the event stream information segment.
[0080] In step S41, the present invention sequentially traverses the linked list starting from the head node of the local event list, reading the three fields of the event type identifier, event start time, and event end time of the first event information. Subsequently, the present invention converts the event type identifier into a string format and converts the timestamp values of the event start time and event end time into a readable date and time string format. Next, the present invention concatenates the three fields into an event record string in the format "event type, start time, end time", adding a newline character at the end of the event record string as a separator. The present invention continues to traverse the next node of the local event list, repeating the above formatting operation to format all event information into event record strings in sequence. When traversing to the tail node of the linked list, the present invention adds an end marker "#" to the last event record string, writes the organized event stream data to the recording file, and records the starting byte offset and total byte length as the position information of the event stream information segment.
[0081] S42. Read the buffered audio and video data in time stamp order, identify key frames and record the offset positions, and construct a video key frame index table.
[0082] In step S42, the present invention reads the first video encoded frame from the video queue of the audio / video buffer and extracts the timestamp identifier field of the encoded frame. Subsequently, the present invention parses the frame header flag of the video encoded frame and determines the value of the frame type field. When the value is 0x01, it is identified as an I-frame (keyframe); when the value is 0x02, it is identified as a P-frame; and when the value is 0x03, it is identified as a B-frame. Later, when a keyframe is identified, the present invention records the byte offset position currently written to the recording file. This offset position is the number of bytes from the start position of the recording file to the start position of the current keyframe data. The present invention combines the keyframe's timestamp identifier and byte offset position into an index entry, which includes a timestamp field and an offset field. Subsequently, the present invention continues to read the next video encoded frame from the audio / video buffer, repeating the above identification and recording operations, storing all keyframe index entries in ascending order of timestamp in an index entry array. This index entry array constitutes a video keyframe index table.
[0083] S43. Encrypt the buffered audio and video data using the device key to obtain encrypted audio and video data, and write the encrypted audio and video data into the audio and video data segment in an alternating manner of audio frames and video frames.
[0084] In step S43, the present invention first reads the device key from the device configuration module. The device key is a 128-bit binary key data, and a unique key is configured for each terminal device using a one-device-one-key method. Then, the present invention initializes the AES encryption algorithm module, inputting the device key as the encryption key into the AES algorithm, setting the encryption mode to CBC mode, and generating an initialization vector. Subsequently, the present invention reads the buffered audio and video data from the audio and video buffer in timestamp order, first reading the audio encoded frame with the smallest timestamp, and inputting the data content of the audio encoded frame into the AES encryption module. The AES encryption module performs byte substitution, row shifting, column mixing, and round key addition operations on the plaintext data, outputting the encrypted audio frame data.
[0085] Furthermore, this invention writes the encrypted audio frame data into the audio / video data segment of the video recording file. Subsequently, this invention reads a video encoded frame with a timestamp close to the audio frame, inputs the data content of the video encoded frame into the AES encryption module, performs the same encryption operation, outputs encrypted video frame data, and writes the encrypted video frame data into the audio / video data segment. This invention reads data from the audio / video buffer in an alternating order of audio first, then video, performing encryption and writing operations sequentially until all data in the audio / video buffer has been processed, forming a complete encrypted audio / video data segment.
[0086] S44. Write the header information to the video file to complete the encapsulation.
[0087] In step S44, the present invention reads the global spatiotemporal identifier from the device configuration module. The global spatiotemporal identifier is structured data containing time information, spatial information, and device UID code. The time information is the system timestamp when the video file was created, the spatial information is the latitude and longitude coordinates of the device installation location, and the device UID code is the unique identifier of the terminal device. Subsequently, the present invention reads the encoding format field from the video list. The encoding format field contains the identifier values of the video encoding type and the audio encoding type. Next, the present invention reads the starting byte offset position and occupied byte length of the video keyframe index table in the video file, and combines the offset position and byte length to form a position information field. At the same time, the present invention reads the starting byte offset position and occupied byte length of the event stream information segment in the video file, and combines the offset position and byte length to form a position information field. Subsequently, the present invention arranges the four fields—global spatiotemporal identifier, encoding format, video keyframe index table position information, and event stream information segment position information—in a fixed order to generate a binary data block of file header information. This invention locates the beginning position of the video file, writes the binary data block of the file header information into the reserved file header information area, overwrites the initial placeholder data, and completes the filling of the file header information and the encapsulation of the video file.
[0088] like Figure 2As shown, the present invention also provides a video recording system based on a digital retina terminal supporting event stream recording, comprising:
[0089] Acquisition module 100: Used to acquire audio and video data streams and store them in the audio and video buffer to obtain buffered audio and video data;
[0090] Parsing module 200: Used to parse target events in real-time scenes and obtain event stream data;
[0091] Generation module 300: used to generate a recording list based on the buffered audio and video data and the event stream data;
[0092] Encapsulation module 400: used to encapsulate the buffered audio and video data and the event stream data according to the video recording list to obtain a video recording file.
[0093] The present invention also provides a video recording device based on a digital retina terminal supporting event stream recording, comprising: a memory and at least one processor, wherein the memory stores instructions; at least one of the processors invokes the instructions in the memory to cause the video recording device based on a digital retina terminal supporting event stream recording to perform a video recording method as described above.
[0094] The present invention also provides a computer-readable storage medium storing instructions that, when executed by a processor, implement a recording method based on a digital retina terminal supporting event stream recording as described in any of the preceding claims.
[0095] This invention provides a method for recording video on a digital retina terminal. Based on edge AI, it triggers target events and can perform customized recording and storage of media data and alarm event stream information from the digital retina terminal. This solves the problems of traditional recording, such as file corruption due to power outages and other anomalies, and long offline / online AI parsing and processing cycles, high costs, and slow indexing.
[0096] In addition, the functions provided by this invention support cross-platform application development and can be applied to terminals including cameras, AI boxes, NVRs, all-in-one machines and different operating system environments. The capabilities can be seamlessly implemented through basic library programming adaptation, resulting in high system compatibility.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.
Claims
1. A video recording method based on a digital retina terminal supporting event stream recording, characterized in that, include: S1. Acquire audio and video data streams and store them in the audio and video buffer to obtain buffered audio and video data; S2. Analyze the target events in the real-time scene to obtain event stream data; S3. Generate a recording list based on the buffered audio and video data and the event stream data; S4. Based on the video recording list, encapsulate the buffered audio and video data and the event stream data to obtain a video recording file.
2. The video recording method based on event stream recording supported by a digital retina terminal according to claim 1, characterized in that, Step S1 further includes: S11. Obtain a video frame sequence and an audio sampling sequence, and perform compression encoding on the video frame sequence and the audio sampling sequence respectively by an encoder to obtain a video encoded stream and an audio encoded stream; S12. After adding timestamp identifiers and encoding type identifiers to the video encoded stream and the audio encoded stream, write them into the audio and video buffer to obtain buffered audio and video data.
3. The video recording method based on event stream recording supported by a digital retina terminal according to claim 1, characterized in that, Step S2 further includes: S21. Analyze real-time video frames using motion detection algorithms, human detection algorithms, and deep learning models to identify target events of preset types; S22. When the target event is detected, the event trigger time is recorded, and the consecutively triggered target events of the same type are smoothed to obtain the event start time and event end time. S23. Construct event information based on the event type identifiers of the event start time, the event end time, and the target time, and write the event information into the local event list in chronological order to form event stream data.
4. A video recording method based on event stream recording supported by a digital retina terminal according to claim 3, characterized in that, The target events of the preset types mentioned in step S21 include face recognition events, license plate capture events, area intrusion events, and sound detection events.
5. A video recording method based on a digital retina terminal supporting event stream recording according to claim 1, characterized in that, The video recording list in step S3 includes: video file identifier, duration parameter, encoding format, and event type tag set.
6. A video recording method based on event stream recording supported by a digital retina terminal according to claim 1, characterized in that, The video file in step S4 includes file header information, event stream information segment, video keyframe index table, and audio / video data segment; The file header information includes a global spatiotemporal identifier, encoding format, location information of the video keyframe index table, and location information of the event stream information segment.
7. A video recording method based on event stream recording supported by a digital retina terminal according to claim 6, characterized in that, Step S4 further includes: S41. Read the event stream data, organize the event stream data according to a preset format, and write it into the event stream information segment; S42. Read the buffered audio and video data in time stamp order, identify key frames and record the offset positions, and construct a video key frame index table. S43. Encrypt the buffered audio and video data using the device key to obtain encrypted audio and video data, and write the encrypted audio and video data into the audio and video data segment in an alternating manner of audio frames and video frames. S44. Write the header information to the video file to complete the encapsulation.
8. A video recording system based on a digital retina terminal supporting event stream recording, characterized in that, include: Acquisition module: Used to acquire audio and video data streams and store them in the audio and video buffer to obtain buffered audio and video data; Parsing module: Used to parse target events in real-time scenes and obtain event stream data; Generation module: used to generate a recording list based on the buffered audio and video data and the event stream data; Encapsulation module: used to encapsulate the buffered audio and video data and the event stream data according to the video recording list to obtain a video file.
9. A video recording device based on a digital retina terminal supporting event stream recording, characterized in that, include: A memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause a recording device based on a digital retina terminal supporting event stream recording to perform a recording method based on a digital retina terminal supporting event stream recording as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor, implement a recording method based on an event stream recording supported by a digital retinal terminal as described in any one of claims 1 to 7.