Video processing method and device, electronic equipment and storage medium
By creating multiple channels and input queues in video processing technology, and through scheduling rules and interrupt thread mechanisms, the problem of untimely processing of image frames into hardware is solved, and the utilization rate of image processing module and video processing efficiency are improved.
Patent Information
- Application Number
- CN202510034919.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-01-09
AI Technical Summary
In the existing video processing technology, the hardware processing of image frames may not be timely, resulting in low hardware utilization and low video processing efficiency.
By creating multiple channels, corresponding to multiple image processing tasks, the frame information of the input frame is stored in the input queue of multiple channels, and through the set scheduling rules, the frame information of the input frame is obtained from the input queue for processing by the image processing module. The image processing module processes the input frame according to the frame information and channel attributes, and continuously schedules the next input frame through the interrupt thread.
The utilization rate of the image processing module and the overall efficiency of video processing are improved, ensuring that the image processing module can continuously process the input frames of multiple image processing tasks, and even when the input frames of a certain task are not sent in time, it can continue to process the input frames of other tasks.
Smart Images

Figure CN119835485A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a video processing method, device, electronic device and storage medium. Background Art
[0002] Video processing technology can be used to rotate, enlarge, reduce, mirror, flip, correct distortion, and perform one or more processes on the image frames of the video to meet the user's demand for video playback effects. Hardware such as CPU, DSP (Digital Signal Processor), and image processing chips can be used to process the image frames of the video.
[0003] In the related art, the image frames of the video are sent to the hardware for image processing frame by frame, and the hardware processes the image frames. However, due to factors such as system scheduling and system freezes, the image frames may not be sent to the hardware in a timely manner, resulting in low hardware utilization and low video processing efficiency. Summary of the invention
[0004] The present application provides a video processing method, device, electronic device and storage medium to solve the problem of low video processing efficiency.
[0005] In a first aspect, the present application provides a video processing method, comprising:
[0006] Obtaining frame information of an input frame of a target video, the frame information including a frame storage address;
[0007] The frame information is stored in input queues corresponding to a plurality of channels, where the channels are pre-created according to image processing tasks of an image processing module, and the channels are provided with input queues and channel attributes, where the channel attributes represent image processing strategies of image processing tasks;
[0008] Obtaining frame information of an input frame and channel attributes of a channel corresponding to the input queue from the input queue, generating an image processing command corresponding to the frame information and the channel attributes, and sending the image processing command to the image processing module;
[0009] The image processing module parses the image processing instruction, obtains the input frame according to the parsed frame storage address, processes the input frame according to the parsed channel attribute, obtains the output frame, and starts the interrupt thread;
[0010] The frame information of another input frame and the channel attributes of the corresponding channel of the input queue are obtained through the interrupt thread for processing by the image processing module.
[0011] In some embodiments, generating an image processing command corresponding to the frame information and the channel attributes includes:
[0012] Applying for a first storage address in the storage module, the first storage address is used for the image processing module to store the output frame;
[0013] Translating the frame information into a first command of an image processing module;
[0014] Translate channel attributes into a second command of the image processing module;
[0015] translating the output frame address into a third command of the image processing module;
[0016] The image processing command includes a first command, a second command, and a third command.
[0017] In some embodiments, the frame information of the input frame further includes frame attributes, and the method further includes:
[0018] Replace the first attribute in the frame attributes of the input frame with the second attribute in the channel attributes to obtain the frame attributes of the output frame, where the first attribute and the second attribute are attributes of the same category;
[0019] The output frame and the frame attributes of the output frame are sent to the downstream image processing task through the interrupt thread.
[0020] In some embodiments, the method further comprises:
[0021] The interrupt thread is used to obtain the frame information of another input frame and the channel attributes of the corresponding channel of the input queue, and the output frame and the frame attributes of the output frame are sent to the downstream image processing task, and then the interrupt thread is ended.
[0022] In some embodiments, before obtaining the frame information of the input frame of the target video, the method further includes:
[0023] Creating a first number of channels, the first number being the number of image processing tasks of the image processing module;
[0024] Allocate an attribute memory for the channel in the storage module, and store the channel attributes in the attribute memory;
[0025] Create an input queue corresponding to the channel and set the scheduling rules for the input queue.
[0026] In some embodiments, obtaining frame information of an input frame from an input queue includes:
[0027] According to the polling scheduling rule, determine the input queue of the frame information of the input frame to be obtained;
[0028] According to the first-in-first-out rule, frame information of an input frame is obtained from the determined input queue.
[0029] In a second aspect, the present application provides a video processing device, including:
[0030] An input module, used for obtaining frame information of an input frame, wherein the frame information includes a frame storage address;
[0031] An input cache module is used to instantiate input queues of multiple channels and store frame information in the multiple input queues. The channels are pre-created according to the image processing tasks of the image processing module. The channels are provided with input queues and channel attributes. The channel attributes represent the image processing strategy of the image processing tasks.
[0032] A pop-up module is used to obtain frame information of an input frame and channel attributes of a channel corresponding to the input queue from the input queue, generate an image processing command corresponding to the frame information and the channel attributes, and send the image processing command to the image processing module;
[0033] The image processing module is used to parse the image processing instructions, obtain the input frame according to the parsed frame storage address, process the input frame according to the parsed channel attributes, obtain the output frame, and start the interrupt thread. The interrupt thread is used to send a pop-up signal to the pop-up module. The pop-up module is also used to obtain the frame information of another input frame and the channel attributes of the channel corresponding to the input queue according to the pop-up signal for processing by the image processing module.
[0034] In some embodiments, the pop-up module includes:
[0035] A scheduling unit, used for obtaining frame information of one of the input frames from one of the input queues;
[0036] A storage configuration unit, used for applying for a first storage address in the storage module, the first storage address is used for the image processing module to store the output frame;
[0037] The translation unit is used to translate the frame information, the channel attribute and the first storage address into an image processing command of the image processing module.
[0038] In some embodiments, the device also includes a push module, and the interrupt thread is further used to send a push signal to the push module. The push module is used to obtain the output frame stored in the image processing module in the storage module according to the push signal and release the storage space of the output frame.
[0039] In some embodiments, the apparatus further comprises:
[0040] The output module is used to send the output frame and the frame attributes of the output frame to the downstream image processing task, wherein the frame attributes of the output frame are obtained by replacing the first attribute in the frame attributes of the input frame with the second attribute in the channel attribute by the pop-up module, and the first attribute and the second attribute are attributes of the same category.
[0041] In a third aspect, the present application provides an electronic device, which includes one or more processors and a memory, and also includes the device of the second aspect; the memory stores a computer program, the computer program includes computer instructions, and one or more processors call the computer instructions to enable the electronic device to execute the video processing method of the first aspect.
[0042] In a fourth aspect, the present application provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes the video processing method of the first aspect.
[0043] It can be seen from the above technical content that the embodiments of the present application provide a video processing method, device, electronic device and storage medium. The embodiments of the present application create multiple channels, which correspond to multiple image processing tasks respectively, store the frame information of the input frame into the input queues of the multiple channels, and obtain the frame information of an input frame from the input queue through the set scheduling rules for the image processing module to process. The image processing module obtains the input frame according to the frame information of the input frame, processes the input frame according to the channel attributes, and after processing the frame information of an input frame, schedules the frame information of an input frame again for processing by interrupting the thread, thereby controlling the image processing module to continuously process the input frames of multiple image processing tasks. If the input frame of one of the image processing tasks is not sent to the image processing module in time, the image processing module can still continue to process the input frames of other image processing tasks, thereby improving the utilization rate of the image processing module and the overall efficiency of video processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 A schematic diagram of the flow of image processing tasks provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of a video processing method according to an embodiment of the present invention;
[0047] Figure 3 A schematic diagram of data flow in the video processing process provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the structure of a pop-up module provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the structure of a video processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following embodiments do not represent all implementations consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
[0051] The embodiments of the present application provide a video processing method, device, electronic device and storage medium. The video processing method is applicable to video processing intelligent devices, which may include security devices such as IPC (Internet Protocol Camera), vehicle-mounted video processing devices or image processing devices.
[0052] See also Figure 1 , is a flow diagram of an image processing task provided by an embodiment of the present application. Figure 1 As shown, the video processing intelligent device usually needs to perform multiple image processing tasks on the target video, that is, the video to be processed. These image processing tasks may include tasks such as rotation, enlargement, reduction, mirroring, flipping, and distortion correction. According to the needs of image processing, an image processing task may specifically include one subtask, or may include multiple subtasks. For example, image processing task 1 to image processing task N are all subtasks of the current image processing task. When multiple subtasks are included, these multiple subtasks may be tasks with the same function, such as tasks with the reduction function, or they may be tasks with different functions. For example, these multiple subtasks may be tasks with functions such as rotation, enlargement, and reduction, respectively. The embodiments of the present application do not specifically limit this.
[0053] For example, Figure 1 In the example, the upstream image processing task is a rotation task, and the video obtained after being processed by the rotation task is the target video of the current image processing task.
[0054] The current image processing task includes three subtasks:
[0055] Image processing task 1: adjust the target video to the first resolution (3840*2160) and the first frame rate (20fps);
[0056] Image processing task 2: adjust the target video to the first resolution (3840*2160) and the second frame rate (10fps);
[0057] Image processing task 3, adjust the target video to the second resolution (1280*720) and the second frame rate (10fps).
[0058] The downstream image processing task is the distortion correction task.
[0059] The current image processing task is processed by the video processing intelligent device. The upstream image processing task and the downstream image processing task may also be processed by the video processing intelligent device, or the upstream image processing task and / or the downstream image processing task may also be processed by other devices, such as a mobile terminal, a server, and the like.
[0060] In some embodiments, the current image processing task has no upstream image processing task, that is, the current image processing task is to process the original video captured by the video capture device. In this case, the target video is the original video.
[0061] In some embodiments, the current image processing task has no downstream image processing task, that is, after the current image processing task is completed, no further image processing is performed on the output result of the current image processing task.
[0062] The video processing intelligent device of the embodiment of the present application creates multiple channels corresponding to multiple image processing tasks respectively, and schedules the image processing module of the video processing intelligent device to process the image frames corresponding to each channel through set scheduling rules, so that the image processing module can continuously process the image frames of multiple image processing tasks, thereby improving the utilization rate of the image processing module and improving the overall efficiency of video processing.
[0063] See also Figure 2 , is a flow chart of a video processing method provided in an embodiment of the present application, such as Figure 2 As shown, the method may include the following steps:
[0064] Step S100: Acquire frame information of an input frame of a target video, where the frame information includes a frame storage address.
[0065] In some embodiments, for a video processing intelligent device, the target video is a frame sequence composed of multiple image frames output by an upstream image processing task, and the image frame of the target video is an input frame. The output frame is obtained by processing the input frame using the video processing method of an embodiment of the present application.
[0066] The video processing intelligent device first stores the image frame output by the upstream image processing task in a storage module, such as a frame memory pool, and then obtains the image frame from the frame memory pool, processes the image frame through the image processing module of the video processing intelligent device, obtains the output frame, and stores the output frame in the frame memory pool. When the efficiency of the upstream image processing task in sending the image frame is greater than the processing efficiency of the image processing module, the image frame can be stored in the input cache to avoid the loss of the image frame; when the efficiency of the upstream image processing task in sending the image frame is less than the processing efficiency of the image processing module, if there are still unprocessed image frames in the input cache, the image processing module can process the unprocessed image frames in the input cache, thereby avoiding a long wait for the upstream image processing task to send the image frame.
[0067] Among them, the image processing module is a hardware module, which can specifically be components such as a CPU, a DSP, and an image processing chip, and the embodiments of the present application do not impose specific restrictions on this.
[0068] The frame memory pool includes an input cache and an output cache. The input cache is used to store image frames output by upstream image processing tasks, that is, input frames, and each input frame has a frame storage address in the input cache; the output cache is used to store output frames obtained after the input frames are processed by the video processing method of an embodiment of the present application, and each output frame has a frame storage address in the output cache.
[0069] The upstream image processing task outputs the image frame and the frame attributes of the image frame. The frame attributes may include information such as frame width, frame height, frame sequence number, etc. The image processing module may process the image frame according to the frame attributes and the image processing task.
[0070] In some embodiments, when there are multiple image processing tasks, in order to improve the hardware utilization efficiency of the image processing module, a first number of channels may be created in advance, corresponding to the multiple image processing tasks respectively, an attribute memory is allocated to the channel in the storage module, the channel attributes are stored in the attribute memory, an input queue corresponding to the channel is created, a scheduling rule for the input queue is set, and then the image processing module is scheduled to process the image frames corresponding to each channel according to the set scheduling rule, so that the image processing module can continuously process the image frames of multiple image processing tasks. The implementation method can be seen in Figure 3 , which is a schematic diagram of data flow in the video processing process provided in an embodiment of the present application.
[0071] like Figure 3As shown, during the video processing process, the frame information of the input frame flows from the input queue to the pop-up module, the pop-up module processes the frame information to obtain input cache information, the input cache information is sent to the image processing module for processing, the image processing module obtains output cache information after processing the input frame, the output cache information includes a first storage address, the push module obtains the output frame from the first storage address according to the output cache information, and pushes the output frame to the downstream image processing task.
[0072] like Figure 3 As shown, in the video processing process, after the frame information of the input frame enters the input queue, the pop-up module receives a start signal. After the pop-up module is started according to the start signal, it obtains the frame information of an input frame from one of the input queues, translates the frame information into a command text, and translates the channel attributes into a command text. It also applies for a first storage address for the output frame in the storage module, translates the first storage address into a command text, sends the command text corresponding to the frame information, the command text corresponding to the channel attributes, and the command text corresponding to the first storage address to the image processing module, merges the frame attributes and channel attributes of the input frame into output frame attributes, translates the output frame attributes into a command text, and sends the command text corresponding to the output frame attributes to the push module for the push module to push to the downstream image processing task.
[0073] In some embodiments, if the downstream image processing task can identify the output frame attributes, the pop-up module may not translate the output frame attributes into command text, but directly send the output frame attributes to the push module.
[0074] The video processing intelligent device includes multiple tasks according to the current image processing task of the image processing module, and pre-establishes multiple channels. The channels are used to transmit the frame information of the image frame. The frame information includes frame attributes and frame storage addresses. The multiple channels correspond to the multiple tasks respectively, and multiple input queues are created for each channel. Multiple channel attribute memories are created in the memory, such as memory 1, memory 2, memory 3..., and the channel attributes of the corresponding channels are stored in the channel attribute memories. The channel attributes include the target parameters of the output frame corresponding to the image processing task. Exemplarily, channel 1 corresponds to image processing task 1, the input queue of channel 1 is queue 1, and the channel attributes of channel 1 include {ch1, 3840*2160, 20fps}, channel 2 corresponds to image processing task 2, the input queue of channel 2 is queue 2, and the channel attributes of channel 2 include {ch2, 3840*2160, 10fps}, channel 3 corresponds to image processing task 3, the input queue of channel 3 is queue 3, and the channel attributes of channel 3 include {ch3, 1280*720, 10fps}, where ch1, ch2, and ch3 are channel numbers.
[0075] In some embodiments, when an image frame output by upstream image processing and frame attributes of the image frame are received, the image frame can be stored in an input buffer and frame information of the image frame can be obtained, where the frame information includes frame attributes and a frame storage address.
[0076] Step S200: Storing frame information into input queues corresponding to multiple channels. The channels are pre-created according to image processing tasks of the image processing module. The channels are provided with input queues and channel attributes. The channel attributes represent image processing strategies of image processing tasks.
[0077] In some embodiments, after obtaining the frame information of an image frame, the frame information of the image frame can be stored in a pre-created input queue corresponding to a first number of channels, wherein the first number is the number of image processing tasks of the image processing module. After obtaining the frame information of the next image frame, the frame information of the next image frame can continue to be stored in the input queues corresponding to multiple channels.
[0078] In some embodiments, each input queue is set with a queue depth. If the number of stored frame information is less than the queue depth, frame information of the image frame can be stored in the input queue. If the number of stored frame information is equal to the queue depth, a blocking signal is generated to prompt not to send frame information to the input queue.
[0079] In some embodiments, the upstream image processing task and the current image processing task may establish a link. After the connection is established, the current image processing task may send channel information of the current image processing task to the upstream image processing task. The channel information includes the channel sequence number. The upstream image processing task may send frame information of the image frame directly to each input queue.
[0080] Step S300: Obtain frame information of an input frame and channel attributes of a channel corresponding to the input queue from the input queue, generate an image processing command corresponding to the frame information and channel attributes, and send the image processing command to the image processing module.
[0081] In some embodiments, when creating channels and queues, the video processing intelligent device can set scheduling rules between multiple channels and scheduling rules for each queue, so that the image processing module processes the frame information in the input queue according to the set scheduling rules.
[0082] For example, the scheduling rule between multiple channels can be a polling scheduling rule, so as to ensure that each channel can get an execution opportunity and avoid a long waiting time for a channel. The scheduling rule of the input queue can be a first-in-first-out rule, which can ensure the continuity of the output frame.
[0083] For example, queue 1 of channel 1, queue 2 of channel 2, and queue 3 of channel 3 all contain frame information of input frame 1, frame information of input frame 2, and frame information of input frame 3. According to the scheduling rules set above, the processing order of the frame information is: frame information of input frame 1 in queue 1, frame information of input frame 1 in queue 2, frame information of input frame 1 in queue 3, frame information of input frame 2 in queue 1, frame information of input frame 2 in queue 2, frame information of input frame 2 in queue 3, frame information of input frame 3 in queue 1, frame information of input frame 3 in queue 2, and frame information of input frame 3 in queue 3.
[0084] In some embodiments, the frame information in each queue can be scheduled by a pop-up module. The pop-up module is a preset software function module. When the video processing intelligent device obtains the first frame of the target video, it sends a start signal to the pop-up module. The pop-up module starts according to the start signal and sends an image processing command corresponding to the first frame to the image processing module.
[0085] join Figure 4 , is a schematic diagram of the structure of the pop-up module, such as Figure 4 As shown, the pop-up module may include a scheduling unit, a storage configuration unit, and a translation unit.
[0086] The scheduling unit is used to obtain frame information of one of the input frames from one of the input queues. The scheduling unit can obtain the frame information according to the above-set scheduling rules.
[0087] The storage configuration unit is used to apply for a frame storage address in the output buffer of the frame memory pool, and the frame storage address is used to store the output frame obtained after the image processing module processes the input frame.
[0088] The translation unit is used to translate the frame information, channel attributes, and the frame storage address applied by the storage configuration unit into an image processing command that can be recognized by the image processing module. The specific translation method can be determined according to the machine language that can be recognized by the image processing module. The image processing command may include multiple sub-commands, for example, it may include a first command translated from the frame information of the input frame, a second command translated from the channel attributes, and a third command translated from the first storage address. After the channel is created and before step S100, the channel attributes can be pre-translated into the second command to improve the overall generation efficiency of subsequent image processing commands.
[0089] The translation unit is further used to merge the frame attributes and channel attributes of the input frame to obtain output frame attributes, translate the output frame attributes into a fourth command, and send the fourth command to the push module.
[0090] Figure 3In the process, the pop-up module translates the frame information of the input frame into a first command, and the first command includes the input buffer information, that is, the image processing module can obtain the frame storage address of the input frame in the input buffer according to the first command.
[0091] The command text includes a second command, a third command and a fourth command, wherein the pop-up module sends the second command and the third command, as well as the input buffer information to the image processing module, and sends the fourth command to the push module. The push module is a preset software function module for distributing output frames to downstream image processing tasks.
[0092] Step S400: parsing the image processing instruction through the image processing module, acquiring the input frame according to the parsed frame storage address, processing the input frame according to the parsed channel attribute, obtaining the output frame, and starting the interrupt thread.
[0093] In some embodiments, the image processing module parses the image processing instruction to obtain the frame buffer address and frame attributes of the input frame, channel attributes, and the frame buffer address of the output frame.
[0094] According to the target parameters corresponding to the channel attributes, the input frame is subjected to image processing to obtain an output frame, and the output frame is stored in the first storage address.
[0095] Step S500: Obtain frame information of another input frame and channel attributes of a channel corresponding to the input queue through an interrupt thread for processing by the image processing module.
[0096] In some embodiments, after obtaining an output frame, the image processing module starts the interrupt thread. After the interrupt thread is started, the pop-up module is controlled to obtain the frame information of an input frame from one of the input queues according to the set scheduling rules, and the frame information is processed. The processing process is the same as the above steps. That is, after the pop-up module sends the image processing command corresponding to the first frame, the interrupt thread can subsequently control the pop-up module to continue processing image frames after the first frame.
[0097] In some embodiments, the interrupt thread may send a pop-up signal to the pop-up module, so that the pop-up module obtains the frame information of an image frame from one of the input queues according to the pop-up signal, and generates an image processing command corresponding to the image frame. The generation method is the same as the method for generating the image processing command corresponding to the first frame. After sending the image processing command corresponding to the image frame to the image processing module, wait for the interrupt thread to send a pop-up signal to the pop-up module again, and so on.
[0098] In some embodiments, after the interrupt thread sends the frame information of another input frame and the channel attributes of the channel corresponding to the input queue to the downstream image processing task, it can be configured to automatically end the interrupt thread, or the processor of the video processing intelligent device can end the interrupt thread. The interrupt thread is started according to the image processing module outputting an output frame, and then ends after controlling the pop-up module to send a new input frame to the image processing module, thereby ensuring that the image processing tasks of the image processing module are carried out in an orderly manner.
[0099] In some embodiments, after being started, the interrupt thread also sends a push signal to the push module, and the push module sends the output frame to the downstream image processing task according to the push signal.
[0100] It can be seen from the above embodiments that the video processing method provided in the embodiments of the present application creates multiple channels corresponding to multiple image processing tasks respectively, stores the frame information of the input frame into the input queues of multiple channels, and obtains the frame information of an input frame from the input queue through the set scheduling rules for the image processing module to process. The image processing module obtains the input frame according to the frame information of the input frame, processes the input frame according to the channel attributes, and after processing the frame information of an input frame, schedules the frame information of an input frame again for processing through the interrupt thread, thereby controlling the image processing module to continuously process the input frames of multiple image processing tasks. If the input frame of one of the image processing tasks is not sent to the image processing module in time, the image processing module can still continue to process the input frames of other image processing tasks, thereby improving the utilization rate of the image processing module and the overall efficiency of video processing.
[0101] The present application also provides a video processing device. Figure 5 The video processing device may include an input module, an input buffer module, a pop-up module and an image processing module.
[0102] An input module, used for obtaining frame information of an input frame, wherein the frame information includes a frame storage address;
[0103] An input cache module is used to instantiate input queues of multiple channels and store frame information in the multiple input queues. The channels are pre-created according to the image processing tasks of the image processing module. The channels are provided with input queues and channel attributes. The channel attributes represent the image processing strategy of the image processing tasks.
[0104] A pop-up module is used to obtain frame information of an input frame and channel attributes of a channel corresponding to the input queue from the input queue, generate an image processing command corresponding to the frame information and the channel attributes, and send the image processing command to the image processing module;
[0105] The image processing module is used to parse the image processing instructions, obtain the input frame according to the parsed frame storage address, process the input frame according to the parsed channel attributes, obtain the output frame, and start the interrupt thread. The interrupt thread is used to send a pop-up signal to the pop-up module. The pop-up module is also used to obtain the frame information of another input frame and the channel attributes of the channel corresponding to the input queue according to the pop-up signal for processing by the image processing module.
[0106] In some embodiments, the video processing device also includes a push module, and the interrupt thread is also used to send a push signal to the push module. The push module is used to obtain the output frame stored in the image processing module in the storage module according to the push signal and release the storage space of the output frame.
[0107] In some embodiments, the video processing device also includes an output module for sending the output frame and the frame attributes of the output frame to a downstream image processing task, wherein the frame attributes of the output frame are obtained by replacing the first attribute in the frame attributes of the input frame with the second attribute in the channel attributes by the pop-up module, and the first attribute and the second attribute are attributes of the same category, for example, both are resolutions, or both are frame rates, etc.
[0108] An embodiment of the present application also provides an electronic device, which includes one or more processors and a memory, and also includes the device of the second aspect; the memory stores a computer program, the computer program includes computer instructions, and one or more processors call the computer instructions to enable the electronic device to execute the video processing method of the embodiment of the present application.
[0109] An embodiment of the present application further provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes the video processing method of the embodiment of the present application.
[0110] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the general concept of this application and do not constitute a limitation on the protection scope of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without creative work belong to the protection scope of this application.
Claims
1. A video processing method, characterized in that: include: Acquire frame information of an input frame of a target video, wherein the frame information includes a frame storage address; The frame information is stored in input queues corresponding to a plurality of channels, wherein the channels are pre-created according to image processing tasks of an image processing module, and the channels are provided with the input queues and channel attributes, and the channel attributes represent image processing strategies of the image processing tasks; Acquire frame information of the input frame and channel attributes of a channel corresponding to the input queue from the input queue, generate an image processing command corresponding to the frame information and the channel attributes, and send the image processing command to the image processing module; Parsing the image processing instruction through the image processing module, acquiring the input frame according to the parsed frame storage address, processing the input frame according to the parsed channel attribute to obtain an output frame, and starting an interrupt thread; The frame information of another input frame and the channel attributes of the channel corresponding to the input queue are obtained through the interrupt thread for processing by the image processing module.
2. The video processing method according to claim 1, characterized in that: The generating of the image processing command corresponding to the frame information and the channel attribute comprises: Applying for a first storage address in a storage module, wherein the first storage address is used for the image processing module to store the output frame; Translating the frame information into a first command of the image processing module; translating the channel attributes into a second command of the image processing module; translating the output frame address into a third command of the image processing module; The image processing commands include the first command, the second command and the third command.
3. The video processing method according to claim 1, characterized in that: The frame information of the input frame also includes frame attributes, and the method further includes: Replacing a first attribute in the frame attributes of the input frame with a second attribute in the channel attributes to obtain a frame attribute of an output frame, wherein the first attribute and the second attribute are attributes of the same category; The output frame and the frame attributes of the output frame are sent to a downstream image processing task through the interrupt thread.
4. The video processing method according to claim 3, characterized in that: The method further comprises: After acquiring the frame information of another input frame and the channel attributes of the channel corresponding to the input queue through the interrupt thread, and sending the output frame and the frame attributes of the output frame to the downstream image processing task, the interrupt thread is terminated.
5. The video processing method according to claim 1, characterized in that: Before obtaining the frame information of the input frame of the target video, the method further includes: Creating a first number of channels, the first number being the number of image processing tasks of the image processing module; Allocating an attribute memory for the channel in a storage module, and storing the channel attributes in the attribute memory; Create an input queue corresponding to the channel, and set a scheduling rule for the input queue.
6. The video processing method according to claim 1, characterized in that: The acquiring frame information of an input frame from the input queue comprises: Determine, according to the polling scheduling rule, an input queue for obtaining frame information of the input frame; According to a first-in-first-out rule, frame information of an input frame is obtained from a determined input queue.
7. A video processing device, characterized in that: include: An input module, used for acquiring frame information of an input frame, wherein the frame information includes a frame storage address; An input cache module, used to instantiate input queues of multiple channels and store the frame information in the multiple input queues, wherein the channels are pre-created according to image processing tasks of an image processing module, and the channels are provided with the input queues and channel attributes, and the channel attributes represent image processing strategies of the image processing tasks; A pop-up module is used to obtain frame information of the input frame and channel attributes of a channel corresponding to the input queue from the input queue, generate an image processing command corresponding to the frame information and the channel attributes, and send the image processing command to the image processing module; An image processing module is used to parse the image processing instruction, obtain the input frame according to the parsed frame storage address, process the input frame according to the parsed channel attributes to obtain the output frame, and start an interrupt thread, the interrupt thread is used to send a pop-up signal to the pop-up module, and the pop-up module is also used to obtain the frame information of another input frame and the channel attributes of the channel corresponding to the input queue according to the pop-up signal for processing by the image processing module.
8. The video processing device according to claim 7, characterized in that: The pop-up module comprises: A scheduling unit, used for obtaining frame information of one of the input frames from one of the input queues; A storage configuration unit, used for applying for a first storage address in a storage module, wherein the first storage address is used for the image processing module to store the output frame; The translation unit is used to translate the frame information, channel attributes and the first storage address into an image processing command of the image processing module.
9. The video processing device according to claim 7, characterized in that: The device also includes a push module, and the interrupt thread is further used to send a push signal to the push module. The push module is used to obtain the output frame stored in the image processing module in the storage module according to the push signal, and release the storage space of the output frame.
10. The video processing device according to claim 7, characterized in that: The device also includes: An output module is used to send the output frame and the frame attributes of the output frame to a downstream image processing task, wherein the frame attributes of the output frame are obtained by replacing the first attribute in the frame attributes of the input frame with the second attribute in the channel attributes by the pop-up module, and the first attribute and the second attribute are attributes of the same category.
11. An electronic device comprising one or more processors and a memory, characterized in that: It also includes the device described in any one of claims 7-10; the memory stores a computer program, the computer program includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the video processing method described in any one of claims 1-6.
12. A computer-readable storage medium, characterized in that: It comprises a computer program, and when the computer program is run on an electronic device, the electronic device executes the video processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
device on underground gas pipelines for detecting leaks in the same
CH31280A
Image terminal management method and device
CN118042291A
Image forming method and image forming device
JP2001189856A
Recording apparatus, recording method, and recording system
US20130202272A1
Processor instruction based data prefetching
US20140108742A1