CN116506664B - Video code stream generation method and device, electronic equipment and medium - Google Patents
Video code stream generation method and device, electronic equipment and medium Download PDFInfo
- Publication number
- CN116506664B CN116506664B CN202310746386.XA CN202310746386A CN116506664B CN 116506664 B CN116506664 B CN 116506664B CN 202310746386 A CN202310746386 A CN 202310746386A CN 116506664 B CN116506664 B CN 116506664B
- Authority
- CN
- China
- Prior art keywords
- target
- event
- code rate
- real
- video data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 70
- 238000001514 detection method Methods 0.000 claims abstract description 105
- 238000012544 monitoring process Methods 0.000 claims abstract description 51
- 230000008859 change Effects 0.000 claims description 11
- 230000009471 action Effects 0.000 claims description 10
- 206010000117 Abnormal behaviour Diseases 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 claims description 4
- 230000000694 effects Effects 0.000 abstract description 7
- 230000002159 abnormal effect Effects 0.000 description 10
- 241001465754 Metazoa Species 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 230000003068 static effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 241000282472 Canis lupus familiaris Species 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 2
- 238000013145 classification model Methods 0.000 description 2
- 230000036961 partial effect Effects 0.000 description 2
- 230000002829 reductive effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 235000019504 cigarettes Nutrition 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002028 premature Effects 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000011895 specific detection Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/266—Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
- H04N21/2662—Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/637—Control signals issued by the client directed to the server or network components
- H04N21/6377—Control signals issued by the client directed to the server or network components directed to server
- H04N21/6379—Control signals issued by the client directed to the server or network components directed to server directed to encoder, e.g. for requesting a lower encoding rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/18—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Closed-Circuit Television Systems (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The application provides a video code stream generation method, a device, electronic equipment and a medium, wherein the method collects real-time video data of a target place; determining a target event occurring in the real-time video data according to a detection result for a detection target in the real-time video data; determining a target code rate of the real-time video data matching according to the target event; encoding real-time video data acquired after the occurrence of the target event according to the target code rate to generate a video code stream of the target location and storing the video code stream of the target location; the application automatically adjusts the code rate according to the content of the real-time video, fully utilizes the network broadband and the storage space of the monitoring system, and ensures the recording effect of the monitoring system.
Description
Technical Field
The application relates to the technical field of video monitoring, in particular to a video code stream generation method, a device, electronic equipment and a medium.
Background
In the field of video monitoring, network cameras are often used for monitoring various scenes, such as scenes to be monitored, for example, in parks, on roads, in parking lots, etc., and recording and storing events occurring in the scenes, and because events occurring in the scenes need to be recorded continuously for a long time, a high network bandwidth and a large storage space are required. In the prior art, only one code rate is generally set to uninterruptedly shoot the same scene, so that the problem is that the duration of shooting video pictures is limited under the condition that a hardware system is fixed.
Disclosure of Invention
Accordingly, the present application is directed to a method, an apparatus, an electronic device, and a medium for generating a video code stream, which automatically adjust a code rate according to the content of a real-time video, and fully utilize the network bandwidth and the storage space of a monitoring system, so that a longer-time picture can be stored, and the recording effect of the monitoring system is ensured.
The video code stream generating method provided by the embodiment of the application is applied to a monitoring system, and comprises the following steps:
collecting real-time video data of a target place;
determining a target event occurring in the real-time video data according to a detection result for a detection target in the real-time video data;
determining a target code rate of the real-time video data matching according to the target event; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate;
and carrying out coding processing on the real-time video data acquired after the occurrence of the target event according to the target code rate so as to generate a video code stream of the target location and storing the video code stream of the target location.
In some embodiments, in the video bitstream generation method, before determining the target event occurring in the real-time video data according to the detection result for the detection target in the real-time video data, the method further includes:
Configuring at least part of events of a target place and code rates of the at least part of events based on the type of the target place;
the higher the priority of the event for the target place, the higher the code rate corresponding to the event.
In some embodiments, in the video code stream generating method, determining, according to the target event, a target code rate for matching the real-time video data includes:
determining the event priority corresponding to the target event according to the target event;
determining a target code rate corresponding to the event priority of the target event based on a pre-configured association relation between the event priority and the code rate; wherein, the lower the event priority, the lower the target code rate.
In some embodiments, in the video code stream generating method, determining a target event occurring in the real-time video data according to a detection result for a detection target in the real-time video data includes:
judging whether a first target event related to a detection target in the real-time video data occurs according to a first detection result aiming at the detection target in the real-time video data;
if so, extracting state information of a detection target in the real-time video data;
And judging whether at least one second target event associated with the detection target occurs or not according to the state information of the detection target.
In some embodiments, in the video bitstream generation method, determining, according to the target event, an event priority corresponding to the target event includes:
when the target event is a detection-free target or the detection target has no abnormal behavior, determining that the target event is a first priority;
when the target event is the occurrence of the detection target intrusion, determining that the target event is of a second priority;
when the target event is that the detection target meets the preset dangerous condition, determining the target time as a third priority;
wherein, the code rate corresponding to the first priority is lower than the code rate corresponding to the second priority, and the code rate corresponding to the second priority is lower than the code rate corresponding to the third priority; the preset dangerous condition is at least one of the following: the detection target performs dangerous actions and/or the category of the detection target belongs to a preset dangerous category.
In some embodiments, in the method for generating a video code stream, the encoding processing is performed on real-time video data acquired after the occurrence of the target event according to the target code rate to generate the video code stream of the target location, including:
After determining that the target event occurs, setting the code rate parameter in the monitoring system as a target code rate;
the monitoring system collects real-time video data, and encodes the collected real-time video data according to a target code rate to generate a video code stream of a target location.
In some embodiments, in the video code stream generating method, after encoding real-time video data acquired after the occurrence of the target event according to the target code rate, the method further includes:
when the change of the target event is detected, the target code rate matched with the real-time video data is redetermined based on the changed target event;
when the redetermined target code rate is larger than the original target code rate, updating the target code rate;
when the redetermined target code rate is smaller than the original target code rate, judging whether the stopping time length of the target event before the change exceeds a preset time length threshold value;
if the target event exceeds the target event, determining that the target event is ended, and updating the target code rate.
In some embodiments, there is also provided a video bitstream generation device applied to a monitoring system, the device including:
the acquisition module is used for acquiring real-time video data of the target site;
The first determining module is used for determining a target event occurring in the real-time video data according to a detection result aiming at a detection target in the real-time video data;
the second determining module is used for determining a target code rate matched with the real-time video data according to the target event; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate;
and the encoding module is used for encoding the real-time video data acquired after the occurrence of the target event according to the target code rate so as to generate a video code stream of the target location and storing the video code stream of the target location.
In some embodiments, there is also provided an electronic device including: the system comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the electronic device is running, the processor and the memory are communicated through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the video code stream generating method.
In some embodiments, a computer readable storage medium is also provided, on which a computer program is stored, which computer program, when being executed by a processor, performs the steps of the video bitstream generation method.
The embodiment of the application provides a video code stream generating method, a device, electronic equipment and a medium, which are applied to a monitoring system, wherein the method is used for collecting real-time video data of a target site, determining a target event occurring in the real-time video data according to a detection result aiming at a detection target in the real-time video data, and determining a target code rate matched with the real-time video data according to the target event; the method comprises the steps of carrying out coding processing on real-time video data acquired after a target event occurs according to a target code rate to generate a video code stream of the target place and storing the video code stream of the target place, so that the event and abnormal situation needing to be noted are recorded by a high-quality image and clear picture only aiming at the target event with high importance, and when the event needing to be noted does not occur in the target place, the scene without abnormal situation and needing to be noted is recorded by a low code rate by general image and definition, so that network broadband and storage space are saved, and based on the situation, the network broadband and the storage space of a monitoring system are fully utilized, the longer-time picture can be stored, and meanwhile the recording effect of the monitoring system is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a method flowchart of a video code stream generating method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for determining a target event occurring in real-time video data based on a detection result for a detected target in the real-time video data according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for encoding real-time video data acquired after a target event occurs according to a target code rate to generate a video code stream of a target location according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a video code stream generating device according to an embodiment of the present application;
fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for the purpose of illustration and description only and are not intended to limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this disclosure, illustrates operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
In addition, the described embodiments are only some, but not all, embodiments of the application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that the term "comprising" will be used in embodiments of the application to indicate the presence of the features stated hereafter, but not to exclude the addition of other features.
In the field of video monitoring, network cameras are often used for monitoring various scenes, such as scenes to be monitored, for example, in parks, on roads, in parking lots, etc., and recording and storing events occurring in the scenes, and because events occurring in the scenes need to be recorded continuously for a long time, a high network bandwidth and a large storage space are required. In the prior art, only one code rate is generally set to uninterruptedly shoot the same scene, so that the problem is that the duration of monitoring shot video pictures is limited under the condition that a hardware system is fixed due to the limited storage space of a monitoring system.
The code rate is the data flow used by the video file in unit time, and is generally understood to be the sampling rate, which is the most important part in the picture quality control in video coding, and the unit is generally kbps.
Based on the above, the embodiment of the application provides a video code stream generating method, a device, an electronic device and a medium, which are applied to a monitoring system, wherein the method is used for collecting real-time video data of a target site, determining a target event occurring in the real-time video data according to a detection result aiming at a detection target in the real-time video data, and determining a target code rate matched with the real-time video data according to the target event; the method comprises the steps of carrying out coding processing on real-time video data acquired after a target event occurs according to a target code rate to generate a video code stream of the target place and storing the video code stream of the target place, so that the event and abnormal situation needing to be noted are recorded by a high-quality image and clear picture only aiming at the target event with high importance, and when the event needing to be noted does not occur in the target place, the scene without abnormal situation and needing to be noted is recorded by a low code rate by general image and definition, so that network broadband and storage space are saved, and based on the situation, the network broadband and the storage space of a monitoring system are fully utilized, the longer-time picture can be stored, and meanwhile the recording effect of the monitoring system is ensured.
Referring to fig. 1, fig. 1 shows a flowchart of a method for generating a video code stream according to an embodiment of the present application, and the method is specifically applied to a monitoring system, and the method includes steps S101 to S104:
s101, acquiring real-time video data of a target place;
s102, determining a target event occurring in the real-time video data according to a detection result aiming at a detection target in the real-time video data;
s103, determining a target code rate matched with the real-time video data according to the target event; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate;
s104, carrying out coding processing on the real-time video data acquired after the occurrence of the target event according to the target code rate so as to generate a video code stream of the target location and storing the video code stream of the target location.
The embodiment of the application provides a video code stream generating method which is applied to a monitoring system, wherein the method is used for collecting real-time video data of a target place, determining a target event which occurs in the real-time video data according to a detection result aiming at a detection target in the real-time video data, and determining a target code rate matched with the real-time video data according to the target event; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate; the method comprises the steps of carrying out coding processing on real-time video data acquired after a target event occurs according to a target code rate to generate a video code stream of the target place and storing the video code stream of the target place, so that the event and abnormal situation needing to be noted are recorded by a high-quality image and clear picture only aiming at the target event with high importance, and when the event needing to be noted does not occur in the target place, the scene without abnormal situation and needing to be noted is recorded by a low code rate by general image and definition, so that network broadband and storage space are saved, and based on the situation, the network broadband and the storage space of a monitoring system are fully utilized, the longer-time picture can be stored, and meanwhile the recording effect of the monitoring system is ensured.
In the embodiment of the application, the monitoring system comprises a video acquisition module, a video analysis module, a video coding module, a code rate calculation module and a code stream storage module.
The video acquisition module is a device capable of shooting video, typically a camera. The video analysis module, the video coding module and the code rate calculation module are realized by one or more processors. The code stream storage module can be a memory card, a hard disk, a cloud storage space and the like.
In said step S101, real-time video data of the target site is acquired.
Here, the target location is a location where the monitoring system is installed, specifically, a shooting area of a video acquisition module of the monitoring system, and is usually a shooting range of a camera. Exemplary are living rooms in a home, store gates, intersections on roads, mountain forests, and the like.
Real-time video data of the target site is acquired, i.e. video data within the target site acquired by a video acquisition module (typically a camera).
In the embodiment of the application, the real-time video data acquired by the video acquisition module are respectively transmitted to the video analysis module and the video coding module.
In the prior art, real-time video data acquired by a video acquisition module are directly transmitted to a video coding module, and the video coding module carries out coding processing according to a fixed code rate.
In the embodiment of the application, the real-time video data acquired by the video acquisition module is divided into two paths and respectively transmitted to the video analysis module and the video coding module, the video analysis module analyzes and detects the received video data to obtain a detection result, and the type of the real-time video data is determined according to the detection result.
The video analysis module analyzes and detects the received video data, specifically, identifies the intrusion of the detection target, generates the target action of the detection target, and the like, wherein the intrusion of the detection target comprises the occurrence of people and animals or the occurrence of target objects carried by the target people and animals.
Or, when the monitoring system is a movable device such as an unmanned aerial vehicle, the detection target may also be static, that is, a target person, a target animal, a target plant, a target building, etc. appear suddenly in a picture shot by the unmanned aerial vehicle.
Here, when the detection target performs a target action, the detection target may be a static object, such as a vase, for example.
In the step S102, a target event occurring in the real-time video data is determined according to a detection result for a detection target in the real-time video data.
Specifically, a video analysis module in the monitoring system receives one path of collected real-time video data, and determines a target event occurring in the real-time video data according to a detection result of a detection target in the received real-time video data.
And after a video analysis module in the monitoring system determines a target event occurring in the real-time video data, the target event is sent to a code rate calculation module. Or the video analysis module sends the analysis result of the real-time video data to the code rate calculation module.
The determining real-time video data video analysis module analyzes and detects the received video data, specifically, detects whether a specific detection target appears in the video data through a target detection algorithm, for example, detects whether a person appears in the video data, whether an animal appears, whether a cigarette end appears, whether a specific action such as taking a frame appears, whether a person carries a specific object, and the object identification can be realized through a trained target classification model. The object classification model is the prior art, and the application is not repeated.
In an embodiment of the present application, before determining a target event occurring in the real-time video data according to a detection result for a detection target in the real-time video data, the method further includes: configuring at least part of events of a target place and code rates of the at least part of events based on the type of the target place;
The higher the priority of the event for the target place, the higher the code rate corresponding to the event.
In the embodiment of the application, at least partial events of the target site in the target time period and the code rate of the at least partial events are configured; the code rates corresponding to the same events in different time periods are different.
That is, the event to be identified by the video analysis module and the code rate corresponding to the event can be manually configured. Specifically, different types of target sites have different degrees of attention to different events. For example, in a park, it is not important to detect a person, because the person in the park is normal and does not need to pay special attention, and a low-quality picture can be shot with a low code rate. However, if abnormal behaviors such as frame taking and the like of a person are detected, important attention is required, and a high-quality picture is shot by adopting a high code rate. However, if a person is detected in a house at home, or at night or in a period of no person in the daytime, a thief may be involved, and a high-quality picture is shot with a high code rate with a great attention.
And, only a monitoring system that functions specifically at a specific site, it is necessary to specifically set a certain detection target. For example, when a recording sheet of a wild animal is photographed, only a certain wild animal is set as a detection target, when the certain wild animal intrudes, a high-quality picture is photographed with a high code rate, and other animals such as cats and dogs are not detection targets, and a low-quality picture is photographed with a low code rate; but for highways, high-quality pictures are shot with high code rate when cats and dogs break in.
Based on this, in the embodiment of the present application, based on the type of the target location and the requirement of the user, at least part of the events of the target location and the code rate of the at least part of the events are configured, the events configured by different target locations may be the same or not the same, and the code rates of the same events of different target locations may be the same or different.
The importance degree of different events for the target place is different, the higher the importance degree of the event for the target place is, the higher the priority of the event is, and the higher the code rate corresponding to the event is.
In the embodiment of the application, the code rate of each event can be configured in a selective mode, for example, the code rates of three levels are set from low to high, and a plurality of events are set, so that a user can establish or modify the corresponding relation between the event and the code rate.
In some embodiments, a user may set a particular code rate for a pre-configured event after selecting the event, e.g., input a particular code rate to set a particular code rate.
In some embodiments, the detection target may be added and a new event may be added by taking a video or a photograph of the detection target, and configuring a corresponding code rate for the new event.
In the embodiment of the present application, referring to fig. 2, determining a target event occurring in real-time video data according to a detection result for a detection target in the real-time video data includes the following steps S201 to S203:
s201, judging whether a first target event related to a detection target in the real-time video data occurs according to a first detection result aiming at the detection target in the real-time video data;
s202, if so, extracting state information of a detection target in the real-time video data;
s203, judging whether at least one second target event associated with the detection target occurs according to the state information of the detection target.
That is, the second target event is an event that occurs after the occurrence of the first target event, or the occurrence of the first target event causes the occurrence of the second target event. For example, a pedestrian frame event may occur only if a pedestrian break-in first occurs; only if the pedestrian break-in event occurs, the pedestrian exit event occurs. Therefore, whether pedestrians appear in the video is detected firstly, if pedestrians appear, the detection of whether the pedestrians are on shelves or carry specific articles is increased in the follow-up detection, if the pedestrians do not appear, only whether the pedestrians appear in the video is recognized later, whether the pedestrians are on shelves or carry the specific articles is not required, and therefore calculation force is saved.
In step S103, a target code rate for matching the real-time video data is determined according to the target event.
Here, different code rates correspond to different events, and the same code rate corresponds to at least one event.
Specifically, the same code rate corresponds to at least one event with a level of importance.
In the embodiment of the application, the video analysis module sends the analysis result of the real-time video data to the code rate calculation module, the code rate calculation module automatically adjusts the code rate according to the video analysis result made by the video analysis module, and the code rate information is sent to the video coding module.
Specifically, determining, according to the target event, a target code rate for matching the real-time video data includes:
determining the event priority corresponding to the target event according to the target event;
determining a target code rate corresponding to the event priority of the target event based on a pre-configured association relation between the event priority and the code rate; wherein, the lower the event priority, the lower the target code rate.
That is, in the embodiment of the application, each event is not set to be different code rates, but several code rates are set, and events with similar importance degrees are recorded by adopting the same code rate, so that the complexity of configuration and automatic code rate adjustment is reduced.
Specifically, determining, according to the target event, an event priority corresponding to the target event includes:
when the target event is a detection-free target or the detection target has no abnormal behavior, determining that the target event is a first priority;
when the target event is the occurrence of the detection target intrusion, determining that the target event is of a second priority;
when the target event is that the detection target meets the preset dangerous condition, determining the target time as a third priority;
wherein, the code rate corresponding to the first priority is lower than the code rate corresponding to the second priority, and the code rate corresponding to the second priority is lower than the code rate corresponding to the third priority; the preset dangerous condition is at least one of the following: the detection target performs dangerous actions and/or the category of the detection target belongs to a preset dangerous category.
That is, in the embodiment of the present application, the code rate is set to three levels, and the code rate of each level corresponds to at least one event belonging to the priority.
For example, when the scene is static and no detection target intrudes or no abnormal behavior of the detection target is detected, the code rate and the frame rate are adjusted to be the lowest, for example, 512kbps, the code rate is set according to the minimum, and code rate information is sent to the video coding module, at the moment, the video picture is unclear, the image quality is general, and the network bandwidth and the storage space can be saved; when the detection target intrudes or the detection target performs abnormal behavior, the code rate is automatically adjusted to 4Mbps, and the acquired video picture has high definition and good picture quality, so that the action in the picture can be resolved; 3. when abnormal fight or dangerous actions occur or dangerous objects occur (such as fire, muzzle and the like), the code rate is automatically adjusted to 20-40Mbps, the code rate is the highest, and the acquired pictures are the clearest; 4. when the hazard is over, the scene is restored to rest or normal, and the code rate is readjusted to 512kbps.
And after the code rate calculation module determines the target code rate, transmitting the target code rate information to the video coding module.
In the step S104, the real-time video data collected after the occurrence of the target event is encoded according to the target code rate, so as to generate a video code stream of the target location, and the video code stream of the target location is stored.
Specifically, referring to fig. 3, the encoding process is performed on the real-time video data collected after the occurrence of the target event according to the target code rate to generate a video code stream of the target location, including the following steps S301-S302:
s301, after determining that a target event occurs, setting a code rate parameter in a monitoring system as a target code rate;
s302, the monitoring system collects real-time video data, and codes the collected real-time video data according to a target code rate to generate a video code stream of a target location.
Here, after the video coding module receives the target code rate, the code rate parameter of the video coding module is set as the target code rate, that is, the code rate parameter in the monitoring system setting is set as the target code rate, specifically: and setting the code rate parameter in the video coding module of the monitoring system as a target code rate.
The video coding module performs compression coding on the received video data according to the received target code rate, and sends the coded video data to the code stream storage module for storage.
That is, the video code stream of the target location is stored, and specifically, the code stream storage module in the monitoring system stores the video code stream of the target location.
In the embodiment of the present application, in the method for generating a video code stream, after encoding real-time video data acquired after occurrence of a target event according to a target code rate, the method further includes:
when the change of the target event is detected, the target code rate matched with the real-time video data is redetermined based on the changed target event;
when the redetermined target code rate is larger than the original target code rate, updating the target code rate;
when the redetermined target code rate is smaller than the original target code rate, judging whether the stopping time length of the target event before the change exceeds a preset time length threshold value;
if the target event exceeds the target event, determining that the target event is ended, and updating the target code rate.
That is, when the redetermined target code rate is greater than the original target code rate, the target code rate is immediately updated, and the code rate parameter of the monitoring system is immediately updated to the redetermined target code rate; when the redetermined target code rate is smaller than the original target code rate, updating the target code rate in a delay way when the stopping time of the target event before the change exceeds a preset time threshold value, and updating the code rate parameter of the monitoring system in the delay way to the redetermined target code rate; if the stopping time of the target event before the change does not exceed the preset time threshold, namely the target event before the change occurs again within the preset time threshold, the condition of updating the target code rate is not met, and the target code rate is not updated.
When the redetermined target code rate is larger than the original target code rate, the target code rate is updated, namely the importance degree of the newly-generated event is higher, and the higher code rate must be immediately replaced so as to record event information as much as possible through clear video recording events; and when the redetermined target code rate is smaller than the original target code rate, the importance degree of the newly generated event is reduced, and in order to prevent the premature recording of the information of the event with higher importance degree by adopting the low code rate, the high code rate is still adopted for recording in a period of time until the preset time length threshold value is exceeded. Illustratively, when the scene is switched from stationary to someone running in, the code rate is immediately switched from the first level to the second level; when a scene is switched to abnormal fight is detected, immediately switching the code rate from the second level to the third level so as to clearly record the whole process of dangerous fight; however, when the dangerous action is detected to be stopped, the two sides of the fight are only separated temporarily, if the two sides are switched to the code rate of the second level immediately, a fight process of recording the image quality for a period of time is adopted, if the two sides continue to fight, the two sides still need to be switched to the code rate of the third level, and thus the complete fight process of recording the image quality with the code rate of the third level is not completed; if the scene is detected to be static, it is also possible that both sides of the fight leave the recording range of the camera temporarily, if the two sides of the fight are recorded with the first code rate immediately, when the two sides of the fight return to the recording range of the camera again, a section of picture with blurred content may exist in the switching process.
Based on the above, in the embodiment of the application, when the redetermined target code rate is larger than the original target code rate, the target code rate is updated immediately, and when the redetermined target code rate is larger than the original target code rate, the target code rate is updated in a delayed manner, so that more important events are continuously recorded with higher image quality to the greatest extent, and the monitoring effect of the monitoring system is ensured.
Based on the same inventive concept, the embodiment of the present application further provides a video code stream generating device corresponding to the video code stream generating method, and since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the video code stream generating method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repetition is omitted.
Referring to fig. 4, fig. 4 shows a schematic structural diagram of a video code stream generating device according to an embodiment of the present application, and in particular, the video code stream generating device is applied to a monitoring system, and the device includes:
the acquisition module 401 is used for acquiring real-time video data of a target site;
a first determining module 402, configured to determine, according to a detection result for a detection target in the real-time video data, a target event occurring in the real-time video data;
A second determining module 403, configured to determine, according to the target event, a target code rate for matching the real-time video data; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate;
the encoding module 404 is configured to encode real-time video data acquired after the occurrence of the target event according to the target code rate, so as to generate a video code stream of the target location, and store the video code stream of the target location.
The embodiment of the application provides a video code stream generating device which is applied to a monitoring system, wherein the method is used for collecting real-time video data of a target place, determining a target event which occurs in the real-time video data according to a detection result aiming at a detection target in the real-time video data, and determining a target code rate matched with the real-time video data according to the target event; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate; the method comprises the steps of carrying out coding processing on real-time video data acquired after a target event occurs according to a target code rate to generate a video code stream of the target place and storing the video code stream of the target place, so that the event and abnormal situation needing to be noted are recorded by a high-quality image and clear picture only aiming at the target event with high importance, and when the event needing to be noted does not occur in the target place, the scene without abnormal situation and needing to be noted is recorded by a low code rate by general image and definition, so that network broadband and storage space are saved, and based on the situation, the network broadband and the storage space of a monitoring system are fully utilized, the longer-time picture can be stored, and meanwhile the recording effect of the monitoring system is ensured.
In some embodiments, the video bitstream generation device further includes:
the configuration module is used for configuring at least part of events of the target sites and code rates of the at least part of events based on the types of the target sites before determining the target events occurring in the real-time video data according to detection results of detection targets in the real-time video data;
the higher the priority of the event for the target place, the higher the code rate corresponding to the event.
In some embodiments, the second determining module in the video code stream generating device is specifically configured to, when determining, according to the target event, a target code rate of the real-time video data match:
determining the event priority corresponding to the target event according to the target event;
determining a target code rate corresponding to the event priority of the target event based on a pre-configured association relation between the event priority and the code rate; wherein, the lower the event priority, the lower the target code rate.
In some embodiments, the first determining module in the video code stream generating device is specifically configured to, when determining, according to a detection result for a detection target in the real-time video data, a target event occurring in the real-time video data:
Judging whether a first target event related to a detection target in the real-time video data occurs according to a first detection result aiming at the detection target in the real-time video data;
if so, extracting state information of a detection target in the real-time video data;
and judging whether at least one second target event associated with the detection target occurs or not according to the state information of the detection target.
In some embodiments, the second determining module in the video bitstream generating device is configured to determine, according to the target event, an event priority corresponding to the target event, where the second determining module is specifically configured to:
when the target event is a detection-free target or the detection target has no abnormal behavior, determining that the target event is a first priority;
when the target event is the occurrence of the detection target intrusion, determining that the target event is of a second priority;
when the target event is that the detection target meets the preset dangerous condition, determining the target time as a third priority;
wherein, the code rate corresponding to the first priority is lower than the code rate corresponding to the second priority, and the code rate corresponding to the second priority is lower than the code rate corresponding to the third priority; the preset dangerous condition is at least one of the following: the detection target performs dangerous actions and/or the category of the detection target belongs to a preset dangerous category.
In some embodiments, the encoding module in the video code stream generating device is specifically configured to, when performing encoding processing on real-time video data acquired after the occurrence of the target event according to the target code rate to generate a video code stream of the target location:
after determining that the target event occurs, setting the code rate parameter in the monitoring system as a target code rate;
the monitoring system collects real-time video data, and encodes the collected real-time video data according to a target code rate to generate a video code stream of a target location.
In some embodiments, the video bitstream generation device further includes:
the updating module is used for re-determining the target code rate matched with the real-time video data based on the changed target event when the change of the target event is detected after the real-time video data acquired after the target event occurs are subjected to coding processing according to the target code rate;
when the redetermined target code rate is larger than the original target code rate, updating the target code rate;
when the redetermined target code rate is smaller than the original target code rate, judging whether the stopping time length of the target event before the change exceeds a preset time length threshold value;
If the target event exceeds the target event, determining that the target event is ended, and updating the target code rate.
Based on the same inventive concept, the embodiment of the present application further provides an electronic device corresponding to the video code stream generating method, and since the principle of solving the problem of the electronic device in the embodiment of the present application is similar to that of the video code stream generating method in the embodiment of the present application, implementation of the electronic device may refer to implementation of the method, and repeated parts are not repeated.
In some embodiments, referring to fig. 5, fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present application, and specifically, the electronic device 500 includes: the video code stream generating method comprises a processor 502, a memory 501 and a bus, wherein the memory 501 stores machine-readable instructions executable by the processor 502, when the electronic device 500 is running, the processor 502 and the memory 501 are communicated through the bus, and the machine-readable instructions are executed by the processor 502 to execute the steps of the video code stream generating method.
Based on the same inventive concept, the embodiment of the present application further provides a computer readable storage medium corresponding to the video code stream generating method, and since the principle of solving the problem by using the computer readable storage medium in the embodiment of the present application is similar to that of the video code stream generating method in the embodiment of the present application, implementation of the computer readable storage medium can refer to implementation of the method, and redundant descriptions are omitted.
In some embodiments, a computer readable storage medium is also provided, on which a computer program is stored, which computer program, when being executed by a processor, performs the steps of the video bitstream generation method.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the method embodiments, and are not repeated in the present disclosure. In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, and for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other form.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily appreciate variations or alternatives within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.
Claims (9)
1. A video code stream generating method, which is applied to a monitoring system, the method comprising: configuring at least part of events of a target place and code rates of the at least part of events based on the type of the target place; the higher the priority of the event aiming at the target place is, the higher the code rate corresponding to the event is;
collecting real-time video data of a target place;
determining a target event occurring in the real-time video data according to a detection result for a detection target in the real-time video data;
determining a target code rate of the real-time video data matching according to the target event; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate;
and carrying out coding processing on the real-time video data acquired after the occurrence of the target event according to the target code rate so as to generate a video code stream of the target location and storing the video code stream of the target location.
2. The video bitstream generation method according to claim 1, wherein determining a target bitrate for the real-time video data match based on the target event comprises:
determining the event priority corresponding to the target event according to the target event;
determining a target code rate corresponding to the event priority of the target event based on a pre-configured association relation between the event priority and the code rate; wherein, the lower the event priority, the lower the target code rate.
3. The video bitstream generation method according to claim 1, wherein: determining a target event occurring in the real-time video data according to a detection result for a detection target in the real-time video data, including:
judging whether a first target event related to a detection target in the real-time video data occurs according to a first detection result aiming at the detection target in the real-time video data;
if so, extracting state information of a detection target in the real-time video data;
and judging whether at least one second target event associated with the detection target occurs or not according to the state information of the detection target.
4. The video bitstream generation method according to claim 2, wherein determining, according to the target event, an event priority corresponding to the target event includes:
When the target event is a detection-free target or the detection target has no abnormal behavior, determining that the target event is a first priority;
when the target event is the occurrence of the detection target intrusion, determining that the target event is of a second priority;
when the target event is that the detection target meets the preset dangerous condition, determining the target time as a third priority;
wherein, the code rate corresponding to the first priority is lower than the code rate corresponding to the second priority, and the code rate corresponding to the second priority is lower than the code rate corresponding to the third priority; the preset dangerous condition is at least one of the following: the detection target performs dangerous actions and/or the category of the detection target belongs to a preset dangerous category.
5. The method for generating a video code stream according to claim 1, wherein the encoding the real-time video data acquired after the occurrence of the target event according to the target code rate to generate the video code stream of the target location comprises:
after determining that the target event occurs, setting the code rate parameter in the monitoring system as a target code rate;
the monitoring system collects real-time video data, and encodes the collected real-time video data according to a target code rate to generate a video code stream of a target location.
6. The video bitstream generation method according to claim 1, wherein after encoding real-time video data acquired after occurrence of a target event according to a target code rate, the method further comprises:
when the change of the target event is detected, the target code rate matched with the real-time video data is redetermined based on the changed target event;
when the redetermined target code rate is larger than the original target code rate, updating the target code rate;
when the redetermined target code rate is smaller than the original target code rate, judging whether the stopping time length of the target event before the change exceeds a preset time length threshold value;
if the target event exceeds the target event, determining that the target event is ended, and updating the target code rate.
7. A video bitstream generation device, for use in a monitoring system, the device comprising:
the configuration module is used for configuring at least part of events of the target site and the code rate of the at least part of events based on the type of the target site; the higher the priority of the event aiming at the target place is, the higher the code rate corresponding to the event is;
the acquisition module is used for acquiring real-time video data of the target site;
the first determining module is used for determining a target event occurring in the real-time video data according to a detection result aiming at a detection target in the real-time video data;
The second determining module is used for determining a target code rate matched with the real-time video data according to the target event; wherein, different events corresponding to different code rates correspond to at least one event with the same code rate;
and the encoding module is used for encoding the real-time video data acquired after the occurrence of the target event according to the target code rate so as to generate a video code stream of the target location and storing the video code stream of the target location.
8. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication over the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the steps of the video bitstream generation method of any of claims 1 to 6.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the video bitstream generation method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310746386.XA CN116506664B (en) | 2023-06-25 | 2023-06-25 | Video code stream generation method and device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310746386.XA CN116506664B (en) | 2023-06-25 | 2023-06-25 | Video code stream generation method and device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116506664A CN116506664A (en) | 2023-07-28 |
CN116506664B true CN116506664B (en) | 2023-09-15 |
Family
ID=87328678
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310746386.XA Active CN116506664B (en) | 2023-06-25 | 2023-06-25 | Video code stream generation method and device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116506664B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102905200A (en) * | 2012-08-07 | 2013-01-30 | 上海交通大学 | Video interesting region double-stream encoding and transmitting method and system |
CN105791774A (en) * | 2016-03-31 | 2016-07-20 | 北京工业大学 | Surveillance video transmission method based on video content analysis |
CN108377411A (en) * | 2018-02-11 | 2018-08-07 | 浙江大华技术股份有限公司 | The method of transmission media data, the method and device for showing media data |
CN113114977A (en) * | 2021-02-20 | 2021-07-13 | 广州颐寿科技有限公司 | Intelligent nursing system and intelligent nursing method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8427552B2 (en) * | 2008-03-03 | 2013-04-23 | Videoiq, Inc. | Extending the operational lifetime of a hard-disk drive used in video data storage applications |
EP3742728B1 (en) * | 2019-05-24 | 2022-09-21 | Axis AB | A method and bitrate controller for controlling output bitrate of a video encoder |
-
2023
- 2023-06-25 CN CN202310746386.XA patent/CN116506664B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102905200A (en) * | 2012-08-07 | 2013-01-30 | 上海交通大学 | Video interesting region double-stream encoding and transmitting method and system |
CN105791774A (en) * | 2016-03-31 | 2016-07-20 | 北京工业大学 | Surveillance video transmission method based on video content analysis |
CN108377411A (en) * | 2018-02-11 | 2018-08-07 | 浙江大华技术股份有限公司 | The method of transmission media data, the method and device for showing media data |
CN113114977A (en) * | 2021-02-20 | 2021-07-13 | 广州颐寿科技有限公司 | Intelligent nursing system and intelligent nursing method |
Also Published As
Publication number | Publication date |
---|---|
CN116506664A (en) | 2023-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107948605B (en) | Method, device and equipment for storing vehicle-mounted monitoring video data and storage medium | |
KR102156818B1 (en) | Action recognition in a video sequence | |
CN109040709B (en) | Video monitoring method and device, monitoring server and video monitoring system | |
KR102217253B1 (en) | Apparatus and method for analyzing behavior pattern | |
CN110766915A (en) | Alarm method and system for identifying fire fighting access state | |
KR101949676B1 (en) | syntax-based method of providing intrusion detection in compressed video | |
CN114079820A (en) | Interval shooting video generation centered on an event/object of interest input on a camera device by means of a neural network | |
CN109960969B (en) | Method, device and system for generating moving route | |
US20110255590A1 (en) | Data transmission apparatus and method, network data transmission system and method using the same | |
CN111260869B (en) | Method and device for extracting video frames in monitoring video and computer equipment | |
CN101339561B (en) | Search method, device and monitoring system for monitoring video frequency image | |
KR20210067066A (en) | Intelligent surveillance system capable of independent directional warning | |
CN114666591A (en) | Method and system for generating a stream of image frames | |
CN114494955A (en) | Regional intrusion detection method and system based on video data and electronic equipment | |
CN116506664B (en) | Video code stream generation method and device, electronic equipment and medium | |
CN201142737Y (en) | Front end monitoring apparatus for IP network video monitoring system | |
CN113658394B (en) | River channel monitoring method and device | |
US20180084228A1 (en) | Low-fidelity always-on audio/video monitoring | |
CN104519357B (en) | A kind of video image storage method and apparatus | |
CN107231547B (en) | Video monitoring system and method | |
CN106781167A (en) | The method and apparatus of monitoring object motion state | |
CN213042656U (en) | Information processing apparatus | |
CN112367478A (en) | Tunnel robot panoramic image processing method and device | |
KR101711447B1 (en) | An apparatus of monitoring a traffic accident | |
CN114639172B (en) | High-altitude parabolic early warning method and system, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |