Automatic transcoding and multi-code-rate automatic switching system and method based on cloud on demand
The cloud-based transcoding and adaptive bitrate switching system addresses inefficiencies in manual configuration and quality loss by automatically generating and switching video streams to match user conditions, ensuring high-quality playback.
Patent Information
- Application Number
- CN202510532447.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-07-15
AI Technical Summary
The existing multi-bit rate video stream generation and switching technologies have problems such as inefficient manual configuration, reduced quality of high-resolution video transcoding, and inaccurate monitoring of network bandwidth and terminal capabilities, which affect the user experience.
Through the built-in transcoding function of the cloud on-demand platform, multiple video streams with different bit rates are automatically generated, and the user's network status and terminal capabilities are monitored in real time during playback, and the video stream with the best bit rate is dynamically selected and switched, and efficient and intelligent video stream switching is achieved using multi-threading technology and synchronization mechanism.
It significantly improves the quality and user experience of video on demand services, provides smooth and high-quality video playback, solves the problems of inefficient manual configuration and degraded video quality, and improves the accuracy of network bandwidth and terminal capability monitoring.
Smart Images

Figure CN120321435A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of multimedia technology, and specifically to a system and method for automatic transcoding and multi-bitrate automatic switching based on cloud video-on-demand. Background Art
[0002] With the rapid development of Internet technology, video-on-demand services have become an important way for people to obtain entertainment and information. Video-on-demand services not only need to provide high-quality video content, but also need to adapt to the network bandwidth and decoding capabilities of different user terminals. However, a single-bitrate video stream cannot meet the needs of all users. Especially in the case of poor network conditions or weak terminal decoding capabilities, video playback may experience problems such as stuttering and latency, seriously affecting the user experience.
[0003] To solve this problem, the technology of generating and automatically switching multi-bitrate video streams has emerged. Multi-bitrate video streams can dynamically select the most suitable video stream for playback according to the user's network conditions and terminal capabilities, thereby improving the smoothness and picture quality of video playback. However, there are some problems with the existing multi-bitrate video stream generation and switching technologies:
[0004] 1. Low efficiency of manual configuration: Currently, the generation of multi-bitrate video streams usually relies on manual configuration and management, which is not only inefficient but also error-prone. During the manual configuration process, the video content needs to be transcoded multiple times, consuming a large amount of time and resources.
[0005] 2. Degradation of high-resolution video transcoding quality: Existing automatic transcoding technologies often result in a decrease in video quality when processing high-resolution videos. After converting a high-resolution video to a low-resolution one, the clarity of the original video is affected, unable to meet the user's demand for high-quality videos.
[0006] 3. Inaccurate monitoring of network bandwidth and terminal capabilities: Existing video stream switching technologies may have errors when monitoring the user's network bandwidth and terminal capabilities, resulting in untimely or incorrect video stream switching and affecting the user experience.
[0007] Therefore, a method that can efficiently and automatically generate multi-bitrate video streams and intelligently switch during playback is needed. This method should be able to adapt to the network bandwidth and decoding capabilities of different user terminals, while ensuring the quality of high-resolution videos and improving the user experience.
[0008] The cloud video on demand platform provides a complete set of video processing and distribution solutions, supporting automatic transcoding of videos and the generation of multi-bitrate video streams. Through the cloud video on demand platform, efficient transcoding and intelligent switching of videos can be achieved, significantly improving the quality of video on demand services and the user experience. However, how to achieve efficient automatic transcoding and intelligent switching on the cloud video on demand platform remains a problem that needs to be studied and solved. Summary of the Invention
[0009] The object of the present invention is to provide a system and method for automatic transcoding and multi-bitrate automatic switching based on cloud video on demand to solve the problems of low efficiency of manual configuration, degradation of transcoding quality of high-resolution videos, and inaccurate monitoring of network bandwidth and terminal capabilities in the prior art. Through the built-in transcoding function of the cloud video on demand platform, efficient transcoding and intelligent switching of videos are achieved, significantly improving the quality of video on demand services and the user experience.
[0010] The technical solution adopted by the present invention is as follows:
[0011] A method for automatic transcoding and multi-bitrate automatic switching based on cloud video on demand includes the following steps:
[0012] S101. Obtain the original video through the cloud video on demand service and start pulling the stream;
[0013] S102. Automatically transcode to generate multiple video streams with different bitrates according to the preset transcoding strategy;
[0014] S103. Store the generated multi-bitrate video streams in the cloud video on demand;
[0015] S104. When the user requests to play a video, dynamically select the most suitable bitrate video stream for playback according to the user's network condition and terminal capabilities;
[0016] S105. During the playback process, continuously monitor the user's network condition and terminal capabilities, and automatically switch to the video stream with the best bitrate.
[0017] In step S101, it is necessary for the cloud video on demand to receive the video stream for processing; the service provider deploys a cloud video on demand service for receiving the push of the original video stream and receiving the video stream after being processed by the video stream switching service.
[0018] In step S102, the transcoding strategy is preset according to the complexity of the video content, the network condition and terminal capabilities of the target users; the transcoding process of the video stream is to decode the original video stream through the cloud video on demand; the built-in transcoding function of the cloud video on demand platform will decode the original video stream and then re-encode it according to the preset transcoding strategy to generate video streams with different bitrates.
[0019] In step S103, the storage and transmission of the video stream are implemented through a distributed storage system.
[0020] In step S104, when a user requests to play a video, the system will first detect the user's network condition and terminal capabilities, and then dynamically select the most suitable bitrate video stream for playback based on this information.
[0021] In step S105, during the playback process, the user's network condition and terminal capabilities are monitored in real time. If it is found that the user's network condition has changed, the system will automatically switch to the video stream with the optimal bitrate; the detection of the user's network condition is implemented through network probing technology, and the detection of the terminal capabilities is implemented through device information acquisition; the switching process of the video stream is implemented through multi-threaded technology and a synchronization mechanism.
[0022] In step S105, the main process of video stream switching includes the following specific steps:
[0023] S201: Pull the live video stream from the cloud video-on-demand server according to the preset configuration, and initialize the video stream decoder;
[0024] S202: After the initialization of the video stream decoder is completed, determine whether a stream switching instruction is received;
[0025] S203: If a stream switching instruction is received, set the stream switching status code, and the status code is 1;
[0026] S204: Start the sub-thread of the stream switching process. This sub-thread mainly initializes the decoder of the target video stream. The time-consuming of this process is mainly reflected in the initialization of the decoder and waiting for the key frame;
[0027] S205: Determine whether the decoder needs to be replaced, and the status code is 2; determine whether the target video stream in the stream switching sub-thread is initialized and the key frame is obtained;
[0028] S206: Set the stream switching status, and the status code is 3; and poll and wait until the status code becomes non-2 or non-3;
[0029] S207: Obtain the decoder and decode the video frame data;
[0030] S208: Encode the video frame according to the preset encoding information and push it to the cloud video-on-demand server. If the main process does not receive a stop push stream instruction, it will continue to poll and execute the subsequent steps from S202.
[0031] The sub-process of video stream switching includes the following specific steps:
[0032] S301: Obtain the address of the target video stream for stream switching;
[0033] S302: Initialize the decoder according to the target video stream address;
[0034] S303: After the decoder initialization is completed, set the commutation state, and the status code is 2;
[0035] S304: Poll and wait for the commutation status code to become non-2, and wait for the main process step S206 to be set to 3;
[0036] S305: Close the original video stream and replace the decoder in the main process;
[0037] S306: Set the commutation state to the initial state, and the status code is 0; the sub-process will end, and in the main process, step S207 will directly use the decoder initialized in the sub-process to obtain video frame data for encoding.
[0038] A system for automatic transcoding and multi-bitrate automatic switching based on cloud video on demand, the system includes:
[0039] A cloud video on demand module that receives uploaded videos;
[0040] A transcoding module for automatically transcoding to generate multiple video streams with different bitrates according to a preset transcoding strategy;
[0041] A storage module for storing the generated multi-bitrate video streams to cloud video on demand;
[0042] A playback control module for dynamically selecting the most suitable bitrate video stream for playback according to the user's network condition and terminal capabilities when the user requests to play a video;
[0043] A switching module for real-time monitoring of the user's network condition and terminal capabilities during playback and automatically switching to the video stream with the best bitrate.
[0044] In summary, due to the adoption of the above technical solutions, the beneficial effects of the present invention are:
[0045] The present invention significantly improves the user experience by efficiently and automatically generating multi-bitrate video streams and intelligently switching during playback. The present invention combines multi-thread technology and synchronization mechanisms, has lower requirements for hardware, supports automatic transcoding and switching of high-resolution video streams, and does not require separate transcoding processing, providing a more smooth and high-quality video experience for users, and solving the problems of low efficiency of manual configuration, degradation of high-resolution video transcoding quality, and inaccurate monitoring of network bandwidth and terminal capabilities in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flow schematic diagram of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings of the present invention and the specific data in the embodiments. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.
[0048] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0049] Embodiment 1
[0050] This embodiment provides a system for automatic transcoding and multi-bitrate automatic switching based on cloud video-on-demand, including:
[0051] A cloud video-on-demand server (cloud video-on-demand module), responsible for receiving the push of the original video stream and receiving the video stream after being processed by the video stream switching service;
[0052] A transcoding module, used to automatically transcode to generate multiple video streams with different bitrates according to a preset transcoding strategy;
[0053] A storage module, used to store the generated multi-bitrate video streams in the cloud video-on-demand server to ensure the efficient storage and access of the video streams;
[0054] A playback control module, used to dynamically select the most suitable bitrate video stream for playback according to the user's network conditions and terminal capabilities when the user requests to play a video;
[0055] A switching module, used to continuously monitor the user's network conditions and terminal capabilities during playback and automatically switch to the video stream with the best bitrate.
[0056] The method for automatic transcoding and multi-bitrate automatic switching based on cloud video-on-demand includes the following steps:
[0057] S101: Obtain the original video stream
[0058] The service provider needs to deploy a cloud video-on-demand service to receive the push of the original video stream and receive the video stream after being processed by the video stream switching service. Through the cloud video-on-demand service, the original video stream can be conveniently obtained and the stream pulling can start.
[0059] S102: Automatically transcode to generate multi-bitrate video streams
[0060] According to the preset transcoding strategy, automatically transcode to generate multiple video streams with different bitrates. The transcoding strategy can be preset according to factors such as the complexity of the video content, the network conditions of the target users, and the terminal capabilities. The built-in transcoding function of the cloud video on demand platform will decode the original video stream and then re-encode it according to the preset transcoding strategy to generate video streams with different bitrates. For example, video streams with multiple bitrates such as 1080p, 720p, and 480p can be generated to adapt to the terminal capabilities and network conditions of different users.
[0061] S103: Store multi-bitrate video streams
[0062] Store the generated multi-bitrate video streams in the cloud video on demand service. The distributed storage system of the cloud video on demand platform will improve the efficiency of storage and access, ensuring the fast response and stable transmission of the video streams. The distributed storage system can store the video streams dispersedly on multiple nodes, avoiding single point of failure and improving the reliability and availability of the system.
[0063] S104: Dynamically select the best bitrate video stream
[0064] When a user requests to play a video, the system will first detect the user's network conditions and terminal capabilities, and then dynamically select the most suitable bitrate video stream for playback according to this information. The detection of the user's network conditions is achieved through network probing technology. For example, the network latency and bandwidth can be measured by sending probing packets. The detection of the terminal capabilities is achieved through device information acquisition. For example, information such as the CPU performance, memory size, and screen resolution of the device can be obtained through the client application. The system selects the most suitable bitrate video stream for playback according to this information to ensure the smoothness and image quality of the video playback.
[0065] S105: Real-time monitor and automatically switch video streams
[0066] During the playback process, the system will real-time monitor the user's network conditions and terminal capabilities. If it is found that the user's network conditions change, the system will automatically switch to the video stream with the best bitrate. The switching process of the video stream is achieved through multi-thread technology and synchronization mechanism to ensure the smoothness and high quality of the video playback. For example, if the user's network conditions deteriorate, the system will automatically switch to a lower bitrate video stream to reduce stuttering and latency; if the user's network conditions improve, the system will automatically switch to a higher bitrate video stream to improve the image quality.
[0067] In the above steps, the main process of video stream switching includes the following specific steps:
[0068] S201: Pull the live video stream from the cloud video on demand server according to the preset configuration, and initialize the video stream decoder;
[0069] S202: After the video stream decoder is initialized, determine whether a stream switching instruction is received;
[0070] S203: If a stream switching instruction is received, set the stream switching status code (status code: 1);
[0071] S204: Start the sub-thread for the stream switching process. This sub-thread mainly initializes the decoder for the target video stream. The time-consuming part of this process is mainly reflected in initializing the decoder and waiting for the key frame;
[0072] S205: Determine whether the decoder needs to be replaced (status code: 2), and determine whether the target video stream in the stream switching sub-thread is initialized and the key frame is obtained;
[0073] S206: Set the stream switching status (status code: 3), and poll and wait for the status code to become non-2 (the initialization of the target stream decoder ends) or non-3 (the main process is ready to fetch video frames);
[0074] S207: Obtain the decoder and decode the video frame data;
[0075] S208: Encode the video frame according to the preset encoding information and push it to the cloud VOD server. If the main process does not receive a stop push instruction, it will continue to poll and execute the subsequent steps starting from S202.
[0076] The video stream switching sub-process includes the following specific steps:
[0077] S301: Obtain the target video stream address for stream switching;
[0078] S302: Initialize the decoder according to the target video stream address;
[0079] S303: After the decoder is initialized, set the stream switching status (status code: 2);
[0080] S304: Poll and wait for the stream switching status code to become non-2 (wait for the main process S206 to set it to 3);
[0081] S305: Close the original video stream and replace the decoder in the main process;
[0082] S306: Set the stream switching status to the initial state (status code: 0); the sub-process will end, and in the main process, S207 will directly use the decoder initialized in the sub-process to fetch video frame data for encoding.
[0083] The present invention significantly improves the user experience by efficiently and automatically generating multi-bitrate video streams and intelligently switching during playback. This solution combines multi-threading technology and synchronization mechanisms, has lower requirements for hardware, supports automatic transcoding and switching of high-resolution video streams, and does not require separate transcoding processing, providing users with a smoother and higher-quality video experience.
Claims
1. A method for automatic transcoding and automatic multi-bitrate switching based on cloud video on demand, characterized in that It includes the following steps: S101. Obtain the original video through the cloud video-on-demand service and start pulling the stream; S102. Automatically transcode according to the preset transcoding strategy to generate multiple video streams with different bitrates; S103. Store the generated multi-bitrate video streams in the cloud video-on-demand; S104. When the user requests to play a video, dynamically select the most suitable bitrate video stream for playback according to the user's network condition and terminal capabilities; S105. During the playback process, continuously monitor the user's network condition and terminal capabilities. If it is found that the user's network condition changes, automatically switch to the video stream with the optimal bitrate.
2. The method for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand according to claim 1, wherein: In step S101, it is necessary for the cloud video-on-demand to receive the video stream for processing; the service provider deploys a cloud video-on-demand service to receive the push of the original video stream and receive the video stream after being processed by the video stream switching service.
3. The method for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand according to claim 1, wherein: In step S102, the transcoding strategy is preset according to the complexity of the video content, the network condition of the target user, and the terminal capabilities; the transcoding process of the video stream is to decode the original video stream through the cloud video-on-demand; The built-in transcoding function of the cloud video-on-demand platform will decode the original video stream and then re-encode it according to the preset transcoding strategy to generate video streams with different bitrates.
4. The method for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand according to claim 1, wherein: In step S103, the storage and transmission of the video stream are implemented through a distributed storage system.
5. The method for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand according to claim 1, wherein: In step S104, when the user requests to play a video, the system will first detect the user's network condition and terminal capabilities, and then dynamically select the most suitable bitrate video stream for playback according to this information.
6. The method for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand according to claim 1, wherein: In step S105, the detection of the user's network condition is realized through network detection technology, and the detection of the terminal capabilities is realized through obtaining device information; the switching process of the video stream is realized through multi-thread technology and synchronization mechanism.
7. The method for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand according to claim 1, wherein: In step S105, the main process of video stream switching includes the following specific steps: S201: Pull the live video stream from the cloud video-on-demand server according to the preset configuration and initialize the video stream decoder; S202: After the initialization of the video stream decoder is completed, determine whether a stream switching instruction is received; S203: If a stream switching instruction is received, set the stream switching status code, and the status code is 1; S204: Start the sub-thread of the stream switching process. This sub-thread mainly initializes the decoder of the target video stream. The time-consuming of this process is mainly reflected in the initialization of the decoder and waiting for the key frame; S205: Determine whether the decoder needs to be replaced, and the status code is 2; determine whether the target video stream in the stream switching sub-thread is initialized and the key frame is obtained; S206: Set the stream switching status, and the status code is 3; and poll and wait for the status code to become non-2 or non-3; S207: Obtain the decoder and decode the video frame data; S208: Encode the video frame according to the preset encoding information and push it to the cloud video-on-demand server. If the main process does not receive a stop pushing stream instruction, continue to poll and execute the subsequent steps from S202.
8. The method for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand according to claim 7, characterized in that: The sub-process of video stream switching includes the following specific steps: S301: Obtain the address of the target video stream for stream switching; S302: Initialize the decoder according to the target video stream address; S303: After the initialization of the decoder is completed, set the stream switching status, and the status code is 2; S304: Poll and wait for the commutation status code to become non-2, and wait for the main process step S206 to be set to 3; S305: Close the original video stream and replace the decoder in the main process; S306: Set the commutation status to the initial state with the status code being 0; the subprocess will end, and in the main process, step S207 will directly use the decoder initialized in the subprocess to obtain video frame data for encoding.
9. A system for automatic transcoding and automatic multi-bitrate switching based on cloud video-on-demand, characterized in that: The system includes: A cloud video-on-demand module that receives uploaded videos; A transcoding module that automatically transcodes to generate multiple video streams with different bitrates according to a preset transcoding strategy; A storage module that stores the generated multi-bitrate video streams to the cloud video-on-demand; A playback control module that, when a user requests to play a video, dynamically selects the most suitable bitrate video stream for playback according to the user's network condition and terminal capabilities; A switching module that, during playback, monitors the user's network condition and terminal capabilities in real time and automatically switches to the video stream with the best bitrate.