A media stream real-time playing method and device, electronic equipment and storage medium
By dynamically adjusting the input buffer threshold and playback multiplier of the decoded frames, the problem that existing player caching strategies cannot balance smoothness and real-time performance is solved, achieving efficient media streaming playback under different network conditions, reducing latency and stuttering, and improving user experience.
Patent Information
- Application Number
- CN202510512111.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-04-23
AI Technical Summary
Existing web players cannot simultaneously achieve both smoothness and real-time performance when playing media streams, resulting in high latency or stuttering, which affects the viewing experience.
By dynamically adjusting the input buffer threshold and playback multiplier of the decoded frames, and making real-time adjustments based on the target frame rate of the video source, the player's frame rate, and the buffer data values, the matching between the player and the video source and the optimization of the buffer are ensured.
It reduces latency and stuttering under different network conditions, improves the smoothness and real-time performance of media streaming, and enhances the user experience.
Smart Images

Figure CN120075381B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and in particular to a method for real-time playback of media streams, as well as an electronic device and storage medium. Background Technology
[0002] Existing web players typically use a large frame data buffer to ensure smooth playback of media streams, which leads to higher latency. For live streaming scenarios, high latency significantly impacts the viewing experience. Alternatively, some web players use a lower frame data buffer to ensure real-time performance, but this method can cause stuttering and poor playback quality in situations with poor network connectivity due to missing frame data, also negatively affecting the viewing experience. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device, and storage medium for real-time playback of media streams.
[0004] In a first aspect, embodiments of the present invention provide a method for real-time playback of a media stream, the method comprising:
[0005] Obtain the target frame rate of the video source and the frame rate of the player's decoded frames;
[0006] The input buffer threshold of the decoded frame is adjusted based on the comparison between the frame rate of the decoded frame and the target frame rate.
[0007] Obtain the cached frame data values of the player;
[0008] The decoding playback multiplier is adjusted based on the comparison between the frame data value and the current input buffer threshold, thereby adjusting the input buffer of the decoded frame.
[0009] In conjunction with the first aspect, the step of adjusting the input buffer threshold of the decoded frame based on the comparison between the frame rate of the decoded frame and the target frame rate includes:
[0010] If the frame rate of the decoded frame is less than the target frame rate, increase the input buffer threshold of the decoded frame;
[0011] If the frame rate of the decoded frame is greater than or equal to the target frame rate, the input buffer threshold of the decoded frame is lowered.
[0012] In conjunction with the first aspect, the step of adjusting the decoding playback multiplier based on the comparison between the frame data value and the current input buffer threshold includes:
[0013] If the frame data value is greater than the current input buffer threshold, increase the decoding playback multiplier;
[0014] If the frame data value is less than or equal to the current input buffer threshold, the preset decoding playback multiplier is used as the target decoding playback multiplier.
[0015] In conjunction with the first aspect, the step of increasing the decoding playback multiplier includes:
[0016] Calculate the difference between the frame data value and the current input buffer threshold;
[0017] Based on the comparison relationship between the difference and multiple preset thresholds, the target decoding playback multiplier is determined;
[0018] Adjust the current decoding playback multiplier according to the target decoding playback multiplier.
[0019] In conjunction with the first aspect, the step of adjusting the current decoding playback multiplier based on the target decoding playback multiplier includes:
[0020] Gradually increase the decoding playback multiplier until the target decoding playback multiplier is reached.
[0021] Secondly, embodiments of this application provide a media stream real-time playback device, the device comprising:
[0022] The first acquisition module is used to acquire the target frame rate of the video source and the frame rate of the decoded frame of the player;
[0023] The first adjustment module is used to adjust the input buffer threshold of the decoded frame according to the comparison relationship between the frame rate of the decoded frame and the target frame rate;
[0024] The second acquisition module is used to acquire the cached frame data values of the player;
[0025] The second adjustment module is used to adjust the decoding playback multiplier based on the comparison between the frame data value and the current input buffer threshold, so as to adjust the input buffer of the decoded frame.
[0026] In conjunction with the second aspect, the first adjustment module includes:
[0027] The first buffer threshold adjustment module is used to increase the input buffer threshold of the decoded frame when the frame rate of the decoded frame is less than the target frame rate.
[0028] The second buffer threshold adjustment module is used to lower the input buffer threshold of the decoded frame when the frame rate of the decoded frame is greater than or equal to the target frame rate.
[0029] In conjunction with the second aspect, the second adjustment module includes:
[0030] The first decoding playback multiplier adjustment module is used to increase the decoding playback multiplier when the frame data value is greater than the current input buffer threshold.
[0031] The second decoding playback multiplier adjustment module is used to set a preset decoding playback multiplier as the target decoding playback multiplier when the frame data value is less than or equal to the current input buffer threshold.
[0032] Thirdly, this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor runs the computer program to cause the electronic device to perform the methods described above.
[0033] Fourthly, this application provides a readable storage medium storing computer program instructions, which, when read and executed by a processor, perform the above-described method.
[0034] The embodiments of the present invention bring the following beneficial effects: The media stream real-time playback method, device, electronic device, and storage medium provided in this application include: obtaining the target frame rate of the video source and the frame rate of the decoded frame of the player; adjusting the input buffer threshold of the decoded frame according to the comparison relationship between the frame rate of the decoded frame and the target frame rate; obtaining the buffered frame data value of the player; and adjusting the decoding playback multiplier according to the comparison relationship between the frame data value and the current input buffer threshold to adjust the input buffer of the decoded frame.
[0035] This application provides a method for real-time playback of media streams. First, the target frame rate of the video source is obtained. Then, based on the comparison between the frame rate of the decoded frame and the target frame rate, the input buffer threshold of the decoded frame is dynamically adjusted. At the same time, the decoding playback multiplier is adjusted based on the comparison between the cached frame data value and the input buffer threshold. This dynamic adjustment of the playback rate achieves dynamic adjustment of the input buffer of the decoded frame, thereby reducing large playback delays and playback stuttering, and achieving good real-time performance and smoothness.
[0036] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0037] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0038] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0039] Figure 1 A flowchart illustrating the real-time media stream playback method provided in an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of the structure of the media stream real-time playback device provided in an embodiment of the present invention;
[0041] Figure 3 This is a schematic diagram of the structure of the first adjustment module in the media stream real-time playback device provided in an embodiment of the present invention;
[0042] Figure 4 This is a schematic diagram of the structure of the second adjustment module in the media stream real-time playback device provided in an embodiment of the present invention;
[0043] Figure 5 This is a schematic diagram of the electronic device structure provided in an embodiment of the present invention.
[0044] Figure label:
[0045] 10-First acquisition module, 20-First adjustment module, 21-First cache threshold adjustment module, 22-Second cache threshold adjustment module, 30-Second acquisition module, 40-Second adjustment module, 41-First decoding playback multiplier adjustment module, 42-Second decoding playback multiplier adjustment module;
[0046] 130 - Processor, 131 - Memory, 132 - Bus, 133 - Communication interface. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] To facilitate understanding of this embodiment, the technical terms used in this application will be briefly introduced below.
[0049] Frame rate (Frames Per Second, FPS) refers to the number of images displayed per second. Common frame rates include 24 fps (movie), 25 fps (PAL TV standard), 30 fps (NTSC TV standard), and 60 fps. A higher frame rate results in smoother video playback, but also increases file size.
[0050] Decoding playback speed refers to the playback speed that is dynamically adjusted based on decoding and caching during video playback.
[0051] After introducing the technical terms used in this application, the application scenarios and design concepts of the embodiments of this application will be briefly described below.
[0052] Existing web players face a dilemma when playing media streams: setting a large cache for smoothness can lead to high latency in live streaming, while reducing the cache for real-time performance may cause stuttering when the network is poor, both of which affect the viewing experience.
[0053] Based on this, embodiments of this application provide a method, apparatus, electronic device, and storage medium for real-time playback of media streams.
[0054] Example 1
[0055] This application provides a method for real-time playback of media streams, combined with... Figure 1 As shown, the method includes:
[0056] S110, obtain the target frame rate of the video source and the frame rate of the player's decoded frames.
[0057] S120: Adjust the input buffer threshold of the decoded frame based on the comparison between the frame rate of the decoded frame and the target frame rate.
[0058] S130: Obtain the cached frame data values of the player.
[0059] S140, adjust the decoding playback multiplier based on the comparison between the frame data value and the current input buffer threshold, so as to adjust the input buffer of the decoded frame.
[0060] The real-time media streaming playback method provided in this application dynamically adjusts the input buffer threshold of the decoded frame based on the comparison relationship between the frame rate of the decoded frame and the target frame rate. Then, based on the comparison relationship between the true data value and the current input buffer threshold, it dynamically adjusts the decoding playback multiplier so that the decoded media stream is adapted to the current playback conditions, thereby realizing real-time media streaming playback, reducing latency, improving the smoothness of media streaming playback, and reducing screen stuttering.
[0061] Frame rate (Frames Per Second, FPS) refers to the number of image frames displayed per second. Common frame rates include 24 fps (movie), 25 fps (PAL TV standard), 30 fps (NTSC TV standard), and 60 fps. A higher frame rate results in smoother video playback, but also increases file size.
[0062] In step S110, the target frame rate of the video source refers to the frame rate set by the video file itself, which is usually determined during video encoding and can be extracted using various tools or programming interfaces. The frame rate of the player's decoded frames refers to the number of frames that the player can decode and display during actual playback.
[0063] In step S120, the function of dynamically adjusting the input buffer threshold based on the comparison between the frame rate of the decoded frame and the target frame rate can help optimize video playback performance and ensure that the player can process the video stream more stably, especially when the network conditions are unstable or the hardware performance is limited.
[0064] Step S130 employs different methods depending on the player used to obtain cached frame data (including the number of cached frames or the duration of the cache), such as through command-line tools, programming interfaces, or monitoring the buffer status output in logs. A reasonable cache threshold is determined as a reference point. This value should be sufficiently large to ensure smooth playback without causing noticeable delays. It can be adjusted based on factors such as network conditions and content type.
[0065] Step S140 periodically checks whether the frame data value (i.e. the current buffer level) is lower or higher than the set target threshold during playback, and dynamically changes the player's speed settings based on the comparison results to improve the smoothness and real-time performance of the media stream playback.
[0066] In conjunction with the first aspect, step S120 includes:
[0067] S121, If the frame rate of the decoded frame is less than the target frame rate, increase the input buffer threshold of the decoded frame.
[0068] Specifically, if the frame rate of the decoded frame is lower than the target frame rate, it indicates that the player may not be able to keep up with the speed of the video source. In this case, the input buffer threshold should be increased. This allows more data to enter the buffer in advance, reducing stuttering caused by untimely decoding.
[0069] S122, If the frame rate of the decoded frame is greater than or equal to the target frame rate, lower the input buffer threshold of the decoded frame.
[0070] Specifically, if the frame rate of the decoded frames is greater than or equal to the target frame rate, it indicates that the player can decode the video smoothly, even ahead of the speed set by the video source. In this case, the input buffer threshold should be lowered to avoid excessive data accumulation in the buffer, saving resources and reducing latency.
[0071] After adjustments based on step S120, continuous monitoring and dynamic adjustments are made to ensure optimal playback performance.
[0072] In conjunction with the first aspect, step S140 includes:
[0073] S141, If the frame data value is greater than the current input buffer threshold, increase the decoding playback multiplier.
[0074] Specifically, if the frame data value is greater than the current input buffer threshold, it indicates that the current buffer is too large. In this case, the playback speed can be increased by increasing the decoding playback multiplier, thus speeding up the release of the buffer. For example, playback can be performed at a decoding playback multiplier of 3.
[0075] S142, if the frame data value is less than or equal to the current input buffer threshold, use the preset decoding playback multiplier as the target decoding playback multiplier.
[0076] Specifically, if the frame data value is less than or equal to the current input buffer threshold, it indicates that the current buffer size is small or equal, and playback can be performed at a specified playback rate while maintaining a preset decoding playback multiplier. In this embodiment, the preset decoding playback multiplier is 1.
[0077] As can be seen, in this embodiment, if the frame rate of the decoded frame is greater than or equal to the target frame rate, the input buffer threshold of the decoded frame is lowered. At the same time, the decoding playback multiplier is adjusted according to the comparison relationship between the cached frame data value and the input buffer threshold, so as to adjust the playback rate to lower the input buffer of the decoded frame, thereby ensuring the real-time performance of playback and solving the problem of large playback latency.
[0078] If the frame rate of the decoded frame is less than the target frame rate, the input buffer threshold of the decoded frame is increased. At the same time, the decoding playback multiplier is adjusted according to the comparison between the cached frame data value and the input buffer threshold. This adjusts the playback rate to increase the input buffer of the decoded frame, thereby ensuring smooth playback and reducing stuttering.
[0079] In conjunction with the first aspect, increasing the decoding playback multiplier in step S141 specifically includes:
[0080] S1410, calculate the difference between the frame data value and the current input buffer threshold.
[0081] S1411, Based on the comparison relationship between the difference and multiple preset thresholds, determine the target decoding playback multiplier.
[0082] S1412, Adjust the current decoding playback multiplier according to the target decoding playback multiplier.
[0083] Understandably, the required decoding playback factor will vary depending on the difference between the frame data value and the current input buffer threshold. Therefore, the difference is first calculated, and then compared with multiple preset thresholds to determine the threshold range corresponding to that difference. Finally, the target decoding factor is determined based on the determined threshold range. The correspondence between each threshold range and the target decoding factor is preset.
[0084] For example, six thresholds are pre-defined, such as D1, D2, D3, D4, D5, and D6, corresponding to five threshold intervals: D1~D2, D2~D3, D3~D4, D4~D5, and D5~D6. The decoding multipliers corresponding to these five threshold intervals are A1, A2, A3, A4, and A5, respectively. If the calculated difference is compared with the above six thresholds and the determined threshold interval is D4~D5, then the decoding multiplier A4 corresponding to this threshold interval is taken as the target decoding multiplier.
[0085] In conjunction with the first aspect, step S1412 includes:
[0086] S14120, gradually increase the decoding playback multiplier until the target decoding playback multiplier is reached.
[0087] In this embodiment, the decoding playback multiplier is gradually increased until the target decoding playback multiplier is reached, rather than being adjusted all at once. This avoids the impact of sudden changes on the user experience and allows the system sufficient time to respond to and stabilize the new playback rate.
[0088] Understandably, you can adjust the speed gradually by setting the step size. For example, if the current decoding playback speed is 1x and the target decoding playback speed is 2x, and the adjustment step size is 0.5x, then you need to make two adjustments: first adjust it to 1.5x, and then adjust it to 2x.
[0089] Secondly, embodiments of this application provide a media stream real-time playback device, combined with Figure 2 As shown, the device includes: a first acquisition module 10, a first adjustment module 20, a second acquisition module 30, and a second adjustment module 40.
[0090] The first acquisition module 10 is used to acquire the target frame rate of the video source and the frame rate of the player's decoded frames.
[0091] The first adjustment module 20 is used to adjust the input buffer threshold of the decoded frame based on the comparison between the frame rate of the decoded frame and the target frame rate.
[0092] The second acquisition module 30 is used to acquire the cached frame data values of the player.
[0093] The second adjustment module 40 is used to adjust the decoding playback multiplier based on the comparison between the frame data value and the current input buffer threshold, so as to adjust the input buffer of the decoded frame.
[0094] In this embodiment, the first acquisition module 10 is used to acquire the target frame rate of the video source and the frame rate of the player's decoding frame, so as to ensure that the video playback can match the frame rate standard set by the video source itself as much as possible, while monitoring the actual performance of the player during the decoding process.
[0095] The first adjustment module 20 optimizes the input caching strategy to reduce playback stuttering or delays caused by network jitter and other factors, thereby improving playback smoothness and real-time performance.
[0096] The second acquisition module 30 monitors in real time how many frames of data are currently stored in the player's cache, i.e. the cache size, to provide a basis for subsequent judgment on whether the playback rate needs to be adjusted, so as to maintain an appropriate cache level and avoid the screen stuttering or even playback interruption caused by too low a cache, or the large latency and excessive memory consumption caused by too high a cache.
[0097] The second adjustment module 40 compares the cached frame data value with the currently set input cache threshold to determine whether and how to adjust the decoding playback multiplier. When the cache is insufficient, the playback rate is appropriately reduced to accumulate more frame data; conversely, the playback rate can be increased to improve real-time performance, but it will not exceed the maximum playback multiplier limit set by the user.
[0098] In conjunction with the second aspect, the first adjustment module 20 includes: a first cache threshold adjustment module 21 and a second cache threshold adjustment module 22 (e.g., ...). Figure 3 (As shown).
[0099] The first buffer threshold adjustment module 21 is used to increase the input buffer threshold of the decoded frame when the frame rate of the decoded frame is less than the target frame rate.
[0100] The second buffer threshold adjustment module 22 is used to lower the input buffer threshold of the decoded frame when the frame rate of the decoded frame is greater than or equal to the target frame rate.
[0101] In conjunction with the first aspect, the second adjustment module 40 includes a first decoding playback multiplier adjustment module 41 and a second decoding playback multiplier adjustment module 42 (e.g., Figure 4 (As shown).
[0102] The first decoding playback multiplier adjustment module 41 is used to increase the decoding playback multiplier when the frame data value is greater than the current input buffer threshold.
[0103] The second decoding playback multiplier adjustment module 42 is used to set a preset decoding playback multiplier as the target decoding playback multiplier when the frame data value is less than or equal to the current input buffer threshold.
[0104] Thirdly, embodiments of this application provide an electronic device, combined with Figure 5 As shown, the electronic device includes a memory 131 and a processor 130. The memory 131 stores a computer program, and the processor 130 runs the computer program to make the electronic device perform the above-described method.
[0105] Furthermore, combined Figure 5 The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.
[0106] The memory 131 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0107] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131, and processor 130 reads the information in memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0108] Fourthly, embodiments of this application provide a readable storage medium storing computer program instructions, which are read and executed by a processor to perform the above-described method.
[0109] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0110] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0111] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0112] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0113] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for real-time playback of media streams, characterized in that, Applied to the player; the method includes: Obtain the target frame rate of the video source and the frame rate of the player's local real-time decoding frames; If the frame rate of the decoded frame is less than the target frame rate, increase the input buffer threshold of the decoded frame; If the frame rate of the decoded frame is greater than or equal to the target frame rate, the input buffer threshold of the decoded frame is lowered. Obtain the cached frame data values of the player; The decoding playback multiplier is adjusted based on the comparison between the frame data value and the current input buffer threshold, thereby adjusting the input buffer of the decoded frame; The step of adjusting the decoding playback multiplier based on the comparison between the frame data value and the current input buffer threshold includes: If the frame data value is greater than the current input buffer threshold, calculate the difference between the frame data value and the current input buffer threshold; based on the comparison relationship between the difference and multiple preset thresholds, determine the threshold range and take the decoding playback multiplier corresponding to the threshold range as the target decoding playback multiplier; adjust the current decoding playback multiplier according to the target decoding playback multiplier. If the frame data value is less than or equal to the current input buffer threshold, the preset decoding playback multiplier is used as the target decoding playback multiplier.
2. The method according to claim 1, characterized in that, The step of adjusting the current decoding playback multiplier based on the target decoding playback multiplier includes: Gradually increase the decoding playback multiplier until the target decoding playback multiplier is reached.
3. A media streaming real-time playback device, characterized in that, Applied to a media player; the device includes: The first acquisition module is used to acquire the target frame rate of the video source and the frame rate of the player's local real-time decoding frame; The first adjustment module is used to adjust the input buffer threshold of the decoded frame according to the comparison relationship between the frame rate of the decoded frame and the target frame rate; The second acquisition module is used to acquire the cached frame data values of the player; The second adjustment module is used to adjust the decoding playback multiplier based on the comparison between the frame data value and the current input buffer threshold, so as to adjust the input buffer of the decoded frame; The step of adjusting the decoding playback multiplier based on the comparison between the frame data value and the current input buffer threshold includes: If the frame data value is greater than the current input buffer threshold, calculate the difference between the frame data value and the current input buffer threshold; based on the comparison relationship between the difference and multiple preset thresholds, determine the threshold range and take the decoding playback multiplier corresponding to the threshold range as the target decoding playback multiplier; adjust the current decoding playback multiplier according to the target decoding playback multiplier. If the frame data value is less than or equal to the current input buffer threshold, the preset decoding playback multiplier is used as the target decoding playback multiplier; The first adjustment module includes: The first buffer threshold adjustment module is used to increase the input buffer threshold of the decoded frame when the frame rate of the decoded frame is less than the target frame rate. The second buffer threshold adjustment module is used to lower the input buffer threshold of the decoded frame when the frame rate of the decoded frame is greater than or equal to the target frame rate.
4. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program and the processor running the computer program to cause the electronic device to perform the method of any one of claims 1 to 2.
5. A storage medium, characterized in that, The storage medium stores computer program instructions, which, when read and executed by a processor, perform the method described in any one of claims 1 to 2.
Citation Information
Patent Citations
Video playing method, device and equipment and readable storage medium
CN115695922A
Live video playing method and device, storage medium and computer program product
CN119071519A