Video playing method and device, computer device and storage medium
By dynamically determining the target decoding capability, the video playback compatibility problem caused by differences in the decoding capabilities of user devices is solved, and a high-efficiency, low-consumption video playback solution is achieved.
Patent Information
- Application Number
- CN202211453023.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-11-21
AI Technical Summary
During video playback, there are differences in decoding capabilities among different user devices, causing some devices to be unable to parse the video. Existing technologies struggle to achieve efficient playback across all user devices while reducing performance consumption.
By determining the first device's decoding capability, the video is encoded and fed back to the second device for decoding. The target decoding capability is dynamically determined based on the decoding result, ensuring that all devices can decode and play the video in a compatible manner.
It improves video playback efficiency on various user devices, reduces encoder performance consumption and network bandwidth consumption, and ensures smooth video playback on all devices.
Smart Images

Figure CN115866294B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video processing technology, and in particular to a video playback method, apparatus, computer device, and storage medium. Background Technology
[0002] With the explosive growth of consumer electronics products, video applications such as video social networking, live video streaming, and short video playback have emerged on a large scale. During the process of transmitting video to multiple user devices, due to the differences in the video decoding capabilities of different user devices, some user devices may be unable to decode the video.
[0003] Currently, to ensure compatibility with a large number of user devices, encoders in video processing systems often perform multi-channel encoding for different user devices, or, to reduce video encoding costs, only consider a subset of user devices with the same decoding capabilities, requiring only single-channel encoding. However, multi-channel encoding increases encoder performance overhead, while single-channel encoding necessitates abandoning video transmission to some user devices. Therefore, how to ensure efficient video playback while reducing performance overhead and maintaining compatibility with all user devices is the problem this application aims to solve. Summary of the Invention
[0004] Therefore, it is necessary to provide a video playback method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve video playback efficiency in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a video playback method. The method includes:
[0006] Upon receiving an initial playback request from a first device, the first decoding capability of the first device is determined, and the video to be played corresponding to the video identifier carried in the initial playback request is encoded according to the first decoding capability to obtain an initial encoded video.
[0007] Upon receiving an actual playback request for the video identifier from the second device, the initial encoded video is fed back to the second device; the fed-back initial encoded video is used to trigger the second device to decode the initial encoded video using the second decoding capability corresponding to the second device, and obtain a decoding result;
[0008] Receive the decoding result returned by the second device, and when the decoding result is a preset target result, obtain the target decoding capability based on the first decoding capability and the second decoding capability;
[0009] The target decoding capability is fed back to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability.
[0010] In one embodiment, the first decoding capability includes a first bitrate, a first resolution, and a first video protocol; determining the first decoding capability of the first device includes: determining the current network status of the first device when sending the initial playback request, and determining the first bitrate corresponding to the current network status; determining the device information of the first device, and determining the first resolution based on the device information; and filtering out the first video protocol corresponding to the first device from a video protocol library.
[0011] In one embodiment, encoding the video to be played corresponding to the video identifier carried in the initial playback request to obtain the initial encoded video according to the first decoding capability includes: performing protocol conversion on the video to be played corresponding to the video identifier through the first video protocol to obtain a first candidate video; and encoding the first candidate video according to the first resolution to obtain the initial encoded video.
[0012] In one embodiment, the second decoding capability includes a second bitrate, a second resolution, and a second video protocol; feeding back the initial encoded video to the second device includes: transmitting the initial encoded video to the second device according to the second bitrate; the first decoding capability includes a first video protocol; after feeding back the initial encoded video to the second device, the method further includes: using the second device, when the protocol level of the second video protocol is greater than or equal to the protocol level of the first video protocol, performing protocol conversion on the initial encoded video according to the second video protocol to obtain a second candidate video; using the second device, decoding the second candidate video according to the second resolution to obtain a decoding result.
[0013] In one embodiment, the method further includes: when the protocol level of the second video protocol is lower than the protocol level of the first video protocol, determining the decoding result as a preset target result.
[0014] In one embodiment, the method further includes: when the second device does not receive the initial encoded video, determining that the decoding result is a preset target result.
[0015] In one embodiment, the first decoding capability includes a first video protocol and a first resolution; the second decoding capability includes a second video protocol and a second resolution; the target decoding capability includes a target bitrate, a target resolution, and a target video protocol; obtaining the target decoding capability based on the first decoding capability and the second decoding capability includes: selecting the video protocol that meets preset conditions from the first video protocol and the second video protocol as the target video protocol; filtering the target resolution from the first resolution and the second resolution according to preset filtering rules; determining the actual network conditions at the current time, and determining the target bitrate corresponding to the actual network conditions.
[0016] Secondly, this application also provides a video playback device. The device includes:
[0017] The encoded video determination module is used to determine the first decoding capability of the first device when receiving an initial playback request sent by the first device, and to encode the video to be played corresponding to the video identifier carried in the initial playback request according to the first decoding capability to obtain an initial encoded video.
[0018] The decoding result determination module is used to send the initial encoded video back to the second device when it receives an actual playback request for the video identifier sent by the second device; the initial encoded video sent back is used to trigger the second device to decode the initial encoded video through the second decoding capability corresponding to the second device to obtain a decoding result;
[0019] The decoding capability determination module is used to receive the decoding result returned by the second device, and when the decoding result is a preset target result, to obtain a target decoding capability based on the first decoding capability and the second decoding capability; to feed back the target decoding capability to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability respectively.
[0020] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0021] Upon receiving an initial playback request from a first device, the first decoding capability of the first device is determined, and the video to be played corresponding to the video identifier carried in the initial playback request is encoded according to the first decoding capability to obtain an initial encoded video.
[0022] Upon receiving an actual playback request for the video identifier from the second device, the initial encoded video is fed back to the second device; the fed-back initial encoded video is used to trigger the second device to decode the initial encoded video using the second decoding capability corresponding to the second device, and obtain a decoding result;
[0023] Receive the decoding result returned by the second device, and when the decoding result is a preset target result, obtain the target decoding capability based on the first decoding capability and the second decoding capability;
[0024] The target decoding capability is fed back to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability.
[0025] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the following steps:
[0026] Upon receiving an initial playback request from a first device, the first decoding capability of the first device is determined, and the video to be played corresponding to the video identifier carried in the initial playback request is encoded according to the first decoding capability to obtain an initial encoded video.
[0027] Upon receiving an actual playback request for the video identifier from the second device, the initial encoded video is fed back to the second device; the fed-back initial encoded video is used to trigger the second device to decode the initial encoded video using the second decoding capability corresponding to the second device, and obtain a decoding result;
[0028] Receive the decoding result returned by the second device, and when the decoding result is a preset target result, obtain the target decoding capability based on the first decoding capability and the second decoding capability;
[0029] The target decoding capability is fed back to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability.
[0030] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0031] Upon receiving an initial playback request from a first device, the first decoding capability of the first device is determined, and the video to be played corresponding to the video identifier carried in the initial playback request is encoded according to the first decoding capability to obtain an initial encoded video.
[0032] Upon receiving an actual playback request for the video identifier from the second device, the initial encoded video is fed back to the second device; the fed-back initial encoded video is used to trigger the second device to decode the initial encoded video using the second decoding capability corresponding to the second device, and obtain a decoding result;
[0033] Receive the decoding result returned by the second device, and when the decoding result is a preset target result, obtain the target decoding capability based on the first decoding capability and the second decoding capability;
[0034] The target decoding capability is fed back to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability.
[0035] The aforementioned video playback method, apparatus, computer device, storage medium, and computer program product, upon receiving an initial playback request from a first device, determine the first device's first decoding capability, and then encode the video to be played corresponding to a video identifier based on the first decoding capability to obtain an initial encoded video. Upon receiving an actual playback request for a video identifier from a second device, the initial encoded video is fed back to the second device, triggering the second device to obtain a decoding result. When the decoding result returned by the second device is received, and the decoding result is a preset target result, the target decoding capability can be obtained based on the first and second decoding capabilities. Thus, the target decoding capability can be fed back to both the first and second devices, triggering both devices based on the fed-back target decoding capability, thereby achieving the decoding and playback of the video to be played. Since this application determines the target decoding capability directly based on the first decoding capability and the second decoding capability when the decoding result is a preset target result, compared with the traditional method that can only perform multi-channel encoding or single-channel encoding, this application can dynamically determine the target decoding capability that both the first device and the second device meet based on the decoding capabilities of different user devices, so as to ensure compatibility with all user devices. Therefore, it improves the efficiency of subsequent playback of video by multiple user devices.
[0036] Meanwhile, since the same target decoding capability is used to trigger different user devices to decode the video to be played, it not only maintains the encoder performance consumption without additional increase, but also ensures the output of one channel of encoded video by the encoder, thereby greatly reducing the consumption of network bandwidth. Attached Figure Description
[0037] Figure 1 This is a diagram illustrating the application environment of a video playback method in one embodiment;
[0038] Figure 2 This is a flowchart illustrating a video playback method in one embodiment;
[0039] Figure 3 This is a block diagram illustrating the principle of sending a playback request in one embodiment;
[0040] Figure 4 This is a block diagram illustrating the principle of determining the target decoding capability in one embodiment;
[0041] Figure 5 This is a flowchart illustrating the process of determining the decoding result in one embodiment;
[0042] Figure 6 This is a structural block diagram of a video playback device in one embodiment;
[0043] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0045] The video playback method provided in this application can be applied to, for example... Figure 1In the illustrated application environment, there are a first device 102, an encoder 104, and a second device 106. The first device 102 communicates with the encoder 104 via a network, and the second device 106 also communicates with the encoder 104 via a network. The first device 102 sends an initial playback request carrying a video identifier to the encoder 104. Upon receiving the initial playback request, the encoder 104 determines the first device's first decoding capability and encodes the video to be played corresponding to the video identifier according to the first decoding capability, obtaining an initial encoded video. The second device 106 sends an actual playback request carrying the video identifier to the encoder 104, causing the encoder 104 to feed back the initial encoded video to the second device 106 and triggering the second device 106 to decode the initial encoded video according to its second decoding capability, obtaining a decoding result. The second device 106 then returns the decoding result to the encoder 104. When the decoding result is a preset target result, encoder 104 obtains the target decoding capability based on the first decoding capability and the second decoding capability, and feeds back the target decoding capability to the first device 102 and the second device 106 respectively, thereby triggering the first device 102 and the second device 106 to decode and play the video to be played according to the target decoding capability. The first device 102 and the second device 106 can be, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and encoder 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0046] In one embodiment, such as Figure 2 As shown, a video playback method is provided, which can be applied to... Figure 1 Taking the encoder in the example, the following steps are included:
[0047] Step 202: Upon receiving an initial playback request from the first device, determine the first decoding capability of the first device, and encode the video to be played corresponding to the video identifier carried in the initial playback request according to the first decoding capability to obtain the initial encoded video.
[0048] The first device and the second device can be different user devices in the same cluster and shared network. When multiple user devices need to share the same video to be played sent by the video terminal, the encoder in the video terminal can send the video to be played to the corresponding user devices respectively, so that each user device can decode and play the video to be played.
[0049] Specifically, when the first device responds to a user's trigger operation, it generates an initial playback request carrying a video identifier and sends the initial playback request to the decoder. At this point, the decoder can determine the first device's initial decoding capability. Since the first device includes components such as a CPU, memory, graphics card, and motherboard, the device's performance can be used to determine the first device's initial decoding capability.
[0050] Since the encoder transmits video images, it integrates multiple video protocols, such as H.264 and H.265. Similarly, because the first device needs to decode the video, it also includes decoding capabilities for multiple video protocols; that is, the first decoding capability includes the first video protocol. Therefore, based on the first decoding capability, the server can encode the video to be played corresponding to the video identifier, obtaining an initial encoded video that conforms to the first video protocol.
[0051] In one embodiment, when only one first device needs to play the video to be played, the encoder receives the initial playback request sent by the first device, determines the first decoding capability of the first device, and triggers the first device to directly decode and play the video to be played based on the first decoding capability.
[0052] In one embodiment, when only one first device needs to play the video to be played, the encoder receives an initial playback request sent by the first device, wherein the initial playback request carries the first device's first decoding capability, such as... Figure 3 As shown, Figure 3 This is a block diagram illustrating the principle of sending a playback request. After receiving the initial playback request, the encoder encodes the video to be played according to the first decoding capability, obtaining an initial encoded video, and sends the initial encoded video to the first device, so that the first device can decode and play the initial encoded video according to the first decoding capability.
[0053] Step 204: Upon receiving the actual playback request for the video identifier sent by the second device, the initially encoded video is fed back to the second device.
[0054] The initial encoded video feedback is used to trigger the second device to decode the initial encoded video using the second decoding capability corresponding to the second device, and obtain the decoding result.
[0055] Specifically, the initial playback request sent by the first device can be used to determine the playback status of the video to be played corresponding to the video identifier. Based on the playback status, subsequent operations on the encoder can be determined. When the playback status is playable, it indicates that the second device can continue to send actual playback requests to the encoder; when the playback status is not playable, it is necessary to check the encoder's device usage or network connection status, etc. (Reference) Figure 3 As shown, when the second device responds to a user's trigger operation, it generates an actual playback request for the video identifier and sends the request to the decoder. The decoder can then determine the second device's second decoding capability based on its device performance. Once the decoder determines the second device's second decoding capability, it can send the initially encoded video back to the second device.
[0056] In one embodiment, when the second device receives the initial encoded video, it can decode the initial encoded video using its second decoding capability to obtain a decoding result. The initial encoded video is obtained using the first device's first decoding capability, and the decoding result is obtained using the second device's second decoding capability. When the decoding result indicates successful decoding, the second device can complete the playback of the video to be played. This can be considered as the first and second decoding capabilities being identical, and in this case, the encoder does not need to switch between the encoding and decoding processes.
[0057] Step 206: Receive the decoding result returned by the second device, and when the decoding result is the preset target result, obtain the target decoding capability based on the first decoding capability and the second decoding capability.
[0058] The preset target result can be decoding failure, which means that the first decoding capability and the second decoding capability are not the same. In this case, the encoder needs to switch between the encoding and decoding processes.
[0059] The first decoding capability includes a first video protocol and a first resolution; the second decoding capability includes a second video protocol and a second resolution; and the target decoding capability includes a target bitrate, a target resolution, and a target video protocol.
[0060] In one embodiment, obtaining the target decoding capability based on the first decoding capability and the second decoding capability includes: selecting the video protocol that meets the preset conditions from the first video protocol and the second video protocol as the target video protocol; selecting the target resolution from the first resolution and the second resolution according to the preset filtering rules; determining the actual network conditions at the current moment, and determining the target bitrate corresponding to the actual network conditions.
[0061] The preset conditions can be to filter video protocols with high protocol levels or video protocols that are more compatible with user devices; the filtering rules can be to filter resolutions with smaller values.
[0062] Specifically, such as Figure 4 As shown, Figure 4The block diagram illustrates the principle for determining the target decoding capability. The encoder can select the video protocol with the higher protocol level from the first and second video protocols as the target video protocol, and the resolution with the smaller numerical value from the first and second resolutions as the target resolution. The encoder also needs to acquire the actual network conditions in real time and determine the target bitrate corresponding to those conditions, where the target bitrate represents the transmission speed required to decode the target capability.
[0063] In this embodiment, because the encoder determines the target bitrate in real time and dynamically according to the actual network conditions, the target decoding capability and the encoded data to be played can be effectively transmitted, thereby saving network bandwidth.
[0064] Step 208: Feed back the target decoding capability to the first device and the second device respectively.
[0065] The feedback target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability.
[0066] Specifically, the encoder transmits the target decoding capability to the first device and the second device respectively according to the target bit rate in the target decoding capability. When the target decoding capability is completed and feedback is received, it indicates that the video to be played can be shared and played on the first device and the second device.
[0067] In one embodiment, before feeding back the target decoding capability to the first device and the second device respectively, the method further includes: the encoder encoding the video to be played corresponding to the video identifier according to the target decoding capability to obtain the actual encoded video.
[0068] In one embodiment, the encoder transmits the actual encoded video to the first device and the second device respectively according to the target bitrate, so that both the first device and the second device can decode the actual encoded video through the target decoding capability, thereby completing the playback of the video to be played.
[0069] The aforementioned video playback method, upon receiving an initial playback request from a first device, determines the first device's first decoding capability and then encodes the video to be played corresponding to the video identifier based on the first decoding capability, obtaining an initial encoded video. Upon receiving an actual playback request for the video identifier from a second device, the initial encoded video is fed back to the second device, triggering it to obtain a decoding result. When the decoding result returned by the second device is received, and the decoding result matches a preset target result, the target decoding capability can be obtained based on the first and second decoding capabilities. Thus, the target decoding capability can be fed back to both the first and second devices, triggering them based on the fed-back target decoding capability, thereby achieving the decoding and playback of the video to be played. Because this application determines the target decoding capability directly based on the first and second decoding capabilities when the decoding result is a preset target result, compared to the traditional method that can only perform multi-channel encoding or single-channel encoding, this application can dynamically determine the target decoding capability that both the first and second devices meet based on the decoding capabilities of different user devices, ensuring compatibility with all user devices. Therefore, it improves the efficiency of subsequent playback of video by multiple user devices. At the same time, since the same target decoding capability is used to trigger different user devices to decode the video to be played, it maintains the encoder performance consumption without additional increase and ensures the output of one channel of encoded video by the encoder, thereby greatly reducing the consumption of network bandwidth.
[0070] In one embodiment, determining the first decoding capability of the first device includes: determining the current network status of the first device when sending the initial playback request, and determining the first bitrate corresponding to the current network status; determining the device information of the first device, and determining the first resolution based on the device information; and filtering out the first video protocol corresponding to the first device from the video protocol library.
[0071] The first decoding capability includes the first bitrate, the first resolution, and the first video protocol.
[0072] Specifically, since the network conditions of the first device often change, the network conditions at the time the initial playback request was sent can be selected as the current network conditions to determine the corresponding first bitrate. For example, the bitrate could be 1Mbps, 2Mbps, etc. The device information may contain the first resolution at the time of manufacture or device information such as memory included in the first device. Therefore, the encoder can directly read the first resolution from the device information or determine the first resolution through analysis and calculation of the device information. For example, the first resolution could be 1080p, 720p, etc. The encoder pre-stores the association between device identifiers and video protocols, and integrates multiple video protocols. Therefore, the encoder can select the first video protocol corresponding to the first device from a video protocol library that integrates multiple video protocols based on the device identifier and the association.
[0073] The specific implementation process for determining the second decoding capability of the second device can be referred to the specific implementation process for determining the first decoding capability of the first device, and will not be repeated here.
[0074] In this embodiment, by accurately obtaining the device information of the first device, the first resolution and the first video protocol of the first device can be quickly obtained, and by determining the target bitrate in real time and dynamically, the first decoding capability of the first device can be accurately obtained.
[0075] In one embodiment, according to a first decoding capability, the video to be played corresponding to the video identifier carried in the initial playback request is encoded to obtain an initial encoded video, including: performing protocol conversion on the video to be played corresponding to the video identifier through a first video protocol to obtain a first candidate video; and encoding the first candidate video according to a first resolution to obtain the initial encoded video.
[0076] Specifically, the encoder performs protocol conversion on the video to be played corresponding to the video identifier using a first video protocol. That is, after processing the video to be played, such as video compression, a first candidate video that can be transmitted efficiently is obtained. In order for the first candidate video to be played smoothly on the first device, it is also necessary to encode the first candidate video according to a first resolution, that is, to obtain an initial encoded video at the first resolution. At this time, the initial encoded video still needs to be transmitted to the first device through the network.
[0077] In this embodiment, by using the first video protocol and the first resolution, an initial encoded video that meets the first decoding capability can be accurately obtained, enabling the subsequent first device to accurately complete the video decoding.
[0078] In one embodiment, feeding back the initial encoded video to the second device includes: transmitting the initial encoded video to the second device according to a second bitrate. The second decoding capability further includes the second bitrate; the encoder can determine the current network conditions when the second device sends an actual playback request, and then determine the second bitrate corresponding to the current network conditions, i.e., the propagation speed at which the initial encoded video can currently be propagated, so that the encoder transmits the initial encoded video to the second device according to the second bitrate.
[0079] In one embodiment, such as Figure 5 As shown, Figure 5 This is a flowchart illustrating the process of determining the decoding result. After the initial encoded video is fed back to the second device, the following steps are also included:
[0080] Step 502: Using the second device, when the protocol level of the second video protocol is greater than or equal to the protocol level of the first video protocol, the initial encoded video is converted according to the second video protocol to obtain the second candidate video.
[0081] Specifically, the encoder can determine the protocol levels corresponding to the second and first video protocols. For example, if the first video protocol is h264 and the second video protocol is h265, according to national video protocol standards, the protocol level of h265 is higher than that of h264. When the protocol level of the second video protocol is greater than or equal to the protocol level of the first video protocol, it can be understood that the first decoding capability corresponding to the first video protocol is weaker than the second decoding capability corresponding to the second video protocol. Therefore, the second device can continue to use the stronger second video protocol to perform protocol conversion on the initially encoded video to obtain the second candidate video.
[0082] Step 504: Using the second device, decode the second candidate video according to the second resolution to obtain the decoding result.
[0083] Specifically, in order for the second candidate video to play smoothly on the second device, it needs to be decoded according to the second resolution to obtain the decoding result. When the second candidate video is successfully decoded according to the second resolution, the decoding result is determined to be successful; when the second candidate video fails to be decoded according to the second resolution, the decoding result is determined to be unsuccessful.
[0084] In one embodiment, when the decoding result is successful, it indicates that the second video protocol and second resolution corresponding to the second device are both higher than the first video protocol and first resolution corresponding to the first device. That is, the second video protocol is compatible with the first video protocol, and the second resolution is compatible with the first resolution. Therefore, the second device can obtain the initial encoded video sent by the encoder and the first decoding capability of the first device, and decode the initial encoded video using the first decoding capability to obtain the video to be played. In this way, the encoder does not need to perform encoding switching to output the initial encoded video with the same characteristics, and the second device does not need to perform decoding switching, reducing the consumption of device resources.
[0085] In one embodiment, the method further includes: when the protocol level of the second video protocol is lower than the protocol level of the first video protocol, determining the decoding result as a preset target result.
[0086] In this context, it's easy to understand that the preset target result is decoding failure. The protocol level of the second video protocol is lower than that of the first video protocol. This can be understood as the first decoding capability corresponding to the first video protocol being stronger than the second decoding capability corresponding to the second video protocol. When the encoder uses the stronger first video protocol to encode the initial encoded video, the second device then uses the weaker second video protocol to decode it, and the resulting decoding result is usually decoding failure.
[0087] In one embodiment, the method further includes: when the second device does not receive the initial encoded video, determining that the decoding result is a preset target result.
[0088] The fact that the second device did not receive the initial encoded video indicates that, under the network conditions of the second bitrate, the encoder could not successfully send the initial encoded video to the second device. This means that a subsequent switch to the second bitrate is required to accurately obtain the target bitrate. The specific implementation process for determining the target bitrate can be found in step 206, which will not be elaborated upon in this embodiment.
[0089] In this embodiment, by comparing the protocol levels between the second video protocol and the first video protocol, different execution processes are determined. After obtaining the second candidate video through the second video protocol, it is possible to further determine whether it is the decoding result of the second resolution, thereby accurately obtaining the preconditions for switching the encoding and improving the efficiency of subsequently obtaining the target decoding capability.
[0090] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0091] Based on the same inventive concept, this application also provides a video playback device for implementing the video playback method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more video playback device embodiments provided below can be found in the limitations of the video playback method described above, and will not be repeated here.
[0092] In one embodiment, such as Figure 6 As shown, a video playback device 600 is provided, including: an encoded video determination module 602, a decoding result determination module 604, and a decoding capability determination module 606, wherein:
[0093] The encoded video determination module 602 is used to determine the first decoding capability of the first device when receiving an initial playback request sent by the first device, and to encode the video to be played corresponding to the video identifier carried in the initial playback request according to the first decoding capability to obtain the initial encoded video.
[0094] The decoding result determination module 604 is used to send back the initial encoded video to the second device when it receives the actual playback request for the video identifier sent by the second device; the initial encoded video is used to trigger the second device to decode the initial encoded video through the second decoding capability corresponding to the second device to obtain the decoding result.
[0095] The decoding capability determination module 606 is used to receive the decoding result returned by the second device, and when the decoding result is a preset target result, to obtain the target decoding capability according to the first decoding capability and the second decoding capability; to feed back the target decoding capability to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability respectively.
[0096] In one embodiment, the encoded video determination module 602 includes a protocol determination module 6021, which is used to determine the current network status of the first device when it sends an initial playback request, and determine the first bitrate corresponding to the current network status; determine the device information of the first device, and determine the first resolution based on the device information; and filter out the first video protocol corresponding to the first device from the video protocol library.
[0097] In one embodiment, the encoded video determination module 602 further includes a protocol conversion module 6022, which is used to perform protocol conversion on the video to be played corresponding to the video identifier through a first video protocol to obtain a first candidate video; and to encode the first candidate video according to a first resolution to obtain an initial encoded video.
[0098] In one embodiment, the decoding result determination module 604 is further configured to transmit the initial encoded video to the second device according to the second bitrate; through the second device, when the protocol level of the second video protocol is greater than or equal to the protocol level of the first video protocol, the initial encoded video is converted according to the second video protocol to obtain the second candidate video; through the second device, the second candidate video is decoded according to the second resolution to obtain the decoding result.
[0099] In one embodiment, the decoding result determination module 604 is further configured to determine the decoding result as a preset target result when the protocol level of the second video protocol is lower than the protocol level of the first video protocol.
[0100] In one embodiment, the decoding result determination module 604 is further configured to determine the decoding result as a preset target result when the second device does not receive the initial encoded video.
[0101] In one embodiment, the decoding capability determination module 606 is further configured to select the video protocol that meets the preset conditions from the first video protocol and the second video protocol as the target video protocol; select the target resolution from the first resolution and the second resolution according to the preset filtering rules; determine the actual network conditions at the current moment, and determine the target bitrate corresponding to the actual network conditions.
[0102] Each module in the aforementioned video playback device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0103] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 7As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores video playback data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a video playback method.
[0104] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0105] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0106] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0107] In one embodiment, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps described in the method embodiments above.
[0108] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0109] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0110] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A video playback method, characterized in that, Performed by the encoder, the method includes: Upon receiving an initial playback request from a first device, the first decoding capability of the first device is determined, and the video to be played corresponding to the video identifier carried in the initial playback request is encoded according to the first decoding capability to obtain an initial encoded video. Upon receiving an actual playback request for the video identifier from the second device, the initial encoded video is fed back to the second device; the fed-back initial encoded video is used to trigger the second device to decode the initial encoded video using the second decoding capability corresponding to the second device, and obtain a decoding result; Receive the decoding result returned by the second device, and when the decoding result is a preset target result, obtain the target decoding capability based on the first decoding capability and the second decoding capability; The target decoding capability is fed back to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability.
2. The method according to claim 1, characterized in that, The first decoding capability includes a first bitrate, a first resolution, and a first video protocol; determining the first decoding capability of the first device includes: Determine the current network status of the first device when it sends the initial playback request, and determine the first bitrate corresponding to the current network status; Determine the device information of the first device, and determine the first resolution based on the device information; The first video protocol corresponding to the first device is selected from the video protocol library.
3. The method according to claim 2, characterized in that, The step of encoding the video to be played corresponding to the video identifier carried in the initial playback request according to the first decoding capability to obtain the initial encoded video includes: The first video protocol is used to convert the video to be played corresponding to the video identifier to obtain the first candidate video. The first candidate video is encoded according to the first resolution to obtain the initial encoded video.
4. The method according to claim 1, characterized in that, The second decoding capability includes a second bitrate, a second resolution, and a second video protocol; feeding back the initial encoded video to the second device includes: The initial encoded video is transmitted to the second device according to the second bitrate; The first decoding capability includes a first video protocol; after feeding back the initially encoded video to the second device, the method further includes: Using the second device, when the protocol level of the second video protocol is greater than or equal to the protocol level of the first video protocol, the initial encoded video is converted according to the second video protocol to obtain a second candidate video; The second candidate video is decoded using the second device according to the second resolution to obtain the decoding result.
5. The method according to claim 4, characterized in that, The method further includes: When the protocol level of the second video protocol is lower than that of the first video protocol, the decoding result is determined to be the preset target result.
6. The method according to claim 4, characterized in that, The method further includes: When the second device does not receive the initial encoded video, the decoding result is determined to be the preset target result.
7. The method according to claim 1, characterized in that, The first decoding capability includes a first video protocol and a first resolution; the second decoding capability includes a second video protocol and a second resolution; the target decoding capability includes a target bitrate, a target resolution, and a target video protocol. The step of obtaining the target decoding capability based on the first decoding capability and the second decoding capability includes: The video protocol that meets the preset conditions among the first video protocol and the second video protocol is taken as the target video protocol; According to the preset filtering rules, the target resolution is selected from the first resolution and the second resolution; Determine the actual network conditions at the current moment, and determine the target bit rate corresponding to the actual network conditions.
8. A video playback device, characterized in that, The device includes: The encoded video determination module is used to determine the first decoding capability of the first device when receiving an initial playback request sent by the first device, and to encode the video to be played corresponding to the video identifier carried in the initial playback request according to the first decoding capability to obtain an initial encoded video. The decoding result determination module is used to send the initial encoded video back to the second device when it receives an actual playback request for the video identifier sent by the second device; the initial encoded video sent back is used to trigger the second device to decode the initial encoded video through the second decoding capability corresponding to the second device to obtain a decoding result; The decoding capability determination module is used to receive the decoding result returned by the second device, and when the decoding result is a preset target result, to obtain a target decoding capability based on the first decoding capability and the second decoding capability; to feed back the target decoding capability to the first device and the second device respectively; the fed-back target decoding capability is used to trigger the first device and the second device to decode and play the video to be played according to the target decoding capability respectively.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multimedia redirection method, device and system
WO2016146078A1
Live broadcast method, system, server, and data storage medium
WO2018050049A1