Coding parameter adjustment method and electronic device
By monitoring the changes in the monitoring type of video stream and adjusting the encoding parameters according to the remaining encoding capabilities of the equipment, the problem of low encoding utilization caused by the fixed encoding parameters in the prior art is solved, and more efficient encoding capability utilization is achieved.
Patent Information
- Application Number
- CN202510156878.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-02-12
AI Technical Summary
In the prior art, the encoding parameters can only be adjusted for single-channel videos, resulting in a fixed maximum encoding capability of each video, and failing to fully utilize the encoding capability of electronic devices for each video, resulting in a low encoding utilization rate.
By monitoring the video streams of each acquisition channel, when a change in monitoring type is detected, the encoding parameters of the acquisition channel are adjusted according to the remaining encoding capabilities of the device to ensure that it reaches the target encoding capability, thereby improving the encoding utilization rate.
It realizes dynamic adjustment of encoding parameters according to changes in the monitoring type of video stream, fully utilizes the encoding capabilities of the equipment, and improves the encoding utilization rate.
Smart Images

Figure CN119653093B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a coding parameter adjustment method and electronic equipment. Background Art
[0002] At present, electronic devices with video acquisition functions can detect and save the collected videos through different monitoring types. The monitoring types include motion detection type and ordinary type. Among them, the motion detection type means that the video will be collected only after the front-end camera triggers the dynamic detection alarm, and no video will be collected if it is not triggered; the ordinary type means that no specific event does not need to be triggered, and all images within the specified time period can be collected.
[0003] When the electronic device detects and saves the collected video using the ordinary type, the front-end camera triggers a dynamic detection alarm. At this time, the dynamic detection type is used to collect the video, and the collected video is encoded according to the encoding parameters corresponding to the dynamic detection type set by the user.
[0004] However, currently, the encoding parameters are adjusted for a single video channel, and the maximum encoding capacity corresponding to each video channel is fixed, which does not fully utilize the encoding capacity of the electronic equipment for each video channel, resulting in a low encoding utilization rate. Summary of the invention
[0005] The present invention provides a coding parameter adjustment method and electronic equipment, which are used to adaptively adjust the coding parameters of a collection channel according to changes in the monitoring type of a collected video stream, fully utilize the coding capability of the equipment, and improve the utilization rate of the coding capability of the equipment.
[0006] In a first aspect, an embodiment of the present invention provides a method for adjusting coding parameters, the method comprising:
[0007] Obtain a video stream of at least one acquisition channel;
[0008] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type, a target parameter corresponding to the target coding capacity is determined according to the remaining coding capacity of the electronic device, wherein the remaining coding capacity represents the coding capacity of the electronic device not occupied by the acquisition channel;
[0009] The encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters.
[0010] The encoding capacity in this embodiment can be adjusted according to the encoding capacity of the device. The encoding upper limit of a certain acquisition channel is no longer fixed. The encoding capacity is reasonably allocated to each acquisition channel according to the image content of each acquisition channel.
[0011] As an optional implementation manner, determining the target parameter corresponding to the target coding capability according to the remaining coding capability of the electronic device includes:
[0012] Determine a first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel;
[0013] The target parameter is determined according to the remaining coding capacity and the first difference.
[0014] As an optional implementation manner, determining the target parameter according to the remaining coding capability and the first difference includes:
[0015] If the remaining coding capacity is greater than the first difference, determining the target parameter to be a coding parameter corresponding to the target coding capacity;
[0016] The target coding capability includes an optimal coding capability and / or a worst coding capability.
[0017] As an optional implementation, the method further includes:
[0018] If the remaining coding capacity is less than the first difference, increasing the remaining coding capacity by reducing the coding capacities corresponding to other acquisition channels;
[0019] When the increased remaining coding capacity is greater than the first difference, the target parameter is determined to be a coding parameter corresponding to the target coding capacity.
[0020] As an optional implementation, the method further includes:
[0021] When the adjusted remaining coding capacity is less than the first difference, reducing the target coding capacity;
[0022] Determine a second difference between the reduced target coding capacity and the coding capacity occupied by the current acquisition channel;
[0023] The target parameter is determined according to the remaining coding capacity and the second difference.
[0024] As an optional implementation, the method further includes:
[0025] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the encoding capacity occupied by the current acquisition channel is greater than the target encoding capacity corresponding to the changed monitoring type, the encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters corresponding to the target encoding capacity.
[0026] As an optional implementation, whether the monitoring type has changed is determined in the following manner:
[0027] Input the video stream of the current acquisition channel into the detection models corresponding to different monitoring types respectively, and determine the monitoring type of the video stream of the current acquisition channel according to the detection results of the detection model corresponding to each monitoring type;
[0028] According to the comparison result of the monitoring type of the current video stream and the monitoring type of the previous video stream, it is determined whether the monitoring type of the video stream of the current acquisition channel has changed.
[0029] As an optional implementation, the remaining encoding capability of the electronic device is determined in the following manner:
[0030] The remaining coding capacity is determined according to the total coding capacity of the electronic device and the coding capacity occupied by each acquisition channel.
[0031] In a second aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory is used to store a program executable by the processor, and the processor is used to read the program in the memory and perform the following steps:
[0032] Obtain a video stream of at least one acquisition channel;
[0033] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type, a target parameter corresponding to the target coding capacity is determined according to the remaining coding capacity of the electronic device, wherein the remaining coding capacity represents the coding capacity of the electronic device not occupied by the acquisition channel;
[0034] The encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters.
[0035] As an optional implementation, the processor is specifically configured to execute:
[0036] Determine a first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel;
[0037] The target parameter is determined according to the remaining coding capacity and the first difference.
[0038] As an optional implementation, the processor is specifically configured to execute:
[0039] If the remaining coding capacity is greater than the first difference, determining the target parameter to be a coding parameter corresponding to the target coding capacity;
[0040] The target coding capability includes an optimal coding capability and / or a worst coding capability.
[0041] As an optional implementation, the processor is further configured to execute:
[0042] If the remaining coding capacity is less than the first difference, increasing the remaining coding capacity by reducing the coding capacities corresponding to other acquisition channels;
[0043] When the increased remaining coding capacity is greater than the first difference, the target parameter is determined to be a coding parameter corresponding to the target coding capacity.
[0044] As an optional implementation, the processor is further configured to execute:
[0045] When the adjusted remaining coding capacity is less than the first difference, reducing the target coding capacity;
[0046] Determine a second difference between the reduced target coding capacity and the coding capacity occupied by the current acquisition channel;
[0047] The target parameter is determined according to the remaining coding capacity and the second difference.
[0048] As an optional implementation, the processor is further configured to execute:
[0049] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the encoding capacity occupied by the current acquisition channel is greater than the target encoding capacity corresponding to the changed monitoring type, the encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters corresponding to the target encoding capacity.
[0050] As an optional implementation, the processor is specifically configured to determine whether the monitoring type changes in the following manner:
[0051] Input the video stream of the current acquisition channel into the detection models corresponding to different monitoring types respectively, and determine the monitoring type of the video stream of the current acquisition channel according to the detection results of the detection model corresponding to each monitoring type;
[0052] According to the comparison result of the monitoring type of the current video stream and the monitoring type of the previous video stream, it is determined whether the monitoring type of the video stream of the current acquisition channel has changed.
[0053] As an optional implementation manner, the processor is specifically configured to determine the remaining encoding capacity of the electronic device in the following manner:
[0054] The remaining coding capacity is determined according to the total coding capacity of the electronic device and the coding capacity occupied by each acquisition channel.
[0055] In a third aspect, an embodiment of the present invention further provides a coding parameter adjustment device, the device comprising:
[0056] A video acquisition unit, used to acquire a video stream of at least one acquisition channel;
[0057] a parameter determination unit, configured to determine a target parameter corresponding to the target coding capacity according to a remaining coding capacity of the electronic device when detecting that the monitoring type of the video stream of the current acquisition channel has changed and the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type, wherein the remaining coding capacity represents the coding capacity of the electronic device not occupied by the acquisition channel;
[0058] The parameter adjustment unit is used to adjust the encoding parameters corresponding to the current acquisition channel to the target parameters.
[0059] As an optional implementation manner, the parameter determination unit is specifically used to:
[0060] Determine a first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel;
[0061] The target parameter is determined according to the remaining coding capacity and the first difference.
[0062] As an optional implementation manner, the parameter determination unit is specifically used to:
[0063] If the remaining coding capacity is greater than the first difference, determining the target parameter to be a coding parameter corresponding to the target coding capacity;
[0064] The target coding capability includes an optimal coding capability and / or a worst coding capability.
[0065] As an optional implementation manner, the parameter determination unit is further configured to:
[0066] If the remaining coding capacity is less than the first difference, increasing the remaining coding capacity by reducing the coding capacities corresponding to other acquisition channels;
[0067] When the increased remaining coding capacity is greater than the first difference, the target parameter is determined to be a coding parameter corresponding to the target coding capacity.
[0068] As an optional implementation manner, the parameter determination unit is further configured to:
[0069] When the adjusted remaining coding capacity is less than the first difference, reducing the target coding capacity;
[0070] Determine a second difference between the reduced target coding capacity and the coding capacity occupied by the current acquisition channel;
[0071] The target parameter is determined according to the remaining coding capacity and the second difference.
[0072] As an optional implementation manner, the parameter adjustment unit is further configured to:
[0073] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the encoding capacity occupied by the current acquisition channel is greater than the target encoding capacity corresponding to the changed monitoring type, the encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters corresponding to the target encoding capacity.
[0074] As an optional implementation manner, the parameter determination unit is specifically used to determine whether the monitoring type changes in the following manner:
[0075] Input the video stream of the current acquisition channel into the detection models corresponding to different monitoring types respectively, and determine the monitoring type of the video stream of the current acquisition channel according to the detection results of the detection model corresponding to each monitoring type;
[0076] According to the comparison result of the monitoring type of the current video stream and the monitoring type of the previous video stream, it is determined whether the monitoring type of the video stream of the current acquisition channel has changed.
[0077] As an optional implementation manner, the parameter determination unit is specifically configured to determine the remaining encoding capability of the electronic device in the following manner:
[0078] The remaining coding capacity is determined according to the total coding capacity of the electronic device and the coding capacity occupied by each acquisition channel.
[0079] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, it is used to implement the steps of any one of the methods described in the first aspect above.
[0080] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.
[0081] These and other aspects of the present application will be more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0083] Figure 1 A flowchart of an implementation method of a coding parameter adjustment method provided by an embodiment of the present invention;
[0084] Figure 2 A flowchart of video acquisition and monitoring provided by an embodiment of the present invention;
[0085] Figure 3 A schematic diagram of video encoding and storage provided by an embodiment of the present invention;
[0086] Figure 4 A multi-channel video encoding parameter adjustment scheme provided by an embodiment of the present invention;
[0087] Figure 5 A flowchart of an implementation of coding parameter adjustment provided by an embodiment of the present invention;
[0088] Figure 6 A flowchart of an implementation of coding parameter adjustment provided by an embodiment of the present invention;
[0089] Figure 7 A schematic diagram of an electronic device provided by an embodiment of the present invention;
[0090] Figure 8 A schematic diagram of a coding parameter adjustment device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0091] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0092] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0093] The application scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0094] Before introducing the coding parameter adjustment method provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.
[0095] At present, electronic devices with video acquisition functions can detect and save the collected videos through different monitoring types. The monitoring types include motion detection type and ordinary type. Among them, the motion detection type means that the video will be collected only after the front-end camera triggers the dynamic detection alarm, and no collection will be made if it is not triggered; the ordinary type means that no specific event needs to be triggered, and all pictures within a specified time period can be collected. In the process of the electronic device using the ordinary type to detect and save the collected video, the front-end camera triggers a dynamic detection alarm. At this time, the motion detection type is used to collect the video, and the collected video is encoded according to the encoding parameters corresponding to the motion detection type set by the user. However, the current encoding parameters can only be adjusted for a single video (the video stream of a single acquisition channel), and the maximum encoding capacity corresponding to each video is fixed, for example, the maximum encoding capacity corresponding to a single acquisition channel = the total encoding capacity of the device / the number of acquisition channels. For example, some electronic devices have a fixed encoding capacity of 30fps for the real-time acquisition channel and a encoding capacity of 15fps for the remaining non-real-time acquisition channels. When actually used, the priority corresponding to the real-time acquisition channel is lower than the priority corresponding to the non-real-time acquisition channel, and the encoding capacity of the non-real-time channel cannot be improved. Therefore, current video acquisition solutions do not fully utilize the encoding capabilities of electronic devices for each channel of video, resulting in low encoding utilization.
[0096] In order to solve the above technical problems, the embodiment of the present application provides a coding parameter adjustment method, the core idea of which is to monitor the video stream of each acquisition channel. When it is detected that the monitoring type of the video stream of the acquisition channel has changed, it is determined whether the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type. If the currently occupied coding capacity is lower than the target coding capacity, the remaining coding capacity of the device can be used to provide additional coding capacity for the current acquisition channel, thereby adjusting the coding parameters of the current acquisition channel to the target parameters corresponding to the target coding capacity. The coding capacity in this embodiment can be adjusted according to the coding capacity of the device, and the coding upper limit of a certain acquisition channel is no longer fixed. The coding capacity is reasonably allocated to each acquisition channel according to the picture content of each acquisition channel collected.
[0097] like Figure 1 As shown, the implementation process of a coding parameter adjustment method provided in this embodiment is applied to an electronic device, and the electronic device includes a host and at least one camera unit; the specific implementation process of the method is as follows:
[0098] Step 100: Obtain a video stream of at least one acquisition channel;
[0099] In implementation, the number of acquisition channels is determined according to the number of camera units of the electronic device. One camera unit corresponds to one acquisition channel, and one camera unit transmits the recorded / shot video screen to the host. It should be noted that the video stream is recorded by the acquisition channel of the electronic device, and the format of the video stream includes but is not limited to: H.264, H.265 and MPEG-4, etc.
[0100] Step 101: When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type, a target parameter corresponding to the target coding capacity is determined according to the remaining coding capacity of the device, wherein the remaining coding capacity represents the coding capacity of the device not occupied by the acquisition channel;
[0101] Optionally, the monitoring types in this embodiment include, but are not limited to: motion detection type, smart motion detection (SmartMotion Detection, SMD) type, and ordinary type. Among them, the motion detection type refers to the video acquisition function realized by motion detection technology. The video will be collected only after the front-end camera triggers the motion detection alarm, and no video will be collected if it is not triggered. In the monitoring system, motion detection recording (video acquisition of motion detection type) is used to record the dynamic situation of the detection point. The monitoring probe (camera unit) can be set in a specific area as needed. When the picture changes, the system will automatically record. The working principle of motion detection recording is to capture images at different frame rates through the camera, and then calculate and compare them according to a specific algorithm through the CPU. When the picture changes, such as someone walks by or the lens is moved, the result of the calculation and comparison will exceed the set threshold, thereby instructing the system to perform corresponding processing, such as automatic recording.
[0102] Smart Motion Detection (SMD) is an intelligent detection technology based on the traditional motion detection function. It is mainly used to determine the category of moving objects (such as people and cars) in the video, so as to determine whether to trigger the motion detection alarm. In this way, smart motion detection can effectively reduce false alarms triggered by environmental factors (such as numerical values, wind movement, light and shadow, insects, etc.), and improve the accuracy and reliability of detection. Smart Motion Detection SMD analyzes moving objects in the video, identifies targets such as people and motor vehicles, and performs alarm linkage actions when these targets are detected. The system will store the detection results in a structured manner for subsequent rapid retrieval. For example, in road traffic scenarios, smart motion detection can effectively detect moving vehicles and pedestrians, trigger alarms in time, and improve the efficiency and safety of traffic management. In park monitoring, smart motion detection can help identify abnormal activities and improve the safety protection level of the park.
[0103] The normal type means that no specific event needs to be triggered and all images within a specified time period can be collected. Usually, the images are saved in the storage device in the form of a loop overwrite. The recorded content is relatively ordinary and is mainly used for general monitoring of the area.
[0104] In some embodiments, whether the monitoring type has changed is determined by:
[0105] Input the video stream of the current acquisition channel into the detection models corresponding to different monitoring types respectively, and determine the monitoring type of the video stream of the current acquisition channel according to the detection results of the detection model corresponding to each monitoring type;
[0106] According to the comparison result of the monitoring type of the current video stream and the monitoring type of the previous video stream, it is determined whether the monitoring type of the video stream of the current acquisition channel has changed.
[0107] During implementation, the video stream of the current acquisition channel is respectively input into the motion detection detection model of the motion detection type and the SMD detection model of the SMD type. If the detection result of the motion detection detection model is motion detection and the detection result of the SMD detection model is non-SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be the motion detection type; if the detection result of the motion detection detection model is non-motion detection and the detection result of the SMD detection model is SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be the SMD type; if the detection result of the motion detection detection model is non-motion detection and the detection result of the SMD detection model is non-SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be the ordinary type; if the detection result of the motion detection detection model is motion detection and the detection result of the SMD detection model is SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be a combination of the motion detection type and the SMD type.
[0108] like Figure 2 As shown, the present embodiment also provides a flowchart of video acquisition and monitoring, wherein the electronic device includes n acquisition channels, n≥1, n is an integer, and the video frames acquired by each acquisition channel are respectively input into the motion detection model for motion detection and input into the SMD detection model for SMD detection, and the detection results of each module are reported to the application layer. The application layer comprehensively determines the monitoring type of the video stream of the current acquisition channel according to the detection results of each module, and further determines whether the monitoring type has changed. When the monitoring type changes, the encoding parameters are adjusted, and the adjusted encoding parameters are sent to the encoder for the encoder to encode the acquired video stream.
[0109] In some embodiments, the remaining encoding capacity of the electronic device is determined by:
[0110] The remaining coding capacity is determined according to the total coding capacity of the electronic device and the coding capacity occupied by each acquisition channel.
[0111] In implementation, the remaining coding capacity = total coding capacity - the sum of the coding capacities occupied by each acquisition channel. When the remaining coding capacity is sufficient to support the coding capacity required by the current acquisition channel, additional coding capacity is allocated to the current acquisition channel from the remaining coding capacity, so that the coding capacity of the current acquisition channel meets the target coding capacity, thereby adjusting the coding parameters corresponding to the current acquisition channel to the target parameters.
[0112] Step 102: Adjust the encoding parameters corresponding to the current acquisition channel to the target parameters.
[0113] During implementation, when it is detected that the monitoring type corresponding to the current acquisition channel has changed, it is determined whether the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type. If the coding capacity occupied by the current acquisition channel is lower than the target coding capacity, it means that the occupied coding capacity at this time is insufficient to reach the target coding capacity, and the remaining coding capacity of the electronic device needs to be reallocated. Additional coding capacity can be allocated to the current acquisition channel from the remaining coding capacity, so that the coding capacity of the current acquisition channel after allocation can meet the target coding capacity corresponding to the changed monitoring type, thereby switching the coding parameters corresponding to the current acquisition channel to the target parameters.
[0114] Optionally, the encoding capability of an electronic device refers to the encoding capability of a main chip of the electronic device, and the encoding capability specifically refers to the number of video frames (N frames) of M resolution (the size of one video frame) that can be encoded per unit time, that is, the encoding capability in this embodiment refers to M resolution that can encode N frames in one second. For example, taking M=1080 as an example, a coding capability of 30fps means that 30 frames of 1080 resolution can be encoded in one second.
[0115] Optionally, the encoding capability in this embodiment includes, but is not limited to: one or more of: frame rate (Frames Per Second, fps), resolution, bit rate, and image quality.
[0116] It should be noted that the target coding capabilities corresponding to different monitoring types are different. Optionally, the target coding capability includes the optimal coding capability and / or the worst coding capability. In implementation, the optimal coding capability corresponding to the SMD type is greater than the optimal coding capability corresponding to the dynamic detection type, and the optimal coding capability corresponding to the dynamic detection type is greater than the optimal coding capability corresponding to the ordinary type. The worst coding capability corresponding to the SMD type is greater than the worst coding capability corresponding to the dynamic detection type, and the worst coding capability corresponding to the dynamic detection type is greater than the worst coding capability corresponding to the ordinary type.
[0117] As shown in Table 1, this embodiment provides a channel coding capability specification table, in which the optimal coding capability / worst coding capability corresponding to different monitoring types is different, and the electronic device includes 16 camera units (16 acquisition channels), including 4 real-time acquisition channels and 12 non-real-time acquisition channels. The number of real-time acquisition channels and non-real-time acquisition channels can be pre-configured by the electronic device, but the target coding capability of the real-time acquisition channels and non-real-time acquisition channels can be dynamically adjusted, as shown below:
[0118] Table 1 Channel coding capability specifications
[0119]
[0120] In the table, the higher level of resolution is greater than the lower level of resolution. I-frame (Intra Coded Frames) is a frame type in video compression, also known as intra-coded frames or key frames. An I-frame is a complete picture that can be decoded independently without reference to other frames to generate a complete image. An I-frame is usually the first frame of a Group of Pictures (GOP) and serves as a reference point for random access.
[0121] During implementation, when it is detected that the monitoring type corresponding to the current acquisition channel is switched from the ordinary type to the motion detection type, it is first determined whether the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the motion detection type. If the currently occupied coding capacity is lower than the target coding capacity corresponding to the motion detection type, the target parameters corresponding to the target coding capacity can be determined according to the remaining coding capacity, that is, the target parameters corresponding to the optimal coding capacity or the worst coding capacity are determined, thereby adjusting the coding parameters of the current acquisition channel to the target parameters.
[0122] The coding parameter adjustment method provided in this embodiment can allocate the coding capacity of the current acquisition channel to other acquisition channels, and can also obtain coding capacity from other acquisition channels. Specifically, according to the monitoring type of each acquisition channel of the device, based on the occupied coding capacity, the required target coding capacity and the remaining coding capacity of the device, the coding capacity can be reasonably allocated to each acquisition channel, thereby adaptively adjusting the coding parameters of each acquisition channel.
[0123] In some embodiments, this embodiment determines the target parameter corresponding to the target coding capability through the following steps:
[0124] Determine a first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel; and determine the target parameter according to the remaining coding capacity and the first difference.
[0125] In the implementation, the first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel is calculated. If the first difference is less than 0, it means that the coding capacity occupied by the current acquisition channel is sufficient to support the target coding capacity. At this time, the coding parameters corresponding to the current acquisition channel can be directly adjusted to the target parameters. If the first difference is greater than 0, it means that the coding capacity occupied by the current acquisition channel is insufficient to support the target coding capacity. At this time, it can be determined whether the target coding capacity needs to be adjusted based on the remaining coding capacity and the size of the first difference, thereby determining the final target parameters.
[0126] In some embodiments, this embodiment determines the target parameter according to the remaining coding capability and the first difference in the following manner:
[0127] If the remaining coding capacity is greater than the first difference, the target parameter is determined to be a coding parameter corresponding to the target coding capacity; wherein the target coding capacity includes an optimal coding capacity and / or a worst coding capacity.
[0128] During implementation, when the target coding capacity is the optimal coding capacity, if the remaining coding capacity is greater than the first difference, the target parameter is determined to be the coding parameter corresponding to the optimal coding capacity; when the target coding capacity is the worst coding capacity, if the remaining coding capacity is greater than the first difference, the target parameter is determined to be the coding parameter corresponding to the worst coding capacity.
[0129] In some embodiments, when the remaining coding capacity is less than the first difference, the coding capacity of the current acquisition channel may be improved by adjusting the coding capacity of other acquisition channels. The specific implementation steps are as follows:
[0130] If the remaining coding capacity is less than the first difference, the remaining coding capacity is increased by reducing the coding capacities corresponding to other acquisition channels; when the increased remaining coding capacity is greater than the first difference, the target parameter is determined to be the coding parameter corresponding to the target coding capacity.
[0131] In implementation, the encoding capabilities of other acquisition channels can be reduced one by one in sequence, that is, the encoding capabilities of other acquisition channels are adjusted from encoding parameters corresponding to the optimal encoding capabilities to encoding parameters corresponding to the worst encoding capabilities. Other acquisition channels refer to acquisition channels other than the current acquisition channel.
[0132] In some embodiments, when the adjusted remaining coding capacity is less than the first difference, the coding capacity of each channel may be readjusted by reducing the target coding capacity. The specific implementation steps are as follows:
[0133] When the adjusted remaining coding capacity is less than the first difference, the target coding capacity is reduced; a second difference between the reduced target coding capacity and the coding capacity occupied by the current acquisition channel is determined; and the target parameter is determined according to the remaining coding capacity and the second difference.
[0134] During implementation, if the coding capabilities of other acquisition channels are adjusted to the coding parameters of the corresponding worst coding capabilities, and the remaining coding capabilities after adjustment are still less than the first difference, the optimal coding capability at this time is adjusted to the worst coding capability, and adjustment is continued based on the worst coding capability.
[0135] In some embodiments, the target parameter is determined according to the remaining coding capability and the second difference in the following manner:
[0136] If the remaining coding capacity is greater than the second difference, the target parameter is determined to be a coding parameter corresponding to the reduced target coding capacity; wherein the target coding capacity includes an optimal coding capacity and / or a worst coding capacity.
[0137] In some embodiments, when the remaining coding capacity is less than the second difference, the coding capacity of each channel may be adjusted by reducing the coding capacity of other acquisition channels, as shown below:
[0138] If the remaining coding capacity is less than the second difference, increasing the remaining coding capacity by reducing the coding capacities corresponding to other acquisition channels;
[0139] When the increased remaining coding capacity is greater than the second difference, the target parameter is determined to be a coding parameter corresponding to the reduced target coding capacity.
[0140] In some embodiments, this embodiment may also adjust the encoding parameters corresponding to the current acquisition channel based on the encoding capacity occupied by the current acquisition channel. The specific steps are as follows:
[0141] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the encoding capacity occupied by the current acquisition channel is greater than the target encoding capacity corresponding to the changed monitoring type, the encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters corresponding to the target encoding capacity.
[0142] During implementation, if the coding capacity occupied by the current acquisition channel is greater than the target coding capacity corresponding to the changed monitoring type, it means that the coding capacity occupied by the current acquisition channel can already meet the target coding capacity corresponding to the changed monitoring type. Then the coding parameters corresponding to the current acquisition channel can be directly switched to the target parameters corresponding to the target coding capacity.
[0143] like Figure 3As shown, this embodiment provides a schematic diagram of video encoding and storage, and the encoding and storage of the video streams of each acquisition channel are realized through the application of the host of the electronic device, wherein the acquired video stream is detected by the media layer (Libmed) of the application, and when the motion detection type is detected, an alarm message is sent to the application layer (Libapp). When the application layer determines that the video stream of the current acquisition channel has changed from the non-motion detection type to the motion detection type, the encoding parameters of the current acquisition channel are adjusted, and the application layer transmits the adjusted encoding parameters to the media layer. The media layer encodes the video stream using the adjusted encoding parameters, and the application layer performs code stream packaging on the encoded video stream, and then saves it. In implementation, during the process of ordinary video storage, if the media layer detects the motion detection type, it is reported to the application layer, the application layer adjusts the encoding parameters, and sends the adjusted encoding parameters to the media layer. The media layer encodes according to the encoding parameters, and the code stream will be re-cut to the file for packaging and storage.
[0144] like Figure 4 As shown, this embodiment also provides a multi-channel video encoding parameter adjustment solution. Taking 4-channel acquisition channels as an example, the media layer (Libmed) of the application performs video detection on the acquired video stream. The video detection is used to determine whether the monitoring type of the video stream of the current acquisition channel has changed, and the detection result is reported to the application layer (Libapp). The parameter adjustment module of the application layer adjusts the encoding parameters (frame rate, resolution and other parameters) corresponding to the current acquisition channel through comprehensive considerations such as the detection result and the encoding capability, and sends the adjusted target parameters to the acquisition channel corresponding to the media layer (Libmed). The encoder is used to encode the video streams of each acquisition channel in combination with the sent target parameters, and the encoded video streams are repackaged and adjusted for storage.
[0145] In implementation, the results of video detection include any one or more of the following:
[0146] The first type is that the monitoring type changes, and the changed monitoring type is the dynamic inspection type.
[0147] Optionally, when the motion detection type is detected, the motion detection ratio can be further determined, that is, the ratio of the motion detection area to the entire screen. During implementation, the difference between the previous and next video frames can be compared to determine which areas of the screen have changed, and the motion detection ratio can be determined based on the range of the change.
[0148] In some embodiments, when it is detected that the monitoring type of the video stream of the current acquisition channel has not changed and the monitoring type is a motion detection type, if it is detected that the difference between the motion detection ratio of the current video stream of the current acquisition channel and the motion detection ratio of the previous video stream exceeds a threshold, it indicates that the change is relatively drastic at this time, and therefore the encoding parameters corresponding to the current acquisition channel can be increased.
[0149] The second type is that the monitoring type changes, and the changed monitoring type is SMD type.
[0150] In implementation, if the monitoring type of the current acquisition channel changes from ordinary to SMD, that is, when a person, car or other target is detected from the current video stream, it is determined that the monitoring type has changed. It should be noted that the detection of SMD type requires computing power of electronic equipment.
[0151] The third type is that the monitoring type changes. The changed monitoring type is a combination of the dynamic inspection type and the SMD type.
[0152] In this embodiment, the additional coding capability of the current acquisition channel may be calculated by any one or more of the following methods, as follows:
[0153] Method 1: The optimal coding capacity corresponding to the monitoring type - the coding capacity occupied by the current acquisition channel = the first difference (i.e., the additional coding capacity).
[0154] Method 2: The worst coding capability corresponding to the monitoring type minus the coding capability occupied by the current acquisition channel = the second difference (i.e., the additional coding capability).
[0155] If the first difference / second difference is a negative number, it means that the encoding capability corresponding to the current encoding parameters is greater than the encoding capability corresponding to the encoding parameters to be set, and it is possible that the SMD type is switched to the dynamic detection type or the ordinary type; otherwise, if it is a positive number, it means that the dynamic detection type or the ordinary type is switched to the SMD type; if it is 0, it means that the currently set encoding parameters do not need to be modified.
[0156] like Figure 5 As shown, this embodiment also provides an implementation process of adjusting the encoding parameters, which is specifically as follows:
[0157] Step 500: Obtain a video stream of at least one acquisition channel;
[0158] Step 501: Perform video detection on a video stream of at least one acquisition channel, and determine that the detection result is SMD;
[0159] Optionally, the detection results include but are not limited to one or more of dynamic detection type, SMD type, and ordinary type.
[0160] Step 502: determine whether the current test result is consistent with the previous test result. If so, the process ends. Otherwise, proceed to step 503.
[0161] If the current detection result is consistent with the previous detection result, it means that the monitoring type of the video stream of the current acquisition channel has not changed, and the current process can be ended without adjusting the encoding parameters.
[0162] Step 503, calculating a first difference between the optimal coding capability corresponding to the SMD type and the coding capability occupied by the current acquisition channel; if the first difference is a positive number, executing step 504, and if the first difference is a negative number, executing step 511;
[0163] In implementation, if the first difference is a negative number, it means that the encoding capacity occupied by the current acquisition channel is sufficient to be set according to the optimal encoding capacity corresponding to the SMD type, and the encoding parameters are directly set to the target parameters of the optimal encoding capacity corresponding to the SMD type. If the first difference is 0, there is no need to adjust the current encoding parameters.
[0164] Step 504: if the first difference is a positive number, determine whether the remaining coding capacity is less than the first difference, if so, execute step 505, otherwise execute step 511;
[0165] During implementation, the size of the remaining coding capacity and the first difference is determined. If the remaining coding capacity is greater than or equal to the first difference, it means that the remaining coding capacity is sufficient, and the target parameter of the optimal coding capacity corresponding to the SMD type is directly set.
[0166] Step 505: reduce the encoding capabilities corresponding to other acquisition channels;
[0167] In implementation, when the remaining coding capacity is less than the first difference, it means that the remaining coding capacity is insufficient to support the optimal coding capacity corresponding to the SMD type, and therefore the coding capacity corresponding to other acquisition channels needs to be reduced.
[0168] Step 506, determining whether the reduced remaining coding capacity is less than the first difference, if so, executing step 507, otherwise executing step 511;
[0169] If the remaining coding capacity does not meet the setting according to the optimal coding capacity, then it is necessary to reduce the coding capacity of other acquisition channels until the coding capacity of other acquisition channels is reduced to the worst coding capacity or the remaining coding capacity after reduction is greater than or equal to the first difference.
[0170] Step 507, calculating a second difference between the worst coding capability corresponding to the SMD type and the coding capability occupied by the current acquisition channel; if the second difference is a positive number, executing step 508, if the second difference is a negative number, executing step 512;
[0171] In implementation, the second difference = the worst coding capability corresponding to the SMD type - the coding capability occupied by the current acquisition channel.
[0172] Step 508, determining whether the remaining coding capacity is less than the second difference, if so, executing step 511, otherwise executing step 512;
[0173] Step 509: reduce the encoding capabilities corresponding to other acquisition channels;
[0174] During implementation, the coding capabilities of other acquisition channels can be reduced one by one in sequence, that is, the coding capabilities of other acquisition channels are adjusted from the coding parameters corresponding to the optimal coding capabilities to the coding parameters corresponding to the worst coding capabilities, until the coding capabilities of other acquisition channels are reduced to the worst coding capabilities or the remaining coding capabilities after reduction are greater than or equal to the first difference.
[0175] Step 510: determine whether the remaining coding capacity after reduction is less than the second difference. If so, restart the adjustment process and indicate that the adjustment failed. Otherwise, execute step 512.
[0176] Step 511: Adjust the encoding parameters corresponding to the current acquisition channel to the optimal encoding capability corresponding to the SMD type;
[0177] Step 512: Adjust the encoding parameters corresponding to the current acquisition channel to the worst encoding capability corresponding to the SMD type.
[0178] like Figure 6 As shown, this embodiment also provides an implementation process of adjusting the encoding parameters, which is specifically as follows:
[0179] Step 600: Obtain a video stream of at least one acquisition channel;
[0180] Step 601: Perform video detection on a video stream of at least one acquisition channel, and determine that the detection result is motion detection;
[0181] Optionally, the detection results include but are not limited to one or more of dynamic detection type, SMD type, and ordinary type.
[0182] Step 602: determine whether the current test result is consistent with the previous test result. If so, end. Otherwise, execute step 603.
[0183] If the current detection result is consistent with the previous detection result, it means that the monitoring type of the video stream of the current acquisition channel has not changed, and the current process can be ended without adjusting the encoding parameters.
[0184] Step 603, calculating a first difference between the optimal coding capacity corresponding to the motion detection type and the coding capacity occupied by the current acquisition channel; if the first difference is a positive number, executing step 604, if the first difference is a negative number, executing step 611;
[0185] In implementation, if the first difference is a negative number, it means that the encoding capacity occupied by the current acquisition channel is sufficient to be set according to the optimal encoding capacity corresponding to the motion detection type, and the encoding parameters are directly set to the target parameters of the optimal encoding capacity corresponding to the motion detection type. If the first difference is 0, there is no need to adjust the current encoding parameters.
[0186] Step 604: If the first difference is a positive number, determine whether the remaining coding capacity is less than the first difference. If so, execute step 605; otherwise, execute step 611;
[0187] During implementation, the size of the remaining coding capacity and the first difference is determined. If the remaining coding capacity is greater than or equal to the first difference, it means that the remaining coding capacity is sufficient, and the target parameter of the optimal coding capacity corresponding to the motion detection type is directly set.
[0188] Step 605: reduce the encoding capabilities corresponding to other acquisition channels;
[0189] In implementation, when the remaining coding capacity is less than the first difference, it means that the remaining coding capacity is insufficient to support the optimal coding capacity corresponding to the motion detection type, and therefore the coding capacity corresponding to other acquisition channels needs to be reduced.
[0190] Step 606: Determine whether the remaining coding capacity after reduction is less than the first difference, if so, execute step 607, otherwise execute step 611;
[0191] If the remaining coding capacity does not meet the setting according to the optimal coding capacity, then it is necessary to reduce the coding capacity of other acquisition channels until the coding capacity of other acquisition channels is reduced to the worst coding capacity or the remaining coding capacity after reduction is greater than or equal to the first difference.
[0192] Step 607, calculating a second difference between the worst coding capability corresponding to the motion detection type and the coding capability occupied by the current acquisition channel; if the second difference is a positive number, executing step 608, if the second difference is a negative number, executing step 612;
[0193] In implementation, the second difference = the worst encoding capability corresponding to the motion detection type - the encoding capability occupied by the current acquisition channel.
[0194] Step 608, determining whether the remaining coding capacity is less than the second difference, if so, executing step 611, otherwise executing step 612;
[0195] Step 609: reduce the encoding capabilities corresponding to other acquisition channels;
[0196] During implementation, the coding capabilities of other acquisition channels can be reduced one by one in sequence, that is, the coding capabilities of other acquisition channels are adjusted from the coding parameters corresponding to the optimal coding capabilities to the coding parameters corresponding to the worst coding capabilities, until the coding capabilities of other acquisition channels are reduced to the worst coding capabilities or the remaining coding capabilities after reduction are greater than or equal to the first difference.
[0197] Step 610: determine whether the remaining coding capacity after reduction is less than the second difference. If so, restart the adjustment process and indicate that the adjustment failed. Otherwise, execute step 612.
[0198] Step 611: Adjust the encoding parameters corresponding to the current acquisition channel to the optimal encoding capability corresponding to the motion detection type;
[0199] Step 612: Adjust the encoding parameters corresponding to the current acquisition channel to the worst encoding capability corresponding to the motion detection type.
[0200] The coding parameter adjustment method provided in this embodiment reasonably distributes the overall coding capacity of the device to each channel according to the content of the captured picture, and no longer fixes the upper limit of the coding of each channel. Break away from the limited thinking of modifying the coding parameters within the channel, and dynamically adjust the channels of the entire device in a unified manner. Different channels set different coding frame rates, resolutions and other parameters according to the complexity of the picture. Improve the channel coding upper limit, and flexibly adjust the coding capacity of each channel by setting the optimal coding capacity and the worst coding capacity. In the scene where all channels are static, the ultimate bit rate saving can be achieved; in the scene of movement, the image quality can be improved to the extreme.
[0201] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device. Since the electronic device is the electronic device in the method in the embodiment of the present invention, and the principle of solving the problem by the electronic device is similar to that of the method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0202] like Figure 7 As shown, the electronic device includes a processor 700 and a memory 701, wherein the memory 701 is used to store a program executable by the processor 700, and the processor 700 is used to read the program in the memory 701 and perform the following steps:
[0203] Obtain a video stream of at least one acquisition channel;
[0204] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type, a target parameter corresponding to the target coding capacity is determined according to the remaining coding capacity of the electronic device, wherein the remaining coding capacity represents the coding capacity of the electronic device not occupied by the acquisition channel;
[0205] The encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters.
[0206] As an optional implementation manner, the processor 700 is specifically configured to execute:
[0207] Determine a first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel;
[0208] The target parameter is determined according to the remaining coding capacity and the first difference.
[0209] As an optional implementation manner, the processor 700 is specifically configured to execute:
[0210] If the remaining coding capacity is greater than the first difference, determining the target parameter to be a coding parameter corresponding to the target coding capacity;
[0211] The target coding capability includes an optimal coding capability and / or a worst coding capability.
[0212] As an optional implementation manner, the processor 700 is further configured to execute:
[0213] If the remaining coding capacity is less than the first difference, increasing the remaining coding capacity by reducing the coding capacities corresponding to other acquisition channels;
[0214] When the increased remaining coding capacity is greater than the first difference, the target parameter is determined to be a coding parameter corresponding to the target coding capacity.
[0215] As an optional implementation manner, the processor 700 is further configured to execute:
[0216] When the adjusted remaining coding capacity is less than the first difference, reducing the target coding capacity;
[0217] Determine a second difference between the reduced target coding capacity and the coding capacity occupied by the current acquisition channel;
[0218] The target parameter is determined according to the remaining coding capacity and the second difference.
[0219] As an optional implementation manner, the processor 700 is further configured to execute:
[0220] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the encoding capacity occupied by the current acquisition channel is greater than the target encoding capacity corresponding to the changed monitoring type, the encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters corresponding to the target encoding capacity.
[0221] As an optional implementation, the processor 700 is specifically configured to determine whether the monitoring type changes in the following manner:
[0222] Input the video stream of the current acquisition channel into the detection models corresponding to different monitoring types respectively, and determine the monitoring type of the video stream of the current acquisition channel according to the detection results of the detection model corresponding to each monitoring type;
[0223] According to the comparison result of the monitoring type of the current video stream and the monitoring type of the previous video stream, it is determined whether the monitoring type of the video stream of the current acquisition channel has changed.
[0224] As an optional implementation manner, the processor 700 is specifically configured to determine the remaining encoding capability of the electronic device in the following manner:
[0225] The remaining coding capacity is determined according to the total coding capacity of the electronic device and the coding capacity occupied by each acquisition channel.
[0226] Based on the same inventive concept, an embodiment of the present invention further provides a coding parameter adjustment device. Since the device is the device in the method in the embodiment of the present invention, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0227] like Figure 8 As shown, the device comprises:
[0228] The video acquisition unit 800 is used to acquire a video stream of at least one acquisition channel;
[0229] The parameter determination unit 801 is used to determine the target parameter corresponding to the target coding capacity according to the remaining coding capacity of the electronic device when it is detected that the monitoring type of the video stream of the current acquisition channel has changed and the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type, wherein the remaining coding capacity represents the coding capacity of the electronic device not occupied by the acquisition channel;
[0230] The parameter adjustment unit 802 is used to adjust the encoding parameters corresponding to the current acquisition channel to the target parameters.
[0231] As an optional implementation manner, the parameter determination unit 801 is specifically configured to:
[0232] Determine a first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel;
[0233] The target parameter is determined according to the remaining coding capacity and the first difference.
[0234] As an optional implementation manner, the parameter determination unit 801 is specifically configured to:
[0235] If the remaining coding capacity is greater than the first difference, determining the target parameter to be a coding parameter corresponding to the target coding capacity;
[0236] The target coding capability includes an optimal coding capability and / or a worst coding capability.
[0237] As an optional implementation manner, the parameter determination unit 801 is further specifically configured to:
[0238] If the remaining coding capacity is less than the first difference, increasing the remaining coding capacity by reducing the coding capacities corresponding to other acquisition channels;
[0239] When the increased remaining coding capacity is greater than the first difference, the target parameter is determined to be a coding parameter corresponding to the target coding capacity.
[0240] As an optional implementation manner, the parameter determination unit 801 is further specifically configured to:
[0241] When the adjusted remaining coding capacity is less than the first difference, reducing the target coding capacity;
[0242] Determine a second difference between the reduced target coding capacity and the coding capacity occupied by the current acquisition channel;
[0243] The target parameter is determined according to the remaining coding capacity and the second difference.
[0244] As an optional implementation manner, the parameter adjustment unit 802 is further configured to:
[0245] When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the encoding capacity occupied by the current acquisition channel is greater than the target encoding capacity corresponding to the changed monitoring type, the encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters corresponding to the target encoding capacity.
[0246] As an optional implementation manner, the parameter determination unit 801 is specifically configured to determine whether the monitoring type has changed in the following manner:
[0247] Input the video stream of the current acquisition channel into the detection models corresponding to different monitoring types respectively, and determine the monitoring type of the video stream of the current acquisition channel according to the detection results of the detection model corresponding to each monitoring type;
[0248] According to the comparison result of the monitoring type of the current video stream and the monitoring type of the previous video stream, it is determined whether the monitoring type of the video stream of the current acquisition channel has changed.
[0249] As an optional implementation manner, the parameter determination unit 801 is specifically configured to determine the remaining coding capability of the electronic device in the following manner:
[0250] The remaining coding capacity is determined according to the total coding capacity of the electronic device and the coding capacity occupied by each acquisition channel.
[0251] Based on the same inventive concept, an embodiment of the present disclosure provides a computer storage medium, the computer storage medium includes: a computer program code, when the computer program code is run on a computer, the computer executes any of the coding parameter adjustment methods discussed above. Since the principle of solving the problem by the above-mentioned computer storage medium is similar to that of the coding parameter adjustment method, the implementation of the above-mentioned computer storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0252] In a specific implementation process, computer storage media may include: Universal Serial Bus Flash Drive (USB), mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other storage media that can store program codes.
[0253] Based on the same inventive concept, the embodiment of the present disclosure also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any coding parameter adjustment method discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the coding parameter adjustment method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0254] The computer program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0255] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.
[0256] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that has the functions specified in one or more boxes.
[0257] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0258] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0259] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A coding parameter adjustment method, characterized in that: The method includes: Obtaining a video stream of at least one acquisition channel; wherein the monitoring type of the video stream of the acquisition channel includes a dynamic detection type, an intelligent dynamic detection SMD type, and a common type; The monitoring type of the current acquisition channel is determined in the following manner: the video stream of the current acquisition channel is respectively input into the motion detection model of the motion detection type and the SMD detection model of the SMD type; if the detection result of the motion detection model is motion detection and the detection result of the SMD detection model is non-SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be the motion detection type; if the detection result of the motion detection model is non-motion detection and the detection result of the SMD detection model is SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be SMD type; if the detection result of the motion detection model is non-motion detection and the detection result of the SMD detection model is non-SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be ordinary type; if the detection result of the motion detection model is motion detection and the detection result of the SMD detection model is SMD type, then the monitoring type of the video stream of the current acquisition channel is determined to be a combination of the motion detection type and the SMD type; When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the coding capacity occupied by the current acquisition channel is lower than the target coding capacity corresponding to the changed monitoring type, the target parameter corresponding to the target coding capacity is determined according to the remaining coding capacity of the electronic device, wherein the remaining coding capacity represents the coding capacity of the electronic device not occupied by the acquisition channel; the coding capacity of the electronic device refers to the number of video frames of M resolution that can be encoded by the main chip of the electronic device per unit time, wherein M is greater than zero; further comprising: allocating coding capacity to each acquisition channel according to the monitoring type of each acquisition channel of the electronic device, based on the coding capacity occupied by each acquisition channel, the target coding capacity required by each acquisition channel, and the remaining coding capacity of the device; The encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters.
2. The method according to claim 1, characterized in that The determining, according to the remaining coding capability of the electronic device, a target parameter corresponding to the target coding capability includes: Determine a first difference between the target coding capacity and the coding capacity occupied by the current acquisition channel; The target parameter is determined according to the remaining coding capacity and the first difference.
3. The method according to claim 2, characterized in that The determining the target parameter according to the remaining coding capability and the first difference includes: If the remaining coding capacity is greater than the first difference, determining the target parameter to be a coding parameter corresponding to the target coding capacity; The target coding capability includes an optimal coding capability and / or a worst coding capability.
4. The method according to claim 2, characterized in that: The method further includes: If the remaining coding capacity is less than the first difference, increasing the remaining coding capacity by reducing the coding capacities corresponding to other acquisition channels; When the increased remaining coding capacity is greater than the first difference, the target parameter is determined to be a coding parameter corresponding to the target coding capacity.
5. The method according to claim 4, characterized in that The method further includes: When the adjusted remaining coding capacity is less than the first difference, reducing the target coding capacity; Determine a second difference between the reduced target coding capacity and the coding capacity occupied by the current acquisition channel; The target parameter is determined according to the remaining coding capacity and the second difference.
6. The method according to any one of claims 1 to 5, characterized in that: The method further includes: When it is detected that the monitoring type of the video stream of the current acquisition channel has changed, and the encoding capacity occupied by the current acquisition channel is greater than the target encoding capacity corresponding to the changed monitoring type, the encoding parameters corresponding to the current acquisition channel are adjusted to the target parameters corresponding to the target encoding capacity.
7. The method according to claim 1, characterized in that Determine if the monitoring type has changed by: Input the video stream of the current acquisition channel into the detection models corresponding to different monitoring types respectively, and determine the monitoring type of the video stream of the current acquisition channel according to the detection results of the detection model corresponding to each monitoring type; According to the comparison result of the monitoring type of the current video stream and the monitoring type of the previous video stream, it is determined whether the monitoring type of the video stream of the current acquisition channel has changed.
8. The method according to claim 1, characterized in that The remaining coding capacity of the electronic device is determined as follows: The remaining coding capacity is determined according to the total coding capacity of the electronic device and the coding capacity occupied by each acquisition channel.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a program executable by the processor, and the processor is used to read the program in the memory and execute the steps of any one of the methods of claims 1 to 8.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Heterogeneous application system video analysis task scheduling method and device, terminal and medium
CN116089043A
Self-adaptive video coding method based on unmanned aerial vehicle
CN118573867A