Video processing method, device, equipment and storage medium
By pre-processing the video clips, evaluating the rate of return after video transcoding, and determining the video processing strategy, the problem of inaccurate noise evaluation and noise reduction processing in the prior art damage to high-quality videos is solved, and the accuracy of video processing and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202210096386.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-01-26
AI Technical Summary
There is inaccuracy in the selection of noise intensity evaluation and noise reduction processing strategies in existing video transcoding systems, resulting in inaccurate evaluation of noise intensity and may damage the picture details of high-quality videos.
By obtaining the target video clip on the original video and transcoding based on different processing methods, the occupied space of the first and second transcoding video clips is obtained. Calculate the rate of return based on the difference in space, and decide whether to perform noise reduction processing and select the appropriate noise reduction intensity.
Improve the accuracy of video processing, reduce the waste of computing resources for high-quality videos, and avoid unnecessary noise reduction processing to damage the picture details.
Smart Images

Figure CN114390290B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a video processing method, apparatus, device and storage medium. Background Art
[0002] Affected by various factors, the quality of recorded video sources is often uneven. Some sources may contain noise, as well as compression quality damage caused by the video production process. For such sources, noise reduction processing is often required during video transcoding to improve the quality of the transcoded video. Among them, video transcoding refers to converting a compressed and encoded video stream into another video stream to adapt to different network bandwidths, different terminal processing capabilities, and different user needs.
[0003] Existing video transcoding systems usually judge the noise intensity based on the statistical characteristics of the picture, and then select the corresponding noise reduction strategy. However, this noise reduction process is easily affected by the characteristics of the picture itself and people's subjective factors, resulting in inaccurate assessment of noise intensity. In addition, a consistent noise reduction process strategy is adopted for all sources, resulting in the fact that when the source quality is high, there is actually no need for filtering, and the noise reduction filter process will damage the picture details. There is a lack of relevant research on how to accurately choose whether to perform noise reduction processing and choose the appropriate noise reduction intensity for the video to be transcoded. Summary of the invention
[0004] The embodiment of the present application provides a video processing method to improve the accuracy of video processing.
[0005] In a first aspect, an embodiment of the present application provides a video processing method, the method comprising:
[0006] Obtain a target video segment based on the original video;
[0007] Transcoding the target video segment based on a first processing method to obtain a first transcoded video segment, wherein the occupied space corresponding to the first transcoded video segment is a first occupied space;
[0008] Transcoding the target video segment based on a second processing method to obtain a second transcoded video segment, wherein the occupied space corresponding to the second transcoded video segment is a second occupied space;
[0009] determining a rate of return based on the first occupied space and the second occupied space;
[0010] The original video is processed accordingly according to the rate of return.
[0011] In a possible implementation manner, transcoding the target video segment based on the first processing method includes:
[0012] The target video segment is subjected to variable bit rate transcoding based on a loop filtering algorithm of a first strength and target transcoding parameters, wherein the target transcoding parameters include at least one of a coding standard, a video container, a target image quality, and a target resolution.
[0013] In a possible implementation, performing variable bit rate transcoding on the target video segment based on the second processing method includes:
[0014] The target video segment is transcoded based on a pre-filtering algorithm, a loop filtering algorithm of a second strength, and the target transcoding parameters.
[0015] In a possible implementation manner, determining the rate of return based on the first occupied space and the second occupied space includes:
[0016] determining an occupied space difference based on the first occupied space and the second occupied space;
[0017] The rate of return is determined based on the occupied space difference and the first occupied space.
[0018] In a possible implementation manner, determining the rate of return based on the first occupied space and the second occupied space includes:
[0019] determining the occupied space difference based on the first occupied space and the second occupied space;
[0020] The rate of return is determined based on the occupied space difference and the second occupied space.
[0021] In a possible implementation, the processing the original video accordingly according to the rate of return includes:
[0022] When the rate of return is greater than a preset rate of return, variable bit rate transcoding is performed on the original video based on the pre-filtering algorithm and the loop filtering algorithm;
[0023] When the rate of return is less than or equal to the preset rate of return, variable bit rate transcoding is performed on the original video based on a loop filtering algorithm.
[0024] In a possible implementation manner, obtaining a target video segment based on an original video includes:
[0025] A video segment of a preset length is randomly intercepted from the original video as the target video segment.
[0026] In a second aspect, an embodiment of the present application provides a video processing device, the device comprising: an acquisition module, a first processing module, a second processing module, a determination module and a third processing module;
[0027] The acquisition module is used to acquire the target video segment based on the original video;
[0028] The first processing module is used to transcode the target video segment based on a first processing method to obtain a first transcoded video segment, wherein the occupied space corresponding to the first transcoded video segment is a first occupied space;
[0029] The second processing module is used to transcode the target video segment based on a second processing method to obtain a second transcoded video segment, wherein the occupied space corresponding to the second transcoded video segment is the second occupied space;
[0030] The determining module is used to determine a rate of return based on the first occupied space and the second occupied space;
[0031] The third processing module is used to perform corresponding processing on the original video according to the rate of return.
[0032] In a third aspect, an embodiment of the present application provides a video processing device, the device comprising: a memory and a processor;
[0033] The memory is used to store relevant program codes;
[0034] The processor is used to call the program code to execute the video processing method described in any one of the implementation modes of the first aspect above.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the video processing method described in any one of the implementations of the first aspect above.
[0036] It can be seen that the embodiments of the present application have the following beneficial effects:
[0037] In the above implementation method of the embodiment of the present application, firstly, a target video clip is obtained from the original video; then, the target video clip is transcoded based on the first processing method to obtain a first transcoded video clip, wherein the occupied space corresponding to the first transcoded video clip is the first occupied space. The target video clip is transcoded based on the second processing method to obtain a second transcoded video clip, wherein the occupied space corresponding to the second transcoded video clip is the second occupied space. The rate of return is determined based on the first occupied space and the second occupied space corresponding to the above-mentioned first transcoded video clip and the second transcoded video clip, respectively, and the original video is processed accordingly according to the rate of return. The video processing method provided in the embodiment of the present application, by performing transcoding preprocessing on the target video clip, evaluates the revenue obtained after video transcoding, thereby determining the transcoding strategy for the original video according to the size of the revenue, thereby improving the accuracy of video processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. It is obvious that the drawings described below are only some embodiments provided in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0039] Figure 1 This is a flow chart of a video processing method in an embodiment of the present application;
[0040] Figure 2 is a schematic diagram of a video processing device in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of a video processing device in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. The described embodiments are only exemplary implementation methods of the present application, not all implementation methods. Those skilled in the art can combine the embodiments of the present application to obtain other embodiments without creative work, and these embodiments are also within the scope of protection of the present application.
[0043] Affected by various factors, the quality of video sources is often uneven. Some sources may contain noise, as well as compression quality damage caused by the video production process. For such sources, noise reduction processing is often required during the video transcoding process to improve the quality of the transcoded video.
[0044] Video transcoding refers to converting a compressed and encoded video stream into another video stream to adapt to different network bandwidths, different terminal processing capabilities and different user needs. Transcoding is essentially a process of decoding first and then encoding.
[0045] The design of existing noise reduction algorithms can be roughly divided into spatial noise reduction, temporal noise reduction, and a mixture of the two. This type of noise reduction algorithm determines the noise intensity based on the statistical characteristics of the picture, and selects the noise reduction strategy based on the texture characteristics of the picture. For example, spatial noise reduction is performed on areas with greater motion intensity in the picture, and temporal noise reduction is performed on areas with less motion intensity. However, relying solely on motion features as a reference for noise reduction intensity is not accurate, because motion detection can generally only obtain local differences between the front and back images of the image, and this difference may be caused by the motion of the original signal, or it may be caused by noise, or a mixture of the two.
[0046] The above noise reduction method is based on the assumption that the distribution of noise in the video between frames is not correlated and approximately obeys a white Gaussian distribution. Usually, a frame of the image is divided into several small blocks, the standard deviation of each block is calculated, and then several blocks with smaller standard deviations are selected and expected to be flat areas in the picture. This method believes that the standard deviation of this area can be used as a reference for noise estimation of the entire frame. However, this method cannot effectively detect the block effect introduced by the editing software or the early transcoding system in the pre-production process. In addition, blocks with small standard deviations are not necessarily flat areas, and the accuracy of selection is easily affected by the texture of the picture.
[0047] Another existing solution is a noise estimation method based on discrete cosine transform (DCT), which first divides the image into blocks, finds the blocks with relatively stable texture, and uses the DCT high-frequency coefficients of the stable blocks to characterize the noise intensity. This evaluation method is easily affected by the texture of the image itself, and non-noise texture in a stable image will also be identified as noise.
[0048] Therefore, the existing noise reduction processing methods are easily affected by the characteristics of the picture itself and people's subjective factors, resulting in inaccurate evaluation of noise intensity. In addition, the same noise reduction processing strategy is adopted for all sources, resulting in the fact that when the source quality is high, there is actually no need for filtering, and the noise reduction filtering processing will damage the picture details. There is a lack of relevant research on how to accurately choose whether to perform noise reduction processing and choose the appropriate noise reduction intensity for the video to be transcoded.
[0049] Based on this, an embodiment of the present application provides a video processing method to improve the accuracy of video processing. In specific implementation, first obtain a target video clip from the original video; then transcode the target video clip based on the first processing method to obtain a first transcoded video clip, wherein the occupied space corresponding to the first transcoded video clip is the first occupied space. Transcode the target video clip based on the second processing method to obtain a second transcoded video clip, wherein the occupied space corresponding to the second transcoded video clip is the second occupied space. Determine the rate of return based on the first occupied space and the second occupied space corresponding to the above-mentioned first transcoded video clip and the second transcoded video clip, respectively, and perform corresponding processing on the original video according to the rate of return. The video processing method provided in the embodiment of the present application, by performing transcoding preprocessing on the target video clip, evaluates the revenue obtained after video transcoding, thereby determining the transcoding strategy for the original video according to the size of the revenue, thereby improving the accuracy of video processing.
[0050] The video processing method provided in the embodiment of the present application will be described below with reference to the accompanying drawings.
[0051] See also Figure 1 , Figure 1 This is a flowchart of a video processing method in an embodiment of the present application.
[0052] The method specifically comprises the following steps:
[0053] S101: Acquire a target video segment based on an original video.
[0054] In the existing noise reduction processing method, the complete video material is directly processed. As the length of the video increases, a large amount of computing resources are required to process the video, which causes a waste of computing resources for high-quality film sources.
[0055] In this embodiment, the target video segment is first obtained based on the original video, and the yield obtained after video transcoding is evaluated by pre-transcoding the target video segment, and the original video is processed accordingly according to the yield, so as to avoid adopting a unified processing strategy for all video segments and reduce the waste of computing resources.
[0056] Since the shooting and production environment of the same video is generally the same, the noise inside the video often has time-domain stability. In one possible implementation, this embodiment can randomly extract a video segment of a preset length from the original video as a target video segment, and then determine the processing strategy for the original video by pre-transcoding the target video segment.
[0057] In another possible implementation, a segment with high video complexity can also be captured from the original video as the target video segment. The video complexity can be specifically determined in combination with the application scenario, and this embodiment does not limit this. For example, a video segment with a large number of characters and a complex lighting scene can be selected.
[0058] S102: Transcode the target video segment based on the first processing method to obtain a first transcoded video segment, wherein the occupied space corresponding to the first transcoded video segment is a first occupied space.
[0059] After the target video segment is obtained, the target video segment may be transcoded based on the first processing method, thereby obtaining a first transcoded video segment.
[0060] In a possible implementation, a variable bit rate transcoding is performed on a target video segment based on a loop filtering algorithm of a first strength and target transcoding parameters to obtain a first transcoded video segment, wherein the occupied space corresponding to the first transcoded video segment obtained after transcoding is a first occupied space. The target transcoding parameters may include: encoding standard, video container, target image quality, target resolution, etc. The format of the video container can be understood as defining how to store video stream data in a container file, and common container formats include MPEG 4, Flash Video, HLS, etc.
[0061] Loop filtering is a component of the encoder, which is used to eliminate the block effect introduced by the reference frame due to video encoding, and also has a certain inhibitory effect on the block effect of the source itself. Among them, the block effect refers to the fact that due to the widespread application of block-based transform coding in image compression coding, as the bit rate decreases, the quantization becomes coarse, and discontinuities appear at the boundaries of blocks, forming obvious defects in the reconstructed image.
[0062] Variable bitrate transcoding is a coding bitrate control algorithm that keeps the video quality relatively constant. It allocates less bitrate to low-complexity areas in the video and more bitrate to high-complexity areas, thereby ensuring that the picture quality is as stable as possible while saving bandwidth as much as possible. The video bitrate refers to the number of data bits transmitted per unit time during data transmission, which is commonly understood as the sampling rate. The higher the sampling rate per unit time, the higher the accuracy, and the closer the processed file is to the original file.
[0063] S103: Transcode the target video segment based on the second processing method to obtain a second transcoded video segment, wherein the occupied space corresponding to the second transcoded video segment is the second occupied space.
[0064] In one possible implementation, the target video segment is transcoded based on a pre-filtering algorithm, a loop filtering algorithm of a second strength, and the above-mentioned target transcoding parameters to obtain a second transcoded video segment, wherein the occupied space corresponding to the second transcoded video segment is a second occupied space, and the target transcoding parameters corresponding to the second processing method are the same as the target transcoding parameters corresponding to the first processing method.
[0065] Pre-filtering is usually located before the encoder and is used to perform noise reduction on the image data before it is sent for encoding. It mainly reduces random noise and the block effect of the image source.
[0066] When transcoding the target video segment based on the above-mentioned second processing method, the target video segment is first decoded, and then the decoded target video segment is pre-noise reduced using a pre-filtering algorithm, and then the target video segment that has undergone pre-noise reduction processing is variable bit rate encoded using a loop filtering algorithm, thereby obtaining the final second transcoded video segment.
[0067] When performing variable bit rate encoding on the same video, constant image quality, resolution, encoding standard, etc. are used and different transcoding strategies are adopted to obtain different transcoded files of the video. The size of the transcoded file can reflect the pros and cons of the corresponding transcoding strategy to a certain extent.
[0068] It should be noted that the embodiment of the present application does not limit the order of executing step S102 and step S103, that is, step S102 can be executed first, step S103 can be executed first, or step S102 and step S103 can be executed at the same time, all of which will not affect the implementation of the present invention.
[0069] S104: Determine a rate of return based on the first occupied space and the second occupied space.
[0070] In a possible implementation manner, an occupied space difference is first determined based on the first occupied space and the second occupied space, and then a rate of return is determined according to the occupied space difference and the first occupied space.
[0071] For example, size1 represents the first occupied space and size2 represents the second occupied space. The occupied space difference is (size1-size2). The rate of return R is determined according to the occupied space difference (size1-size2) and the first occupied space size1, that is, the calculation formula of the rate of return R is (size1-size2) / size1.
[0072] It can be seen from the calculation formula of the above yield R that the smaller the occupied space size2 corresponding to the second transcoded video segment obtained by transcoding based on the second processing method, the larger the corresponding yield R. The main difference between the second processing method and the first processing method lies in whether there is a pre-noise reduction processing, indicating that performing noise reduction processing on the target video segment has a more obvious beneficial effect.
[0073] In another possible implementation manner, an occupied space difference is determined based on the first occupied space and the second occupied space, and then a rate of return is determined according to the occupied space difference and the second occupied space.
[0074] Let size1 represent the first occupied space and size2 represent the second occupied space. The occupied space difference is (size1-size2). The rate of return R is determined according to the occupied space difference (size1-size2) and the second occupied space size2. That is, the calculation formula of the rate of return R is (size1-size2) / size2.
[0075] In the embodiment of the present application, the sizes of video transcoded files obtained based on different transcoding strategies are compared to evaluate the yield of denoising the video, thereby determining the processing strategy for the original video.
[0076] S105: Process the original video accordingly according to the rate of return.
[0077] The yield rate calculated above is compared with the preset yield rate, so as to process the original video accordingly.
[0078] In a possible implementation, when the rate of return is greater than a preset rate of return, it indicates that the second occupied space corresponding to the second transcoded video segment obtained by transcoding based on the second processing method is significantly smaller than the first occupied space corresponding to the first transcoded video segment obtained by transcoding based on the first processing method. Since the target transcoding parameters used by the second processing method and the first processing method are the same, the main difference is whether a pre-filtering algorithm is used to perform noise reduction processing on the target video segment. Therefore, when the rate of return is greater than the preset rate of return, it indicates that the pre-filtering algorithm in the second processing method has a good beneficial effect, so the original video can be transcoded at a variable bit rate based on the pre-filtering algorithm and the loop filtering algorithm.
[0079] When the rate of return is less than or equal to the preset rate of return, it indicates that transcoding based on the second processing method does not have an obvious beneficial effect. If the original video is transcoded based on the second processing method, the quality of the obtained video clip will not be improved, and more computing resources will be wasted. For example, if a high-quality video is pre-filtered, the details of the picture may be damaged after pre-filtering because there is no noise in the video that affects the coding efficiency. In addition, when a high-quality video is subjected to strong loop filtering, if variable bit rate encoding is used, the bit rate of the video transcoding will be greatly increased, increasing unnecessary computing overhead. Therefore, when the rate of return is less than or equal to the preset rate of return, the original video is transcoded at a variable bit rate based on the loop filtering algorithm.
[0080] It should be noted that when the rate of return is greater than the preset rate of return, when transcoding the original video, it is not limited to use the same filtering parameters as the second processing method, and the same transcoding strategy as the second processing method can be used, that is, the pre-filtering algorithm and the loop filtering algorithm are used, and the specific filtering parameters can be set according to the actual application scenario. Similarly, when the rate of return is less than or equal to the preset rate of return, when transcoding the original video, it is not limited to use the same filtering parameters as the first processing method, and the specific filtering parameters can be set according to the actual application scenario.
[0081] The video processing method provided in the embodiment of the present application performs transcoding preprocessing on the target video clip, evaluates the profit obtained after video transcoding, and thus determines the transcoding strategy for the original video according to the size of the profit, thereby improving the accuracy of video processing and reducing the waste of computing resources.
[0082] The video processing method provided in the embodiment of the present application will be described below in conjunction with a specific application scenario.
[0083] First, the target video segment is obtained based on the original video. When the original video is longer than 60 seconds, a video segment with a duration of 60 seconds is randomly selected as the target video segment for subsequent processing; when the original video is less than 60 seconds, the original video with the integer duration is taken as the target video segment.
[0084] Then, the target video segment is transcoded at a variable bit rate based on the loop filter algorithm of the first strength and the target transcoding parameters, and the occupied space corresponding to the first transcoded video segment obtained by transcoding is the first occupied space size1. Specifically, the encoding standard is the H264 format with a fixed bit rate coefficient CRF of 26, the target resolution is 960*540, and the loop filter strength is set to: Alpha threshold Alpha deblock=0 for controlling the loop filter strength, and Beta threshold Beta deblock=0 for controlling the decision within the loop filter.
[0085] Based on the pre-filtering algorithm, the loop filtering algorithm of the second strength and the above-mentioned target transcoding parameters, the target video segment is transcoded at a variable bit rate, and the occupied space corresponding to the second transcoded video segment obtained by transcoding is the second occupied space size2. Specifically, the encoding standard is still set to the H264 format of CRF 26, the target resolution is 960*540, and the loop filtering strength is set to: Alpha deblock=6, Beta deblock=6. The pre-filtering algorithm is implemented using the pre-filter hqdn3d, wherein the filtering parameters are: spatial luminance filter strength luma_spatial=5, spatial chroma filter strength chroma_spatial=3, temporal luminance filter strength luma_tmp=5, and temporal chroma filter strength chroma_tmp=3.
[0086] The rate of return R is determined based on the first occupied space size1 and the second occupied space size2, and then the original video is processed accordingly according to the rate of return and the preset rate of return. In this application scenario, the calculation formula of the rate of return R is defined as: (size1-size2) / size1, and the preset rate of return is set to 3%.
[0087] When the rate of return R is greater than 3%, the original video is transcoded at a variable bit rate based on the pre-filtering algorithm and the loop filtering algorithm; otherwise, the original video is transcoded at a variable bit rate based on the loop filtering algorithm.
[0088] In specific implementation, when the rate of return R>3%, the parameters of the pre-filtering algorithm hqdn3d can be set to: luma_spatial=3, chroma_spatial=1, luma_tmp=3, chroma_tmp=1, and the parameters of the loop filtering algorithm are: Alpha deblock=1, Beta deblock=1; when the rate of return R<=3%, no pre-filtering is performed, and the parameters of the loop filtering algorithm are set to Alpha deblock=0, Beta deblock=0.
[0089] In a preferred implementation, when the rate of return is significantly greater than a preset rate of return, the parameters of the pre-filter algorithm and the loop filter algorithm may be reset to improve the accuracy of video processing. For example, when the rate of return is greater than 6%, the parameters of the pre-filter algorithm may be set to: luma_spatial = 5, chroma_spatial = 3, luma_tmp = 5, chroma_tmp = 3, and the parameters of the loop filter algorithm may be Alpha deblock = 2, Beta deblock = 2.
[0090] It should be noted that the pre-filtering algorithm in the above embodiment is hqdn3d, which is only an exemplary description and is not limited to the pre-filtering algorithm. Other filtering algorithms that can realize the pre-noise reduction function are also within the protection scope of this application. The parameters of the pre-filtering algorithm and the loop filtering algorithm can be set according to actual needs, and the embodiment of this application does not limit this.
[0091] The video processing method provided in the embodiment of the present application performs transcoding preprocessing on the target video clip, evaluates the profit obtained after video transcoding, and thus determines the transcoding strategy for the original video according to the size of the profit, thereby improving the accuracy of video processing.
[0092] Based on the above method embodiment, the embodiment of the present application also provides a video processing device, which will be described below in conjunction with the accompanying drawings.
[0093] See also Figure 2 , Figure 2 Schematic diagram of a video processing device in an embodiment of the present application.
[0094] The device 200 includes: an acquisition module 201, a first processing module 202, a second processing module 203, a determination module 204 and a third processing module 205;
[0095] The acquisition module 201 is used to acquire a target video segment based on the original video;
[0096] The first processing module 202 is configured to transcode the target video segment based on a first processing method to obtain a first transcoded video segment, wherein the occupied space corresponding to the first transcoded video segment is a first occupied space;
[0097] The second processing module 203 is used to transcode the target video segment based on a second processing method to obtain a second transcoded video segment, wherein the occupied space corresponding to the second transcoded video segment is the second occupied space;
[0098] The determination module 204 is configured to determine a rate of return based on the first occupied space and the second occupied space;
[0099] The third processing module 205 is used to process the original video accordingly according to the rate of return.
[0100] The first processing module 202 is specifically used to perform variable bit rate transcoding on the target video segment based on a first strength loop filtering algorithm and target transcoding parameters, wherein the target transcoding parameters include: at least one of a coding standard, a video container, a target image quality, and a target resolution.
[0101] The second processing module 203 is specifically configured to perform variable bit rate transcoding on the target video segment based on a pre-filtering algorithm, a loop filtering algorithm of a second strength, and the target transcoding parameters.
[0102] The determination module 204 is specifically configured to determine an occupied space difference based on the first occupied space and the second occupied space; and determine the rate of return based on the occupied space difference and the first occupied space.
[0103] The determination module 204 is specifically configured to determine the occupied space difference based on the first occupied space and the second occupied space; and determine the rate of return based on the occupied space difference and the second occupied space.
[0104] The third processing module 205 is specifically used to perform variable bit rate transcoding on the original video based on the pre-filtering algorithm and the loop filtering algorithm when the rate of return is greater than the preset rate of return; and to perform variable bit rate transcoding on the original video based on the loop filtering algorithm when the rate of return is less than or equal to the preset rate of return.
[0105] The acquisition module 201 is specifically configured to randomly capture a video segment of a preset duration from the original video as the target video segment.
[0106] The beneficial effects of the video processing device provided in the embodiment of the present application can be found in the above method embodiment and will not be described in detail here.
[0107] Based on the above method embodiments and apparatus embodiments, the present application also provides a video processing device.
[0108] See also Figure 3 , Figure 3 A schematic diagram of a video processing device in an embodiment of the present application.
[0109] The device 300 includes a memory 301 and a processor 302;
[0110] The memory 301 is used to store relevant program codes;
[0111] The processor 302 is used to call the program code to execute the video processing method described in the above method embodiment.
[0112] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the video processing method described in the above method embodiment.
[0113] It should be noted that the terms "first" and "second" used in this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing objects with the same attributes when describing them in the embodiments of this application.
[0114] Each embodiment in this specification is described in a progressive manner, and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the units or modules described as separate components may or may not be physically separated, and the components displayed as units or modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units, and some or all of the units or modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0115] The above is only an exemplary implementation of the present application and does not limit the present application in any form. Any equivalent changes or modifications made to the above embodiments are within the protection scope of the present application.
Claims
1. A video processing method, characterized in that: The method comprises: Get the target video segment in the original video; transcoding the target video segment based on a first processing method to obtain a first transcoded video segment, wherein the occupied space corresponding to the first transcoded video segment is a first occupied space, the first processing method does not include a pre-filtering algorithm, the pre-filtering algorithm is used to perform noise reduction processing on the target video, and the first processing method is used to perform variable bit rate transcoding on the target video segment based on a target transcoding parameter; Transcoding the target video segment based on a second processing method to obtain a second transcoded video segment, wherein the occupied space corresponding to the second transcoded video segment is a second occupied space, the second processing method includes the pre-filtering algorithm, and the second processing method is used to perform variable bit rate transcoding on the target video segment based on the target transcoding parameter; determining a rate of return based on the first occupied space and the second occupied space, the rate of return being used to indicate the extent to which the occupied space is saved by the second processing method compared with the first processing method; According to the rate of return, the original video is processed accordingly based on the first processing method or the second processing method; The determining the rate of return based on the first occupied space and the second occupied space comprises: determining an occupied space difference based on the first occupied space and the second occupied space; The rate of return is determined based on the occupied space difference and the first occupied space.
2. The method according to claim 1, characterized in that The transcoding the target video segment based on the first processing method includes: The target video segment is subjected to variable bit rate transcoding based on a loop filtering algorithm of a first strength and the target transcoding parameters, wherein the target transcoding parameters include at least one of a coding standard, a video container, a target image quality, and a target resolution.
3. The method according to claim 2, characterized in that The transcoding the target video segment based on the second processing method includes: The target video segment is subjected to variable bit rate transcoding based on the pre-filtering algorithm, the loop filtering algorithm of the second strength, and the target transcoding parameters.
4. The method according to claim 1, characterized in that: The determining the rate of return based on the first occupied space and the second occupied space comprises: determining the occupied space difference based on the first occupied space and the second occupied space; The rate of return is determined based on the occupied space difference and the second occupied space.
5. The method according to claim 3, characterized in that: The performing corresponding processing on the original video based on the first processing method or the second processing method according to the rate of return includes: When the rate of return is greater than a preset rate of return, variable bit rate transcoding is performed on the original video based on the pre-filtering algorithm and the loop filtering algorithm; When the rate of return is less than or equal to the preset rate of return, variable bit rate transcoding is performed on the original video based on the loop filtering algorithm.
6. The method according to any one of claims 1 to 5, characterized in that: The step of obtaining the target video segment in the original video includes: A video segment of a preset length is randomly intercepted from the original video as the target video segment.
7. A video processing device, characterized in that: The device comprises: an acquisition module, a first processing module, a second processing module, a determination module and a third processing module; The acquisition module is used to acquire the target video segment in the original video; The first processing module is used to transcode the target video segment based on a first processing method to obtain a first transcoded video segment, wherein the occupied space corresponding to the first transcoded video segment is a first occupied space, the first processing method does not include a pre-filtering algorithm, the pre-filtering algorithm is used to perform noise reduction processing on the target video, and the first processing method is used to perform variable bit rate transcoding on the target video segment based on a target transcoding parameter; The second processing module is used to transcode the target video segment based on a second processing method to obtain a second transcoded video segment, wherein the occupied space corresponding to the second transcoded video segment is the second occupied space, the second processing method includes the pre-filtering algorithm, and the second processing method is used to perform variable bit rate transcoding on the target video segment based on the target transcoding parameter; The determining module is used to determine a rate of return based on the first occupied space and the second occupied space, wherein the rate of return is used to indicate the degree of occupied space saved by the second processing method compared with the first processing method; The third processing module is used to process the original video accordingly based on the first processing method or the second processing method according to the rate of return; The determination module is specifically used to: determine an occupied space difference based on the first occupied space and the second occupied space, and determine the rate of return based on the occupied space difference and the first occupied space.
8. A video processing device, characterized in that: The device comprises: a memory and a processor; The memory is used to store relevant program codes; The processor is used to call the program code to execute the video processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is executed by a computing device, and the computing device is used to execute the video processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Video transcoding method and device, equipment and storage medium
CN112153415A