Video processing method and device, electronic equipment and computer readable storage medium
Patent Information
- Application Number
- CN202210351947.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2042-04-02
AI Technical Summary
[0003]但是,随着录像时长的增加,视频容量也在不断提升,为录像视频的存储提供了内存压力
[0015]本申请实施例根据原始视频的光强信息,得到原始视频在目标时间段的光强波动值,并在光强波动值未达到预设阈值时,根据单个通道对目标时间段的原始视频进行通道视频提取,得到目标单通道视频,随后,根据原始视频和目标单通道视频生成待存储的目标视频。其中,由于在光强波动值未达到预设阈值时,说明目标时间段内视频图像的光强值的波动满足处理条件,由于单个通道提取后的视频相较于多个通道提取的视频存在视频容量较小的特点,因此,通过在满足处理条件后的单个通道对该目标时间段内的通道视频的提取,使得提取得到的目标单通道视频所占用的内存较小,并在与原始视频合成得到目标视频后,可降低目标视频所占用的内存,便于该视频的存储。
Smart Images

Figure CN114640869B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a video processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] With the rapid development of computer technology, the performance of camera equipment is also constantly being optimized. Camera equipment can record scenes and obtain video information of scenes at historical times.
[0003] However, as recording time increases, video size also increases, putting memory pressure on the storage of recorded videos. Summary of the Invention
[0004] This application provides a video processing method, apparatus, electronic device, and computer-readable storage medium, which can reduce the memory occupied by video storage and facilitate video storage.
[0005] In a first aspect, embodiments of this application provide a video processing method, including: Based on the light intensity information of the original video, the light intensity fluctuation value of the original video during the target time period is obtained; When the light intensity fluctuation value does not reach the preset threshold, channel video is extracted from the original video within the target time period based on the target single channel to obtain the target single channel video. Based on the original video and the target single-channel video, the target video to be stored is obtained.
[0006] Secondly, embodiments of this application also provide a video processing apparatus, including: The acquisition module is used to obtain the light intensity fluctuation value of the original video during the target time period based on the light intensity information of the original video. The extraction module is used to extract channel video from the original video within the target time period based on the target single channel when the light intensity fluctuation value does not reach the preset threshold, so as to obtain the target single channel video. The processing module is used to obtain the target video to be stored based on the original video and the target single-channel video.
[0007] In some embodiments of this application, the target single channel includes a light intensity imaging channel, and the extraction module includes: The first extraction unit is used to extract channel images from each frame of the original video within the target time period according to the light intensity imaging channel to obtain the light intensity channel image corresponding to the video image. The first generation unit is used to obtain the target single-channel video based on all light intensity channel images within the target time period.
[0008] In some embodiments of this application, the acquisition module includes: The first acquisition unit is used to acquire the light intensity value of each frame of the original video within the target time period; The second generation unit is used to obtain the light intensity fluctuation value of the original video in the target time period based on the maximum and minimum light intensity values in the target time period.
[0009] In some embodiments of this application, the target time period includes several target sub-time periods, and the acquisition module includes: The second acquisition unit is used to obtain the light intensity and value of several target sub-time periods based on the light intensity information of the original video. The third generation unit is used to obtain the light intensity difference between the light intensity sums and values based on the light intensity sums and values corresponding to the several target sub-time periods; A determining unit is used to use the light intensity difference as the light intensity fluctuation value of the original video in the target time period.
[0010] In some embodiments of this application, the acquisition module includes time points that are adjacent to each other or have a preset number of overlapping time points between target sub-time periods.
[0011] In some embodiments of this application, the processing module includes: The first processing unit is used to replace the video of the target time period in the original video according to the target single-channel video to obtain the target video to be stored.
[0012] In some embodiments of this application, the processing module includes: The second extraction unit is used to extract multi-channel video from the original video of the target time period based on at least two channels when the light intensity fluctuation value reaches the preset threshold, so as to obtain the target multi-channel video. The fourth generation unit is used to obtain the target video to be stored based on the original video and the target multi-channel video.
[0013] Thirdly, embodiments of this application also provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the video processing method described above.
[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the video processing method described above.
[0015] This embodiment of the application obtains the light intensity fluctuation value of the original video within a target time period based on the light intensity information of the original video. When the light intensity fluctuation value does not reach a preset threshold, channel video extraction is performed on the original video within the target time period using a single channel to obtain a target single-channel video. Subsequently, a target video to be stored is generated based on the original video and the target single-channel video. Since the light intensity fluctuation value does not reach the preset threshold, it indicates that the light intensity fluctuation of the video image within the target time period meets the processing conditions. Because the video extracted from a single channel has a smaller file size compared to videos extracted from multiple channels, extracting the channel video within the target time period using a single channel after meeting the processing conditions reduces the memory occupied by the extracted target single-channel video. Furthermore, after merging it with the original video to obtain the target video, the memory occupied by the target video can be reduced, facilitating its storage. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of a scene illustrating the video processing method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the video processing method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the video storage process provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of the video processing apparatus provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0018] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] This application provides a video processing method, apparatus, electronic device, and computer-readable storage medium. Specifically, this application provides a video processing apparatus suitable for electronic devices, wherein the electronic device includes devices such as terminals or servers. The terminal can be a computer, a personal laptop, or a mobile phone, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The server can be directly or indirectly connected via wired or wireless communication.
[0020] The embodiments of this application can be executed by the terminal device alone, by the server alone, or by both the terminal device and the server jointly. Please refer to [link to relevant documentation]. Figure 1 Taking the execution of video processing methods by a terminal device as an example, the specific execution process of the video processing method is as follows: Terminal device 10 activates the video image acquisition function to acquire video images of the target scene and obtain the original video. After obtaining the original video of the target scene, terminal device 10 extracts the light intensity information of the original video and obtains the light intensity fluctuation value of the original video in the target time period based on the light intensity information. When the light intensity fluctuation value does not reach the preset condition, channel video extraction is performed on the original video in the target time period based on the target single channel to obtain the target single channel video. Subsequently, the target video to be stored is synthesized based on the original video and the target single channel video.
[0021] In this embodiment, the terminal device 10 may include a camera device. The camera device's recording module captures video images of the scene, and then the camera device's processing unit processes the video images to obtain a target video with a smaller file size. In this embodiment, the target video may be stored in the camera device's local memory or uploaded to the cloud and stored there for later viewing.
[0022] In this embodiment, the acquisition and processing of the original video can be performed by two different terminal devices. For example, one terminal device can acquire video images of the target scene to obtain the original video of the target scene, and then send the original video to another terminal device. After receiving the original video, the other terminal device can obtain the light intensity fluctuation value of the original video in the target time period based on the light intensity information of the original video. Subsequently, single-channel video extraction is performed on the original video in the target time period to obtain the target single-channel video. Then, the original video outside the target time period and the target single-channel video are combined to obtain the target video with a smaller storage capacity.
[0023] In this embodiment, the original video can be captured and forwarded by a server to a terminal device. The terminal device then processes the original video to obtain a target video with a smaller storage capacity. Alternatively, the original video forwarded by the server can be captured by other terminal devices, stored on the server, and then forwarded to the video processing terminal by the server.
[0024] In this embodiment, the server can also perform video processing on the original video. Specifically, the server's rapid data processing capabilities can be utilized to extract single-channel video and synthesize the extracted video with the original video, thereby obtaining a target video with a smaller storage capacity. In other words, a terminal device can capture video images of the target scene to obtain the original video of the target scene. Subsequently, the terminal device sends the original video to the server, where the server processes the original video to obtain a target video with a smaller memory footprint.
[0025] In this embodiment, the light intensity fluctuation value of the original video within a target time period is obtained based on the light intensity information of the original video. When the light intensity fluctuation value does not reach a preset threshold, channel extraction is performed on the original video within the target time period using a single channel to obtain a target single-channel video. Subsequently, a target video to be stored is generated based on the original video and the target single-channel video. Since the light intensity fluctuation value not reaching the preset threshold indicates that the light intensity fluctuation of the video image within the target time period meets the processing conditions, and since the video extracted from a single channel has a smaller memory footprint compared to videos extracted from multiple channels, extracting the target single-channel video within the target time period using a single channel after meeting the processing conditions reduces the memory occupied by the extracted target single-channel video. This further reduces the memory occupied by the target video after it is synthesized with the original video, facilitating its storage.
[0026] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0027] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating the video processing method provided in an embodiment of this application. The specific flow of the video processing method can be as follows: 101. Based on the light intensity information of the original video, obtain the light intensity fluctuation value of the original video during the target time period.
[0028] In this embodiment of the application, the original video is a video obtained by directly capturing it through a camera device, such as a surveillance video obtained by capturing it through a camera.
[0029] In this embodiment of the application, the light intensity information is the light intensity information corresponding to the video images in the original video. For example, in this embodiment of the application, the original video contains multiple video images, each of which corresponds to a light intensity value. The light intensity information of the original video is obtained based on the light intensity values corresponding to each video image.
[0030] Since each video image corresponds to a separate acquisition time, the light intensity value for any time period can be obtained from the light intensity information of the original video.
[0031] In this embodiment, by collecting light intensity fluctuation values for a target time period in the original video, the changes in light intensity information in the original video during the target time period can be determined based on these fluctuation values. Furthermore, this embodiment can perform corresponding video processing based on the changes in light intensity information.
[0032] In this embodiment of the application, the light intensity fluctuation value of the original video in the target time period can be obtained based on the light intensity value of each frame of the video image in the target time period. That is, optionally, in some embodiments of the application, the step "obtaining the light intensity fluctuation value of the original video in the target time period based on the light intensity information of the original video" includes: Obtain the light intensity value of each frame of the original video within the target time period; The light intensity fluctuation value of the original video during the target time period is obtained based on the maximum and minimum light intensity values within the target time period.
[0033] The light intensity value of each frame of video image can be extracted through the light intensity imaging channel, which may include the white channel (W) of the four primary colors (RGBW).
[0034] Specifically, by using the maximum and minimum values of light intensity within the target time period, the light intensity fluctuation value of the original video within the target time period can be obtained. That is, the difference between the maximum and minimum values of light intensity within the target time period is taken as the light intensity fluctuation value of the target time period.
[0035] In some embodiments of this application, the target time period can be divided into multiple sub-time periods, and the light intensity fluctuation value of the target time period can be obtained through the light intensity values of multiple sub-time periods. That is, optionally, in some embodiments of this application, the target time period includes several target sub-time periods, and the step "obtaining the light intensity fluctuation value of the original video in the target time period based on the light intensity information of the original video" includes: Based on the light intensity information of the original video, the light intensity and values of several target sub-time periods are obtained; Based on the sum of light intensities corresponding to the several target sub-time periods, the light intensity difference between the sums of light intensities is obtained; The light intensity difference is used as the light intensity fluctuation value of the original video during the target time period.
[0036] In this embodiment of the application, each target sub-time period includes multiple moments, that is, each target sub-time period corresponds to multiple light intensity values of video images, and for each target sub-time period, the sum of the light intensity values of multiple video images in the target sub-time period can be used as the light intensity value of the target sub-time period.
[0037] Therefore, in this embodiment of the application, the light intensity fluctuation value of the target sub-time period can be obtained based on the sum of light intensity values of each target sub-time period. For example, in this implementation, the maximum and minimum values of the sum of light intensity values can be determined from each sum of light intensity values, and the light intensity fluctuation value of the target time period can be determined based on the maximum and minimum values.
[0038] In this embodiment of the application, the time points between each target sub-time period can be adjacent or have a preset number of overlapping time points. For target sub-time periods with adjacent time points, it can be understood that the start time of each sub-time period is adjacent to the end time of the previous sub-time period. For sub-time periods with a preset number of overlapping time points, it can be understood that there is a time point overlap between the previous sub-time period and the next sub-time period.
[0039] Specifically, by splicing together multiple sub-time periods adjacent to each other before and after a time point, the entire target sub-time period can be obtained. In other words, this setting of adjacent sub-time periods before and after a time point can ensure the comprehensiveness of light intensity value acquisition within the target time period. That is, the light intensity fluctuation value corresponding to the target time period is obtained based on the light intensity value of the video image at all times in the target time period.
[0040] In particular, for sub-time periods where consecutive time points overlap, the number of moments contained in each sub-time period is relatively small because there is partial overlap between the two sub-time periods. That is, for a target time period of the same size, the number of corresponding seed time periods is relatively large, and the calculation span of light intensity values is relatively small. For example, when calculating the light intensity fluctuation values for the time period from 1 to 10, and dividing the sub-time periods into five-moment segments, if the sub-time periods are divided according to adjacent time points, it can be divided into two sub-time periods: 1-5 and 6-10. If we divide the light intensity into segments, we can divide it into six sub-segments: 1-5, 2-6, 3-7, 4-8, 5-9, and 6-10, based on overlapping time points. The time span is one time point added to each sub-segment. Because the sub-segment division is based on overlapping time points, there are overlapping times between adjacent sub-segments, resulting in a greater correlation between the light intensity and values of adjacent sub-segments and increasing the number of light intensity and values. The increased correlation and number of light intensity and values make it easier to obtain more accurate light intensity fluctuation values.
[0041] 102. When the light intensity fluctuation value does not reach the preset threshold, the original video within the target time period is extracted according to the target single channel to obtain the target single channel video.
[0042] In this embodiment, the preset threshold is a threshold for changes in the scene image. Specifically, when the light intensity fluctuation value reaches or exceeds this threshold, the scene image content is considered to have changed. The scene image content refers to the actual objects, people, or animals contained in the scene image. In this embodiment, the preset threshold is selected based on practical experience parameters. For example, in this embodiment, the light intensity value of the scene image when no target enters and the light intensity value after a target enters can be recorded, and the preset threshold is obtained based on the difference between the two light intensity values.
[0043] In this embodiment of the application, a channel refers to a color channel. An image can correspond to multiple color channels. For example, a three-primary-color (RGB) image can include a red channel, a green channel, and a blue channel, while a four-primary-color (RGBW) image can include a red channel, a green channel, a blue channel, and a white channel.
[0044] By extracting video from a single channel, the extracted target single-channel video contains only video image data from a single channel, which is the same as the video image from a three- or four-channel video. The video capacity of a single channel is small, and the required storage space is small.
[0045] In this embodiment of the application, when extracting a single-channel video, it can be achieved by performing single-channel extraction on each frame of video image. In this embodiment, the target single channel may include a light intensity imaging channel. Optionally, in some embodiments of this application, the step "extracting channel video from the original video within the target time period based on the target single channel to obtain the target single-channel video" includes: For each frame of the original video within the target time period, channel image extraction is performed on the video image according to the light intensity imaging channel to obtain the light intensity channel image corresponding to the video image; Based on all light intensity channel images within the target time period, the target single-channel video is obtained.
[0046] Specifically, by extracting single-channel images from each frame of the original video image within the target time period, a light intensity channel image corresponding to each original video image can be obtained. Furthermore, by synthesizing the extracted multiple light intensity channel images according to the acquisition time of the original video images, a target single-channel video corresponding to the original video within the target time period can be obtained. In this embodiment, video compositing technology can be used to synthesize the video from the images.
[0047] In this embodiment, the light intensity imaging channel may include the white channel in a four-color (RGBW) image. Extracting the video image through the white channel allows for the acquisition of brightness information, resulting in a black-and-white image. This black-and-white information reveals the basic outlines of objects in the scene, preventing excessive loss of image content information.
[0048] Since the capacity of a single-channel video is smaller than that of a three-channel or four-channel video, less memory is required when storing a single-channel video.
[0049] 103. Based on the original video and the target single-channel video, obtain the target video to be stored.
[0050] The target video is obtained by combining the original video with the target single-channel video. The target video has a smaller file size than the original video and occupies less memory when stored, which enables the storage of video recordings of longer durations.
[0051] In this embodiment of the application, the target video can be obtained by replacing the video of the target time period in the original video with the target single-channel video. That is, optionally, in some embodiments of this application, the step "obtaining the target video to be stored based on the original video and the target single-channel video" includes: Based on the target single-channel video, the video of the target time period in the original video is replaced to obtain the target video to be stored.
[0052] The process involves replacing the original video within a target time period with the target video to obtain the replaced target video. Since the replaced portion of the original video uses a single-channel video format, the resulting target video is smaller in size than the original video. This smaller size means less memory is required for storage, facilitating video storage. For example, it allows for the storage of longer video durations within the same memory limit, making it suitable for scenarios requiring long-duration video recording.
[0053] In this embodiment, to obtain more content information in the scene, when the light intensity fluctuation value reaches a preset threshold, the video can be extracted through multiple channels to obtain multi-channel video. Since multi-channel video has richer image content information than single-channel video, storing multi-channel video makes it easier to obtain richer content information in the scene from the video. For example, when a target object appears in a fixed scene, video images from multiple channels can be saved to obtain the scene content through the video images. When the fixed scene remains unchanged, video images from a single channel can be saved to reduce the video size, reduce the storage of invalid data, and reduce the occupation of memory resources.
[0054] In this embodiment of the application, when the light intensity fluctuation value reaches a preset threshold, the scene image can be imaged and stored using four primary colors (RGBW).
[0055] In this embodiment, the light intensity fluctuation value of the original video within a target time period is obtained based on the light intensity information of the original video. When the light intensity fluctuation value does not reach a preset threshold, channel extraction is performed on the original video within the target time period using a single channel to obtain a target single-channel video. Subsequently, a target video to be stored is generated based on the original video and the target single-channel video. Since the light intensity fluctuation value not reaching the preset threshold indicates that the light intensity fluctuation of the video image within the target time period meets the processing conditions, and since the video extracted from a single channel has a smaller memory footprint compared to videos extracted from multiple channels, extracting the target single-channel video within the target time period using a single channel after meeting the processing conditions reduces the memory occupied by the extracted target single-channel video. This further reduces the memory occupied by the target video after it is synthesized with the original video, facilitating its storage.
[0056] In this embodiment of the application, light intensity fluctuation values over multiple time periods can be obtained, and based on the relationship between the light intensity fluctuation values and a preset threshold, it can be determined whether the video image can be extracted through a single channel, so as to reduce the size of the video image and reduce the memory occupied by storing the video image.
[0057] Please see Figure 3 , Figure 3 This is a schematic diagram of the video storage process provided in an embodiment of this application, wherein the specific process of video storage includes: 111. Turn on the camera and input the image information in the four primary colors (RGBW) mode; 112. Extract the light intensity of the white (W) channel from the image information to obtain the light intensity value of the white (W) channel; 113. Process the light intensity value of the white (W) channel to obtain the gray value W1; 114. Within time T1, calculate N1 for the light intensity fluctuation (variance fluctuation) of gray value W1; 115. If N1 is less than the preset threshold M, then proceed to step 116; otherwise, proceed to step 117. 116. This indicates that there are no significant changes in the objects in the current environment, so only the current W channel is used for imaging, and the W brightness image is saved. 117. Use the three primary color (RGB) channels, that is, simultaneously enable the four primary colors (RGBW) to fully record brightness and color information.
[0058] In this embodiment of the application, after comprehensively recording brightness and color information using the four primary colors (RGBW), the light intensity fluctuation of the grayscale value W can be calculated within time T2 to determine whether the light intensity fluctuation value exceeds a preset threshold within time T2, as follows: 118. Calculate the light intensity fluctuation during time T2 to obtain N2; 119. If N2 is less than the preset threshold Q, then proceed to step 113; otherwise, proceed to step 120. 120. Continue to record brightness and color information comprehensively using the four primary colors (RGBW).
[0059] In this embodiment of the application, steps 118-120 can be executed repeatedly to determine whether the video image needs single-channel processing, so as to minimize the video size and reduce the memory occupied by storing the video.
[0060] By processing video images whose light intensity fluctuation values are less than a preset threshold using a single channel, the final video has a smaller file size, making it easier to store. For example, the same storage capacity can store a single-channel video for a longer period of time.
[0061] To facilitate better implementation of the video processing method of this application, this application also provides a video processing apparatus based on the above-described video processing method. The meaning of the third target term is the same as in the above-described video processing method; specific implementation details can be found in the description of the method embodiments.
[0062] Please see Figure 4 , Figure 4 The schematic diagram of the video processing apparatus provided in this application shows that the video processing apparatus may include: The acquisition module 201 is used to obtain the light intensity fluctuation value of the original video in the target time period based on the light intensity information of the original video; Extraction module 202 is used to extract channel video from the original video within the target time period based on the target single channel when the light intensity fluctuation value does not reach the preset threshold, so as to obtain the target single channel video. The processing module 203 is used to obtain the target video to be stored based on the original video and the target single-channel video.
[0063] In some embodiments of this application, the target single channel includes a light intensity imaging channel, and the extraction module 202 includes: The first extraction unit is used to extract channel images from each frame of the original video within the target time period according to the light intensity imaging channel to obtain the light intensity channel image corresponding to the video image. The first generation unit is used to obtain the target single-channel video based on all light intensity channel images within the target time period.
[0064] In some embodiments of this application, the acquisition module 201 includes: The first acquisition unit is used to acquire the light intensity value of each frame of the original video within the target time period; The second generation unit is used to obtain the light intensity fluctuation value of the original video in the target time period based on the maximum and minimum light intensity values in the target time period.
[0065] In some embodiments of this application, the target time period includes several target sub-time periods, and the acquisition module 201 includes: The second acquisition unit is used to obtain the light intensity and value of several target sub-time periods based on the light intensity information of the original video. The third generation unit is used to obtain the light intensity difference between the light intensity sums and values based on the light intensity sums and values corresponding to the several target sub-time periods; A determining unit is used to use the light intensity difference as the light intensity fluctuation value of the original video in the target time period.
[0066] In some embodiments of this application, the acquisition module 201 includes time points that are adjacent to each other or have a preset number of overlapping time points between target sub-time periods.
[0067] In some embodiments of this application, the processing module 203 includes: The first processing unit is used to replace the video of the target time period in the original video according to the target single-channel video to obtain the target video to be stored.
[0068] In some embodiments of this application, the processing module 203 includes: The second extraction unit is used to extract multi-channel video from the original video of the target time period based on at least two channels when the light intensity fluctuation value reaches the preset threshold, so as to obtain the target multi-channel video. The fourth generation unit is used to obtain the target video to be stored based on the original video and the target multi-channel video.
[0069] In this embodiment, the acquisition module 201 obtains the light intensity fluctuation value of the original video within the target time period based on the light intensity information of the original video. Then, when the light intensity fluctuation value does not reach a preset threshold, the extraction module 202 performs channel video extraction on the original video within the target time period based on the target single channel to obtain the target single channel video. Finally, the processing module 203 obtains the target video to be stored based on the original video and the target single channel video.
[0070] In this embodiment, the light intensity fluctuation value of the original video within a target time period is obtained based on the light intensity information of the original video. When the light intensity fluctuation value does not reach a preset threshold, channel extraction is performed on the original video within the target time period using a single channel to obtain a target single-channel video. Subsequently, a target video to be stored is generated based on the original video and the target single-channel video. Since the light intensity fluctuation value not reaching the preset threshold indicates that the light intensity fluctuation of the video image within the target time period meets the processing conditions, and since the video extracted from a single channel has a smaller memory footprint compared to videos extracted from multiple channels, extracting the target single-channel video within the target time period using a single channel after meeting the processing conditions reduces the memory occupied by the extracted target single-channel video. This further reduces the memory occupied by the target video after it is synthesized with the original video, facilitating its storage.
[0071] In addition, this application also provides an electronic device, such as Figure 5 As shown, it illustrates the structural diagram of the electronic device involved in this application, specifically: The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 401 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 402, and calls data stored in the memory 402, to perform various functions and process data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0072] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0073] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0074] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0075] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402, thereby implementing the steps in any of the video processing methods provided in this application.
[0076] This embodiment of the application obtains the light intensity fluctuation value of the original video within a target time period based on the light intensity information of the original video. When the light intensity fluctuation value does not reach a preset threshold, channel extraction is performed on the original video within the target time period using a single channel to obtain a target single-channel video. Subsequently, a target video to be stored is generated based on the original video and the target single-channel video. Since the light intensity fluctuation value not reaching the preset threshold indicates that the light intensity fluctuation of the video image within the target time period meets the processing conditions, and since the video extracted from a single channel has a smaller memory footprint compared to videos extracted from multiple channels, extracting the target single-channel video within the target time period using a single channel after meeting the processing conditions reduces the memory occupied by the extracted target single-channel video. This further reduces the memory occupied by the target video after it is synthesized with the original video, facilitating its storage.
[0077] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0078] Therefore, this application provides a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the video processing methods provided in this application.
[0079] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0080] Since the instructions stored in the computer-readable storage medium can execute any of the image processing steps provided in this application, the beneficial effects that any of the video processing methods provided in this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0081] The video processing method, apparatus, electronic device, and storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A video processing method, characterized in that, include: Based on the light intensity information of the original video, the light intensity fluctuation value of the original video during the target time period is obtained; When the light intensity fluctuation value does not reach the preset threshold, channel video is extracted from the original video within the target time period based on the target single channel to obtain the target single channel video. Based on the original video and the target single-channel video, the target video to be stored is obtained; The step of obtaining the target video to be stored based on the original video and the target single-channel video includes: Based on the target single-channel video, the video of the target time period in the original video is replaced to obtain the target video to be stored.
2. The method according to claim 1, characterized in that, The target single channel includes a light intensity imaging channel. The step of extracting channel video from the original video within the target time period based on the target single channel to obtain the target single channel video includes: For each frame of the original video within the target time period, channel image extraction is performed on the video image according to the light intensity imaging channel to obtain the light intensity channel image corresponding to the video image; Based on all light intensity channel images within the target time period, the target single-channel video is obtained.
3. The method according to claim 1, characterized in that, The step of obtaining the light intensity fluctuation value of the original video during the target time period based on the light intensity information of the original video includes: Obtain the light intensity value of each frame of the original video within the target time period; The light intensity fluctuation value of the original video during the target time period is obtained based on the maximum and minimum light intensity values within the target time period.
4. The method according to claim 1, characterized in that, The target time period includes several target sub-time periods. The step of obtaining the light intensity fluctuation value of the original video within the target time period based on the light intensity information of the original video includes: Based on the light intensity information of the original video, the light intensity and values of several target sub-time periods are obtained; Based on the sum of light intensities corresponding to the several target sub-time periods, the light intensity difference between the sums of light intensities is obtained; The light intensity difference is used as the light intensity fluctuation value of the original video during the target time period.
5. The method according to claim 4, characterized in that, The target sub-time periods are adjacent to each other or have a preset number of overlapping time points.
6. The method according to claim 1, characterized in that, The step of obtaining the target video to be stored based on the original video and the target single-channel video includes: When the light intensity fluctuation value reaches the preset threshold, multi-channel video extraction is performed on the original video of the target time period based on at least two channels to obtain the target multi-channel video; Based on the original video and the target multi-channel video, the target video to be stored is obtained.
7. A video processing apparatus, characterized in that, include: The acquisition module is used to obtain the light intensity fluctuation value of the original video during the target time period based on the light intensity information of the original video. The extraction module is used to extract channel video from the original video within the target time period based on the target single channel when the light intensity fluctuation value does not reach the preset threshold, so as to obtain the target single channel video. The processing module is used to obtain the target video to be stored based on the original video and the target single-channel video; The step of obtaining the target video to be stored based on the original video and the target single-channel video includes: Based on the target single-channel video, the video of the target time period in the original video is replaced to obtain the target video to be stored.
8. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the video processing method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the video processing method as described in any one of claims 1-6.
Citation Information
Patent Citations
Video data transmission method and device
CN102932656A
Video processing method and system, electronic equipment and storage medium
CN111654721A