A video playing method and related device
By parallelizing the DRM session initialization and media demultiplexing process and obtaining PSSH data in advance, the problem of slow video playback startup speed on the Android platform with Widevine DRM was solved, resulting in improved video playback response speed and user experience.
Patent Information
- Application Number
- CN202511547043.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-28
AI Technical Summary
On the Android platform, when playing Widevine DRM-encrypted DASH/fMP4 videos, there is a problem with slow playback startup speed, and users need to wait a long time to see the video content.
By parallelizing the DRM session initialization and media demultiplexing process, the protection system-specific header information (PSSH) is obtained in advance. The authorization license and protection system-specific header information are directly obtained from the server to initialize the decryption session and avoid waiting for the demultiplexing result.
It significantly reduces the initial loading time of video playback and improves video startup speed, especially in mobile environments with large network fluctuations, reducing loading latency and improving user experience.
Smart Images

Figure CN121037614B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video processing technology, and in particular to a video playback method and related apparatus. Background Technology
[0002] With increasing awareness of digital video copyright protection, mainstream online video platforms generally adopt DRM-based encrypted transmission mechanisms to prevent unauthorized copying and illegal distribution of content. On the Android platform, Widevine DRM has become the de facto standard for encrypted video playback and is widely used in various player architectures. Traditional players often experience slow playback startup when playing DASH / fMP4 videos protected by Widevine DRM (Digital Rights Management), requiring users to wait a considerable amount of time before seeing the video content. Summary of the Invention
[0003] In view of the above problems, this application provides a video playback method and related apparatus, the specific solution of which is as follows:
[0004] The first aspect of this application provides a video playback method, including:
[0005] The system receives a playback instruction for a target video and obtains the video link address, license, and protection system-specific header information of the target video from the server. The target video is a video encrypted based on digital rights management.
[0006] The decryption session is initialized based on the license and the specific header information of the protection system to obtain the decryption key;
[0007] The encrypted media stream of the target video is decrypted using the decryption key to obtain a plaintext media stream, which includes the video stream.
[0008] The plaintext media stream is decoded to obtain the original media stream;
[0009] Play the original media stream.
[0010] One possible implementation also includes:
[0011] The average bandwidth is determined based on the real-time values of preset network performance indicators, including download speed and network latency.
[0012] If the average bandwidth is greater than the preset bandwidth threshold, the current network status is determined to be good;
[0013] If the average bandwidth is not greater than the bandwidth threshold, the current network state is determined to be poor.
[0014] In one possible implementation, the video link address, license, and protection system-specific header information of the target video are obtained from the server, including:
[0015] Under the current poor network conditions, the video link address, the license, and the protection system-specific header information of the target video are obtained from the server.
[0016] In one possible implementation, the video playback method also includes:
[0017] Under the condition that the current network conditions are good, obtain the video link address and the authorization license of the target video from the server;
[0018] After receiving the demultiplexing result of the target video, the protection system-specific header information is extracted from the demultiplexing result.
[0019] The demultiplexing result includes the encrypted media stream of the target video and the protection system-specific header information; the demultiplexing result is obtained by demultiplexing the multimedia container file of the target video after receiving the playback instruction of the target video.
[0020] In one possible implementation, the encrypted media stream of the target video is decrypted using the decryption key to obtain a plaintext media stream, including:
[0021] After receiving the demultiplexing result of the target video, the encrypted media stream of the target video is extracted from the demultiplexing result;
[0022] In the decryption session, the encrypted media stream of the target video is decrypted using the decryption key to obtain the plaintext media stream.
[0023] In one possible implementation, the media stream further includes an audio stream; playing the original media stream includes:
[0024] Synchronize audio and video between plaintext video and plaintext audio streams;
[0025] By integrating the plaintext video stream and the plaintext audio stream after audio-visual synchronization, the target media stream is obtained;
[0026] Play the target media stream.
[0027] A second aspect of this application provides a video playback device, comprising:
[0028] The security information acquisition unit is used to receive the playback instruction of the target video, and obtain the video link address, license, and protection system-specific header information of the target video from the server. The target video is a video encrypted based on digital rights management.
[0029] The session initialization unit is used to initialize the decryption session based on the authorization license and the specific header information of the protection system, and obtain the decryption key;
[0030] The video decryption unit is used to decrypt the encrypted media stream of the target video using the decryption key to obtain a plaintext media stream, wherein the media stream includes the video stream;
[0031] A video decoding unit is used to decode the plaintext media stream to obtain the original media stream;
[0032] A video playback unit is used to play the original media stream.
[0033] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the video playback method described in the first aspect or any implementation thereof.
[0034] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0035] The memory is used to store computer programs;
[0036] The processor is used to execute the computer program so that the electronic device can implement the video playback method of the first aspect or any implementation thereof.
[0037] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the video playback method described in the first aspect or any implementation thereof.
[0038] By employing the above technical solution, this application provides a video playback method and related apparatus that receive a playback instruction for a target video, obtains the video link address, license, and protection system-specific header information of the target video from the server, where the target video is encrypted based on digital rights management (DRM). The decryption session is initialized based on the license and protection system-specific header information to obtain a decryption key. The encrypted media stream of the target video is decrypted using the decryption key to obtain a plaintext media stream, which includes the video stream. The plaintext media stream is decoded to obtain the original media stream, which is then played. It is evident that this method directly extracts the license and protection system-specific header information from the server, eliminating the need to wait for the demultiplexing result, thus enabling the initialization of the decryption session and improving the response speed of video playback. Attached Figure Description
[0039] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote 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.
[0040] Figure 1 A schematic diagram of a system architecture is provided for this application;
[0041] Figure 2 A flowchart illustrating a video playback method provided in an embodiment of this application;
[0042] Figure 3 A flowchart illustrating yet another video playback method provided in an embodiment of this application;
[0043] Figure 4 This is a schematic diagram of the specific structure of a video playback system provided in an embodiment of this application;
[0044] Figure 5 This is a schematic diagram of the structure of a video playback device provided in an embodiment of this application;
[0045] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0046] Terminology Explanation:
[0047] DRM (Digital Rights Management) refers to a technological means used to prevent the illegal copying and distribution of digital content. It protects copyright by encrypting media content such as audio and video, ensuring that only authorized users on legitimate devices can play the content.
[0048] Google Widevine DRM: A cross-platform DRM solution provided by Google, widely used in devices such as Android, Chrome browser, and smart TVs. Widevine supports streaming media formats such as MPEG-DASH and HLS, enabling secure decoding and playback of encrypted media, and is one of the main DRM technologies used by mainstream video platforms.
[0049] License: In a DRM system, a license is an authorization data packet issued by the content server, containing necessary information such as the decryption key. Before playing encrypted videos, the player must communicate with the license server to obtain a valid license in order to decrypt and play the video.
[0050] PSSH (Protection System Specific Header): A structure in MPEG-DASH and fMP4 containers used to carry DRM-related information. It contains content needed to identify the encryption scheme, such as the encryption system identifier (UUID) and initialization data. The player can use the PSSH data to determine which DRM system to use and initiate authentication.
[0051] MediaDrm is a system-level API provided by Android for managing DRM processes, such as creating sessions, requesting authorization, receiving keys, and co-decrypting with decoders. MediaDrm is responsible for interacting with DRM servers via PSSH and License, and controlling the secure use of content.
[0052] MediaCrypto: An intermediary interface provided by Android for connecting MediaDrm and the decoder (MediaCodec). MediaCrypto assists in the secure decryption of encrypted data during the decoding process, ensuring that content can only be accessed by authorized hardware or software modules.
[0053] MediaCodec: The interface for audio and video decoding on the Android platform, supporting hardware-accelerated decoding. It is responsible for converting compressed media data into playable audio / image frames. In DRM scenarios, MediaCodec works in conjunction with MediaCrypto to securely decode encrypted videos.
[0054] fMP4 (fragmented MP4): A variant of the MP4 video format that supports dividing video content into multiple independent segments. This structure is suitable for streaming media transmission, especially for adaptive playback protocols such as DASH, and supports embedding DRM information such as PSSH.
[0055] DASH (Dynamic Adaptive Streaming over HTTP): An international standard video streaming protocol. It organizes video into multiple bitrates and segments, allowing the player to dynamically select the appropriate resolution and segments based on network conditions, improving playback smoothness and stability.
[0056] FFmpeg is an open-source audio and video processing library and toolset that supports functions such as format parsing, demultiplexing, and transcoding. In this invention, FFmpeg is used to parse DASH files and fMP4 files, extracting media track information to provide data support for subsequent decoding and playback. The process of parsing files and extracting media track information is called demultiplexing.
[0057] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0058] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0059] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0060] To meet the demands of multi-bitrate adaptive playback, the MPEG-DASH standard is widely adopted for media encapsulation and transmission protocols, with media containers typically in fragmented MP4 (fMP4) format. When playing such resources, Android players rely on FFmpeg (a tool from the FastForward Motion Picture Experts Group) to parse the media resource, extract the PSSH (Protection System Specific Header) encapsulated in the fMP4 file, and pass the PSSH to the Android platform's MediaDrm (Digital Rights Management) interface for DRM session initialization, key request, and response. It is evident that the establishment of the DRM session depends on the result of FFmpeg initialization; the time consumed by FFmpeg initialization directly blocks DRM initialization, and the delay in DRM initialization further blocks subsequent decoding and integration processes. Therefore, this sequential processing flow leads to wasted time between media parsing and DRM authentication, especially under poor network conditions or when HTTP-based dynamic adaptive streaming media DASH is complex, resulting in slow loading of the first video frame, excessively long black screen times, and a negative impact on user experience.
[0061] Based on this, this application provides a video playback method applicable to Android platform players playing Widevine DRM video resources based on the DASH protocol and using the fMP4 encapsulation format. By decoupling and parallel reconstructing DRM initialization and media parsing, the parallel capabilities of the system are fully utilized to improve the startup speed of the first screen playback and optimize the video playback effect.
[0062] See Figure 1 , Figure 1 A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 can provide the methods provided in the embodiments of this application to one or more terminals.
[0063] The terminal 100 may have a video playback application installed. The application and webpage can provide an interface. The terminal 100 can receive relevant parameters input by the user on the video playback interface and send the parameters to the server 200. The server 200 can obtain the processing result based on the received parameters and return the processing result to the terminal 100.
[0064] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters on its own, without the need for the server to cooperate. This application embodiment is not limited to this.
[0065] The following description Figure 1 The product form of the mid-terminal 100;
[0066] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc., and this application embodiment does not impose any restrictions on it.
[0067] Terminal 100 may include a radio frequency unit, memory, input unit, display unit, camera (optional), audio circuitry (optional), speaker (optional), microphone (optional), headphone jack (optional), processor, external interface, power supply, and other components. Those skilled in the art will understand that the above-mentioned components are merely examples and do not constitute a limitation on the terminal or multifunctional device; it may include more or fewer components, or a combination of certain components, or different components.
[0068] The input unit can be used to receive input numeric or character information, and to generate key signal inputs related to user settings and function control of the portable multi-functional device. Specifically, the input unit may include a touchscreen (optional) and / or other input devices. Other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0069] Among them, the input device can receive input data, etc.
[0070] The display unit can be used to display information input by the user or information provided to the user, various menus of the terminal, interactive interfaces, file display, and / or playback of any multimedia file. In the embodiments of this application, the display unit can be used to display the video playback interface, processing results, etc.
[0071] The memory can be used to store software code related to the video playback method, the processor can execute the steps of the video playback method, and can also schedule other units (such as the above-mentioned input unit and display unit) to achieve the corresponding functions.
[0072] This radio frequency unit (optional) can be used to receive and send signals during information transmission or calls.
[0073] In this embodiment of the application, the radio frequency unit can send data to the server 200 and receive the processing results sent by the server 200.
[0074] It should be understood that this radio frequency unit is optional and can be replaced with other communication interfaces, such as a network port.
[0075] Terminal 100 also includes a power source (such as a battery) for supplying power to the various components.
[0076] Terminal 100 also includes an external interface, which can be a standard Micro USB interface or a multi-pin connector, which can be used to connect terminal 100 to other devices for communication or to connect a charger to charge terminal 100.
[0077] Server 200 includes a bus, a processor, a communication interface, and memory. The processor, memory, and communication interface communicate with each other via the bus.
[0078] The memory can be used to store software code related to the video playback method, the processor can execute the steps of the chip's video playback method, and can also schedule other units to achieve corresponding functions.
[0079] The video playback method of this application embodiment will be described in detail below with reference to the accompanying drawings.
[0080] This application provides a video playback method applied to a video playback system, which includes a server and a client. (Refer to...) Figure 2 , Figure 2 This is a flowchart illustrating a video playback method provided in an embodiment of this application, as shown below. Figure 2 As shown, it may include steps S201 to S205, which are described in detail below.
[0081] S201. Receive the playback instruction of the target video and obtain the video link address, license, and protection system-specific header information of the target video from the server.
[0082] In this embodiment, the target video is a video encrypted using Digital Rights Management (DRM).
[0083] In this embodiment, the server pre-associates and stores the unique identifier of each video with the corresponding protection system-specific header information PSSH, license, and video link URL. When the client requests playback data from the server, the PSSH, video link URL, and license information can be passed to the client together.
[0084] S202. Initialize the decryption session based on the license and protection system-specific header information to obtain the decryption key.
[0085] In this embodiment, decryption session initialization refers to creating a suitable environment and process for decryption. By combining the verification of the license and the reading of the protection system's specific header information, the various parameters and environment required for decryption are configured. After completing the decryption session initialization, a decryption key for decrypting data is generated based on the license and the protection system's specific header information, through a series of preset algorithms and rules.
[0086] S203. Use the decryption key to decrypt the encrypted media stream of the target video to obtain the plaintext media stream.
[0087] In this embodiment, the encrypted media stream of the target video is media stream data that has been compressed and encoded using a preset encoding algorithm and then encrypted using a preset encryption algorithm. The media stream includes video streams; that is, plaintext media streams include plaintext video streams.
[0088] In this embodiment, within the decryption environment generated based on the initialization of the decryption session, the decryption key is used as a parameter to decrypt the encrypted media stream according to a preset decryption algorithm. For example, using the AES (Advanced Encryption Standard) decryption algorithm, a series of permutations, substitutions, and XOR operations are performed on each data block in the encrypted media stream according to the decryption key to gradually decrypt and restore the plaintext media stream data.
[0089] S204. Decode the plaintext media stream to obtain the original media stream.
[0090] In this embodiment, decoding is the reverse process of encoding. Based on the algorithm rules used during encoding, the compressed plaintext media stream is reversed to reconstruct the original raw media stream data. For example, video, audio and other information compressed and organized in the plaintext media stream according to preset encoding rules are restored to the original, uncompressed raw media stream data.
[0091] S205, Play the original media stream.
[0092] As can be seen from the above technical solution, the video playback method provided in this application receives a playback instruction for a target video, obtains the video link address, license, and protection system-specific header information of the target video from the server, where the target video is a video encrypted based on Digital Rights Management (DRM). Based on the license and protection system-specific header information, a decryption session is initialized to obtain a decryption key. The decryption key is used to decrypt the encrypted media stream of the target video to obtain a plaintext media stream, which includes the video stream. The plaintext media stream is decoded to obtain the original media stream, which is then played. It is evident that this method directly extracts the license and protection system-specific header information from the server, eliminating the need to wait for the demultiplexing result, thus enabling the initialization of the decryption session and improving the response speed of video playback.
[0093] Based on the above embodiments, referring to Figure 3 , Figure 3 This is a schematic diagram illustrating the specific implementation process of a video playback method provided in an embodiment of this application, such as... Figure 3 As shown, this method may specifically include steps S301 to S313, which are described in detail below.
[0094] S301, Receive playback command for target video.
[0095] In this embodiment, the playback instruction for the target video includes a unique identifier (ID) for the target video, which is used to instruct the playback of the target video.
[0096] S302. Determine the average bandwidth based on the real-time values of preset network performance indicators.
[0097] In this embodiment, network performance metrics include download speed and network latency.
[0098] S303. If the average bandwidth is not greater than the bandwidth threshold, the current network status is determined to be poor.
[0099] S304. Under the current poor network conditions, obtain the video link address, license, and protection system-specific header information of the target video from the server.
[0100] S305. If the average bandwidth is greater than the preset bandwidth threshold, the current network status is determined to be good.
[0101] S306. Under the current good network conditions, obtain the video link address and license of the target video from the server.
[0102] S307. After receiving the demultiplexing result of the target video, extract the protection system-specific header information from the demultiplexing result of the target video.
[0103] In this embodiment, the demultiplexing result includes the encrypted media stream of the target video and the protection system-specific header information. The demultiplexing result is obtained by demultiplexing the multimedia container file of the target video after receiving the playback instruction. Specifically, FFmpeg demultiplexes the multimedia container file of the target video after receiving the playback instruction.
[0104] S308. Initialize the decryption session based on the license and protection system-specific header information to obtain the decryption key.
[0105] S309. In the decryption session, the encrypted media stream of the target video is decrypted using the decryption key to obtain the plaintext media stream.
[0106] S310. Decode the plaintext media stream to obtain the original media stream.
[0107] S311. Perform audio-visual synchronization on plaintext video stream and plaintext audio stream.
[0108] In this embodiment, the video stream and audio stream each carry time information indicating when the data should be presented. By comparing this time information with the actual system time, audio-visual time deviation is detected, and then a dynamic adjustment strategy is used to eliminate the deviation, thereby achieving audio-visual synchronization.
[0109] S312. Integrate the plaintext video stream and plaintext audio stream after audio-visual synchronization to obtain the target media stream.
[0110] In this embodiment, when integrating the plaintext video stream and plaintext audio stream after audio-visual synchronization, the consistency of the timestamps is checked again. For example, for each frame of video and its corresponding audio segment, the timestamp deviation should be controlled within a very small threshold (usually in the millisecond range or even lower) to avoid new desynchronization problems in subsequent playback or processing.
[0111] Furthermore, during the integration process, the synchronization status of audio and video is continuously monitored in real time. By comparing information such as playback progress and timestamps of video and audio, a correction mechanism is immediately activated if the deviation exceeds a preset threshold.
[0112] S313, Play the target media stream.
[0113] As can be seen from the above technical solutions, the video playback method provided in this application, specifically for DRM-encrypted videos, decouples and reconstructs the sequential structure of the traditional DRM playback process that relies on FFmpeg to extract PSSH data under poor network conditions. By pre-extracting PSSH data, the DRM session initialization and media demultiplexing processes are executed in parallel, significantly reducing the first-screen playback time. By parallelizing the DRM session initialization and FFmpeg media parsing processes, the serial waiting time is effectively reduced, video startup speed is improved, and the perceived first-screen black screen time is reduced. In mobile devices, especially in scenarios with large network fluctuations, this parallel mechanism can significantly reduce loading latency, improve video playback response speed, and enhance user experience.
[0114] Furthermore, under good network conditions, the protection system-specific header information is extracted from the demultiplexing results of the target video. It can be seen that, regarding the network adaptability issue when playing Widevine DRM encrypted videos, it can optimize server load when network conditions are good, and ensure playback startup speed and stability when network conditions are poor, achieving a balance between playback experience and performance.
[0115] Based on the above embodiments, referring to Figure 4 , Figure 4 This is a schematic diagram of the specific structure of a player provided in an embodiment of this application, such as... Figure 4 As shown, the player includes a network monitoring module, a playback request initialization module, a demultiplexing module, a MediaDrm module, a video decoding module, an audio-visual synchronization module, and a video rendering module.
[0116] Combination Figure 4 The following is a detailed implementation flow of a video playback method provided in an embodiment of this application:
[0117] 1. Network monitoring module:
[0118] Regularly monitor real-time download speed and network latency, calculate average bandwidth, compare the average bandwidth with a preset bandwidth threshold, and determine whether the current network status is good or poor.
[0119] 2. Playback request initialization module:
[0120] Based on the current network status, select the corresponding server interface to obtain information such as the video URL and license.
[0121] When the network is in good condition, obtain the video URL and license through server interface A, and set the license to the MediaDrm module.
[0122] When network conditions are poor, the video URL, license, and PSSH are obtained through server-side interface B, with the PSSH obtained directly from the server. The license and PSSH are then assigned to the MediaDrm module.
[0123] 3. Demultiplexing module FFmpeg:
[0124] A raw video file is typically large, so to save bandwidth, it usually undergoes compression and encapsulation processes on the server side. Compression reduces file size through video encoding, while encapsulation standardizes the video file format. FFmpeg loads the target video file through its interface, reads the DASH + fMP4 stream information and audio / video data based on the video URL, completes stream identification and demultiplexing preparation, and provides basic information such as media tracks, encoding type, and timestamps to achieve demultiplexing of the target video file. After decapsulating the target video file, FFmpeg passes the compressed video frames to the video decoding module.
[0125] When the network status is good, the FFmpeg interface is called to obtain the PSSH based on the video URL. Specifically, FFmpeg parses the PSSH embedded in fMP4 during demultiplexing and sets it to the MediaDrm module after obtaining the PSSH.
[0126] 4. MediaDrm module:
[0127] MediaDrm creates a DRM session and passes PSSH data to generate a KeyRequest.
[0128] Send a KeyRequest to the License server and obtain the KeyResponse required for decryption.
[0129] Set the obtained KeyResponse to the MediaDrm module.
[0130] Complete the key exchange and initialize the decryption session.
[0131] 5. Video decoding module (MediaCodec decoder):
[0132] The MediaCodec decoder receives the demultiplexing result from FFmpeg and sends the encrypted audio and video frames from the demultiplexing result to MediaCrypto. MediaCrypto then uses KeyResponse to decrypt the encrypted audio and video frames. In other words, through the collaboration between MediaCodec and MediaCrypto, audio decoding of the encrypted audio frames and video decoding of the encrypted video frames are completed.
[0133] 6. Audio-visual synchronization module:
[0134] The decoded audio and video frames are obtained from the decoder. The audio track is used as the clock reference. If the video frame arrives in advance, it will be buffered and wait for the audio to catch up. If the video frame is delayed, it may skip frames to catch up with the audio and output synchronized audio and video frames.
[0135] 7. Video rendering module:
[0136] Perform audio rendering and video rendering. Play the video rendering result, i.e., the video frame, through the playback interface, and play the audio rendering result through the audio output device.
[0137] In summary, the player provided in this application addresses the network adaptability issue when playing Widevine DRM-encrypted videos by proposing a PSSH acquisition and decoding processing scheme based on network condition adaptation. This scheme optimizes server load under good network conditions while ensuring playback startup speed and stability under poor network conditions, achieving a balance between playback experience and performance.
[0138] Specifically, the sequential structure of traditional DRM playback, which relies on FFmpeg to extract PSSH data, is decoupled and reconstructed. By pre-extracting PSSH data, the DRM session initialization and media demultiplexing processes are executed in parallel, significantly reducing the first-screen playback time. Parallelizing the DRM session initialization and FFmpeg media parsing processes effectively reduces serial waiting time, improves video startup speed, and reduces the perceived first-screen black screen time. On mobile devices, especially in scenarios with significant network fluctuations, this parallel mechanism can significantly reduce loading latency, improve video playback response speed, and enhance the user experience.
[0139] The above describes a video playback method provided by an embodiment of this application. The following describes an apparatus for performing the above video playback method.
[0140] This application also provides a video playback device in its embodiments. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of the structure of a video playback device provided in an embodiment of this application. Figure 5 As shown, the video playback device 500 includes:
[0141] The security information acquisition unit 501 is used to receive the playback instruction of the target video, and to obtain the video link address, license, and protection system specific header information of the target video from the server. The target video is a video encrypted based on digital rights management.
[0142] The session initialization unit 502 is used to initialize the decryption session based on the authorization license and the specific header information of the protection system, and obtain the decryption key;
[0143] The video decryption unit 503 is used to decrypt the encrypted media stream of the target video using the decryption key to obtain a plaintext media stream, wherein the media stream includes the video stream;
[0144] Video decoding unit 504 is used to decode the plaintext media stream to obtain the original media stream;
[0145] The video playback unit 505 is used to play the original media stream.
[0146] In one possible implementation, a network status monitoring unit is also included, which is used to determine the average bandwidth based on the real-time values of preset network performance indicators, including download speed and network latency; if the average bandwidth is greater than a preset bandwidth threshold, the current network status is determined to be good; if the average bandwidth is not greater than the bandwidth threshold, the current network status is determined to be poor.
[0147] In one possible implementation, when the security information acquisition unit obtains the video link address, license, and protection system-specific header information of the target video from the server, it is specifically used for:
[0148] Under the current poor network conditions, the video link address, the license, and the protection system-specific header information of the target video are obtained from the server.
[0149] In one possible implementation, the security information acquisition unit is also used for:
[0150] Under the condition that the current network conditions are good, obtain the video link address and the authorization license of the target video from the server;
[0151] After receiving the demultiplexing result of the target video, the protection system-specific header information is extracted from the demultiplexing result.
[0152] The demultiplexing result includes the encrypted media stream of the target video and the protection system-specific header information; the demultiplexing result is obtained by demultiplexing the multimedia container file of the target video after receiving the playback instruction of the target video.
[0153] In one possible implementation, the video decryption unit is used to decrypt the encrypted media stream of the target video using the decryption key to obtain the plaintext media stream, specifically for:
[0154] After receiving the demultiplexing result of the target video, the encrypted media stream of the target video is extracted from the demultiplexing result;
[0155] In the decryption session, the encrypted media stream of the target video is decrypted using the decryption key to obtain the plaintext media stream.
[0156] In one possible implementation, the media stream also includes an audio stream; when the video playback unit is used to play the original media stream, it is specifically used for:
[0157] Synchronize audio and video between plaintext video and plaintext audio streams;
[0158] By integrating the plaintext video stream and the plaintext audio stream after audio-visual synchronization, the target media stream is obtained;
[0159] Play the target media stream.
[0160] This application also provides an electronic device in its embodiments. (See reference...) Figure 6 As shown, Figure 6 It illustrates a structural diagram suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0161] like Figure 6 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0162] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.
[0163] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the video playback methods provided in this application.
[0164] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the video playback methods provided in this application.
[0165] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0166] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0167] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0168] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A video playback method, characterized in that, include: The system receives a playback instruction for a target video and obtains the video link address, license, and protection system-specific header information of the target video from the server. The target video is a video encrypted based on digital rights management. The decryption session is initialized based on the license and the specific header information of the protection system to obtain the decryption key; The encrypted media stream of the target video is decrypted using the decryption key to obtain a plaintext media stream, which includes the video stream. The plaintext media stream is decoded to obtain the original media stream; Play the original media stream; The video playback method further includes: Under the condition that the current network conditions are good, obtain the video link address and the authorization license of the target video from the server; After receiving the demultiplexing result of the target video, extract the protection system-specific header information from the demultiplexing result; The demultiplexing result includes the encrypted media stream of the target video and the protection system-specific header information; the demultiplexing result is obtained by demultiplexing the multimedia container file of the target video after receiving the playback instruction of the target video.
2. The video playback method according to claim 1, characterized in that, Also includes: The average bandwidth is determined based on the real-time values of preset network performance indicators, including download speed and network latency. If the average bandwidth is greater than the preset bandwidth threshold, the current network status is determined to be good; If the average bandwidth is not greater than the bandwidth threshold, the current network state is determined to be poor.
3. The video playback method according to claim 1 or 2, characterized in that, The step of obtaining the video link address, license, and protection system-specific header information of the target video from the server includes: Under the current poor network conditions, the video link address, the license, and the protection system-specific header information of the target video are obtained from the server.
4. The video playback method according to claim 1, characterized in that, The step of decrypting the encrypted media stream of the target video using the decryption key to obtain the plaintext media stream includes: After receiving the demultiplexing result of the target video, the encrypted media stream of the target video is extracted from the demultiplexing result; In the decryption session, the encrypted media stream of the target video is decrypted using the decryption key to obtain the plaintext media stream.
5. The video playback method according to claim 4, characterized in that, The plaintext media stream also includes an audio stream; playing the original media stream includes: Synchronize audio and video between plaintext video and plaintext audio streams; By integrating the plaintext video stream and the plaintext audio stream after audio-visual synchronization, the target media stream is obtained; Play the target media stream.
6. A video playback device, characterized in that, include: The security information acquisition unit is used to receive the playback instruction of the target video, and obtain the video link address, license, and protection system-specific header information of the target video from the server. The target video is a video encrypted based on digital rights management. The session initialization unit is used to initialize the decryption session based on the authorization license and the specific header information of the protection system, and obtain the decryption key; A video decryption unit is used to decrypt the encrypted media stream of the target video using the decryption key to obtain a plaintext media stream, wherein the plaintext media stream includes the video stream; A video decoding unit is used to decode the plaintext media stream to obtain the original media stream; The video playback unit is used to play the original media stream; The security information acquisition unit is further configured to: Under good network conditions, the video link address and the license of the target video are obtained from the server; after receiving the demultiplexing result of the target video, the protection system-specific header information is extracted from the demultiplexing result; wherein, the demultiplexing result includes the encrypted media stream of the target video and the protection system-specific header information; the demultiplexing result is obtained by demultiplexing the multimedia container file of the target video after receiving the playback instruction of the target video.
7. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the video playback method as described in any one of claims 1 to 5.
8. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the video playback method as described in any one of claims 1 to 5.
9. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the video playback method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Audio and video playing starting method and device, electronic equipment and computer readable storage medium
CN118368453A
Method, apparatus and system for digital rights management (DRM)
WO2021168856A1