Video transcoding method and device, equipment, storage medium and program product

By employing adaptive keyframe extraction and dynamic transcoding task scheduling, combined with video frame clustering centers and load balancing, the stability and efficiency issues in the video transcoding process are resolved, thereby improving user experience and resource utilization.

CN121814968APending Publication Date: 2026-04-07CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing video transcoding methods suffer from problems such as low output stability, slow caching speed, unreasonable use of server resources, and video playback stuttering. In particular, these methods affect the user experience during the transcoding of a large number of video resources in the video check-in and management system for field staff.

Method used

By adaptively extracting keyframes, dynamically scheduling transcoding tasks, employing video frame clustering centers and load balancing strategies, and utilizing multiple transcoders for video cutting, transcoding, and merging, the adaptability of video content and transcoding quality are ensured.

Benefits of technology

It improves the stability of video output and viewing experience, optimizes server resource utilization, and enhances transcoding efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121814968A_ABST
    Figure CN121814968A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video processing, and particularly provides a video transcoding method and device, equipment, a storage medium and a program product. The method comprises the following steps: acquiring a plurality of video frame clustering centers of a video to be transcoded; wherein the video to be transcoded comprises a plurality of video frames to be transcoded; performing key frame extraction on the video to be transcoded based on the plurality of video frame clustering centers to obtain a plurality of key frames; wherein the plurality of key frames are used for determining a video cutting frame sequence; cutting a to-be-transcoded video by using the video cutting frame sequence to obtain a plurality of to-be-transcoded video clips; transcoding the plurality of video clips to be transcoded by using at least one target transcoder in the plurality of transcoders to obtain a plurality of transcoded video clips; and merging the plurality of transcoded video clips to obtain a transcoded video. The key frame can be adaptively extracted according to the video content, the transcoding task is dynamically scheduled, and the transcoding quality, the stability of video output and the watching experience are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of video processing, and in particular to a video transcoding method and device, equipment, storage medium and program product. BACKGROUND

[0002] To ensure consistency between the actual attendance of field staff and the attendance purpose, field staff need to use video clock-in mode to submit field proof videos to the management system. Meanwhile, there are a large number of external training courses in the management system, which contain a large number of video resources. To ensure the playability of the video on multiple terminals, control network traffic and bandwidth usage, and ensure user experience, the original video needs to be transcoded to ensure the format and resolution of the video in the play process.

[0003] In related technologies, video transcoding can usually be performed in a manner of video slice extraction based on key frames and distributed parallel transcoding. However, the video processed by this method has the problems of low output stability, low cache speed, and unreasonable use of server resources. SUMMARY

[0004] The present disclosure is proposed in view of the above problems. The present disclosure provides a video transcoding method, device, equipment, storage medium and program product.

[0005] According to one aspect of the present disclosure, a video transcoding method is provided, comprising: obtaining a plurality of video frame clustering centers of a to-be-transcoded video; wherein the to-be-transcoded video comprises a plurality of to-be-transcoded video frames; extracting key frames based on the plurality of video frame clustering centers, to obtain a plurality of key frames; wherein the plurality of key frames are used to determine a video cutting frame sequence; cutting the to-be-transcoded video using the video cutting frame sequence to obtain a plurality of to-be-transcoded video segments; transcoding the plurality of to-be-transcoded video segments using at least one target transcoder in a plurality of transcoders to obtain a plurality of transcoded video segments; merging the plurality of transcoded video segments to obtain a transcoded video.

[0006] According to another aspect of the present disclosure, a video transcoding device is provided, comprising: an obtaining module configured to obtain a plurality of video frame clustering centers of a to-be-transcoded video; wherein the to-be-transcoded video comprises a plurality of to-be-transcoded video frames; an extracting module configured to extract key frames based on the plurality of video frame clustering centers, to obtain a plurality of key frames; wherein the plurality of key frames are used to determine a video cutting frame sequence; cutting module configured to cut the video to be transcoded using the video cutting frame sequence to obtain a plurality of video segments to be transcoded; transcoding module configured to transcode the plurality of video segments to be transcoded using at least one target transcoder in a plurality of transcoders to obtain a plurality of transcoded video segments; merging module configured to merge the plurality of transcoded video segments to obtain a transcoded video.

[0007] In yet another aspect of the embodiments of the present disclosure, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the method according to the embodiments of the present disclosure.

[0008] In yet another aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the method according to the embodiments of the present disclosure.

[0009] In yet another aspect of the embodiments of the present disclosure, a computer program product is provided, which includes a computer program, and the computer program is executed by a processor to implement the method according to the embodiments of the present disclosure.

[0010] As will be described in detail below, according to the video transcoding method according to the embodiments of the present disclosure, a plurality of video frame clustering centers of a video to be transcoded are obtained, wherein the video to be transcoded includes a plurality of video frames to be transcoded; key frames are extracted from the video to be transcoded based on the plurality of video frame clustering centers to obtain a plurality of key frames; wherein the plurality of key frames are used to determine a video cutting frame sequence; the video to be transcoded is cut using the video cutting frame sequence to obtain a plurality of video segments to be transcoded; the plurality of video segments to be transcoded are transcoded using at least one target transcoder in a plurality of transcoders to obtain a plurality of transcoded video segments; and the plurality of transcoded video segments are merged to obtain a transcoded video, which can adaptively extract key frames according to video content, dynamically schedule transcoding tasks, and guarantee transcoding quality, stability of video output, and viewing experience.

[0011] It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the subject technology. BRIEF DESCRIPTION OF DRAWINGS

[0012] The foregoing and other objects, features, and advantages of the present disclosure will become more apparent from the following detailed description, which proceeds with reference to the accompanying drawings. The drawings are intended to provide a further understanding, but are not intended for limitation of the present disclosure. In the drawings, the same reference numerals are generally used to represent similar or like components.

[0013] Figure 1 A flow diagram of a video transcoding method is shown; Figure 2 A structural diagram of a video transcoding apparatus is shown; Figure 3 A structural diagram of an electronic device is shown; Figure 4 A structural diagram of a computer system is shown. DETAILED DESCRIPTION

[0014] In order to make the objectives, technical solutions and advantages of the present disclosure more apparent, the following will describe the example embodiments according to the present disclosure in detail with reference to the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the example embodiments described herein.

[0015] It should be understood that each of the steps recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.

[0016] The term “comprising” and variations thereof as used herein are open-ended, that is, “comprising but not limited to.” The term “based on” is intended to mean “based, at least in part, on” unless explicitly stated otherwise. The term “one embodiment” is used herein to mean at least one embodiment; the term “another embodiment” is used herein to mean at least one additional embodiment; the term “some embodiments” is used herein to mean at least some embodiments. Relative terms such as “first,” “second,” and the like can be used herein to distinguish one element from another and the terms “first,” “second,” and the like are not necessarily used consistently with respect to the sequence of actions or the order of description. Other definitions will be apparent from the description that follows.

[0017] It should be noted that the terms “one,” “plural” and the like as used herein are illustrative and not limiting, and those skilled in the art will understand that “one” or “a” should be interpreted as “one or more” unless the context clearly indicates otherwise.

[0018] The names of the messages or information exchanged between the plurality of apparatuses in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.

[0019] Regarding the authenticity of the field work certificate video submitted in the management system, if artificial inspection is used, it will result in low efficiency, therefore, the field work certificate video can be checked by artificial intelligence to determine whether it is consistent with the field work purpose, before the field work certificate video is input into the inspection model, the field work certificate video needs to be compressed and transcoded to reduce the calculation amount of the artificial intelligence model and improve the calculation efficiency.

[0020] In the related art, video transcoding can usually adopt the way of extracting key frames to slice the video to form video segments, and the video segments are processed in parallel through load balancing.

[0021] Among them, regarding the method based on shot boundary: although the key frame extraction speed is fast, the extracted key frame cannot effectively represent the main content of the shot, because the first frame of the shot is not necessarily the key frame, resulting in insufficient representation.

[0022] Regarding the method based on motion analysis: this method selects key frames by analyzing inter-frame motion information, but the calculation amount is too large because the motion of the image needs to be analyzed and processed, and the key frame selected according to the principle of minimum local motion amount is not necessarily accurate.

[0023] Regarding the K-means clustering method: the threshold for controlling the number of clusters in unsupervised clustering can only be artificially set, so only a fixed number of key frames can be extracted, but the number of key frames cannot be adaptively adjusted according to the complexity of the video content, and the setting of the clustering threshold depends on artificial experience, and the applicability is poor. If you need to set the threshold according to different types of videos, you need a lot of experiments, which is tedious and inaccurate.

[0024] Based on this, there are problems such as difficulty in threshold setting, non-representative extraction results, and large consumption of computing resources in the key frame extraction process. And because of the lack of dynamics and individualization in slicing, the video can only be cached in the order of slicing when caching the video, resulting in slow video caching speed. In addition, the existing transcoding method usually adopts a simple load balancing strategy for parallel transcoding after video slicing, lacks consideration of the dynamic load of the transcoder, and is easy to cause some nodes to be overloaded, affecting the overall transcoding efficiency. At the same time, in the merging process after video segmentation and transcoding, if there is network packet loss or node failure, it is easy to cause video playback lag, mosaic and other phenomena, affecting the stability of video output and the viewing experience.

[0025] Therefore, in order to solve the above problems, the embodiments of the present disclosure provide a video transcoding method which can adaptively extract key frames according to video content, dynamically schedule transcoding tasks and guarantee transcoding quality, video output stability and viewing experience.

[0026] The video transcoding method provided by the example embodiments of the present disclosure can be executed by a terminal or a chip applied to the terminal.

[0027] For example, the terminal can include one or more of a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and a wearable device based on augmented reality (AR) and / or virtual reality (VR) technology, and the like, and the example embodiments of the present disclosure are not limited thereto.

[0028] Figure 1 A flowchart of the video transcoding method provided by the example embodiments of the present disclosure is shown. As shown in the flowchart, the video transcoding method includes: Figure 1 S101, obtaining a plurality of video frame clustering centers of a to-be-transcoded video; wherein the to-be-transcoded video includes a plurality of to-be-transcoded video frames; S102, performing key frame extraction on the to-be-transcoded video based on the plurality of video frame clustering centers to obtain a plurality of key frames; wherein the plurality of key frames are used to determine a video cutting frame sequence; S103, cutting the to-be-transcoded video using the video cutting frame sequence to obtain a plurality of to-be-transcoded video segments; S104, transcoding the plurality of to-be-transcoded video segments using at least one target transcoder in a plurality of transcoders to obtain a plurality of transcoded video segments; S105, merging the plurality of transcoded video segments to obtain a transcoded video.

[0029] Specifically, the to-be-transcoded video can be a video clock-in mode used by a field worker to submit a field work proof video to a management system. Since there are a large number of external training courses in the management system, which contain a large number of video resources, in order to ensure the play process and format, resolution of the video on multiple terminals, the original video needs to be transcoded to ensure the playability of the terminal, control network traffic and bandwidth usage, and ensure user experience.

[0030] Of course, the to-be-transcoded video can also be other videos that need to be transcoded, and the example embodiments of the present disclosure are not limited thereto.

[0031] ​The to-be-transcoded video includes a plurality of to-be-transcoded video frames. The embodiments of the present disclosure can perform clustering processing on the plurality of to-be-transcoded video frames to obtain a plurality of video frame cluster centers, and then perform key frame extraction on the to-be-transcoded video based on the plurality of video frame cluster centers to obtain a plurality of key frames.

[0032] Here, the embodiments of the present disclosure can select the to-be-transcoded video frame closest to the video frame cluster center from each cluster (also referred to as a family), take the to-be-transcoded video frame closest to the video frame cluster center as a key frame, and form a key frame sequence including a plurality of key frames.

[0033] For example, after clustering is completed, key frames are selected, the frame closest to the cluster center is extracted from each cluster as the representative frame of the cluster, and the representative frames of all clusters constitute the key frames of the video shot. The distance is calculated using the following formula:

[0034] wherein, represents the distance between the ith to-be-transcoded video frame and the bth cluster center, f ie represents the value of the ith to-be-transcoded video frame on the e th feature, t be represents the value of the bth cluster center on the e th feature, and E represents the total number of features.

[0035] After the key frames are extracted, the number of selected key frames is set according to the length of the to-be-transcoded video, the start and end key frames of the cut are calculated, and the video is cut to obtain a series of video segments.

[0036] Suppose the total number of the plurality of extracted key frames is N, the number of selected key frames is P, and the selection interval I is:

[0037] At this time, the video cutting frame sequence can be determined through the plurality of key frames, and the video cutting frame sequence includes cutting start key frames and cutting end key frames. The index of the cutting start key frame is: 1, 1+I×1, 1+I×2, 1+I×3, …, 1+I×(P-1); and the index of the cutting end key frame is: I×1, I×2, I×3, …, I×(P-1).

[0038] When the to-be-transcoded video is cut using the video cutting frame sequence to obtain a plurality of to-be-transcoded video segments, the to-be-transcoded video can be cut by the cutting start key frame and the cutting end key frame with the same index sorting, and a to-be-transcoded video segment can be obtained in this way. A plurality of to-be-transcoded video segments can be obtained. The plurality of cut to-be-transcoded video segments are stored in a general storage, and the plurality of cut to-be-transcoded video segments are represented as S={S1, …, S q , …, SQ}, wherein S represents a set of multiple video segments to be transcoded; S1 represents a first video segment to be transcoded; S q represents a qth video segment to be transcoded; and S Q represents a Qth video segment to be transcoded.

[0039] Based on this, the embodiments of the present disclosure take the key frame sequence as the video cutting frame sequence, ensure that the cutting points are based on the video content structure, and the multiple video segments to be transcoded obtained by cutting can maintain the integrity of the video scene, avoiding the incoherent playback caused by random cutting.

[0040] When transcoding the multiple video segments to be transcoded, at least one target transcoder can be selected from the multiple transcoders through a weighted random algorithm; then, the multiple video segments to be transcoded are transcoded by using the at least one target transcoder to obtain multiple transcoded video segments. In this way, the transcoding tasks among the transcoders can be balanced, and the transcoding tasks are not allocated to the transcoders with heavy loads, so as to avoid the waste of resources of the transcoders with light loads, thereby ensuring the performance balance of the transcoders, ensuring that the overall transcoding does not have too much waiting, ensuring the efficiency of parallel transcoding, and further ensuring the transcoding quality, the stability of video output, and the viewing experience. Here, the transcoder can be a server.

[0041] After receiving the transcoding task, the target transcoder uses ffmpeg to transcode the received video segment to be transcoded S q to obtain a transcoded video segment, denoted as S' q . Here, the target transcoder can convert the video segment to be transcoded into a target format and a target code rate according to the requirements of the playback platform or device.

[0042] After transcoding is completed, the multiple transcoded video segments are stored in a general storage, and a scheduler of the target transcoder is notified that the transcoding has been completed. After receiving the notification that the transcoding is completed, the scheduler checks whether there are remaining video segments to be transcoded that have not been transcoded, and if there are, assigns new video segments to be transcoded to the target transcoder.

[0043] After the multiple video segments to be transcoded are all transcoded, the multiple transcoded video segments obtained by transcoding are merged, all the transcoded video segments are spliced, and a final transcoded video is obtained. The transcoded video is denoted as: S' = S'1|…|S' q |…|S' Q , wherein | represents video splicing, S' represents a set of multiple transcoded video segments, S'1 represents a first transcoded video segment, S' q represents a qth transcoded video segment, and S' Q represents a Qth transcoded video segment. S' is saved to the general storage, and {S1, …, S qS Q}、{S'1,…,S' q ,…,S' Q The transcoding is now complete.

[0044] With the development of multimedia technology, the amount of video information is increasing daily, and multimedia data has become the main data source for various information systems. Video accounts for a large proportion of multimedia data. The video transcoding method provided in this disclosure can effectively improve the user's viewing experience when playing videos online, better adapt to the transcoding of different types of videos, and meet the market's demand for the diversity of multimedia information and the quality and efficiency of transmission.

[0045] According to the technical solution of the exemplary embodiments of this disclosure, multiple video frame clustering centers of the video to be transcoded are obtained; wherein the video to be transcoded includes multiple video frames to be transcoded; key frames are extracted from the video to be transcoded based on the multiple video frame clustering centers to obtain multiple key frames; wherein the multiple key frames are used to determine the video cutting frame sequence; the video to be transcoded is cut using the video cutting frame sequence to obtain multiple video segments to be transcoded; the multiple video segments to be transcoded are transcoded using at least one target transcoder among multiple transcoders to obtain multiple transcoded video segments; the multiple transcoded video segments are merged to obtain a transcoded video. This method can adaptively extract key frames according to the video content, dynamically schedule transcoding tasks, and ensure transcoding quality, video output stability, and viewing experience.

[0046] In some embodiments, obtaining multiple video frame cluster centers of the video to be transcoded includes: Extract visual features from each frame of the video to be transcoded; Obtain a visual similarity calculation model based on visual features; A visual similarity calculation model is used to cluster multiple video frames to be transcoded based on their visual features, resulting in multiple video frame cluster centers.

[0047] Specifically, embodiments of this disclosure can extract the visual features of each video frame to be transcoded. These visual features can be understood as converting the visual content of a video frame to be transcoded into a string of mathematical numbers that represent its core characteristics, i.e., a feature vector. This process is called "feature extraction." The purpose is to enable computers to understand and compare image content, rather than simply seeing a bunch of raw pixels.

[0048] The embodiment of the present disclosure can also construct a visual similarity calculation model in advance based on visual features. Through the visual similarity calculation model, the visual similarity between the to-be-converted video frames can be compared based on the visual features of the to-be-converted video frames, and the to-be-converted video frames are clustered according to the visual similarity, so as to obtain a plurality of video frame clustering centers, thereby improving the accuracy of the video frame clustering center.

[0049] In some embodiments, the visual features include color features and texture features; the visual features of the to-be-converted video frames are extracted from the to-be-converted video, including: Color features of the to-be-converted video are extracted by using a color cumulative histogram, to obtain the color features of the to-be-converted video frames; Texture features of the to-be-converted video are extracted by using an edge histogram descriptor, to obtain the texture features of the to-be-converted video frames.

[0050] Specifically, the color cumulative histogram described above can be a color feature calculated in the HSV color space. The image can be first converted from the RGB color space to the HSV space which is more consistent with human visual perception, and then the number of pixels of each color feature component (H, S, V) in different level intervals is counted to form a histogram. The color cumulative histogram is to accumulate each bin of the ordinary histogram, so that it is more robust to changes in light and the like. In the embodiment of the present disclosure, H, S and V are quantized into 8, 4 and 1 levels respectively, and finally a 32-dimensional feature vector is generated to describe the overall color distribution of the image. Color features of the to-be-converted video are extracted by using the color cumulative histogram, to obtain the color features of the to-be-converted video frames.

[0051] The edge histogram descriptor described above (which can be specifically an MPEG-7 edge histogram descriptor) can describe the texture and contour information of the image by detecting the edges (such as vertical, horizontal, 45° diagonal lines, etc.) in the image and counting the spatial distribution of these edges in different sub-regions of the image. The descriptor can effectively capture the structured content of the image, and finally generate an 80-dimensional feature vector. Texture features of the to-be-converted video are extracted by using the edge histogram descriptor, to obtain the texture features of the to-be-converted video frames.

[0052] In some embodiments, the to-be-converted video frames are clustered based on the visual features of the to-be-converted video frames by using the visual similarity calculation model, to obtain a plurality of video frame clustering centers, including: The visual similarity between any two to-be-converted video frames is calculated based on the visual features of the to-be-converted video frames by using the visual similarity calculation model; The to-be-converted video frames are clustered based on the visual similarity between any two to-be-converted video frames, to obtain a plurality of video frame clustering centers.

[0053] Specifically, the visual similarity calculation model can be a pre-constructed visual similarity-based calculation model, which can calculate the visual similarity between any two frames of the to-be-transcoded video frames based on the visual features of the to-be-transcoded video frames.

[0054] After obtaining the visual similarity between any two frames of the to-be-transcoded video frames, it can be determined whether the two frames of the to-be-transcoded video frames can be clustered into the same class based on the visual similarity between any two frames of the to-be-transcoded video frames. Based on this, the embodiments of the present disclosure can cluster the plurality of to-be-transcoded video frames based on the visual similarity between any two frames of the to-be-transcoded video frames to obtain a plurality of video frame clustering centers.

[0055] In some embodiments, the visual similarity between any two frames of the to-be-transcoded video frames is calculated based on the visual features of the to-be-transcoded video frames using a visual similarity calculation model, including: The color features are subjected to Gaussian normalization processing to obtain normalized color features of each to-be-transcoded video frame; The texture features are subjected to Gaussian normalization processing to obtain normalized texture features of each to-be-transcoded video frame; The visual similarity between the two frames of the to-be-transcoded video frames is calculated based on the normalized color features and the normalized texture features of the to-be-transcoded video frames using the visual similarity calculation model.

[0056] Specifically, in order to eliminate the influence of the range difference of the color features and the texture features, the embodiments of the present disclosure can respectively perform Gaussian normalization on the color features and the texture features. For example, the color features can be subjected to Gaussian normalization processing to obtain normalized color features of each to-be-transcoded video frame; and the texture features can be subjected to Gaussian normalization processing to obtain normalized texture features of each to-be-transcoded video frame.

[0057] After eliminating the influence of the range difference of the color features and the texture features through Gaussian normalization, the visual similarity between the two frames of the to-be-transcoded video frames is calculated based on the normalized color features and the normalized texture features of the to-be-transcoded video frames using the visual similarity calculation model.

[0058] For example, the visual similarity calculation model is:

[0059] wherein, Sij represents the visual similarity between the i-th frame of the to-be-transcoded video frame and the j-th frame of the to-be-transcoded video frame; F i F represents the normalized visual features of the i-th frame of the to-be-transcoded video frame; F j F represents the normalized visual features of the j-th frame of the to-be-transcoded video frame; a k-th dimension component of a normalized color feature of an i-th frame of the to-be-converted video frame, c represents a color feature with a dimension of 32, k is an integer greater than or equal to 0 and less than or equal to 31; a k-th dimension component of a normalized color feature of a j-th frame of the to-be-converted video frame; a s-th dimension component of a normalized texture feature of an i-th frame of the to-be-converted video frame, t represents a texture feature with a dimension of 80, s is an integer greater than or equal to 0 and less than or equal to 79; a s-th dimension component of a normalized texture feature of a j-th frame of the to-be-converted video frame; a weight of the color feature; a weight of the texture feature.

[0060] For example, the calculation formula of the normalized visual feature is as follows:

[0061] wherein, F i a normalized visual feature of an i-th frame of the to-be-converted video frame; f i a visual feature of an i-th frame of the to-be-converted video frame; a standard deviation; m represents a mean value of the visual features of the plurality of to-be-converted video frames; and N represents a total number of the plurality of to-be-converted video frames.

[0062] In some embodiments, the method can further include: obtaining a pre-constructed adaptive threshold calculation model, and calculating the Euclidean distances between the starting frame and each to-be-converted video frame in the plurality of to-be-converted video frames; calculating the cluster threshold of the plurality of video frame cluster centers based on the Euclidean distances and the number of the plurality of to-be-converted video frames by using the adaptive threshold calculation model.

[0063] Specifically, the traditional clustering algorithm (such as the K-means clustering algorithm) can only extract key frames with a fixed number of clusters, and the cluster centers must be set in advance. The threshold for controlling the number of clusters in the unsupervised clustering algorithm can only be set artificially, and cannot be adaptively selected according to different video types. The advantage of such an unsupervised clustering algorithm is that it can extract key frames with different numbers of clusters according to the complexity of the video, overcoming the shortcomings of the traditional K-means clustering algorithm.

[0064] This disclosure improves upon general unsupervised clustering algorithms by adaptively selecting a threshold, resulting in an adaptive threshold unsupervised clustering algorithm. When extracting keyframes, the setting of the cluster threshold significantly impacts the extraction results. If the cluster threshold is set too low, too many keyframes will be extracted; if the cluster threshold is set too high, the extracted keyframes will not represent the main content of the shot. Furthermore, the choice of cluster threshold varies for different types of videos. Therefore, this algorithm, which automatically selects the cluster threshold, overcomes the limitation of general unsupervised clustering, which requires extensive experimentation to pre-set a cluster threshold.

[0065] Using the starting frame among multiple video frames to be transcoded as a reference point, the Euclidean distance between the starting frame and each subsequent video frame to be transcoded is calculated. This Euclidean distance is calculated based on the visual features extracted in the previous steps, and therefore can accurately reflect the comprehensive differences in visual content between two video frames to be transcoded.

[0066] Obtain a pre-built adaptive threshold calculation model, and use the adaptive threshold calculation model to calculate the cluster threshold of multiple video frame cluster centers based on Euclidean distance and the number of multiple video frames to be transcoded.

[0067] For example, the adaptive threshold calculation model can be:

[0068] Where T represents the cluster threshold of multiple video frame cluster centers; N represents the number of multiple video frames to be transcoded; f1 represents the starting frame among the multiple video frames to be transcoded; f i Let f1 represent the i-th video frame to be transcoded; C represents a constant. Here, f1 can specifically represent the visual features of the starting frame, f i This represents the visual features of the i-th video frame to be transcoded.

[0069] The adaptive threshold unsupervised clustering algorithm of this disclosure is summarized as follows: (1) Automatically select the family threshold: T; (2) Initialization: Obtain the starting frame f1 from multiple video frames to be transcoded, and assign f1 to the family ω1. f1 serves as the cluster center of family ω1, and Nc = 1. (3) Obtain the next frame of the video to be transcoded f i If the video frame to be transcoded is empty, then proceed to (6). (4) Calculate the video frame f to be transcoded according to the formula. i The Euclidean distance Dist(f) between the existing family ωa (a = 1, 2, ..., Nc) and the existing family ωa (a = 1, 2, ..., Nc) i ,ωa); where ωca is the cluster center of class ωa; (5) Calculation And determine which family matches the video frame to be transcoded f. i Most similar. If Mindis > T, it means that the video frame f to be transcoded is the most similar. i If it is not similar enough to any existing class, proceed to (6); otherwise, convert the video frame to be transcoded f i Assign it to a family with a Mindis value; (6) Nc = Nc + 1, forming a new family: video frame f to be transcoded i Classified into family ωa; (7) Recalculate the cluster centers: Let the original cluster center of the family ωa be ωac1, and D be the number of video frames to be transcoded in this family. Then the new cluster center ωac2 is: ωac2=(D×ωac1) / (D+1)+1 / (D+1)f i , then go to (2).

[0070] The embodiments of this disclosure can effectively overcome the redundancy problem that occurs when extracting keyframes from video shots with relatively little motion by automatically selecting a family threshold.

[0071] In some embodiments, at least one target transcoder from a plurality of transcoders is used to transcode a plurality of video segments to be transcoded, resulting in a plurality of transcoded video segments, including: Obtain the current load distribution information of multiple transcoders, as well as the pre-built load balancing calculation model; The upper limit of video segments to be allocated is calculated using a load balancing calculation model based on the current load distribution information of multiple transcoders; Under the constraint of the upper limit of video segments to be allocated, multiple video segments to be transcoded are allocated to at least one target transcoder among multiple transcoders, so as to schedule at least one target transcoder to transcode the multiple video segments to be transcoded, thereby obtaining multiple transcoded video segments.

[0072] Specifically, the aforementioned current load allocation information can be the number of transcoding tasks currently allocated to the transcoder. The total number of current load allocation information entries for multiple transcoders can be:

[0073] Where n represents the total number of current load distribution information entries for multiple transcoders; K x This indicates the current load distribution information for the x-th transcoder; X represents the total number of transcoders. To ensure the load is balanced as much as possible among transcoders, this is achieved by minimizing the variance in the number of transcoding tasks among them. Based on this, a load balancing calculation model is constructed. The load balancing calculation model can be:

[0074]

[0075] wherein, represents an upper limit of the video segments to be allocated, that is, a variance of the number of transcoding tasks between the transcoders is minimized; represents a mean value of the current load distribution information of the plurality of transcoders.

[0076] After the upper limit of the video segments to be allocated is calculated based on the current load distribution information of the plurality of transcoders by using the load balancing calculation model, at least one target transcoder can be selected from the plurality of transcoders; under the constraint of the upper limit of the video segments to be allocated, the plurality of video segments to be transcoded are allocated to the at least one target transcoder in the plurality of transcoders, so as to schedule the at least one target transcoder to transcode the plurality of video segments to be transcoded, and obtain a plurality of transcoded video segments.

[0077] The video segments to be transcoded S q The logic of being allocated to the at least one target transcoder x is: traversing all transcoders, checking whether the transcoder x has a transcoding task being performed, if no task is being performed, allocating at most number of video segments to be transcoded S q to the transcoder x, so as to avoid that the load of the target transcoder is too heavy and causes low transcoding efficiency, and improve the output stability of the transcoded video segments.

[0078] The above mainly introduces the scheme provided by the embodiments of the present disclosure. It can be understood that, in order to realize the above functions, the electronic device contains the hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in the present text, the present disclosure can be realized in the form of hardware or the combination of hardware and computer software. Whether a certain function is driven by hardware or computer software, depends on the specific application and design constraints of the technical solution. The professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present disclosure.

[0079] The embodiments of the present disclosure can divide the functional units of the electronic device according to the above method examples, for example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The above integrated module can be realized in the form of hardware or in the form of software functional module. It should be noted that the division of the modules in the embodiments of the present disclosure is illustrative, and is only a logical function division. When actually implemented, there can be another division manner.

[0080] In the case of dividing each functional module according to each function, the exemplary embodiments of the present disclosure provide a video transcoding device, which can be a terminal or a chip applied to a terminal. Figure 2 A structural schematic diagram of a video transcoding device provided by the exemplary embodiments of the present disclosure is shown. As shown in the figure, Figure 2 The device 200 includes: The acquisition module 201 is configured to acquire a plurality of video frame clustering centers of a video to be transcoded, wherein the video to be transcoded includes a plurality of video frames to be transcoded. The extraction module 202 is configured to extract key frames from the video to be transcoded based on the plurality of video frame clustering centers, to obtain a plurality of key frames, wherein the plurality of key frames are used to determine a video cutting frame sequence. The cutting module 203 is configured to cut the video to be transcoded using the video cutting frame sequence, to obtain a plurality of video segments to be transcoded. The transcoding module 204 is configured to transcode the plurality of video segments to be transcoded using at least one target transcoder in a plurality of transcoders, to obtain a plurality of transcoded video segments. The merging module 205 is configured to merge the plurality of transcoded video segments, to obtain a transcoded video.

[0081] In some embodiments, the acquisition module 201 is further configured to extract visual features of each of the video frames to be transcoded from the video to be transcoded, acquire a visual similarity calculation model constructed based on the visual features, and cluster the plurality of video frames to be transcoded based on the visual features of each of the video frames to be transcoded using the visual similarity calculation model, to obtain a plurality of video frame clustering centers.

[0082] In some embodiments, the visual features include color features and texture features. The acquisition module 201 is further configured to extract color features of each of the video frames to be transcoded from the video to be transcoded using a color cumulative histogram, and extract texture features of each of the video frames to be transcoded from the video to be transcoded using an edge histogram descriptor.

[0083] In some embodiments, the acquisition module 201 is further configured to calculate visual similarity of any two of the video frames to be transcoded based on the visual features of each of the video frames to be transcoded using the visual similarity calculation model, and cluster the plurality of video frames to be transcoded based on the visual similarity of any two of the video frames to be transcoded, to obtain a plurality of video frame clustering centers.

[0084] In some embodiments, the obtaining module 201 is further configured to perform Gaussian normalization on the color feature to obtain a normalized color feature of each of the to-be-transcoded video frames; perform Gaussian normalization on the texture feature to obtain a normalized texture feature of each of the to-be-transcoded video frames; and calculate, based on the normalized color feature and the normalized texture feature of each of the to-be-transcoded video frames, the visual similarity between two of the to-be-transcoded video frames by using the visual similarity calculation model.

[0085] In some embodiments, the visual similarity calculation model is:

[0086] wherein, denotes the visual similarity between an i-th to-be-transcoded video frame and a j-th to-be-transcoded video frame; F i denotes the normalized visual feature of the i-th to-be-transcoded video frame; F j denotes the normalized visual feature of the j-th to-be-transcoded video frame; denotes a k-th dimensional component of the normalized color feature of the i-th to-be-transcoded video frame, c denotes a color feature with a dimension of 32, and k is an integer greater than or equal to 0 and less than or equal to 31; denotes a k-th dimensional component of the normalized color feature of the j-th to-be-transcoded video frame; denotes an s-th dimensional component of the normalized texture feature of the i-th to-be-transcoded video frame, t denotes a texture feature with a dimension of 80, and s is an integer greater than or equal to 0 and less than or equal to 79; denotes an s-th dimensional component of the normalized texture feature of the j-th to-be-transcoded video frame; denotes a weight of the color feature; denotes a weight of the texture feature.

[0087] In some embodiments, the obtaining module 201 is further configured to obtain a pre-constructed adaptive threshold calculation model, calculate the Euclidean distance between a starting frame in the plurality of to-be-transcoded video frames and each of the to-be-transcoded video frames, and calculate, based on the Euclidean distance and the number of the plurality of to-be-transcoded video frames, the cluster threshold of the plurality of video frame clustering centers by using the adaptive threshold calculation model.

[0088] In some embodiments, the adaptive threshold calculation model is:

[0089] wherein, T denotes the cluster threshold of the plurality of video frame clustering centers; N denotes the number of the plurality of to-be-transcoded video frames; f1 denotes the starting frame in the plurality of to-be-transcoded video frames; f i denotes the i-th to-be-transcoded video frame; and C denotes a constant.

[0090] In some embodiments, the transcoding module 204 is further configured to acquire current load distribution information of a plurality of transcoders and a pre-constructed load balancing calculation model; calculate an upper limit of video segments to be allocated based on the current load distribution information of the plurality of transcoders by using the load balancing calculation model; and allocate the plurality of video segments to be transcoded to at least one target transcoder in the plurality of transcoders under the constraint of the upper limit of video segments to be allocated, so as to schedule the at least one target transcoder to transcode the plurality of video segments to be transcoded, and obtain a plurality of transcoded video segments.

[0091] The embodiments of the present disclosure further provide an electronic device, including a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the above method.

[0092] Figure 3 A structure schematic diagram of an electronic device provided by an exemplary embodiment of the present disclosure is shown. As shown in the figure, the electronic device 300 includes at least one processor 301 and a memory 302 coupled to the processor 301, and the processor 301 can execute corresponding steps in the above method disclosed by the embodiments of the present disclosure. Figure 3 The processor 301 can execute corresponding steps in the above method disclosed by the embodiments of the present disclosure.

[0093] The processor 301 can also be called a central processing unit (CPU), which can be an integrated circuit chip with signal processing capability. Each step in the above method disclosed by the embodiments of the present disclosure can be completed by integrated logic circuits or instructions in the form of software in the processor 301. The processor 301 can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a ready-to-use programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as hardware decoding processor execution or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in the memory 302, such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register or other mature storage medium in the art. The processor 301 reads information in the memory 302 and combines hardware to complete the steps of the above method.

[0094] Furthermore, various operations / processes according to this disclosure, implemented via software and / or firmware, can be transmitted from a storage medium or network to a computer system with a dedicated hardware architecture, for example, Figure 4 The computer system 400 shown is equipped with the programs that constitute the software. When various programs are installed, the computer system is able to perform various functions, including functions such as those described above. Figure 4 A schematic diagram of the structure of a computer system provided in an exemplary embodiment of this disclosure is shown.

[0095] Computer system 400 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0096] like Figure 4 As shown, the computer system 400 includes a computing unit 401, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. The RAM 403 may also store various programs and data required for the operation of the computer system 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0097] A plurality of components in the computer system 400 are connected to the I / O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 can be any type of device capable of inputting information to the computer system 400, and can receive inputted digital or character information, and generate key signal input related to user settings and / or function control of the electronic device. The output unit 407 can be any type of device capable of presenting information, and can include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 408 can include, but is not limited to, a magnetic disk, an optical disk. The communication unit 409 allows the computer system 400 to exchange information / data with other devices through a network such as the Internet, and can include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, for example, a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0098] The computing unit 401 can be various general and / or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs various methods and processes described above. For example, in some embodiments, the above-described methods disclosed by embodiments of the present disclosure can be implemented as a computer software program tangibly embodied in a machine-readable medium, for example, the storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device via the ROM 402 and / or the communication unit 409. In some embodiments, the computing unit 401 can be configured to perform the above-described methods disclosed by embodiments of the present disclosure by any other appropriate means, for example, by means of firmware.

[0099] Embodiments of the present disclosure also provide a computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the above-described methods disclosed by embodiments of the present disclosure.

[0100] The computer readable storage medium in an embodiment of the present disclosure can be a tangible medium, which can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The above computer readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the above. More specifically, the above computer readable storage medium can include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0101] The above computer readable medium can be contained in the above electronic device; or can exist separately without being assembled into the electronic device.

[0102] An embodiment of the present disclosure further provides a computer program product, including a computer program, wherein the computer program is executed by a processor to implement the above method disclosed by the embodiment of the present disclosure.

[0103] In an embodiment of the present disclosure, the computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer.

[0104] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0105] The modules, components or units described in the embodiments of the present disclosure can be implemented by software or by hardware. In some cases, the name of the module, component or unit does not constitute a limitation on the module, component or unit itself.

[0106] The functions described above can be performed by one or more hardware logic components. For example, non-limiting examples of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip (SOCs), Complex Programmable Logic Devices (CPLDs), etc.

[0107] The above description is merely some embodiments of the present disclosure and a description of principles of technology used. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and also covers other technical solutions formed by any combinations of the above technical features or equivalent features without departing from the above disclosed concept. For example, technical solutions formed by replacing the above features with technical features disclosed in the present disclosure (but not limited to) having similar functions.

[0108] Although some specific embodiments of the present disclosure have been described in detail by way of examples, it should be understood that the above examples are merely for illustration, and are not intended to limit the scope of the present disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims

1. A video transcoding method, characterized in that, include: Obtain cluster centers of multiple video frames of the video to be transcoded; wherein, the video to be transcoded includes multiple video frames to be transcoded; Based on the multiple video frame clustering centers, key frames are extracted from the video to be transcoded to obtain multiple key frames; wherein, the multiple key frames are used to determine the video segmentation frame sequence; The video to be transcoded is segmented using the video segmentation frame sequence to obtain multiple video segments to be transcoded; Using at least one target transcoder among multiple transcoders, the multiple video segments to be transcoded are transcoded to obtain multiple transcoded video segments; The multiple transcoded video segments are merged to obtain a transcoded video.

2. The method as described in claim 1, characterized in that, The process of obtaining multiple video frame clustering centers for the video to be transcoded includes: Extract the visual features of each frame of the video to be transcoded from the video to be transcoded; Obtain a visual similarity calculation model constructed based on the aforementioned visual features; The visual similarity calculation model is used to cluster the multiple video frames to be transcoded based on the visual features of each video frame to be transcoded, thereby obtaining multiple video frame cluster centers.

3. The method as described in claim 2, characterized in that, The visual features include color features and texture features; The extraction of visual features from each frame of the video to be transcoded includes: Color features are extracted from the video to be transcoded using a color cumulative histogram to obtain the color features of each frame of the video to be transcoded. Texture features are extracted from the video to be transcoded using an edge histogram descriptor to obtain the texture features of each video frame to be transcoded.

4. The method as described in claim 3, characterized in that, The method of using the visual similarity calculation model to cluster the multiple video frames to be transcoded based on the visual features of each video frame to obtain multiple video frame cluster centers includes: The visual similarity calculation model is used to calculate the visual similarity between any two video frames to be transcoded based on the visual features of each video frame to be transcoded. Based on the visual similarity between any two video frames to be transcoded, the multiple video frames to be transcoded are clustered to obtain multiple video frame cluster centers.

5. The method as described in claim 4, characterized in that, The step of using the visual similarity calculation model to calculate the visual similarity between any two frames of the video to be transcoded based on the visual features of each frame includes: The color features are subjected to Gaussian normalization to obtain the normalized color features of each of the video frames to be transcoded. The texture features are subjected to Gaussian normalization to obtain the normalized texture features of each of the video frames to be transcoded. The visual similarity calculation model is used to calculate the visual similarity between two video frames to be transcoded based on the normalized color features and normalized texture features of each video frame to be transcoded.

6. The method as described in claim 5, characterized in that, The visual similarity calculation model is as follows: in, F represents the visual similarity between the i-th and j-th video frames to be transcoded; i F represents the normalized visual features of the i-th video frame to be transcoded; j Represents the normalized visual features of the j-th video frame to be transcoded; Let c represent the k-th dimension component of the normalized color feature of the i-th video frame to be transcoded, where c represents the color feature with dimension 32, and k is an integer greater than or equal to 0 and less than or equal to 31. The k-th dimension component represents the normalized color feature of the j-th video frame to be transcoded. Let t represent the s-th component of the normalized texture feature of the i-th video frame to be transcoded, where t represents the texture feature with dimension 80, and s is an integer greater than or equal to 0 and less than or equal to 79. The s-th component represents the normalized texture feature of the j-th video frame to be transcoded. Weights representing color features; The weights represent the texture features.

7. The method as described in claim 1, characterized in that, The method further includes: Obtain a pre-built adaptive threshold calculation model and calculate the Euclidean distance between the starting frame and each of the multiple video frames to be transcoded. The adaptive threshold calculation model is used to calculate the cluster threshold of the multiple video frame cluster centers based on the Euclidean distance and the number of multiple video frames to be transcoded.

8. The method as described in claim 7, characterized in that, The adaptive threshold calculation model is as follows: Where T represents the cluster threshold of the multiple video frame cluster centers; N represents the number of the multiple video frames to be transcoded; f1 represents the starting frame among the multiple video frames to be transcoded; f i Let represent the i-th video frame to be transcoded; C represents a constant.

9. The method according to any one of claims 1 to 8, characterized in that, The process involves using at least one target transcoder from a plurality of transcoders to transcode the plurality of video segments to be transcoded, resulting in a plurality of transcoded video segments, including: Obtain the current load distribution information of multiple transcoders, as well as the pre-built load balancing calculation model; The load balancing calculation model is used to calculate the upper limit of video segments to be allocated based on the current load allocation information of the multiple transcoders; Under the constraint of the upper limit of the video segments to be allocated, the plurality of video segments to be transcoded are allocated to at least one target transcoder among the plurality of transcoders, so as to schedule the at least one target transcoder to transcode the plurality of video segments to be transcoded, thereby obtaining a plurality of transcoded video segments.

10. A video transcoding device, characterized in that, include: An acquisition module is used to acquire multiple video frame cluster centers of the video to be transcoded; wherein, the video to be transcoded includes multiple video frames to be transcoded; The extraction module is used to extract key frames from the video to be transcoded based on the multiple video frame clustering centers to obtain multiple key frames; wherein, the multiple key frames are used to determine the video cutting frame sequence; The cutting module is used to cut the video to be transcoded using the video cutting frame sequence to obtain multiple video segments to be transcoded; The transcoding module is used to transcode the multiple video segments to be transcoded using at least one target transcoder among multiple transcoders, to obtain multiple transcoded video segments. The merging module is used to merge the multiple transcoded video segments to obtain a transcoded video.

11. The apparatus as claimed in claim 10, characterized in that, The acquisition module is further configured to extract visual features of each video frame to be transcoded from the video to be transcoded; acquire a visual similarity calculation model constructed based on the visual features; and use the visual similarity calculation model to cluster the multiple video frames to be transcoded based on the visual features of each video frame to obtain multiple video frame cluster centers.

12. The apparatus as claimed in claim 11, characterized in that, The visual features include color features and texture features; The acquisition module is further configured to extract color features from the video to be transcoded using a color cumulative histogram to obtain the color features of each video frame to be transcoded; and to extract texture features from the video to be transcoded using an edge histogram descriptor to obtain the texture features of each video frame to be transcoded.

13. The apparatus as claimed in claim 12, characterized in that, The acquisition module is further configured to use the visual similarity calculation model to calculate the visual similarity between any two video frames to be transcoded based on the visual features of each video frame to be transcoded; and to cluster the multiple video frames to be transcoded based on the visual similarity between any two video frames to be transcoded to obtain multiple video frame cluster centers.

14. The apparatus as claimed in claim 13, characterized in that, The acquisition module is further configured to perform Gaussian normalization on the color features to obtain normalized color features of each of the video frames to be transcoded; perform Gaussian normalization on the texture features to obtain normalized texture features of each of the video frames to be transcoded; and use the visual similarity calculation model to calculate the visual similarity between two video frames to be transcoded based on the normalized color features and normalized texture features of each of the video frames to be transcoded.

15. The apparatus as claimed in claim 14, characterized in that, The visual similarity calculation model is as follows: in, F represents the visual similarity between the i-th and j-th video frames to be transcoded; i F represents the normalized visual features of the i-th video frame to be transcoded; j Represents the normalized visual features of the j-th video frame to be transcoded; Let c represent the k-th dimension component of the normalized color feature of the i-th video frame to be transcoded, where c represents the color feature with dimension 32, and k is an integer greater than or equal to 0 and less than or equal to 31. The k-th dimension component represents the normalized color feature of the j-th video frame to be transcoded. Let t represent the s-th component of the normalized texture feature of the i-th video frame to be transcoded, where t represents the texture feature with dimension 80, and s is an integer greater than or equal to 0 and less than or equal to 79. The s-th component represents the normalized texture feature of the j-th video frame to be transcoded. Weights representing color features; The weights represent the texture features.

16. The apparatus as claimed in claim 10, characterized in that, The acquisition module is further configured to acquire a pre-built adaptive threshold calculation model and calculate the Euclidean distance between the starting frame and each of the multiple video frames to be transcoded; and use the adaptive threshold calculation model to calculate the cluster threshold of the multiple video frames based on the Euclidean distance and the number of the multiple video frames to be transcoded.

17. The apparatus as claimed in claim 16, characterized in that, The adaptive threshold calculation model is as follows: Where T represents the cluster threshold of the multiple video frame cluster centers; N represents the number of the multiple video frames to be transcoded; f1 represents the starting frame among the multiple video frames to be transcoded; f i Let represent the i-th video frame to be transcoded; C represents a constant.

18. The apparatus according to any one of claims 10 to 17, characterized in that, The transcoding module is also used to obtain the current load distribution information of multiple transcoders and a pre-built load balancing calculation model; and to calculate the upper limit of the video segments to be allocated based on the current load distribution information of the multiple transcoders using the load balancing calculation model. Under the constraint of the upper limit of the video segments to be allocated, the plurality of video segments to be transcoded are allocated to at least one target transcoder among the plurality of transcoders, so as to schedule the at least one target transcoder to transcode the plurality of video segments to be transcoded, thereby obtaining a plurality of transcoded video segments.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 9.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method described in any one of claims 1 to 9.

21. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method described in any one of claims 1 to 9.