Video transcoding file optimization method and related device

By monitoring and replacing cloud-based transcoding files and using local transcoding files to replace cloud-based transcoding files, the problem of high playback bandwidth caused by excessive volume of video transcoding files on the cloud server is solved, and the video playback stability and effect is improved.

CN119233023APending Publication Date: 2024-12-31新奥新智科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411362351.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The video transcoding file on the cloud server is too large, resulting in high video playback bandwidth requirements, especially when the video file is centrally broadcast on demand, resulting in poor playback effect.

Method used

By monitoring the number of playbacks of the target video file in the cloud, when the preset optimization time is reached, the average video playback and number of playbacks in the target cycle are obtained. If the number of playbacks is greater than the optimization threshold, upload the local transcoding file to the cloud service. The terminal replaces the cloud-based transcoding file, uses different periods of time to monitor the playback situation, and reduces the playback bandwidth requirement.

Benefits of technology

It reduces the play bandwidth requirement during the centralized on-demand time period and improves the stability and effect of video playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119233023A_ABST
    Figure CN119233023A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video transcoding file optimization method and a related device, and the method comprises the steps: monitoring the playing times of a cloud transcoding file of a target video file, obtaining a video playing mean value in a target period and the playing times of the target video file when a preset optimization opportunity is reached, and carrying out the optimization of the video transcoding file. The video playing mean value is used for indicating the average level of the video playing times, the optimization opportunity comprises an end moment of reaching a target period, the target period comprises at least one period in a plurality of preset periods, and different preset periods are different in duration; and if the number of playing times of the target video file in at least one target period meets a preset optimization condition, uploading a local transcoding file of the target video file to a cloud server to replace a cloud transcoding file, the optimization condition comprising that the number of playing times of the target video file in the target period is greater than an optimization threshold of the target period. The demand on the playing bandwidth in the centralized on-demand time period is reduced, and the video playing stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method for optimizing a video transcoding file and a related device. Background Art

[0002] Cloud servers have the characteristics of high stability and high bandwidth. Therefore, cloud servers are usually used for video on demand to improve the stability of video playback. Cloud servers provide cloud video processing processes including video storage, transcoding, encryption, management, and playback. Standard H264 transcoding is usually used to transcode video files. The large file size of the transcoded video files will lead to excessively high playback bandwidth requirements for the video transcoded files, especially during the time period when video files are intensively played on demand. The bandwidth pressure for playing video files is high, which will result in poor video file playback effects. Summary of the invention

[0003] The present application provides a method and related device for optimizing video transcoding files, the purpose of which is to improve the video playback effect of the cloud server, as follows:

[0004] A method for optimizing a video transcoding file, applied to a client, the method for optimizing a video transcoding file comprising:

[0005] Monitor the number of times the cloud-transcoded file of the target video file is played;

[0006] When a preset optimization time is reached, the video playback mean value and the number of playbacks of the target video file within a target period are obtained, the video playback mean value is used to indicate the average level of the number of video playbacks, the optimization time includes the end time of the target period, the target period includes at least one period of a plurality of preset periods, and different preset periods have different durations;

[0007] If the number of times the target video file is played within at least one of the target cycles meets a preset optimization condition, the local transcoded file of the target video file is uploaded to the cloud server to replace the cloud transcoded file, and the optimization condition includes that the number of times the target video file is played within the target cycle is greater than the optimization threshold of the target cycle.

[0008] Optionally, the method for optimizing the video transcoding file further includes:

[0009] Obtaining a ratio of a file size of a local transcoded file of the target video file to a file size of a cloud transcoded file as a transcoded file optimization ratio, wherein the file size of the local transcoded file is smaller than the file size of the cloud transcoded file;

[0010] Based on the video playback mean value and the transcoding file optimization ratio within the target period, an optimization threshold value of the target period is obtained, and the optimization threshold value is positively correlated with both the video playback mean value and the transcoding file optimization ratio.

[0011] Optionally, obtaining an optimization threshold of the target period based on the video playback mean and the transcoded file optimization ratio within the target period includes:

[0012] The product of the video playback mean value and the transcoding file optimization ratio within the target period is calculated as the optimization threshold of the target period.

[0013] Optionally, before monitoring the number of times the target video file is played, the method for optimizing the video transcoding file further includes:

[0014] Transcoding the target video file to obtain the local transcoded file;

[0015] Uploading the target video file to a cloud server, so that the cloud server transcodes the target video file to obtain the cloud transcoded file, and stores the cloud transcoded file in an object storage space;

[0016] In response to the play instruction of the target video file, the cloud transcoded file is searched from the cloud service end, and the cloud transcoded file is played.

[0017] Optionally, transcoding the target video file to obtain the local transcoded file includes:

[0018] Transcoding the target video file to obtain a candidate local transcoded file of the target video file;

[0019] Determine whether the ratio of the file size of the candidate local transcoding file to the file size of the cloud transcoding file is less than 1. If so, store the candidate local transcoding file as the local transcoding file; if not, issue a local transcoding failure instruction.

[0020] Optionally, in response to the playback instruction of the target video file, searching the cloud transcoding file from the cloud server includes:

[0021] In response to the play instruction of the target video file, searching the content distribution network service of the cloud server whether the cloud transcoding file exists, and if so, obtaining the cloud transcoding file;

[0022] If not, the cloud transcoded file is searched for in the object storage space and a push instruction for the cloud transcoded file is issued, so that the cloud service end pushes the cloud transcoded file to the content distribution network service.

[0023] Optionally, after uploading the local transcoded file of the target video file to the cloud server to replace the cloud transcoded file, the video transcoded file optimization method further includes:

[0024] In response to the play instruction of the target video file, searching for the local transcoded file from the cloud server and playing the local transcoded file;

[0025] Monitoring the cumulative number of playbacks of the local transcoded file as the number of optimized playbacks;

[0026] Monitoring the number of times the playback status of the local transcoded file is abnormal playback as the number of abnormal playback times;

[0027] If the optimized playback times reach a preset times threshold, determine whether the ratio of the playback abnormality times to the optimized playback times is greater than a preset first ratio threshold; if so, restore the local transcoded file on the cloud server to the cloud transcoded file;

[0028] If the end time of the abnormal monitoring period is reached, determine whether the playback status of the local transcoded file within the abnormal monitoring period is greater than a preset second ratio threshold value for the ratio of the number of playback exceptions to the number of playbacks of the local transcoded file; if so, restore the local transcoded file on the cloud server to the cloud transcoded file.

[0029] Optionally, after uploading the local transcoded file to the cloud server to replace the cloud transcoded file, the video transcoded file optimization method further includes:

[0030] If the end time of the target recovery period is reached, it is determined whether the target recovery period satisfies a preset automatic recovery condition, wherein the automatic recovery condition includes: the ratio of the number of times the local transcoded file is played in the target recovery period to the average number of times the target video file is played in each preset recovery period is less than a preset third ratio threshold, and the target recovery period is any recovery period;

[0031] If there are a continuous preset number of recovery cycles that meet the automatic recovery condition, the local transcoded file on the cloud server is restored to the cloud transcoded file.

[0032] A video transcoding file optimization system, applied to a client, comprising:

[0033] A playback monitoring unit, used to monitor the number of times a cloud-transcoded file of a target video file is played;

[0034] a cycle monitoring unit, configured to obtain, when a preset optimization opportunity is reached, a video playback mean within a target cycle and the number of times the target video file is played, wherein the video playback mean is used to indicate an average level of the number of times the video is played, the optimization opportunity includes the end time of reaching the target cycle, the target cycle includes at least one cycle among a plurality of preset cycles, and different preset cycles have different durations;

[0035] The transcoded file replacement unit is used to upload the local transcoded file of the target video file to the cloud server to replace the cloud transcoded file if the number of times the target video file is played within at least one of the target periods meets a preset optimization condition, wherein the optimization condition includes that the number of times the target video file is played within the target period is greater than an optimization threshold of the target period.

[0036] A device for optimizing video transcoding files, comprising: a memory and a processor;

[0037] The memory is used to store programs;

[0038] The processor is used to execute the program to implement the various steps of the above-mentioned method for optimizing the video transcoding file.

[0039] A readable storage medium stores a computer program, which, when executed by a processor, implements the various steps of the above-mentioned method for optimizing video transcoding files.

[0040] A computer program product includes a computer program. When the computer program is executed by a processor, the computer program implements the various steps of the above-mentioned video transcoding file optimization method.

[0041] It can be seen from the above technical scheme that the optimization method and related device of the video transcoding file provided by the embodiment of the present application are applied to the client to monitor the number of times the cloud transcoding file of the target video file is played. When the preset optimization time is reached, the video playback mean and the number of times the target video file is played in the target period are obtained. The video playback mean is used to indicate the average level of the number of video playbacks. The optimization time includes the end time of reaching the target period. The target period includes at least one period in multiple preset periods, and the duration of different preset periods is different. If the number of times the target video file is played in at least one target period meets the preset optimization conditions, the local transcoding file of the target video file is uploaded to the cloud server to replace the cloud transcoding file. The optimization conditions include that the number of times the target video file is played in the target period is greater than the optimization threshold of the target period. It can be seen that by monitoring the playback of the cloud transcoding file of the target video file in periods of different durations, when the number of times the target video file is played in at least one target period is greater than the optimization threshold of the target period, the local transcoding file is uploaded to the cloud server to replace the cloud transcoding file, and the cloud transcoding file of the target video file can be replaced with the local transcoding file when it is centrally played on demand, thereby reducing the demand for playback bandwidth during the centralized on-demand time period and improving the stability of the playback video. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0044] Figure 1 A schematic diagram of the architecture of a video transcoding file optimization system provided in an embodiment of the present application;

[0045] Figure 2 A flowchart of a specific implementation method of a method for optimizing a video transcoding file provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of a flow chart of a method for optimizing a video transcoding file provided in an embodiment of the present application;

[0047] Figure 4A schematic diagram of the structure of a video transcoding file optimization system provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of the structure of a video transcoding file optimization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain 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 interpreted as being limited to the embodiments set forth herein, but rather these embodiments are provided for a more thorough and complete understanding of the present disclosure.

[0050] It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure. The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the description below. The modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and non-restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more".

[0051] At present, the cloud video on demand service of the cloud server can provide video playback services for the client. The cloud video on demand service includes functions such as video storage, processing, encryption, management, and accelerated playback. It has been applied to a variety of video application scenarios, including media, education, e-commerce, and enterprises. Cloud video processing also includes the process of video storage, transcoding, encryption, management, and playback, but it pays more attention to video transcoding, has a more complex and professional configuration, and is suitable for customers with higher standards for video processing. For both the original video file and the transcoded file, they will be stored in the object storage service configured on the cloud server. The object storage service can efficiently manage the entire life cycle of the file, including upload, modification, download, and deletion. Although the cloud server has the characteristics of high stability and high bandwidth, when using the cloud video processing and cloud video on demand service of the cloud server, when using the standard H264 to transcode the video file, the size of the transcoded file will be too large (generally larger than the local transcoded file), and the playback of the transcoded file requires high bandwidth, resulting in a low video playback experience.

[0052] Specifically, in the enterprise's education and training scenario, the cloud service performs cloud video processing on the uploaded teaching and training videos and saves the transcoded files of the teaching and training videos. When the cloud video on demand service receives the on-demand request from the client, it plays the transcoded files of the teaching and training videos. Generally, in the early stage of uploading the training video, in response to the high on-demand volume, the cloud video on-demand service has a high playback volume for the teaching and training videos in a short period of time. After a period of time, the playback volume of the teaching and training videos drops sharply. For example, after the teaching and training video is uploaded, a large number of clients request to play the teaching and training video. After the teaching cycle of the teaching and training video ends, the number of clients requesting to play the teaching and training video drops sharply. It can be seen that the on-demand volume of the teaching and training video has obvious fluctuations over time.

[0053] In response to this scenario, this article proposes a video playback optimization technology that combines cloud video services and local services. When applied in enterprise education and training scenarios, it can reduce the playback bandwidth requirements for Alibaba Cloud Video Services during periods of high playback volume, avoid poor playback effects, and thus improve the video playback experience.

[0054] The video transcoding file optimization method provided in the embodiment of the present application is applied to but not limited to the video transcoding file optimization system, such as Figure 1 As shown, the optimization system for video transcoding files includes a client and a cloud server, wherein the client includes file optimization services, video playback services, local video transcoding services, and file storage space, and the cloud server includes cloud video transcoding services, object storage space, and content delivery network CDN (Content Delivery Network). It should be noted that the client can access various services preset in the cloud server by calling preset interfaces. Figure 2 An example of a specific implementation process for optimizing a video transcoding file is shown below. Figure 2 As shown, this method specifically includes:

[0055] S201. The local video transcoding service transcodes a target video file to obtain a candidate local transcoding file for transcoding the target video file.

[0056] In this embodiment, the local video transcoding service implements target video file transcoding based on a preset local service transcoding algorithm. Optionally, the local service transcoding algorithm is libx264, which is compatible with more video players.

[0057] Specifically, by using the open source software ffmpeg video transcoding to obtain a smaller file size without affecting the video quality and audio quality, it is necessary to adjust the video bit rate, frame rate, and compression algorithm, and the audio also needs to adjust the bit rate, sampling frequency, and compression algorithm. In this embodiment, the video quality parameter crf is set to 26, which can reduce the video bit rate while ensuring the video is clear. The frame rate of the video is set to 25, which can ensure the stability and smoothness of the video playback. The video also uses a sharpening algorithm, which can obtain a clearer effect under the condition of the same resolution. The sharpening radius is set to 3, the sharpening intensity is 3, the threshold is 0.5, the brightness channel radius is 3, and the brightness channel intensity is 3. The audio compression algorithm uses libfdk_aac. Compared with the ordinary acc audio algorithm, the transcoded file compressed by the audio compression algorithm occupies a smaller volume and has better sound quality. The sampling rate of the audio is set to no more than 44100Hz, which is realized while ensuring the high quality of the audio and reducing the file size.

[0058] S202: The local video transcoding service uploads the target video file to the cloud server.

[0059] In this embodiment, the local video transcoding service uploads the target video file to the cloud server through a preset first interface. For specific methods of uploading video files, reference may be made to the prior art.

[0060] S203: The cloud video transcoding service transcodes the target video file to obtain a cloud transcoded file of the target video file, and stores the cloud transcoded file in the object storage space.

[0061] In this embodiment, the specific method for the cloud video transcoding service to transcode the target video file can refer to the existing service.

[0062] S204. The local video transcoding service determines whether the ratio of the file size of the candidate local transcoding file to the file size of the cloud transcoding file is less than 1. If so, the candidate local transcoding file is stored as a local transcoding file in the file storage space. If not, a local transcoding failure instruction is issued.

[0063] In this embodiment, the file size of the candidate local transcoded file is recorded as q1, and the file size of the cloud transcoded file is recorded as q2. Then, it is determined whether q1 / q2 is less than 1, that is, whether q1 is less than q2. If q1 / q2<1 is satisfied, the candidate local transcoded file is stored as a local transcoded file in the file storage space. If q1 / q2<1 is not satisfied, a local transcoding failure instruction is issued to notify the local transcoding failure.

[0064] S205. The file optimization service obtains a ratio of the file size of the local transcoded file to the file size of the cloud transcoded file as a transcoded file optimization ratio.

[0065] Continuing with the above example, after the candidate local transcoded file is stored as a local transcoded file in the file storage space, q1 / q2 is obtained as the transcoded file optimization ratio. In summary, it can be seen that the file size of the local transcoded file is smaller than the file size of the cloud transcoded file.

[0066] S206: The video playback service responds to the playback instruction of the target video file, searches for the cloud transcoded file from the cloud server, and plays the cloud transcoded file.

[0067] In this embodiment, the video playback service responds to the playback instruction of the target video file, searches the content distribution network service for a cloud transcoding file, and if so, obtains the cloud transcoding file from the content distribution network service and plays the cloud transcoding file.

[0068] If not, the video playback service searches for the cloud transcoded file from the object storage space, plays the cloud transcoded file and issues a push instruction for the cloud transcoded file, so that the object storage space pushes the cloud transcoded file to the content distribution network service.

[0069] It can be seen that in this application, when the target video file is played for the first time, the video playback service obtains and plays the cloud transcoded file of the target video file from the object storage space. When the target video file is not played for the first time, since the cloud server has pushed the cloud transcoded file to the content distribution network service CDN, the video playback service obtains and plays the cloud transcoded file of the target video file from the content distribution network service. At this time, video acceleration support will be provided by CDN.

[0070] S207. The file optimization service monitors the number of times the cloud-transcoded file is played as the number of times the target video file is played.

[0071] In this embodiment, the file optimization service can call a preset monitoring program to record the number of plays each time the cloud transcoded file of the target video file is played. The number of plays is stored in the distributed memory database redis to ensure the fast response of the playback interface.

[0072] S208: When the preset optimization time is reached, the file optimization service obtains the video playback average value and the number of playbacks of the target video file within the target period.

[0073] In this embodiment, the number of times the target video file is played is the number of times the cloud transcoded file of the target video file is played within the target period. The video play average is used to indicate the average level of the number of times each video is played. The optimization timing includes reaching the end time of the target period. The target period includes at least one period from a plurality of preset periods, and the durations of different preset periods are different. For example, three preset periods are pre-configured, namely, a short-term period of 30 minutes, a medium-term period of 120 minutes, and a long-term period of 1440 minutes. With the initial time being 0, when the 240th minute is reached, the end time of the short-term period and the medium-term period is reached respectively. The average number of times the video files are played (the ratio of the total number of times all video files are played to the number of video files) within the short-term period (first target period) with the 240th minute as the end time and the medium-term period (second target period) with the 240th minute as the end time is obtained as the average level of the number of video plays.

[0074] Specifically, three global playback timers with different preset periods are defined, namely, a short-term timer, a medium-term timer, and a long-term timer. The cycle timing duration of the short-term timer is 30 minutes, the cycle timing duration of the medium-term timer is 120 minutes, and the cycle timing duration of the long-term timer is 1440 minutes. The timing end time of the global playback timer is the end time of the preset period.

[0075] S209: The file optimization service obtains an optimization threshold of the target period based on the video playback average and the transcoding file optimization ratio within the target period.

[0076] In this embodiment, the optimization threshold is positively correlated with both the video playback mean and the transcoded file optimization ratio. Optionally, the product of the video playback mean and the transcoded file optimization ratio is calculated as the optimization threshold.

[0077] Continuing with the above example, the average number of video file playbacks in the first target period is K1, the average number of video file playbacks in the second target period is K2, and the transcoded file optimization ratio is q1 / q2. Therefore, the first optimization threshold X1=K1*q1 / q2, and the second optimization threshold X2=K2*q1 / q2.

[0078] S210: If the number of times the target video file is played within at least one target period meets a preset optimization condition, the file optimization service uploads the local transcoded file to the cloud server to replace the cloud transcoded file.

[0079] In this embodiment, the optimization condition includes that the number of times the target video file is played within the target period is greater than the optimization threshold of the target period. For example, the first optimization threshold X1=K1*q1 / q2 corresponding to the first target period, the second optimization threshold X2=K2*q1 / q2 corresponding to the second target period, the number of times the target video file is played within the first target period is p1, and the number of times the target video file is played within the second target period is p2. If at least one of p1>X1 or p2>X2 is satisfied, the local transcoded file is uploaded to the cloud server to replace the cloud transcoded file.

[0080] In this embodiment, based on three global playback timers, it is determined whether the files on the object storage space need to be replaced. The short-term timer is characterized by being able to capture traffic changes in a short period of time, the long-term timer can capture changes in the overall video traffic, and the medium-term timer is characterized by being between the other two. The coordinated use of the three timers can better monitor traffic changes.

[0081] In this embodiment, the file volume (file size) of the cloud transcoded file is guaranteed to be larger than the file volume of the local transcoded file. According to the optimization conditions, the optimization threshold is proportional to the optimization ratio of the transcoded file, that is, as the optimization ratio of the transcoded file decreases, the optimization threshold becomes smaller and smaller, thereby ensuring the reduction of the overall playback bandwidth. Using the replaced local transcoded file to support video playback, the file size of the local transcoded file is smaller than the cloud transcoded file, which will reduce the bandwidth and improve the user viewing experience.

[0082] In this embodiment, three timers with different cycle timing durations are configured, corresponding to three preset periods of different durations. Therefore, the replacement action is triggered only after the bandwidth usage meets the optimization conditions, which can effectively reduce the frequency of file replacement and improve the overall stability of the system.

[0083] S211. After uploading the local transcoded file to the cloud server to replace the cloud transcoded file, the video playback service responds to the playback instruction of the target video file, searches for the local transcoded file from the cloud server, and plays the local transcoded file.

[0084] It should be noted that the specific implementation method of this step can refer to S206.

[0085] S212. The file optimization service monitors the cumulative number of times the local transcoded file is played as the number of optimized plays, and monitors the number of times the play status of the local transcoded file is abnormal as the number of abnormal plays.

[0086] In this embodiment, the local transcoded file may become unstable, such as incomplete playback file and playback file parsing failure, etc., and the video playback status needs to be monitored. The file optimization service monitors the playback status of the local transcoded file by calling the pre-written monitoring log logic, sends an error log when the playback status is abnormal, and records the number of playback exceptions.

[0087] S213. If the optimized playback times reach a preset times threshold, the file optimization service determines whether the ratio of the playback abnormality times to the optimized playback times is greater than a preset first ratio threshold. If so, the local transcoded file on the cloud server is restored to the cloud transcoded file.

[0088] For example, the preset number threshold is 10 times, the first ratio threshold is 50%, and the optimized playback times reach 10 times. It is determined whether the ratio of the playback abnormality times to the optimized playback times (playback abnormality rate) is greater than 50%. If so, the local transcoded file on the cloud server is restored to the cloud transcoded file.

[0089] S214. If the end time of the abnormality monitoring period is reached, the file optimization service determines whether the playback status of the local transcoded file during the abnormality monitoring period is a ratio of the number of playback abnormalities to the number of playback times of the local transcoded file is greater than a preset second ratio threshold. If so, the local transcoded file on the cloud server is restored to the cloud transcoded file.

[0090] For example, the abnormality monitoring period is 30 minutes, and the second ratio threshold is 50%. When the end time of any abnormality monitoring period is reached, the playback status of the local transcoded file within 30 minutes corresponding to the abnormality monitoring period is obtained, which is the ratio of the number of playback exceptions to the number of playback times of the local transcoded file. It is determined whether the ratio is greater than 50%. If so, the local transcoded file on the cloud server is restored to the cloud transcoded file.

[0091] It should be noted that determining whether to execute a recovery action based on the abnormal playback rate of the previous 10 times can more quickly discover problems and respond to them, thereby better improving the overall operational stability. Determining whether to execute a recovery action based on the abnormal playback rate of the abnormal monitoring period ensures automatic handling of abnormalities that occur during the smooth operation of the video.

[0092] S215: If the end time of the target recovery period is reached, the file optimization service determines whether the target recovery period meets the preset automatic recovery conditions.

[0093] In this embodiment, the automatic recovery condition includes: the ratio of the number of times the local transcoded file is played within the target recovery period to the average number of times the local transcoded file is played within each preset recovery period is less than a preset third ratio threshold, and the target recovery period is any recovery period.

[0094] Taking one day as a recovery cycle, at the end time corresponding to the target day, determine the ratio of the number of times the local transcoded files are played within the target day to the average number of times the local transcoded files are played per day, and determine the size of the ratio and the third ratio threshold. Taking the third ratio threshold as 20% as an example, if the ratio is less than 20%, it is determined that the target day meets the automatic recovery conditions.

[0095] S216: If there are a preset number of consecutive recovery cycles that meet the automatic recovery condition, the file optimization service restores the local transcoded file on the cloud server to the cloud transcoded file.

[0096] Specifically, the playback volume of the target video file (local transcoded file) for three consecutive days is recorded. If the playback volume is less than 20% of the historical average playback volume, the local transcoded file on the cloud server is restored to the cloud transcoded file.

[0097] It should be noted that after the video playback volume decreases and the video playback volume is lower than 20% of the historical average playback volume for three consecutive days, the local transcoded files on the cloud server will be restored to cloud-based transcoded files. This not only reduces the playback bandwidth during the peak period of video playback, but also ensures that a large number of local transcoded files will not be restored to cloud-based transcoded files after an abnormal situation occurs, thereby improving playback stability.

[0098] It can be seen from the above technical scheme that in the optimization method for video transcoding files provided in the embodiment of the present application, the optimization conditions include that the number of playbacks of the target video file within the target period is greater than the optimization threshold of the target period, and the optimization threshold is positively correlated with the video playback mean and the transcoding file optimization ratio. The video playback mean is used to indicate the average level of the video playback number. Therefore, the higher the video playback mean or the higher the transcoding file optimization ratio of the present application, the larger the optimization threshold. When the number of playbacks of the target video file within at least one target period is greater than the optimization threshold of the target period, the local transcoded file is uploaded to the cloud server to replace the cloud transcoded file. Since the file size of the local transcoded file is smaller than that of the cloud transcoded file, the playback bandwidth requirement can be reduced and the playback video stability can be improved.

[0099] Furthermore, since the optimization timing includes the end time of reaching the target cycle, the target cycle includes at least one cycle among multiple preset cycles, and the duration of different preset cycles is different, the timeliness and flexibility of traffic monitoring are improved through preset cycles of different durations. For example, three timers with different cycle timing durations are configured, corresponding to three preset cycles of different durations. Therefore, the replacement action is triggered only after the bandwidth usage meets the optimization conditions, which can effectively reduce the frequency of file replacement and improve the overall stability of the system.

[0100] It should be noted that the above S201~S216 are only an optional specific implementation process of the video transcoding file optimization method provided in the embodiment of the present application, and the embodiment of the present application also includes other specific implementation processes. For example, S201~S204 are an optional video transcoding and storage method, the purpose of which is to obtain a local transcoding file and a cloud transcoding file of a target video file and store them accordingly, S206 is an optional specific method for playing a video file, that is, a cloud transcoding file, and S211~S216 are optional steps.

[0101] For another example, the method also includes: the file optimization service receives a file recovery instruction and recovers the local transcoded file on the cloud server to a cloud transcoded file, so that the developer can directly intervene in the automatic recovery function to prevent the problem of automatic recovery failure.

[0102] For another example, the method in which the file optimization service uploads the local transcoded file to the cloud server to replace the cloud transcoded file specifically includes: the file optimization service uploads the local transcoded file to the cloud server as the video file to be played, and changes the name of the cloud transcoded file at the same time. The purpose is to retain the cloud transcoded file in the object storage space at the same time, improve the execution speed of the recovery action (the file optimization service restores the local transcoded file of the cloud server to the cloud transcoded file), and can respond quickly to abnormal problems.

[0103] In an optional embodiment, the cloud video server is the Alibaba Cloud video server. Alibaba Cloud video on demand is a professional service for providing video playback to customers, which includes functions such as video storage, processing, encryption, management, and accelerated playback, and can be well applied to various video application scenarios, including media, education, e-commerce, and enterprises. Alibaba Cloud video processing also includes the process of video storage, transcoding, encryption, management, and playback, but it pays more attention to video transcoding, has a more complex and professional configuration, and is suitable for customers with higher standards for video processing. For video files and transcoded files, they will be stored in the Alibaba Cloud object storage service. The Alibaba Cloud object storage service can efficiently manage the entire life cycle of the file, including upload, modification, download, and deletion operations. Although Alibaba Cloud has the characteristics of high stability and high bandwidth, in the process of using its video processing and video on demand services, when using standard H264 transcoding, the file size of the video after transcoding will be too large, which is not friendly to the playback of the video transcoded file.

[0104] Furthermore, the present application is applied to the education and training scenarios of enterprises, using Alibaba Cloud to perform cloud video processing and playback of uploaded teaching and training videos. During the period when the playback volume of teaching and training videos is high, the playback bandwidth requirements of Alibaba Cloud video services are reduced to avoid poor playback effects, thereby improving the video playback experience.

[0105] Combining the video playback optimization technology of cloud video service and local service, the playback bandwidth of cloud video service can be reduced and the video playback experience can be improved. The video transcoding of this embodiment mainly relies on cloud video service, which has the advantages of fast transcoding speed, high bandwidth of video playback, support for CDN acceleration, etc. The local service has higher scalability and flexibility. Through the above video parameters, the audio and video quality consistent with the transcoded files on Alibaba Cloud can be achieved, and the video size can be reduced at the same time, which has certain advantages in video playback. The local transcoding service is connected to the cloud video service. The local service automatically replaces the playback files on Alibaba Cloud by monitoring the playback volume and abnormal volume, so as to reduce bandwidth usage under higher playback volume and restore cloud transcoded files at lower playback volume. It not only effectively solves the shortcomings of high bandwidth requirements caused by the centralized playback of large transcoded files by cloud video service, but also ensures that the video quality of transcoded files is improved in the non-centralized playback stage.

[0106] In summary, the optimization method for video transcoding files provided in the embodiment of the present application can be summarized as follows: Figure 3 The schematic diagram of a video transcoding file optimization method flow chart is shown in FIG. 1 , and the video transcoding file optimization method provided in the embodiment of the present application is applied to a client, such as Figure 3 As shown, the method may include S301~S305.

[0107] S301, monitoring the number of times the cloud-transcoded file of the target video file is played.

[0108] S302: When a preset optimization time is reached, the average video playback value and the number of playback times of the target video file within the target period are obtained.

[0109] In this embodiment, the video play mean is used to indicate the average level of video play times, and the optimization timing includes reaching the end time of the target cycle, and the target cycle includes at least one cycle among multiple preset cycles, and different preset cycles have different durations.

[0110] For example, three preset cycles are pre-configured, namely a short-term cycle of 30 minutes, a medium-term cycle of 120 minutes, and a long-term cycle of 1440 minutes. With the initial time being 0, when it reaches the 240th minute, the end time of the short-term cycle and the medium-term cycle is reached respectively. The number of times the target video file is played and the average number of times the video file is played (the ratio of the total number of times all video files are played to the number of video files) in the short-term cycle (first target cycle) ending at the 240th minute and the medium-term cycle (second target cycle) ending at the 240th minute are obtained, and the average number of times the target video file is played is taken as the average level of the number of times the video is played.

[0111] S303: If the number of playbacks of the target video file within at least one target period meets a preset optimization condition, the local transcoded file of the target video file is uploaded to the cloud server to replace the cloud transcoded file.

[0112] In this embodiment, the optimization condition includes that the number of times the target video file is played within the target period is greater than the optimization threshold of the target period.

[0113] Optionally, based on the video playback mean and the transcoding file optimization ratio in the target period, an optimization threshold of the target period is obtained. The optimization threshold is positively correlated with the video playback mean and the transcoding file optimization ratio. The file size of the file is the file volume, and the file size of the local transcoding file is smaller than the file size of the cloud transcoding file. The method for obtaining the file size of the local transcoding file of the target video file and the file size of the cloud transcoding file can be referred to the prior art.

[0114] That is, one target period corresponds to one optimization threshold, and the optimization threshold can be calculated by calculating the product of the video playback mean and the transcoding file optimization ratio as the optimization threshold or other specific calculation methods. For example, the first optimization threshold X1=K1*q1 / q2 corresponding to the first target period, the second optimization threshold X2=K2*q1 / q2 corresponding to the second target period, the number of playbacks of the target video file in the first target period is p1, and the number of playbacks of the target video file in the second target period is p2. If at least one of p1>X1 or p2>X2 is satisfied, the local transcoded file is uploaded to the cloud server to replace the cloud transcoded file.

[0115] Optionally, if the ratio of the file size of the local transcoded file of the target video file to the file size of the cloud transcoded file is not less than 1, the process is terminated directly and an error instruction is issued. It can be seen from the above technical scheme that the optimization method for video transcoded files provided in the embodiment of the present application monitors the number of times the cloud transcoded file of the target video file is played, and when a preset optimization time is reached, the video playback mean value and the number of times the target video file is played within the target period are obtained, the video playback mean value is used to indicate the average level of the video playback number, the optimization time includes the end time of the target period, the target period includes at least one period among multiple preset periods, and the duration of different preset periods is different; if the number of times the target video file is played within at least one target period meets the preset optimization condition, the local transcoded file of the target video file is uploaded to the cloud server to replace the cloud transcoded file, and the optimization condition includes that the number of times the target video file is played within the target period is greater than the optimization threshold of the target period. It can be seen that by monitoring the playback status of the cloud transcoded files of the target video files in periods of different durations, when the number of playback times of the target video files in at least one target period is greater than the optimization threshold of the target period, the local transcoded files are uploaded to the cloud server to replace the cloud transcoded files. When the cloud transcoded files of the target video files are centrally played on demand, they can be replaced with the local transcoded files, thereby reducing the demand for playback bandwidth during the centralized on-demand time period and improving the stability of video playback.

[0116] Figure 4 A schematic diagram of the structure of a video transcoding file optimization system provided in an embodiment of the present application is shown. Figure 4 As shown, the system may include:

[0117] A play monitoring unit 401 is used to monitor the play times of the cloud transcoded file of the target video file;

[0118] The cycle monitoring unit 402 is used to obtain the video playback mean value and the number of playbacks of the target video file within a target cycle when a preset optimization opportunity is reached, the video playback mean value is used to indicate the average level of the number of video playbacks, the optimization opportunity includes the end time of the target cycle, the target cycle includes at least one cycle of a plurality of preset cycles, and different preset cycles have different durations;

[0119] The transcoded file replacement unit 403 is used to upload the local transcoded file of the target video file to the cloud server to replace the cloud transcoded file if the number of times the target video file is played within at least one of the target periods meets a preset optimization condition, wherein the optimization condition includes that the number of times the target video file is played within the target period is greater than an optimization threshold of the target period.

[0120] The functions of the various functional units of the video transcoding file optimization system provided in the embodiment of the present application can be referred to the above embodiment, and this embodiment will not be described in detail here.

[0121] Figure 5 A schematic diagram of the structure of a video transcoding file optimization device is shown, and the device may include: at least one processor 501, at least one communication interface 502, at least one memory 503 and at least one communication bus 504;

[0122] In the embodiment of the present application, the number of the processor 501, the communication interface 502, the memory 503, and the communication bus 504 is at least one, and the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504;

[0123] The processor 501 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0124] The memory 503 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0125] The memory stores a program, and the processor can execute the program stored in the memory to implement various steps of a method for optimizing a video transcoding file provided in an embodiment of the present application, as follows:

[0126] A method for optimizing a video transcoding file, applied to a client, the method for optimizing a video transcoding file comprising:

[0127] Monitor the number of times the cloud-transcoded file of the target video file is played;

[0128] When a preset optimization time is reached, the video playback mean value and the number of playbacks of the target video file within a target period are obtained, the video playback mean value is used to indicate the average level of the number of video playbacks, the optimization time includes the end time of the target period, the target period includes at least one period of a plurality of preset periods, and different preset periods have different durations;

[0129] If the number of times the target video file is played within at least one of the target cycles meets a preset optimization condition, the local transcoded file of the target video file is uploaded to the cloud server to replace the cloud transcoded file, and the optimization condition includes that the number of times the target video file is played within the target cycle is greater than the optimization threshold of the target cycle.

[0130] The specific implementation methods of each step of the method for optimizing a video transcoding file provided in the embodiment of the present application can be referred to the above embodiment, and this embodiment will not be described in detail here.

[0131] The present application also provides a readable storage medium, which can store a computer program suitable for execution by a processor. When the computer program is executed by the processor, the steps of a method for optimizing a video transcoding file provided in the present application are implemented as follows:

[0132] A method for optimizing a video transcoding file, applied to a client, the method for optimizing a video transcoding file comprising:

[0133] Monitor the number of times the cloud-transcoded file of the target video file is played;

[0134] When a preset optimization time is reached, the video playback mean value and the number of playbacks of the target video file within a target period are obtained, the video playback mean value is used to indicate the average level of the number of video playbacks, the optimization time includes the end time of the target period, the target period includes at least one period of a plurality of preset periods, and different preset periods have different durations;

[0135] If the number of times the target video file is played within at least one of the target cycles meets a preset optimization condition, the local transcoded file of the target video file is uploaded to the cloud server to replace the cloud transcoded file, and the optimization condition includes that the number of times the target video file is played within the target cycle is greater than the optimization threshold of the target cycle.

[0136] The specific implementation methods of each step of the method for optimizing a video transcoding file provided in the embodiment of the present application can be referred to the above embodiment, and this embodiment will not be described in detail here.

[0137] The embodiment of the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the above-mentioned method for optimizing the video transcoding file are implemented as follows:

[0138] A method for optimizing a video transcoding file, applied to a client, the method for optimizing a video transcoding file comprising:

[0139] Monitor the number of times the cloud-transcoded file of the target video file is played;

[0140] When a preset optimization time is reached, the video playback mean value and the number of playbacks of the target video file within a target period are obtained, the video playback mean value is used to indicate the average level of the number of video playbacks, the optimization time includes the end time of the target period, the target period includes at least one period of a plurality of preset periods, and different preset periods have different durations;

[0141] If the number of times the target video file is played within at least one of the target cycles meets a preset optimization condition, the local transcoded file of the target video file is uploaded to the cloud server to replace the cloud transcoded file, and the optimization condition includes that the number of times the target video file is played within the target cycle is greater than the optimization threshold of the target cycle.

[0142] The specific implementation methods of each step of the method for optimizing a video transcoding file provided in the embodiment of the present application can be referred to the above embodiment, and this embodiment will not be described in detail here.

[0143] It should be noted that in the context of the present disclosure, a readable storage medium may be a tangible medium that may contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. The readable storage medium may be a machine-readable signal medium or a machine-readable storage medium. The readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0144] Finally, it should be noted that, in the context of the present disclosure, relational terms such as first and second, etc., are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the statement "comprise one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0145] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

[0146] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.

[0147] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

Claims

1. A method for optimizing a video transcoding file, characterized in that: Applied to the client, the optimization method of the video transcoding file includes: Monitor the number of times the cloud-transcoded file of the target video file is played; When a preset optimization time is reached, the video playback mean value and the number of playbacks of the target video file within a target period are obtained, the video playback mean value is used to indicate the average level of the number of video playbacks, the optimization time includes the end time of the target period, the target period includes at least one period of a plurality of preset periods, and different preset periods have different durations; If the number of times the target video file is played within at least one of the target cycles meets a preset optimization condition, the local transcoded file of the target video file is uploaded to the cloud server to replace the cloud transcoded file, and the optimization condition includes that the number of times the target video file is played within the target cycle is greater than the optimization threshold of the target cycle.

2. The method for optimizing a video transcoding file according to claim 1, characterized in that: The method for optimizing the video transcoding file also includes: Obtaining a ratio of a file size of a local transcoded file of the target video file to a file size of a cloud transcoded file as a transcoded file optimization ratio, wherein the file size of the local transcoded file is smaller than the file size of the cloud transcoded file; Based on the video playback mean value and the transcoding file optimization ratio within the target period, an optimization threshold value of the target period is obtained, and the optimization threshold value is positively correlated with both the video playback mean value and the transcoding file optimization ratio.

3. The method for optimizing a video transcoding file according to claim 2, characterized in that: The obtaining the optimization threshold of the target period based on the video playback mean value and the transcoding file optimization ratio within the target period includes: The product of the video playback mean value and the transcoding file optimization ratio within the target period is calculated as the optimization threshold of the target period.

4. The method for optimizing a video transcoding file according to claim 2, characterized in that: Before monitoring the number of times the target video file is played, the method for optimizing the video transcoding file further includes: Transcoding the target video file to obtain the local transcoded file; Uploading the target video file to a cloud server, so that the cloud server transcodes the target video file to obtain the cloud transcoded file, and stores the cloud transcoded file in an object storage space; In response to the play instruction of the target video file, the cloud transcoded file is searched from the cloud service end, and the cloud transcoded file is played.

5. The method for optimizing a video transcoding file according to claim 2, characterized in that: The step of transcoding the target video file to obtain the local transcoded file includes: Transcoding the target video file to obtain a candidate local transcoded file of the target video file; Determine whether the ratio of the file size of the candidate local transcoding file to the file size of the cloud transcoding file is less than 1. If so, store the candidate local transcoding file as the local transcoding file; if not, issue a local transcoding failure instruction.

6. The method for optimizing a video transcoding file according to claim 2, characterized in that: The step of searching the cloud transcoding file from the cloud server in response to the play instruction of the target video file includes: In response to the play instruction of the target video file, searching the content distribution network service of the cloud server whether the cloud transcoding file exists, and if so, obtaining the cloud transcoding file; If not, the cloud transcoded file is searched for in the object storage space and a push instruction for the cloud transcoded file is issued, so that the cloud service end pushes the cloud transcoded file to the content distribution network service.

7. The method for optimizing a video transcoding file according to claim 1, characterized in that: After uploading the local transcoded file of the target video file to the cloud server to replace the cloud transcoded file, the video transcoded file optimization method further includes: In response to the play instruction of the target video file, searching for the local transcoded file from the cloud server and playing the local transcoded file; Monitoring the cumulative number of playbacks of the local transcoded file as the number of optimized playbacks; Monitoring the number of times the playback status of the local transcoded file is abnormal playback as the number of abnormal playback times; If the optimized playback times reach a preset times threshold, determine whether the ratio of the playback abnormality times to the optimized playback times is greater than a preset first ratio threshold; if so, restore the local transcoded file on the cloud server to the cloud transcoded file; If the end time of the abnormal monitoring period is reached, determine whether the playback status of the local transcoded file within the abnormal monitoring period is greater than a preset second ratio threshold value for the ratio of the number of playback exceptions to the number of playbacks of the local transcoded file; if so, restore the local transcoded file on the cloud server to the cloud transcoded file.

8. The method for optimizing a video transcoding file according to claim 7, characterized in that: After uploading the local transcoded file to the cloud server to replace the cloud transcoded file, the video transcoded file optimization method further includes: If the end time of the target recovery period is reached, it is determined whether the target recovery period satisfies a preset automatic recovery condition, wherein the automatic recovery condition includes: the ratio of the number of times the local transcoded file is played in the target recovery period to the average number of times the target video file is played in each preset recovery period is less than a preset third ratio threshold, and the target recovery period is any recovery period; If there are a continuous preset number of recovery cycles that meet the automatic recovery condition, the local transcoded file on the cloud server is restored to the cloud transcoded file.

9. A video transcoding file optimization system, applied to a client, characterized in that: include: A playback monitoring unit, used to monitor the number of times a cloud-transcoded file of a target video file is played; a cycle monitoring unit, configured to obtain, when a preset optimization opportunity is reached, a video playback mean within a target cycle and the number of times the target video file is played, wherein the video playback mean is used to indicate an average level of the number of times the video is played, the optimization opportunity includes the end time of reaching the target cycle, the target cycle includes at least one cycle among a plurality of preset cycles, and different preset cycles have different durations; The transcoded file replacement unit is used to upload the local transcoded file of the target video file to the cloud server to replace the cloud transcoded file if the number of times the target video file is played within at least one of the target periods meets a preset optimization condition, wherein the optimization condition includes that the number of times the target video file is played within the target period is greater than an optimization threshold of the target period.

10. A device for optimizing video transcoding files, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the method for optimizing a video transcoding file as described in any one of claims 1 to 8.