Resource allocation method and device for video recorder and video recorder
By introducing multiple video decoding channels and video processing modules into the video recorder, and using the second processing channel to process intelligent service video, the problem of insufficient decoding resources of the video recorder is solved, and the simultaneous display of multiple videos and the simultaneous activation of multiple intelligent services is realized.
Patent Information
- Application Number
- CN202411876004.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The video recorder has insufficient decoding resources, which cannot meet the needs of simultaneous display of multiple videos and simultaneous activation of multiple intelligent services.
By introducing a plurality of video decoding channels and corresponding video processing modules in the video recorder, each video processing module includes a first processing channel and a second processing channel. The specific method includes: decoding the received multiple code stream data based on multiple video decoding channels and sending it to the corresponding video processing module for processing; when the target decoding channel opens the intelligent service, it uses its second processing channel to perform video data processing, generates intelligent service video, and superimposes and displays with the preview video.
This method does not need to occupy additional video decoding channels and video processing channels, but directly uses the second processing channel of the video processing module that generates preview videos for processing, saving the decoding resources and video processing resources of the video recorder, and solving the problem of insufficient decoding resources.
Smart Images

Figure CN119324991B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of security monitoring, and in particular to a resource allocation method and device for a video recorder, and a video recorder. Background Art
[0002] With the rapid development of artificial intelligence (AI), the number of intelligent services for network video recorders (NVRs) and extended video recorders (XVRs) has also increased. Intelligent services can use AI technology to identify and extract features of people, cars, and objects in the video screen, thereby realizing applications such as face recognition, vehicle recognition, and behavior analysis. In the related technology, taking NVR as an example, a channel for opening intelligent services can be selected from the multiple streams input by multiple cameras, and two decoders (VDEC) are created according to the video parameters of the streams to decode the H.265 / H.264 streams into video images. Then, after the video images are framed or scaled by the video processing subsystem (VPSS), one channel is sent to the video output (VO) for screen display, and the other channel is sent to the intelligent service. The analysis results obtained after intelligent algorithm analysis are processed and sent to VO for display. However, with the increase in the number of intelligent services and the continuous improvement of video image resolution, the decoding resources of NVR are insufficient to meet the needs of simultaneous display of multiple videos and simultaneous opening of multiple intelligent services.
[0003] Currently, no effective solution has been proposed to the problem of insufficient decoding resources of video recorders. Summary of the invention
[0004] In this embodiment, a resource allocation method and device for a video recorder and a video recorder are provided to solve the problem of insufficient decoding resources of the video recorder.
[0005] In a first aspect, a resource allocation method for a video recorder is provided in this embodiment, wherein the video recorder includes a plurality of video decoding channels and a plurality of corresponding video processing modules, each of the video processing modules includes a first processing channel and a second processing channel, and the method includes:
[0006] Based on the multiple video decoding channels, decoding the received multiple-channel code stream data to obtain corresponding multiple-channel video data, and sending the multiple-channel video data to the corresponding video processing module;
[0007] Based on the first processing channel of each of the video processing modules, the video data is processed to obtain a corresponding preview video;
[0008] When one or more target decoding channels among the multiple video decoding channels start intelligent services, the video data corresponding to the target decoding channels are processed based on the second processing channel of the target decoding channels to obtain corresponding intelligent service videos. The intelligent service videos are used to perform intelligent analysis to obtain analysis results and are superimposed with the corresponding preview videos for display.
[0009] In some embodiments, the multi-channel code stream data includes at least one main code stream and at least one auxiliary code stream, and the second processing channel based on the target decoding channel processes the video data corresponding to the target decoding channel to obtain the corresponding intelligent service video including:
[0010] Determining whether the video parameters of the bitstream data corresponding to the target decoding channel meet the video parameter requirements of the intelligent service;
[0011] If not, determining whether the video parameters of the main stream in the multiple stream data meet the video parameter requirements of the intelligent service;
[0012] If the conditions are met, the bitstream data corresponding to the target decoding channel is decoded based on the video parameters of the main bitstream.
[0013] In some embodiments, decoding the bitstream data corresponding to the target decoding channel based on the video parameters of the main bitstream includes:
[0014] Switching the bitstream data corresponding to the target decoding channel to the main bitstream;
[0015] Determining whether the decoding resources of the multiple video decoding channels meet the decoding requirements of the main code stream;
[0016] If the conditions are met, the current target decoding channel is destroyed, a new target decoding channel is created as the video decoding channel corresponding to the main code stream, and the video data corresponding to the target decoding channel is processed based on the second processing channel corresponding to the target decoding channel.
[0017] In some embodiments, after determining whether the decoding resources of the plurality of video decoding channels meet the decoding requirements of the main stream, the method further includes:
[0018] If the requirements are not met, multiple main code streams corresponding to the video decoding channels without the smart service enabled are sequentially reduced to auxiliary code streams until the decoding resources of the multiple video decoding channels meet the decoding requirements of the main code streams.
[0019] In some of the embodiments, after the multiple main code streams corresponding to the video decoding channel without the smart service enabled are sequentially reduced to auxiliary code streams, the method further includes:
[0020] When the decoding resources of the multiple video decoding channels do not meet the decoding requirements of the main code stream, the decoding functions of the multiple video decoding channels that do not enable the smart service are turned off in sequence until the decoding resources of the multiple video decoding channels meet the decoding requirements of the main code stream.
[0021] In some embodiments, the method further comprises:
[0022] When one or more target decoding channels among the multiple video decoding channels close intelligent services, determining whether to release decoding resources corresponding to the target decoding channels;
[0023] In the case where the decoding resources have been released, the decoding resources are allocated, and the allocation priorities are, from high to low, the video decoding channels with the decoding function turned off and the video decoding channels corresponding to the bitstream data whose video parameters meet the requirements of the main bitstream.
[0024] In some of the embodiments, before determining whether the decoding resources corresponding to the target decoding channel are released, the method further includes:
[0025] Determine whether the bitstream data corresponding to the target decoding channel is a main bitstream;
[0026] In a case where the bitstream data is a main bitstream, determining whether there is a video decoding channel with a decoding function disabled among the multiple video decoding channels;
[0027] If it exists, the code stream data corresponding to the target decoding channel is reduced to an auxiliary code stream.
[0028] In some of the embodiments, after determining whether there is a video decoding channel with a decoding function disabled among the multiple video decoding channels, the method further includes:
[0029] If there is no video decoding channel with the decoding function turned off, determining whether the video parameters of the multi-channel code stream data corresponding to the target decoding channel match the display requirements;
[0030] When the video parameters of the bitstream data corresponding to the target decoding channel are higher than the display requirement, and the video parameters of the bitstream data corresponding to other video decoding channels are lower than the corresponding display requirement, the bitstream data corresponding to the target decoding channel is reduced to an auxiliary bitstream.
[0031] In a second aspect, a resource allocation device for a video recorder is provided in this embodiment, wherein the video recorder includes a plurality of video decoding channels and a plurality of corresponding video processing modules, each of the video processing modules includes a first processing channel and a second processing channel, and the device includes:
[0032] A decoding module, configured to decode the received multi-channel code stream data based on the multiple video decoding channels to obtain corresponding multi-channel video data, and send the multi-channel video data to a corresponding video processing module;
[0033] A first processing module, configured to process the video data based on the first processing channel of each of the video processing modules to obtain a corresponding preview video;
[0034] The second processing module is used to process the video data corresponding to one or more target decoding channels among the multiple video decoding channels based on the second processing channel of the target decoding channels to obtain corresponding smart service videos when the smart service is enabled. The smart service videos are used to perform smart analysis to obtain analysis results and are superimposed with the corresponding preview videos for display.
[0035] According to a third aspect, a video recorder is provided in this embodiment, which includes a resource allocation device for the video recorder as described in the second aspect, as well as multiple video decoding channels and corresponding multiple video processing modules, each of which includes a first processing channel and a second processing channel.
[0036] Compared with the related art, the resource allocation method of the video recorder provided in this embodiment decodes the received multi-channel code stream data based on multiple video decoding channels to obtain corresponding multi-channel video data, and sends the multi-channel video data to the corresponding video processing module to decode the code stream data sent by multiple cameras; processes the video data based on the first processing channel of each video processing module to obtain the corresponding preview video, thereby realizing the simultaneous display of multiple channels of video; when one or more target decoding channels among the multiple video decoding channels start the intelligent service, the video data corresponding to the target decoding channel is processed through the second processing channel based on the target decoding channel to obtain the corresponding intelligent service video. Compared with the related art, no additional video decoding channel and video processing channel are occupied, but the second processing channel of the video processing module that generates the preview video is directly used to process the video data corresponding to the preview video, thereby saving the decoding resources and video processing resources of the video recorder and solving the problem of insufficient decoding resources of the video recorder.
[0037] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0039] Figure 1 is a hardware structure block diagram of a video recorder of some embodiments of the present application;
[0040] Figure 2 is a flow chart of a resource allocation method of a video recorder in some embodiments of the present application;
[0041] Figure 3 is a flowchart of obtaining intelligent service video based on video data of a target decoding channel in some embodiments of the present application;
[0042] Figure 4 is a flowchart of video parameter decoding based on the main stream in some embodiments of the present application;
[0043] Figure 5 is a flowchart of decoding resource allocation when shutting down intelligent services in some embodiments of the present application;
[0044] Figure 6 is a flowchart of releasing decoding resources by a target decoding channel in some embodiments of the present application;
[0045] Figure 7 is a flowchart of releasing decoding resources by a target decoding channel in some other embodiments of the present application;
[0046] Figure 8 is a flow chart of a resource allocation method when the intelligent service of a video recorder is turned on in some preferred embodiments of the present application;
[0047] Fig. 9 is a flow chart of a resource allocation method when the intelligent service of a video recorder is turned off in some preferred embodiments of the present application;
[0048] Fig.10 It is a structural block diagram of a resource allocation device of a video recorder in some embodiments of the present application. DETAILED DESCRIPTION
[0049] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0051] The resource allocation method of the video recorder provided in the embodiment of the present application can be executed in the processor of the video recorder. Figure 1 is a hardware structure block diagram of a video recorder of some embodiments of the present application. Figure 1 As shown, the video recorder includes multiple video decoding channels VDEC0~VDECn (two are shown in the figure) and corresponding multiple video processing modules VPSS0~VPSSn, each of which includes a first processing channel VPSS_CN0 and a second processing channel VPSS_CN1. Furthermore, the video recorder may also include video output modules VO0~VOn, which are used to output and display the preview video output by the first processing channel VPSS_CN0, or to superimpose and display the preview video output by the first processing channel VPSS_CN0 and the intelligent business video output by the second processing channel VPSS_CN1 after the analysis result of the intelligent algorithm analysis. It can be understood by ordinary technicians in this field that Figure 1 The structure shown is for illustration only and does not limit the structure of the video recorder. Figure 1 More or fewer video decoding channels and video processing modules as shown in, or with Figure 1 Different configurations shown.
[0052] In this embodiment, a resource allocation method for a video recorder is provided, which is applied to Figure 1 Video recorder shown. Figure 2 is a flow chart of a resource allocation method for a video recorder of some embodiments of the present application, such as Figure 2 As shown, the process includes the following steps:
[0053] Step S201: Based on multiple video decoding channels, the received multi-channel code stream data is decoded to obtain corresponding multi-channel video data, and the multi-channel video data is sent to the corresponding video processing module.
[0054] Each video decoding channel (VDEC) can decode one stream of data. Decoding means decoding the pre-compressed stream data into a video file. The stream data can be H.265 / H.264 stream, and the video file can be a YUV format video.
[0055] In a specific embodiment, an NVR device may include 32 VDECs, which can decode up to 32 code streams. In practical applications, since the video parameters corresponding to each code stream are different, the required decoding resources are also different. For example, for code stream data with video parameters of 4K@30fps, the required decoding resources are equal to 4 times the code stream data with video parameters of 1080P@30fps. The video parameters may include resolution and frame rate. The resolution may be, for example, 4K, 1080P, 720P, etc., and the frame rate may be, for example, 30fps, 60fps, etc. The larger the video parameters, the more decoding resources are required.
[0056] When the video recorder receives each bitstream data, it allocates corresponding decoding resources according to the video parameters of the bitstream data. In a specific embodiment, the NVR device may include 32 VDECs, and the total decoding resources of the device are 20 1080p@30fps, that is, the device can decode and display 20 bitstream data with video parameters of 1080p@30fps at the same time, or decode and display 5 bitstream data with video parameters of 4K @30fps at the same time. When the number of bitstream data or video parameters is greater than this value, the NVR device cannot support the decoding function of all bitstream data.
[0057] Multiple video decoding channels and multiple video processing modules can be pre-bound to form a one-to-one correspondence. After the video decoding channel decodes the bitstream data to obtain corresponding video data, the video data is sent to the bound video processing module.
[0058] Step S202: Process the video data based on the first processing channel of each video processing module to obtain a corresponding preview video.
[0059] The video processing module (Video Process Sub-System, VPSS) in this embodiment includes a first processing channel VPSS_CN0 and a second processing channel VPSS_CN1. In some embodiments, each video processing module may also include more processing channels. Each processing channel of VPSS can be used to process the input video data according to requirements, such as denoising, cutting out, scaling, etc., and finally output video data that meets the processing requirements. VPSS processes the video data sent by VDEC through the first processing channel to obtain a preview video that meets the display requirements.
[0060] Furthermore, the VPSS may be pre-bound to a video output unit (VO) to send the preview video to the corresponding VO for display. In other embodiments, the VPSS may also send the preview video to a video encoding module for encoding and outputting through a network.
[0061] Step S203, when one or more target decoding channels among multiple video decoding channels start intelligent services, the video data corresponding to the target decoding channels are processed based on the second processing channel of the target decoding channels to obtain corresponding intelligent service videos. The intelligent service videos are used to perform intelligent analysis to obtain analysis results and are superimposed with the corresponding preview videos for display.
[0062] When smart services are enabled based on demand, one or more target decoding channels are designated as the channels for enabling smart services, and the video data output by the target decoding channels is processed, such as denoising, cropping, scaling, etc., to obtain smart service videos that meet the requirements of the smart services. Different smart services may have different video parameter requirements for smart service videos. The smart service video can be sent to the smart analysis module to obtain analysis results. The analysis results can be face recognition results, vehicle recognition results, etc. The analysis results are sent to the VO and superimposed with the preview video for reference by relevant personnel.
[0063] When the target decoding channel starts the intelligent service, in the related art, a new VDEC and a corresponding VPSS are usually allocated, the code stream data of the target decoding channel is sent to the new VDEC for decoding, and then the decoded video data is sent to the corresponding VPSS, and the VPSS processes the video data. However, in this embodiment, a new VDEC and a corresponding VPSS are not allocated, but the video data output by the target decoding channel is directly processed through the second processing channel of the VPSS corresponding to the target decoding channel to obtain the corresponding intelligent service video, which meets the requirements of the corresponding intelligent service for video parameters.
[0064] Through steps S201 to S203, the received multi-channel code stream data is decoded based on multiple video decoding channels to obtain corresponding multi-channel video data, and the multi-channel video data is sent to the corresponding video processing module to decode the code stream data sent by multiple cameras; the video data is processed based on the first processing channel of each video processing module to obtain the corresponding preview video, so as to realize the simultaneous display of multiple channels of video; when one or more target decoding channels among the multiple video decoding channels start the intelligent service, the video data corresponding to the target decoding channel is processed through the second processing channel based on the target decoding channel to obtain the corresponding intelligent service video. Compared with the related art, no additional video decoding channel and video processing channel are occupied, but the second processing channel of the video processing module that generates the preview video is directly used to process the video data corresponding to the preview video, thereby saving the decoding resources and video processing resources of the video recorder and solving the problem of insufficient decoding resources of the video recorder.
[0065] In some embodiments, the multiple code stream data includes at least one main code stream and at least one auxiliary code stream. Figure 3 is a flowchart of obtaining intelligent service video based on video data of a target decoding channel in some embodiments of the present application, such as Figure 3 As shown, the process includes the following steps:
[0066] Step S301: determine whether the video parameters of the bitstream data corresponding to the target decoding channel meet the video parameter requirements of the intelligent service.
[0067] When receiving bitstream data, each video decoding channel can obtain the video parameters of the bitstream data, which may include resolution and frame rate. Multi-channel bitstream data includes at least one main bitstream and at least one auxiliary bitstream. Usually, the resolution and frame rate of the main bitstream are higher, while the resolution and frame rate of the auxiliary bitstream are lower. When the target decoding channel starts the intelligent service, the corresponding video parameter requirements can be obtained according to the type of intelligent service. The video parameters of the bitstream data of the target decoding channel are compared with the video parameter requirements to determine whether the video parameter requirements are met, that is, whether the resolution and frame rate of the bitstream data of the target decoding channel are greater than or equal to the resolution and frame rate of the intelligent service.
[0068] Step S302: if the requirements are not met, determine whether the video parameters of the main stream in the multi-channel stream data meet the video parameter requirements of the intelligent service.
[0069] If the video parameters of the code stream data of the target decoding channel do not meet the video parameter requirements, the video parameters of the main code stream are obtained to determine whether the video parameters of the main code stream meet the video parameter requirements.
[0070] If the video parameters of the code stream data of the target decoding channel meet the video parameter requirements, the target decoding channel (VDEC) is directly decoded according to the video parameter requirements to obtain the YUV video; then it is processed through the corresponding VPSS_CN0 to output the preview video, and then processed through the corresponding VPSS_CN1 to output the intelligent business video. After the intelligent algorithm analysis, the analysis result is obtained and sent to VO, which is superimposed with the preview video output by VPSS_CN0 for display.
[0071] Step S303: If the conditions are met, the bitstream data corresponding to the target decoding channel is decoded based on the video parameters of the main bitstream.
[0072] If the video parameters of the main code stream meet the video parameter requirements, the code stream data corresponding to the target decoding channel is decoded based on the video parameters of the main code stream to obtain the corresponding smart service video. If the video parameters of the main code stream also cannot meet the video parameter requirements, the smart service activation process is terminated.
[0073] Through steps S301 to S303, it is determined whether the video parameters of the code stream data corresponding to the target decoding channel meet the video parameter requirements of the intelligent service. If not, it is determined whether the video parameters of the main code stream in the multi-channel code stream data meet the video parameter requirements of the intelligent service. If the video parameters of the main code stream meet the requirements, the code stream data corresponding to the target decoding channel is decoded based on the video parameters of the main code stream. When the resolution and frame rate of the code stream data of the target decoding channel are low and do not meet the requirements of the intelligent service, the decoding of the code stream data of the target decoding channel is achieved, which provides the necessary conditions for executing the intelligent service.
[0074] In some embodiments, Figure 4 is a flowchart of video parameter decoding based on the main code stream in some embodiments of the present application, such as Figure 4 As shown, the process includes the following steps:
[0075] Step S401, switching the bitstream data corresponding to the target decoding channel to the main bitstream.
[0076] Specifically, communication may be performed with a camera corresponding to a target decoding channel, and the camera may be notified to send code stream data using video parameters of the main code stream.
[0077] Step S402: determine whether the decoding resources of the multiple video decoding channels meet the decoding requirements of the main stream.
[0078] Determine whether the decoding requirements of the main stream are met based on the idle decoding resources of all video decoding channels (VDEC) of the video recorder.
[0079] Step S403, if the conditions are met, destroy the current target decoding channel, create a new target decoding channel as the video decoding channel corresponding to the main stream, and process the video data corresponding to the target decoding channel based on the second processing channel corresponding to the target decoding channel.
[0080] If the existing idle decoding resources meet the decoding requirements of the main code stream, the current target decoding channel is destroyed and a new target decoding channel is created as the VDEC corresponding to the main code stream. Decoding is performed through the target decoding channel according to the video parameter requirements of the intelligent service to obtain the YUV video, which is processed through the first processing channel VPSS_CN0 in the corresponding video processing module (VPSS) to output the preview video of the main code stream, which can be displayed through VO; the video is processed through the second processing channel VPSS_CN1 in VPSS to output the corresponding intelligent service video, and the analysis result is obtained after the intelligent algorithm analysis, and the analysis result is sent to VO to be displayed superimposed with the preview video.
[0081] Specifically, the second processing channel VPSS_CN1 can process the YUV video into the resolution and frame rate required by the intelligent algorithm by configuring frame extraction, scaling and other operations.
[0082] Through steps S401 to S403, when the video parameters of the current code stream data of the target decoding channel do not meet the video parameter requirements of the smart service, and the video parameters of the main code stream meet the video parameter requirements, based on the video parameter requirements of the smart service, the code stream data corresponding to the target decoding channel is switched from the auxiliary code stream to the main code stream, and the target decoding channel is recreated, and the idle decoding resources are called for decoding based on the second processing channel corresponding to the target decoding channel, and the corresponding smart service video is output, thereby realizing the activation of the smart service.
[0083] In some embodiments, a method for releasing decoding resources is also provided when the decoding resources of the video decoding channel do not meet the decoding requirements of the main code stream. The method includes:
[0084] Multiple main code streams corresponding to video decoding channels that do not enable intelligent services are sequentially reduced to auxiliary code streams until the decoding resources of the multiple video decoding channels meet the decoding requirements of the main code streams.
[0085] For all VDECs in the video recorder that do not have intelligent services enabled, if there are one or more VDECs whose code stream data is the main code stream, each main code stream is reduced to an auxiliary code stream in turn, and then it is determined whether the existing decoding resources meet the decoding requirements of the main code stream. If not, the main code stream of the next VDEC is reduced to an auxiliary code stream, and then it is determined whether it meets the requirements, and so on, until the decoding resources meet the decoding requirements of the main code stream or the main code streams of all VDECs are reduced to auxiliary code streams.
[0086] Specifically, the main code stream can be reduced to the auxiliary code stream by communicating with the camera and requiring the camera to switch the main code stream to the auxiliary code stream.
[0087] The resource allocation method of the video recorder of this embodiment reduces the main code stream of the intelligent service that is not enabled to the auxiliary code stream in sequence, thereby gradually releasing decoding resources in a manner of reducing the video quality of other channels for priority use by the VDEC that enables the intelligent service. This provides a decoding resource release and resource allocation method, and improves the resource allocation priority of the intelligent service.
[0088] In some embodiments, it also relates to a method for releasing decoding resources when the decoding resources of the video decoding channel still do not meet the decoding requirements of the main code stream after the method of the previous embodiment is executed. The method includes:
[0089] When the decoding resources of multiple video decoding channels do not meet the decoding requirements of the main code stream, the decoding functions of multiple video decoding channels that do not enable intelligent services are turned off in sequence until the decoding resources of multiple video decoding channels meet the decoding requirements of the main code stream.
[0090] When the main code streams of all VDECs without intelligent services are reduced to auxiliary code streams and there are still insufficient decoding resources, the decoding functions of these VDECs are turned off in turn, and the super decoding prompt information is displayed. After each VDEC is turned off, it is determined whether the existing decoding resources meet the decoding requirements of the main code stream. If not, the next VDEC is turned off repeatedly until the decoding resources meet the decoding requirements of the main code stream, or the decoding functions of all VDECs without intelligent services are turned off.
[0091] When all VDECs that do not enable the intelligent service disable the decoding function and the decoding resources still do not meet the decoding requirements of the main code stream, the intelligent service enabling process is terminated.
[0092] The resource allocation method of the video recorder of this embodiment provides a decoding resource release and resource allocation method by successively shutting down the decoding functions of the video decoding channels that have not enabled the intelligent service, and gradually releasing the decoding resources for priority use by the VDEC that has enabled the intelligent service, thereby improving the resource allocation priority of the intelligent service.
[0093] In some embodiments, Figure 5 is a flowchart of decoding resource allocation when shutting down intelligent services in some embodiments of the present application, such as Figure 5 As shown, the process includes the following steps:
[0094] Step S501: when one or more target decoding channels among a plurality of video decoding channels close intelligent services, it is determined whether to release decoding resources corresponding to the target decoding channels.
[0095] When the intelligent service of the target decoding channel is closed, it can be determined whether the decoding resources of the target decoding channel need to be released based on factors such as whether the code stream data of the target decoding channel is the main code stream and whether the decoding resources of other video decoding channels of the video recorder meet the requirements.
[0096] If it is determined that the decoding resources of the target decoding channel need to be released, the code stream data of the target decoding channel is switched, for example, the main code stream of the target decoding channel is switched to the auxiliary code stream to reduce the decoding resources required for the target decoding channel, and the released decoding resources are used for other video decoding channels.
[0097] Step S502, when the decoding resources have been released, the decoding resources are allocated, and the allocated priorities from high to low are respectively the video decoding channels with the decoding function turned off and the video decoding channels corresponding to the bitstream data whose video parameters meet the requirements of the main bitstream.
[0098] The decoding resources released by the target decoding channel are allocated according to the priority, and are preferentially provided to the video decoding channel whose decoding function has been turned off in the video recorder, so that the video decoding channel can resume decoding and display the corresponding video image.
[0099] If the decoding function of other video decoding channels in the video recorder is not turned off, the decoding resource is allocated to the video decoding channel corresponding to the code stream data whose video parameters meet the requirements of the main code stream, so that the code stream data can be displayed on a large screen according to the video parameters of the main code stream.
[0100] Through steps S501~S502, when one or more target decoding channels among multiple video decoding channels close the intelligent service, it is determined whether to release the decoding resources corresponding to the target decoding channel. When the decoding resources have been released, the decoding resources are reasonably allocated according to the set priority, thereby improving the quantity and quality of video decoding.
[0101] In some embodiments, Figure 6 is a flowchart of releasing decoding resources by a target decoding channel in some embodiments of the present application, such as Figure 6 As shown, the process includes the following steps:
[0102] Step S601, determining whether the bitstream data corresponding to the target decoding channel is a main bitstream.
[0103] If the code stream data corresponding to the target decoding channel is not the main code stream, there is no need to release the decoding resources and the process can be ended directly.
[0104] Step S602: when the code stream data is the main code stream, determine whether there is a video decoding channel with a disabled decoding function among the multiple video decoding channels.
[0105] If the code stream data corresponding to the target decoding channel is the main code stream, it means that decoding and processing the preview video through the target decoding channel requires more decoding resources, and these decoding resources can be allocated to other video decoding channels after being released.
[0106] Step S603: if it exists, the code stream data corresponding to the target decoding channel is reduced to an auxiliary code stream.
[0107] If there are video decoding channels with disabled decoding functions in other video decoding channels, releasing these decoding resources can start the decoding functions of other video decoding channels and restore the video display of other video decoding channels. The code stream data corresponding to the target decoding channel can be reduced from the main code stream to the auxiliary code stream through communication with the camera, thereby releasing decoding resources.
[0108] Through steps S601 to S603, it is determined whether the code stream data corresponding to the target decoding channel is the main code stream, and whether it is necessary to release the decoding resources; when the code stream data is the main code stream, if there is a video decoding channel with a decoding function turned off in other video decoding channels, the code stream data corresponding to the target decoding channel is reduced to an auxiliary code stream to release excess decoding resources, start the decoding function of other video decoding channels, restore the video display of other video decoding channels, and increase the number of decoding channels of the video recorder.
[0109] In a further embodiment, Figure 7 is a flowchart of releasing decoding resources by a target decoding channel in some other embodiments of the present application, such as Figure 7 As shown, the process includes the following steps:
[0110] Step S701: If there is no video decoding channel with the decoding function disabled, it is determined whether the video parameters of the bitstream data corresponding to the target decoding channel match the display requirements.
[0111] If the bitstream data corresponding to the target decoding channel is the main bitstream, and there is no video decoding channel with the decoding function turned off in other video decoding channels, it is further determined whether the video parameters of the bitstream data corresponding to the target decoding channel match the corresponding display requirements. Specifically, if the bitstream data corresponding to the target decoding channel is the main bitstream, it is confirmed whether the display requirements corresponding to the target decoding channel are high resolution and high frame rate; if so, it is determined that the video parameters of the bitstream data corresponding to the target decoding channel match the display requirements; if the display requirements corresponding to the target decoding channel are low resolution and low frame rate, the video parameters of the bitstream data are higher than the display requirements.
[0112] Step S702: when the video parameters of the bitstream data corresponding to the target decoding channel are higher than the display requirement and the video parameters of the bitstream data corresponding to other video decoding channels are lower than the corresponding display requirement, the bitstream data corresponding to the target decoding channel is reduced to an auxiliary bitstream.
[0113] When the video parameters of the bitstream data corresponding to the target decoding channel are higher than the display requirements, determine whether the video parameters of the bitstream data corresponding to other video decoding channels match the corresponding display requirements. If the video parameters of the bitstream data of other video decoding channels are lower than the corresponding display requirements, the bitstream data corresponding to the target decoding channel is reduced to an auxiliary bitstream, thereby releasing decoding resources, so that other video decoding channels upgrade the corresponding bitstream data from an auxiliary bitstream to a main bitstream and decode it to meet their high-resolution and high-frame-rate display requirements.
[0114] Through steps S701~S702, by judging whether the video parameters of the bitstream data corresponding to the target decoding channel and other video decoding channels match the corresponding display requirements, it is determined whether to release the decoding resources of the target decoding channel, and the released resources are allocated to other video decoding channels with high display requirements, thereby improving the decoding capabilities of other video decoding channels and improving the video display quality.
[0115] The resource allocation method of the video recorder of the present application is described and illustrated by means of a preferred embodiment below. Figure 8 The flowchart of the resource allocation method when the intelligent service of the video recorder of some preferred embodiments of the present application is turned on, the video recorder includes a plurality of video decoding channels VDEC and a corresponding plurality of video processing modules VPSS, each video processing module VPSS includes a first processing channel VPSS_CN0 and a second processing channel VPSS_CN1. Figure 8 As shown, the process includes the following steps:
[0116] Step S801, multiple VDECs of the video recorder decode the received multi-channel code stream data to obtain corresponding multi-channel YUV, and send the multi-channel YUV to the corresponding VPSS, where the multi-channel code stream data includes at least one main code stream and at least one auxiliary code stream;
[0117] Step S802, based on VPSS_CN0 of each VPSS, YUV is processed to obtain the corresponding preview video and sent to the corresponding VO to realize preview multi-screen display;
[0118] Step S803, when one or more target decoding channels start intelligent services, determine whether the target decoding channels have corresponding preview images, and if not, end the process;
[0119] Step S804: if there is a preview screen, determine whether the resolution and frame rate of the bitstream data corresponding to the target decoding channel meet the intelligent service requirements;
[0120] Step S805: if not, determine whether the resolution and frame rate of the main stream meet the requirements of the intelligent service; if yes, execute step S809;
[0121] Step S806: If the resolution and frame rate of the main code stream meet the requirements of the intelligent service, the code stream data corresponding to the target decoding channel is switched to the main code stream;
[0122] Step S807, determining whether the existing idle decoding resources meet the decoding requirements of the main stream;
[0123] Step S808: If the conditions are met, the current target decoding channel is destroyed, and a new target decoding channel is created as the video decoding channel corresponding to the main stream;
[0124] Step S809, based on the VPSS_CN1 of the target decoding channel, configure frame rate extraction, scaling and other operations on the YUV output by the target decoding channel to obtain the corresponding intelligent service video for intelligent analysis;
[0125] Step S810: if the requirements are not met, multiple main code streams corresponding to the video decoding channels that do not enable the smart service are sequentially reduced to auxiliary code streams;
[0126] Step S811, determining whether the existing idle decoding resources meet the decoding requirements of the main code stream, if not, returning to step S810 until the main code streams of all video decoding channels that do not enable smart services are reduced to auxiliary code streams;
[0127] Step S812: if the conditions are not met, the decoding functions of the multiple video decoding channels that do not have the smart service enabled are disabled in sequence;
[0128] Step S813, determining whether the existing idle decoding resources meet the decoding requirements of the main stream, if not, returning to step S812, until all video decoding channels that do not enable smart services have their decoding functions disabled.
[0129] Through steps S801 to S813, when multiple video decoding channels decode and display corresponding preview videos at the same time, for the target decoding channel for starting the intelligent service, it is first determined whether the resolution and frame rate of the code stream data corresponding to the target decoding channel meet the requirements of the intelligent service. If the requirements are met, the VPSS_CN1 corresponding to the target decoding channel is directly used for processing to obtain the corresponding intelligent service video, without occupying additional video decoding channels and video processing channels, saving decoding resources and video processing resources of the video recorder, and solving the problem of insufficient decoding resources of the video recorder; if the requirements of the intelligent service are not met, the code stream data corresponding to the target decoding channel is switched to the main code stream, and the existing decoding resources are used or the decoding resources of other video decoding channels are called to generate a new target decoding channel to decode the main code stream, and the intelligent service video is obtained through the VPSS_CN1 corresponding to the target decoding channel, and the feasibility of the intelligent service is further improved through reasonable resource allocation.
[0130] Fig. 9 Flow chart of the resource allocation method when the intelligent service of the video recorder is closed in some preferred embodiments of the present application, such as Fig. 9 As shown, the process includes the following steps:
[0131] Step S901, when one or more target decoding channels close the intelligent service, determine whether the code stream data corresponding to the target decoding channel is the main code stream;
[0132] Step S902: if it is not the main code stream, proceed to step S906; if it is the main code stream, determine whether there is a video decoding channel with the decoding function turned off;
[0133] Step S903: if there is a video decoding channel with the decoding function turned off, proceed to step S905; if there is no video decoding channel with the decoding function turned off, determine whether the preview video display requirement corresponding to the target decoding channel is a large screen;
[0134] Step S904: if it is a large screen, proceed to step S906; if it is not a large screen, determine whether the preview video display requirements corresponding to other video decoding channels have a large screen requirement; if so, proceed to step S905;
[0135] Step S905, reducing the main code stream of the target decoding channel to an auxiliary code stream;
[0136] Step S906, determine whether there is any decoding resource released, if not, end the process;
[0137] Step S907, if there is a decoding resource released, the decoding resource is provided to the video decoding channel whose decoding function has been turned off, so as to display the corresponding preview picture;
[0138] Step S908: If there are still remaining decoding resources, the remaining decoding resources are provided to the video decoding channel that requires a large screen display.
[0139] Through steps S901 to S908, when one or more target decoding channels close the intelligent service, it is determined whether the decoding resources need to be released by judging whether the code stream data corresponding to the target decoding channel is the main code stream; when other video decoding channels need decoding resources, the resources are released by reducing the main code stream to the auxiliary code stream, and the decoding resources are reasonably allocated according to the set priority, thereby improving the quantity and quality of video decoding.
[0140] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0141] In some embodiments, the present application also provides a resource allocation device for a video recorder, which is used to implement the above embodiments and preferred implementations, and will not be repeated for those that have been described. The terms "module", "unit", "subunit", etc. used below refer to a combination of software and / or hardware that can implement a predetermined function.
[0142] Fig.10 is a structural block diagram of a resource allocation device of a video recorder of this embodiment. The video recorder includes a plurality of video decoding channels and a corresponding plurality of video processing modules. Each video processing module includes a first processing channel and a second processing channel. Fig.10 As shown, the device comprises:
[0143] The decoding module 1001 is used to decode the received multi-channel code stream data based on multiple video decoding channels to obtain corresponding multi-channel video data, and send the multi-channel video data to the corresponding video processing module;
[0144] A first processing module 1002, configured to process the video data based on the first processing channel of each video processing module to obtain a corresponding preview video;
[0145] The second processing module 1003 is used to process the video data corresponding to one or more target decoding channels among multiple video decoding channels when the intelligent service is enabled, based on the second processing channel of the target decoding channel, to obtain the corresponding intelligent service video, and the intelligent service video is used to perform intelligent analysis to obtain the analysis result and overlay it with the corresponding preview video for display.
[0146] The resource allocation device of the video recorder of this embodiment decodes the received multi-channel code stream data based on multiple video decoding channels by the decoding module 1001 to obtain corresponding multi-channel video data, and sends the multi-channel video data to the corresponding video processing module to decode the code stream data sent by multiple cameras; the first processing module 1002 processes the video data based on the first processing channel of each video processing module to obtain the corresponding preview video, thereby realizing the simultaneous display of multiple channels of video; when one or more target decoding channels among the multiple video decoding channels start the intelligent service, the second processing module 1003 processes the video data corresponding to the target decoding channel based on the second processing channel of the target decoding channel to obtain the corresponding intelligent service video. Compared with the related art, no additional video decoding channel and video processing channel are occupied, but the second processing channel of the video processing module that generates the preview video is directly used to process the video data corresponding to the preview video, thereby saving the decoding resources and video processing resources of the video recorder and solving the problem of insufficient decoding resources of the video recorder.
[0147] In some embodiments, the present application also provides a video recorder, which includes the resource allocation device of the video recorder of the above embodiment, as well as multiple video decoding channels and corresponding multiple video processing modules, each video processing module including a first processing channel and a second processing channel.
[0148] The video recorder of this embodiment, when one or more target decoding channels start intelligent services, processes the video data corresponding to the target decoding channels through the second processing channel of the target decoding channels to obtain corresponding intelligent service videos, without occupying additional video decoding channels and video processing channels, saving decoding resources and video processing resources of the video recorder, and solving the problem of insufficient decoding resources of the video recorder.
[0149] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0150] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0151] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0152] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0153] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A resource allocation method for a video recorder, wherein the video recorder comprises a plurality of video decoding channels and a plurality of corresponding video processing modules, each of the video processing modules comprises a first processing channel and a second processing channel, characterized in that: The method comprises: Based on the multiple video decoding channels, decoding the received multiple-channel code stream data to obtain corresponding multiple-channel video data, and sending the multiple-channel video data to the corresponding video processing module; Based on the first processing channel of each of the video processing modules, the video data is processed to obtain a corresponding preview video; When one or more target decoding channels among the multiple video decoding channels start intelligent services, based on the second processing channel of the target decoding channels, the video data corresponding to the target decoding channels are processed to obtain corresponding intelligent service videos, and the intelligent service videos are used to perform intelligent analysis to obtain analysis results and are superimposed on the corresponding preview videos for display; The multi-channel code stream data includes at least one main code stream and at least one auxiliary code stream, and the second processing channel based on the target decoding channel processes the video data corresponding to the target decoding channel to obtain the corresponding intelligent service video including: Determining whether the video parameters of the bitstream data corresponding to the target decoding channel meet the video parameter requirements of the intelligent service; If not, determining whether the video parameters of the main stream in the multiple stream data meet the video parameter requirements of the intelligent service; If the conditions are met, decoding the bitstream data corresponding to the target decoding channel based on the video parameters of the main bitstream; If the video parameters of the bitstream data of the target decoding channel meet the video parameter requirements, decoding is performed according to the video parameter requirements through the target decoding channel; The decoding of the bitstream data corresponding to the target decoding channel based on the video parameters of the main bitstream includes: Switching the bitstream data corresponding to the target decoding channel to the main bitstream; Determining whether the decoding resources of the multiple video decoding channels meet the decoding requirements of the main code stream; If the conditions are met, the current target decoding channel is destroyed, a new target decoding channel is created as the video decoding channel corresponding to the main code stream, and the video data corresponding to the target decoding channel is processed based on the second processing channel corresponding to the target decoding channel.
2. The method according to claim 1, characterized in that After determining whether the decoding resources of the plurality of video decoding channels meet the decoding requirements of the main stream, the method further includes: If the requirements are not met, multiple main code streams corresponding to the video decoding channels without the smart service enabled are sequentially reduced to auxiliary code streams until the decoding resources of the multiple video decoding channels meet the decoding requirements of the main code streams.
3. The method according to claim 2, characterized in that After the multiple main code streams corresponding to the video decoding channel without the intelligent service enabled are sequentially reduced to auxiliary code streams, the method further includes: When the decoding resources of the multiple video decoding channels do not meet the decoding requirements of the main code stream, the decoding functions of the multiple video decoding channels that do not enable the smart service are turned off in sequence until the decoding resources of the multiple video decoding channels meet the decoding requirements of the main code stream.
4. The method according to claim 1, characterized in that: The method further comprises: When one or more target decoding channels among the multiple video decoding channels close intelligent services, determining whether to release decoding resources corresponding to the target decoding channels; In the case where the decoding resources have been released, the decoding resources are allocated, and the allocation priorities are, from high to low, the video decoding channels with the decoding function turned off and the video decoding channels corresponding to the bitstream data whose video parameters meet the requirements of the main bitstream.
5. The method according to claim 4, characterized in that Before determining whether the decoding resources corresponding to the target decoding channel are released, the method further includes: Determine whether the bitstream data corresponding to the target decoding channel is a main bitstream; In a case where the bitstream data is a main bitstream, determining whether there is a video decoding channel with a decoding function disabled among the multiple video decoding channels; If it exists, the code stream data corresponding to the target decoding channel is reduced to an auxiliary code stream.
6. The method according to claim 5, characterized in that After determining whether there is a video decoding channel with a decoding function turned off among the multiple video decoding channels, the method further includes: If there is no video decoding channel with the decoding function turned off, determining whether the video parameters of the multi-channel code stream data corresponding to the target decoding channel match the display requirements; When the video parameters of the bitstream data corresponding to the target decoding channel are higher than the display requirement, and the video parameters of the bitstream data corresponding to other video decoding channels are lower than the corresponding display requirement, the bitstream data corresponding to the target decoding channel is reduced to an auxiliary bitstream.
7. A resource allocation device for a video recorder, the video recorder comprising a plurality of video decoding channels and a corresponding plurality of video processing modules, each of the video processing modules comprising a first processing channel and a second processing channel, characterized in that: The device comprises: A decoding module, configured to decode the received multi-channel code stream data based on the multiple video decoding channels to obtain corresponding multi-channel video data, and send the multi-channel video data to a corresponding video processing module; A first processing module, configured to process the video data based on the first processing channel of each of the video processing modules to obtain a corresponding preview video; A second processing module is used for processing video data corresponding to one or more target decoding channels among the multiple video decoding channels based on the second processing channel of the target decoding channel to obtain a corresponding smart service video when the smart service is enabled. The smart service video is used to perform smart analysis to obtain an analysis result and to overlay the result with the corresponding preview video for display; The multi-channel code stream data includes at least one main code stream and at least one auxiliary code stream, and the second processing channel based on the target decoding channel processes the video data corresponding to the target decoding channel to obtain the corresponding intelligent service video, including: determining whether the video parameters of the code stream data corresponding to the target decoding channel meet the video parameter requirements of the intelligent service; if not, determining whether the video parameters of the main code stream in the multi-channel code stream data meet the video parameter requirements of the intelligent service; if they meet, decoding the code stream data corresponding to the target decoding channel based on the video parameters of the main code stream; if the video parameters of the code stream data of the target decoding channel meet the video parameter requirements, decoding according to the video parameter requirements through the target decoding channel; The decoding of the stream data corresponding to the target decoding channel based on the video parameters of the main stream includes: switching the stream data corresponding to the target decoding channel to the main stream; determining whether the decoding resources of the multiple video decoding channels meet the decoding requirements of the main stream; if so, destroying the current target decoding channel, creating a new target decoding channel as the video decoding channel corresponding to the main stream, and processing the video data corresponding to the target decoding channel based on the second processing channel corresponding to the target decoding channel.
8. A video recorder, characterized in that: The video recorder comprises the resource allocation device of the video recorder as claimed in claim 7, as well as a plurality of video decoding channels and a corresponding plurality of video processing modules, each of the video processing modules comprising a first processing channel and a second processing channel.
Citation Information
Patent Citations
Method and client side for previewing multi-channel code streams
CN104079869A
Video decoding method and device and electronic equipment
CN118042137A