A video transcoding method and system based on distributed storage
Through the video transcoding method based on distributed storage, using color histograms to divide the video and dynamically adjust the margin frame number, the problems of low video transcoding efficiency and discontinuity in traditional methods are solved, and efficient and seamless video transcoding and storage are achieved.
Patent Information
- Application Number
- CN202411041903.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Traditional video transcoding methods are not efficient when facing large-scale videos, and the video frames are discontinuous after segmented transcoding, resulting in unnatural picture jumps or transitions during playback.
The video transcoding method based on distributed storage is adopted, and the video is divided into multiple sub-videos through a color histogram, the initial margin frame number of each sub-video is identified and adjusted, dynamically adjusted according to the content complexity and historical data, and the sub-videos are divided into three categories: head, middle and tail for distributed storage.
It improves the speed and quality of video transcoding, ensures seamless splicing of videos, avoids picture jumps and unnatural transitions, and improves the user's viewing experience.
Smart Images

Figure CN118945373B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video transcoding, and in particular to a video transcoding method and system based on distributed storage. Background Art
[0002] With the rapid development of the Internet and multimedia technology, video content has become one of the main carriers of information dissemination and entertainment. Whether watching high-definition movies on streaming platforms or sharing personal videos on social media, the quality and transmission speed of videos are crucial. However, video files are usually very large, especially high-resolution videos, which poses a huge challenge to storage and transmission. Video transcoding technology has become an important way to solve video transmission and storage.
[0003] However, traditional video transcoding methods usually process the entire video as a unit, which is not efficient when facing large-scale videos. In order to speed up the processing speed, segmented transcoding has become a popular method, which divides the video into multiple smaller parts and transcodes them separately. Although segmented transcoding significantly improves the processing speed, it also brings some problems. For example, when the segmented transcoded videos are spliced, video frame discontinuity is prone to occur, resulting in picture jumps or unnatural transitions during playback. Traditional methods often do not fully consider the complexity of the video content, resulting in reduced or inconsistent quality of some segments.
[0004] Therefore, it is necessary to design a video transcoding method and system based on distributed storage to solve the problems existing in the current technology. Summary of the invention
[0005] In view of this, the present invention proposes a video transcoding method and system based on distributed storage, aiming to solve the problems existing in the current segmented video transcoding technology that easily cause video discontinuity, picture jumping or video quality degradation.
[0006] In one aspect, the present invention provides a video transcoding method based on distributed storage, comprising:
[0007] Determine a video to be transcoded, and divide the video to be transcoded into a plurality of sub-videos according to a color histogram;
[0008] Identify the position of each of the sub-videos in the video to be transcoded and determine the margin position according to the position, and determine the initial margin frame number of all the sub-videos according to the objective evaluation of the video to be transcoded;
[0009] Collecting the content complexity of each sub-video, and comparing the content complexity of each sub-video with the complexity threshold, and judging whether to adjust the initial margin frame number of the sub-video according to the comparison result; when it is judged that the initial margin frame number is to be adjusted, obtaining the similarity between the sub-video and the sub-video in the historical data according to the content complexity of the sub-video, and determining the initial margin frame number adjustment scheme according to the similarity;
[0010] The sub-videos after the residual frame number is determined are divided into three categories: the head, the middle and the tail, and the videos are distributedly stored according to the sub-video classification.
[0011] Furthermore, the step of dividing the video to be transcoded into a plurality of sub-videos according to the color histogram includes:
[0012] Extract the number of frames of the video to be transcoded, and calculate the color histogram of each frame;
[0013] Calculate the histogram difference between frames based on the correlation;
[0014] The correlation is calculated by the following formula:
[0015]
[0016] When the inter-frame histogram difference X(Fi, Fi+1) is greater than the difference threshold, it is determined that Fi+1 belongs to another sub-video.
[0017] Further, when determining the initial margin frame numbers of all the sub-videos according to the objective evaluation of the video to be transcoded, the objective evaluation of the video to be transcoded is obtained by calculating the following formula:
[0018]
[0019] Among them, P represents objective evaluation, B represents the size of the standard image, S represents the image size of the video to be transcoded, and h ij Indicates the grayscale value of the i-th row and j-th column in the video to be transcoded, h′ ij Represents the grayscale value of the i-th row and j-th column in the standard image.
[0020] Furthermore, when determining the initial margin frame numbers of all the sub-videos according to the objective evaluation of the video to be transcoded, the method further includes:
[0021] The objective evaluation is compared with a first preset evaluation and a second preset evaluation respectively, the first preset evaluation is less than the second preset evaluation, and the initial margin frame number of all the sub-videos is determined according to the comparison result;
[0022] When the objective evaluation is less than or equal to the first preset evaluation, the initial remaining frame number of all the sub-videos is determined to be the first preset frame number; when the objective evaluation is greater than the first preset evaluation and less than or equal to the second preset evaluation, the initial remaining frame number of all the sub-videos is determined to be the second preset frame number; when the objective evaluation is greater than the second preset evaluation, the initial remaining frame number of all the sub-videos is determined to be the third preset frame number; wherein the first preset frame number is greater than the second preset frame number, and the second preset frame number is greater than the third preset frame number.
[0023] Furthermore, when the content complexity of each sub-video is compared with the complexity threshold, the content complexity is obtained in the following manner:
[0024] Calculate the pixel change between frames;
[0025] Di=∑ x,y ∣Ii+1(x, y)-Ii(x, y)∣;
[0026] Where Di represents the pixel change between the i-th frame and the i+1-th frame, Ii represents the i-th frame image, Ii+1 represents the i+1-th frame image, and (x, y) represents the position of each pixel in the image;
[0027] Calculate the information entropy Hi of the frame;
[0028] Ei=-∑ x,y pi(x,y)logpi(x,y);
[0029] Where pi(x, y) represents the normalized frequency of pixel (x, y) in the i-th frame image, and Ei represents the information entropy of the i-th frame;
[0030] Obtaining the content complexity according to the pixel variation between frames and the information entropy of the frames;
[0031]
[0032] Among them, C represents the content complexity, L represents the number of frames of the sub-video, and w1 and w2 represent weight coefficients.
[0033] Further, judging whether to adjust the initial margin frame number of the sub-video according to the comparison result includes:
[0034] When the content complexity is less than or equal to the complexity threshold, determining not to adjust the initial margin frame number of the sub-video;
[0035] When the content complexity is greater than a complexity threshold, it is determined to adjust the initial margin frame number of the sub-video.
[0036] Further, obtaining the similarity between the sub-video and the sub-video in the historical data according to the complexity of the sub-video content, and determining the initial margin frame number adjustment scheme according to the similarity, includes:
[0037] When the difference between the content complexity of the sub-video and the content complexity of the sub-video in the historical data is less than a%, it is determined that the sub-video in the historical data is similar to the current sub-video;
[0038] When there is a sub-video similar to the current sub-video in the historical data, a similarity set is established and the average number of residual frames in the similarity set is used as the number of residual frames of the current sub-video;
[0039] When there is no sub-video similar to the current sub-video in the historical data, sub-videos whose content complexity difference with the current sub-video is less than b% are extracted from the historical data to establish a filtering set, and the number of remaining frames of the current sub-video is determined based on the filtering set, where a is less than b.
[0040] Further, when determining the remaining number of frames of the current sub-video according to the filter set, it includes:
[0041] In the filtering set, sub-videos whose residual frame numbers are greater than the initial residual frame number are filtered out to construct a large frame number set and sub-videos whose residual frame numbers are less than the initial residual frame number are filtered out to construct a small frame number set, and the residual frame number of the current sub-video is obtained according to the initial residual frame number, the large frame number set and the small frame number set.
[0042] Further, when obtaining the remaining frame number of the current sub-video according to the initial remaining frame number, the large frame number set and the small frame number set, it includes:
[0043]
[0044] Among them, Z represents the number of residual frames, Zt represents the number of residual frames of the t-th sub-video in the large frame number set, T represents the number of sub-videos in the large frame number set, Z0 represents the initial number of residual frames, Zu represents the number of residual frames of the u-th sub-video in the small frame number set, and U represents the number of sub-videos in the small frame number set.
[0045] Compared with the prior art, the beneficial effects of the present invention are: using color histogram to analyze the changes between video frames, accurately identifying scene change points, and dividing the video into multiple sub-video segments. Under the premise of maintaining content coherence, the segmentation and parallel processing of the video are accelerated, and the overall transcoding speed is improved. By adding a reasonable number of margin frames in each sub-video segment and adjusting it according to the video content and historical data, the seamless splicing of the segmented video is ensured. The common picture jumps and unnatural transitions during video playback are avoided, and the user's viewing experience is improved. The analysis of content complexity is introduced, the complexity of each sub-video segment is collected and evaluated, and compared with the preset complexity threshold. The dynamic adjustment mechanism ensures that the complex content part gets more processing resources and appropriate margin frames, while the simpler part is processed in a more efficient way, thereby maintaining the high quality of the overall video. When it is determined that the initial margin frame number needs to be adjusted, the optimal margin adjustment scheme is determined by similarity analysis with similar video segments in historical data. By using past processing experience, the video quality and processing efficiency are further improved. By dividing the sub-videos into three categories: the first, middle and last part, and performing distributed storage management based on these categories, the efficiency of video storage and access is improved.
[0046] On the other hand, the present application also provides a distributed storage-based video transcoding system, which is used to apply the above-mentioned distributed storage-based video transcoding method, including:
[0047] A division unit is configured to determine a video to be transcoded, and divide the video to be transcoded into a plurality of sub-videos according to a color histogram;
[0048] a processing unit configured to identify a position of each of the sub-videos in the video to be transcoded and determine a margin position according to the position, and determine an initial margin frame number of all the sub-videos according to an objective evaluation of the video to be transcoded;
[0049] A judgment unit is configured to collect the content complexity of each sub-video, and compare the content complexity of each sub-video with the complexity threshold, and judge whether to adjust the initial residual frame number of the sub-video according to the comparison result; when it is determined to adjust the initial residual frame number, obtain the similarity between the sub-video and the sub-video in the historical data according to the content complexity of the sub-video, and determine the initial residual frame number adjustment scheme according to the similarity;
[0050] The storage unit is configured to divide the sub-videos after determining the number of residual frames into three categories: the head, the middle and the tail, and perform distributed storage of the videos according to the sub-video classification.
[0051] It is understandable that the above-mentioned video transcoding method and system based on distributed storage have the same beneficial effects, which will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0053] Figure 1 A flowchart of a video transcoding method based on distributed storage provided by an embodiment of the present invention;
[0054] Figure 2 This is a functional block diagram of a distributed storage-based video transcoding system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features described in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0056] With the rapid development of the Internet and multimedia technology, video content has become one of the main carriers of information dissemination and entertainment. Whether watching high-definition movies on streaming platforms or sharing personal videos on social media, the quality and transmission speed of videos are crucial. Especially with the popularity of high-definition (HD), ultra-high-definition (UHD) and even 4K and 8K resolution videos, the size of video files has increased dramatically, posing huge challenges to storage and transmission. In order to meet these challenges, video transcoding technology has become an important way to solve video transmission and storage. By converting video files into different formats and resolutions, video transcoding technology can optimize the volume and quality of videos to adapt to different transmission bandwidths and playback devices.
[0057] In order to speed up the processing speed, the segmented transcoding method came into being. By dividing the video into multiple smaller parts, each part can be processed in parallel, which significantly improves the overall transcoding speed. This method is suitable for large-scale video processing and real-time applications. However, although segmented transcoding significantly improves processing efficiency, it also raises a series of new problems. After segmented transcoding, different parts of the video need to be re-stitched when they need to be played. Since the transcoding of each part is performed independently, discontinuity of video frames is prone to occur during splicing. For example, the timestamps of the frames do not match or the video content is incoherent, resulting in unnatural picture jumps or transitions during playback. This not only destroys the viewing experience of the video, but may also affect the overall content presentation of the video. And the complexity of video content varies. Some segments may contain a lot of motion, changes in details, or complex scene switching, while other segments may be relatively static or simple. If a unified processing strategy is adopted for all video segments, the quality of some complex segments may be reduced. Therefore, it is necessary to design a video transcoding method and system based on distributed storage to solve the current problems.
[0058] In some embodiments of the present application, see Figure 1 As shown, a video transcoding method based on distributed storage includes:
[0059] S100: Determine a video to be transcoded, and divide the video to be transcoded into a plurality of sub-videos according to a color histogram.
[0060] S200: Identify the position of each sub-video in the video to be transcoded and determine the margin position according to the position, and determine the initial margin frame number of all sub-videos according to the objective evaluation of the video to be transcoded.
[0061] S300: Collect the content complexity of each sub-video, and compare the content complexity of each sub-video with the complexity threshold, and determine whether to adjust the initial margin frame number of the sub-video according to the comparison result. When it is determined to adjust the initial margin frame number, obtain the similarity between the sub-video and the sub-video in the historical data according to the content complexity of the sub-video, and determine the initial margin frame number adjustment plan according to the similarity.
[0062] S400: Divide the sub-videos after the residual frame number is determined into three categories: the head, the middle and the tail, and perform distributed storage of the videos according to the sub-video classification.
[0063] Specifically, S100 first selects the video to be transcoded. Then, the color histogram analysis technology is used to detect scene change points in the video. Color histogram is a tool used to represent the color distribution in an image or video frame. By comparing the color histograms of adjacent frames, significant content change points in the video can be identified, and these points usually represent different scenes. Based on these scene change points, the video is divided into multiple smaller sub-video segments. S200 identifies the specific position of each sub-video segment in the original video. The residual position refers to the extra frames reserved at the beginning or end of each sub-video segment. These reserved frames are called residual frames, and their function is to ensure that in the subsequent splicing process, each sub-video segment can be smoothly connected with the previous and next segments to avoid visual jumps or discontinuities. For example, a video is divided into three segments, the tail of the first segment, the head and tail of the second segment, and the head of the third segment are set with a surplus frame number. The content presented by the surplus frame number is the same, that is, the tail of the first segment is the same as the head of the second segment, and the tail of the second segment is the same as the head of the third segment. Therefore, when the surplus frame number of the tail of the first segment is determined, the surplus frame number of the head of the second segment has been determined. At this time, when the surplus frame number of the second segment is determined, the surplus frame number of the tail of the second segment is determined, and so on. In order to determine the appropriate surplus frame number, the entire video is first objectively evaluated. The evaluation index helps estimate how many surplus frames need to be reserved when the sub-video segments are spliced. The setting of the initial surplus frame number is a preliminary estimate based on global characteristics.
[0064] Specifically, in S300, the content complexity of each sub-video segment is evaluated. The content complexity can be measured by multiple indicators, such as the amount of motion between video frames, the frequency of color changes, and information entropy. These indicators reflect the degree of change and the richness of details in the video content. The complexity of each sub-video segment is compared with the preset complexity threshold to determine whether the initial setting of the margin frame number is reasonable. If the complexity of the sub-video segment is higher than the threshold, it means that the content of the segment is more varied and complex, and the margin frame number needs to be increased to ensure the smoothness of the splicing; if the margin frame number needs to be adjusted, refer to similar video segments in historical data. By calculating the similarity between the current sub-video segment and similar segments in historical data, a more accurate margin adjustment scheme is adopted. The adjustment method based on historical data and similarity makes the setting of the margin frame number more reasonable. In S400, the sub-video segments after the margin frame number adjustment are further classified into three categories: the head, the middle, and the tail. This classification method helps to more effectively manage and optimize the storage and access strategy of videos in distributed storage systems. Each type of sub-video segment is stored in different locations. When playback is required, the hash value is used to quickly find the target file for association based on the same content of the remaining frames.
[0065] It is understandable that the use of color histograms to effectively detect scene change points ensures the accuracy of segmentation and the coherence of content; through the dynamic adjustment mechanism of content complexity, the margin frame number of each sub-video segment is intelligently determined, so that the transcoded video can be seamlessly spliced. The margin adjustment is combined with historical data to improve the scientificity and accuracy of the adjustment. Finally, the classification and distributed storage management of sub-video segments optimizes the efficiency and reliability of large-scale video storage.
[0066] In some embodiments of the present application, when dividing a video to be transcoded into multiple sub-videos according to a color histogram, the method includes: extracting the number of frames of the video to be transcoded, and calculating the color histogram of each frame. The difference of the histogram between frames is calculated based on the correlation. The correlation is calculated by the following formula:
[0067]
[0068] When the inter-frame histogram difference X(Fi, Fi+1) is greater than the difference threshold, it is determined that Fi+1 belongs to another sub-video.
[0069] Specifically, ∥·∥ represents the correlation measure between vectors. Each frame is extracted from the video to be transcoded. Each frame can be regarded as a static image, representing the content of the video at a specific point in time. For each frame of the image, its color histogram is calculated. A color histogram is a statistical chart used to represent the color distribution of pixels in an image. Usually, these histograms are divided into multiple color channels (such as RGB channels), and each channel is divided into several chromaticity intervals (bins). By counting the number of pixels in each interval, a histogram reflecting the color distribution of the image is generated. After calculating the color histogram of each frame, the color histograms between adjacent frames are compared to determine the difference between them. When the difference in histograms between frames exceeds the preset difference threshold, it indicates that there is a significant content change between the two frames and the position is determined as the segmentation position.
[0070] It can be understood that compared with the traditional segmentation method based on time interval, the segmentation method based on color histogram can better capture the changes in video content, especially in scene switching and complex visual content. It can effectively identify the change points of content in the video, so as to segment the video at the most suitable position, ensuring that each sub-video segment is coherent and complete in content.
[0071] In some embodiments of the present application, when determining the initial margin frame number of all sub-videos according to the objective evaluation of the video to be transcoded, the objective evaluation of the video to be transcoded is calculated by the following formula:
[0072]
[0073] Among them, P represents objective evaluation, B represents the size of the standard image, S represents the image size of the video to be transcoded, and h ij Indicates the grayscale value of the i-th row and j-th column in the video to be transcoded, h′ ij Represents the grayscale value of the i-th row and j-th column in the standard image.
[0074] In some embodiments of the present application, when determining the initial remaining frame number of all sub-videos based on the objective evaluation of the video to be transcoded, it also includes: comparing the objective evaluation with a pre-set first preset evaluation and a second preset evaluation, respectively, the first preset evaluation is less than the second preset evaluation, and determining the initial remaining frame number of all sub-videos based on the comparison result.
[0075] Specifically, when the objective evaluation is less than or equal to the first preset evaluation, the initial remaining frame number of all sub-videos is determined to be the first preset frame number. When the objective evaluation is greater than the first preset evaluation and less than or equal to the second preset evaluation, the initial remaining frame number of all sub-videos is determined to be the second preset frame number. When the objective evaluation is greater than the second preset evaluation, the initial remaining frame number of all sub-videos is determined to be the third preset frame number. The first preset frame number is greater than the second preset frame number, and the second preset frame number is greater than the third preset frame number.
[0076] It can be understood that the overall quality or complexity of the video is evaluated by calculating the square average of the grayscale difference between the video to be transcoded and the standard image. The grayscale value reflects the brightness information of the image. By comparing the grayscale difference of each pixel, the degree of change and complexity of the video relative to the standard image can be obtained. Generally, the standard image can be selected as a reference frame or a set of average frames to represent the ideal video quality. The lower the objective evaluation, the higher the video quality and the more complex the content. Unlike the simple fixed margin frame number setting, the dynamic adjustment mechanism based on the complexity of the video content can more accurately adapt to different types of video content. For videos with simple content, the margin frame number is reduced to improve processing efficiency; for videos with complex content, the margin frame number is increased to ensure the smoothness of the splicing. In addition, through the preset evaluation and the step-by-step adjustment of the margin frame number, a flexible framework is provided to achieve customization and optimization according to actual application needs.
[0077] In some embodiments of the present application, when the content complexity of each sub-video is compared with the complexity threshold, the content complexity is obtained in the following manner:
[0078] Calculate the pixel change between frames;
[0079] Di=∑ x,y ∣Ii+1(x, y)-Ii(x, y)∣;
[0080] Wherein, Di represents the pixel change between the i-th frame and the i+1-th frame, Ii represents the i-th frame image, Ii+1 represents the i+1-th frame image, and (x, y) represents the position of each pixel in the image.
[0081] Calculate the information entropy Hi of the frame;
[0082] Ei=-∑ x,y pi(x,y)logpi(x,y);
[0083] Wherein, pi(x, y) represents the normalized frequency of pixel (x, y) in the i-th frame image, and Ei represents the information entropy of the i-th frame.
[0084] The content complexity is obtained based on the pixel variation between frames and the information entropy of the frames;
[0085]
[0086] Among them, C represents the content complexity, L represents the number of frames of the sub-video, and w1 and w2 represent weight coefficients.
[0087] Specifically, by summing the brightness differences of each pixel position, the total change between the entire frames is obtained. The pixel change between frames reflects the degree of visual difference between frames and is one of the important indicators of content complexity. If the change between two frames is large, it means that the video has more dynamic changes or scene switching in this section, and the content complexity is high. By counting the frequency of occurrence of each pixel value and taking the logarithm of its probability value and then weighted summing them, the information entropy is obtained. The higher the information entropy value, the more complex and diverse the content of the frame.
[0088] It is understandable that by combining the pixel change between frames and information entropy, the temporal and spatial complexity of the video can be more accurately evaluated to adapt to different types of video content. The complexity calculation method can dynamically adjust the number of residual frames, making the video smoother during splicing, reducing the problem of picture jumps and discontinuities, and improving the user experience after video transcoding.
[0089] In some embodiments of the present application, when determining whether to adjust the initial margin frame number of the sub-video according to the comparison result, it includes: when the content complexity is less than or equal to the complexity threshold, determining not to adjust the initial margin frame number of the sub-video. When the content complexity is greater than the complexity threshold, determining to adjust the initial margin frame number of the sub-video.
[0090] In some embodiments of the present application, the similarity between a sub-video and a sub-video in historical data is obtained based on the complexity of the sub-video content, and the initial margin frame adjustment scheme is determined based on the similarity, including: when the difference between the content complexity of the sub-video and the content complexity of the sub-video in the historical data is less than a%, it is determined that the sub-video in the historical data is similar to the current sub-video.
[0091] Specifically, when there are sub-videos similar to the current sub-video in the historical data, a similar set is established and the average number of residual frames in the similar set is used as the number of residual frames of the current sub-video. When there are no sub-videos similar to the current sub-video in the historical data, sub-videos whose content complexity difference with the current sub-video is less than b% are extracted from the historical data to establish a screening set, and the number of residual frames of the current sub-video is determined based on the screening set, where a is less than b.
[0092] Specifically, if the content complexity of the sub-video is less than or equal to the complexity threshold, it is considered that the content change and complexity of the sub-video are within an acceptable range and no additional margin frames are required. Therefore, the initially set margin frames are maintained. If the content complexity of the sub-video is greater than the complexity threshold, it means that the content of the sub-video is relatively complex and contains more dynamic changes or details. Therefore, the initial margin frames need to be adjusted to ensure smooth transition and picture continuity during video splicing.
[0093] It is understandable that by evaluating the content complexity of the sub-videos in real time and dynamically adjusting the number of residual frames according to the specific situation, the smooth transition of each sub-video during splicing is ensured, thereby improving the coherence and viewing experience of the overall video. By using the residual frames of similar sub-videos in historical data as a reference, the residual frames of the current sub-video can be adjusted more accurately. The data-driven adjustment method reduces blindness and improves the intelligence of the transcoding process. Screening and adjusting the number of residual frames under different complexity thresholds can not only target highly similar sub-videos, but also find reasonable adjustment plans when the similarity is not high, thereby improving flexibility and adaptability. By adjusting the number of residual frames, the picture jumps and unnatural transitions during video splicing can be effectively avoided, especially for sub-videos with large content changes, thereby improving the quality of video splicing.
[0094] In some embodiments of the present application, when determining the remaining frame number of the current sub-video according to the filtering set, it includes: filtering out the sub-videos whose remaining frame number is greater than the initial remaining frame number to construct a large frame number set and the sub-videos whose remaining frame number is less than the initial remaining frame number to construct a small frame number set in the filtering set, and obtaining the remaining frame number of the current sub-video according to the initial remaining frame number, the large frame number set and the small frame number set.
[0095] In some embodiments of the present application, obtaining the remaining frame number of the current sub-video according to the initial remaining frame number, the large frame number set, and the small frame number set includes:
[0096]
[0097] Among them, Z represents the number of residual frames, Zt represents the number of residual frames of the t-th sub-video in the large frame number set, T represents the number of sub-videos in the large frame number set, Z0 represents the initial number of residual frames, Zu represents the number of residual frames of the u-th sub-video in the small frame number set, and U represents the number of sub-videos in the small frame number set.
[0098] It can be understood that by comprehensively considering the initial number of residual frames and the residual frames of the sub-videos in the large frame number and small frame number sets, the final number of residual frames can be determined in a more balanced manner. The calculation of the final number of residual frames avoids adjustments that are too large or too small, and maintains the stability of the number of residual frames. By using the large frame number and small frame number sets in the historical data, the actual number of residual frames of sub-videos with similar complexity are referred to, thereby providing a data-driven adjustment basis. The accuracy and rationality of the adjustment of the number of residual frames are improved. By introducing the large frame number and small frame number sets, it can flexibly adapt to video clips of different content complexities. Whether it is a relatively simple scene or a complex and changeable scene, the setting of the number of residual frames can be optimized through the appropriate reference sub-videos in the historical data.
[0099] In the above embodiment, a color histogram is used to analyze the changes between video frames, accurately identify scene change points, and divide the video into multiple sub-video segments. Under the premise of maintaining content continuity, the segmentation and parallel processing of the video are accelerated, thereby improving the speed of overall transcoding. By adding a reasonable number of margin frames in each sub-video segment and adjusting it according to the video content and historical data, seamless splicing of the segmented video is ensured. The common picture jumps and unnatural transitions during video playback are avoided, thereby improving the user's viewing experience. The analysis of content complexity is introduced, and the complexity of each sub-video segment is collected and evaluated, and compared with the preset complexity threshold. The dynamic adjustment mechanism ensures that the complex content part obtains more processing resources and an appropriate number of margin frames, while the simpler part is processed in a more efficient manner, thereby maintaining the high quality of the overall video. When it is determined that the initial margin frame number needs to be adjusted, the optimal margin adjustment scheme is determined by similarity analysis with similar video segments in historical data. By using past processing experience, the video quality and processing efficiency are further improved. By dividing the sub-videos into three categories: the first, middle and last part, and performing distributed storage management based on these categories, the efficiency of video storage and access is improved.
[0100] In another preferred embodiment based on the above embodiment, refer to Figure 2 As shown, this embodiment provides a distributed storage-based video transcoding system, which is used to apply the above-mentioned distributed storage-based video transcoding method, including:
[0101] A division unit is configured to determine a video to be transcoded, and divide the video to be transcoded into a plurality of sub-videos according to a color histogram;
[0102] a processing unit configured to identify a position of each sub-video in the video to be transcoded and determine a margin position according to the position, and determine an initial margin frame number of all sub-videos according to an objective evaluation of the video to be transcoded;
[0103] A judgment unit is configured to collect the content complexity of each sub-video, and compare the content complexity of each sub-video with the complexity threshold, and judge whether to adjust the initial residual frame number of the sub-video according to the comparison result; when it is determined to adjust the initial residual frame number, obtain the similarity between the sub-video and the sub-video in the historical data according to the content complexity of the sub-video, and determine the initial residual frame number adjustment plan according to the similarity;
[0104] The storage unit is configured to divide the sub-videos after determining the number of residual frames into three categories: the head, the middle and the tail, and perform distributed storage of the videos according to the sub-video classification.
[0105] It is understandable that the color histogram is used to analyze the changes between video frames, accurately identify the scene change points, and divide the video into multiple sub-video segments. Under the premise of maintaining content coherence, the segmentation and parallel processing of the video are accelerated, which improves the overall transcoding speed. By adding a reasonable number of margin frames in each sub-video segment and adjusting it according to the video content and historical data, the seamless splicing of the segmented video is ensured. The common picture jumps and unnatural transitions during video playback are avoided, which improves the user's viewing experience. The analysis of content complexity is introduced, and the complexity of each sub-video segment is collected and evaluated, and compared with the preset complexity threshold. The dynamic adjustment mechanism ensures that the complex content part gets more processing resources and appropriate margin frames, while the simpler part is processed in a more efficient way, thereby maintaining the high quality of the overall video. When it is determined that the initial margin frame number needs to be adjusted, the optimal margin adjustment scheme is determined by similarity analysis with similar video segments in historical data. The video quality and processing efficiency are further improved by using past processing experience. By dividing the sub-videos into three categories: the first, middle and last part, and performing distributed storage management based on these categories, the efficiency of video storage and access is improved.
[0106] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0107] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0108] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A video transcoding method based on distributed storage, characterized in that: include: Determine a video to be transcoded, and divide the video to be transcoded into a plurality of sub-videos according to a color histogram; Identify the position of each of the sub-videos in the video to be transcoded and determine a margin position according to the position, and determine the initial margin frame number of all the sub-videos according to the objective evaluation of the video to be transcoded, wherein the margin position refers to an extra frame reserved at the beginning or end of each sub-video segment, and the extra frame is the initial margin frame number; Collecting the content complexity of each sub-video, and comparing the content complexity of each sub-video with the complexity threshold, and judging whether to adjust the initial margin frame number of the sub-video according to the comparison result; when it is judged that the initial margin frame number is to be adjusted, obtaining the similarity between the sub-video and the sub-video in the historical data according to the content complexity of the sub-video, and determining the initial margin frame number adjustment scheme according to the similarity; Obtaining the similarity between the sub-video and the sub-video in the historical data according to the complexity of the sub-video content, and determining the initial margin frame number adjustment scheme according to the similarity, including: When the difference between the content complexity of the sub-video and the content complexity of the sub-video in the historical data is less than a%, it is determined that the sub-video in the historical data is similar to the current sub-video; When there is a sub-video similar to the current sub-video in the historical data, a similarity set is established and the average number of residual frames in the similarity set is used as the number of residual frames of the current sub-video; When there is no sub-video similar to the current sub-video in the historical data, extract sub-videos whose content complexity difference with the current sub-video is less than b% from the historical data to establish a screening set, and determine the number of residual frames of the current sub-video according to the screening set, where a is less than b; The sub-videos after the residual frame number is determined are divided into three categories: the head, the middle and the tail, and the videos are distributedly stored according to the sub-video classification.
2. The video transcoding method based on distributed storage according to claim 1, characterized in that: The method of dividing the video to be transcoded into a plurality of sub-videos according to the color histogram includes: Extract the number of frames of the video to be transcoded, and calculate the color histogram of each frame; Calculate the histogram difference between frames based on the correlation; The correlation is calculated by the following formula: ; When the histogram difference between frames When it is greater than the difference threshold, determine Belongs to another sub-video, where represents the correlation measure between vectors, represents the i-th frame of the video to be transcoded, Indicates the i+1th frame of the video to be transcoded, Represents the color histogram of the i-th frame of the video to be transcoded, Represents the color histogram of the i+1th frame of the video to be transcoded.
3. The video transcoding method based on distributed storage according to claim 1, characterized in that: When determining the initial margin frame numbers of all the sub-videos according to the objective evaluation of the video to be transcoded, the objective evaluation of the video to be transcoded is obtained by calculating the following formula: ; Among them, P represents objective evaluation, B represents the size of the standard image, and S represents the image size of the video to be transcoded. Represents the grayscale value of the i-th row and j-th column in the video to be transcoded, represents the gray value of the i-th row and j-th column in the standard image, where the standard image is represented as a reference frame or a group of average frames.
4. The video transcoding method based on distributed storage according to claim 3 is characterized in that: When determining the initial margin frame numbers of all the sub-videos according to the objective evaluation of the video to be transcoded, the method further includes: The objective evaluation is compared with a first preset evaluation and a second preset evaluation respectively, the first preset evaluation is less than the second preset evaluation, and the initial margin frame number of all the sub-videos is determined according to the comparison result; When the objective evaluation is less than or equal to the first preset evaluation, the initial remaining frame number of all the sub-videos is determined to be the first preset frame number; when the objective evaluation is greater than the first preset evaluation and less than or equal to the second preset evaluation, the initial remaining frame number of all the sub-videos is determined to be the second preset frame number; when the objective evaluation is greater than the second preset evaluation, the initial remaining frame number of all the sub-videos is determined to be the third preset frame number; wherein the first preset frame number is greater than the second preset frame number, and the second preset frame number is greater than the third preset frame number.
5. The video transcoding method based on distributed storage according to claim 1, characterized in that: When the content complexity of each sub-video is compared with the complexity threshold, the content complexity is obtained in the following manner: Calculate the pixel change between frames; ; Where Di represents the pixel change between the i-th frame and the i+1-th frame, Ii represents the i-th frame image, Ii+1 represents the i+1-th frame image, and (x, y) represents the position of each pixel in the image; Calculate the information entropy Hi of the frame; ; Where pi(x, y) represents the normalized frequency of pixel (x, y) in the i-th frame image, and Ei represents the information entropy of the i-th frame; Obtaining the content complexity according to the pixel variation between frames and the information entropy of the frames; ; Among them, C represents the content complexity, L represents the number of frames of the sub-video, and w1 and w2 represent weight coefficients.
6. The video transcoding method based on distributed storage according to claim 5, characterized in that: When judging whether to adjust the initial margin frame number of the sub-video according to the comparison result, it includes: When the content complexity is less than or equal to the complexity threshold, determining not to adjust the initial margin frame number of the sub-video; When the content complexity is greater than a complexity threshold, it is determined to adjust the initial margin frame number of the sub-video.
7. The video transcoding method based on distributed storage according to claim 6, characterized in that: When determining the remaining number of frames of the current sub-video according to the filter set, it includes: In the filtering set, sub-videos whose residual frame numbers are greater than the initial residual frame number are filtered out to construct a large frame number set and sub-videos whose residual frame numbers are less than the initial residual frame number are filtered out to construct a small frame number set, and the residual frame number of the current sub-video is obtained according to the initial residual frame number, the large frame number set and the small frame number set.
8. The video transcoding method based on distributed storage according to claim 7, characterized in that: When obtaining the remaining frame number of the current sub-video according to the initial remaining frame number, the large frame number set and the small frame number set, it includes: ; Among them, Z represents the number of residual frames, Zt represents the number of residual frames of the t-th sub-video in the large frame number set, T represents the number of sub-videos in the large frame number set, Z0 represents the initial number of residual frames, Zu represents the number of residual frames of the u-th sub-video in the small frame number set, and U represents the number of sub-videos in the small frame number set.
9. A distributed storage-based video transcoding system, used for applying the distributed storage-based video transcoding method according to any one of claims 1 to 8, characterized in that: include: A division unit is configured to determine a video to be transcoded, and divide the video to be transcoded into a plurality of sub-videos according to a color histogram; a processing unit configured to identify a position of each of the sub-videos in the video to be transcoded and determine a margin position according to the position, and determine an initial margin frame number of all the sub-videos according to an objective evaluation of the video to be transcoded, wherein the margin position refers to an extra frame reserved at the beginning or end of each sub-video segment, and the extra frame is the initial margin frame number; A judgment unit is configured to collect the content complexity of each sub-video, and compare the content complexity of each sub-video with the complexity threshold, and judge whether to adjust the initial residual frame number of the sub-video according to the comparison result; when it is determined to adjust the initial residual frame number, obtain the similarity between the sub-video and the sub-video in the historical data according to the content complexity of the sub-video, and determine the initial residual frame number adjustment scheme according to the similarity; Obtaining the similarity between the sub-video and the sub-video in the historical data according to the complexity of the sub-video content, and determining the initial margin frame number adjustment scheme according to the similarity, including: When the difference between the content complexity of the sub-video and the content complexity of the sub-video in the historical data is less than a%, it is determined that the sub-video in the historical data is similar to the current sub-video; When there is a sub-video similar to the current sub-video in the historical data, a similarity set is established and the average number of residual frames in the similarity set is used as the number of residual frames of the current sub-video; When there is no sub-video similar to the current sub-video in the historical data, extract sub-videos whose content complexity difference with the current sub-video is less than b% from the historical data to establish a screening set, and determine the number of residual frames of the current sub-video according to the screening set, where a is less than b; The storage unit is configured to divide the sub-videos after determining the number of residual frames into three categories: the head, the middle and the tail, and perform distributed storage of the videos according to the sub-video classification.
Citation Information
Patent Citations
Video coding method and device, storage medium and electronic device
CN108650510A
Variable bitrate control for distributed video encoding
US20170078676A1