Media stream real-time playing method and device, electronic equipment and storage medium
By dynamically adjusting the input cache threshold and the decoded playback multiple of the decoded frame, the problems of high media stream playback delay and lag in the prior art are solved, and better fluency and real-time are achieved.
Patent Information
- Application Number
- CN202510512111.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-23
AI Technical Summary
When playing media streams, existing web players face problems of high delays and lag in order to ensure smoothness and real-time performance.
By obtaining the target frame rate of the video source and the frame rate of the player decoded frame, the input cache threshold of the decoded frame is dynamically adjusted, and the decoded playback multiple is adjusted according to the comparison relationship between the frame data value and the current input cache threshold to adjust the input cache of the decoded frame.
It reduces playback delay and lag, and improves the smoothness and real-timeness of media streaming.
Smart Images

Figure CN120075381A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular, to a method for real-time media stream playback, an electronic device, and a storage medium. Background Art
[0002] When existing web players play media streams, in order to ensure smoothness, they all have a large frame data cache, which results in a relatively high playback delay. For live broadcast scenarios, a high delay greatly affects the viewing experience. In addition, there are also web players that, when playing media streams, in order to ensure real-time performance, set the frame data cache relatively low. However, in the case of poor network conditions, due to the lack of frame data, the playback picture will freeze, which also greatly affects the viewing experience. Summary of the Invention
[0003] In view of this, an object of the present invention is to provide a method, device, electronic device, and storage medium for real-time media stream playback.
[0004] In a first aspect, an embodiment of the present invention provides a method for real-time media stream playback, the method including: Obtaining a target frame rate of a video source and a frame rate of a player's decoded frames; Adjusting an input cache threshold of the decoded frames according to a comparison relationship between the frame rate of the decoded frames and the target frame rate; Obtaining a value of frame data cached by the player; Adjusting a decoded playback multiple according to a comparison relationship between the value of the frame data and the current input cache threshold, so as to adjust the input cache of the decoded frames.
[0005] Combined with the first aspect, the step of adjusting the input cache threshold of the decoded frames according to the comparison relationship between the frame rate of the decoded frames and the target frame rate includes: If the frame rate of the decoded frames is less than the target frame rate, increasing the input cache threshold of the decoded frames; If the frame rate of the decoded frames is greater than or equal to the target frame rate, decreasing the input cache threshold of the decoded frames.
[0006] Combined with the first aspect, the step of adjusting the decoded playback multiple according to the comparison relationship between the value of the frame data and the current input cache threshold includes: If the value of the frame data is greater than the current input cache threshold, increasing the decoded playback multiple; If the value of the frame data is less than or equal to the current input cache threshold, using a preset decoded playback multiple as the target decoded playback multiple.
[0007] Combined with the first aspect, the step of increasing the decoded playback multiple includes: Calculating a difference between the value of the frame data and the current input cache threshold; Determine a target decoding and playing multiple based on the comparison relationship between the difference value and multiple preset thresholds; Adjust the current decoding and playing multiple according to the target decoding and playing multiple.
[0008] Combined with the first aspect, the step of adjusting the current decoding and playing multiple according to the target decoding and playing multiple includes: Gradually increase the decoding and playing multiple until the target decoding and playing multiple is reached.
[0009] In a second aspect, an embodiment of the present application provides a media stream real-time playing device, and the device includes: A first acquisition module, configured to acquire a target frame rate of a video source and a frame rate of a player's decoded frames; A first adjustment module, configured to adjust an input buffer threshold of the decoded frames according to the comparison relationship between the frame rate of the decoded frames and the target frame rate; A second acquisition module, configured to acquire a frame data value of a buffer of the player; A second adjustment module, configured to adjust the decoding and playing multiple according to the comparison relationship between the frame data value and the current input buffer threshold, so as to adjust the input buffer of the decoded frames.
[0010] Combined with the second aspect, the first adjustment module includes: A first buffer threshold adjustment module, configured to increase the input buffer threshold of the decoded frames when the frame rate of the decoded frames is less than the target frame rate; A second buffer threshold adjustment module, configured to decrease the input buffer threshold of the decoded frames when the frame rate of the decoded frames is greater than or equal to the target frame rate.
[0011] Combined with the second aspect, the second adjustment module includes: A first decoding and playing multiple adjustment module, configured to increase the decoding and playing multiple when the frame data value is greater than the current input buffer threshold; A second decoding and playing multiple adjustment module, configured to use a preset decoding and playing multiple as the target decoding and playing multiple when the frame data value is less than or equal to the current input buffer threshold.
[0012] In a third aspect, the present application provides an electronic device, and the electronic device includes a memory and a processor, the memory is used for storing a computer program, and the processor runs the computer program to enable the electronic device to execute the above method.
[0013] Fourthly, the present application provides a readable storage medium storing computer program instructions, which, when read and executed by a processor, execute the above-mentioned method.
[0014] 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 by the present application. The method includes: obtaining the target frame rate of a video source and the frame rate of decoded frames of a player; adjusting the input buffer threshold of the decoded frames according to the comparison relationship between the frame rate of the decoded frames and the target frame rate; obtaining the frame data value of the buffer of the player; adjusting the decoding playback multiple according to the comparison relationship between the frame data value and the current input buffer threshold to adjust the input buffer of the decoded frames.
[0015] The media stream real-time playback method provided by the present application first obtains the target frame rate of a video source, then dynamically adjusts the input buffer threshold of the decoded frames according to the comparison relationship between the frame rate of the decoded frames and the target frame rate, and at the same time adjusts the decoding playback multiple according to the comparison relationship between the cached frame data value and the input buffer threshold to dynamically adjust the playback rate to dynamically adjust the input buffer of the decoded frames, thereby reducing phenomena such as large playback delay and playback stuttering, and achieving good real-time performance and smoothness.
[0016] Other features and advantages of the present invention will be described in the following description, and in part will be obvious from the description, or will be understood by implementing the present invention. The objectives and other advantages of the present invention are achieved and obtained by the structures specifically pointed out in the description, claims, and drawings.
[0017] To make the above objectives, features, and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given in conjunction with the accompanying drawings and are described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is a schematic flowchart of the media stream real-time playback method provided by the embodiments of the present invention; Figure 2 It is a schematic structural diagram of the media stream real-time playback device provided by the embodiments of the present invention; Figure 3 It is a schematic structural diagram of the first adjustment module in the media stream real-time playback device provided by the embodiments of the present invention; Figure 4Schematic diagram of the structure of the second adjustment module in the media stream real-time playback device provided by the embodiment of the present invention; Figure 5 Schematic diagram of the structure of the electronic device provided by the embodiment of the present invention.
[0020] Reference numerals: 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 multiple adjustment module, 42 - Second decoding playback multiple adjustment module; 130 - Processor, 131 - Memory, 132 - Bus, 133 - Communication interface. Detailed implementation manners
[0021] 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. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0022] To facilitate the understanding of this embodiment, the technical terms designed in this application will be briefly introduced below.
[0023] Frame rate (Frames Per Second, FPS) refers to the number of image frames displayed per second. Common frame rates include 24fps (movies), 25fps (PAL television standard), 30fps (NTSC television standard), 60fps, etc. The higher the frame rate, the better the video smoothness, but the file size will also increase.
[0024] The decoding playback multiple refers to the playback speed dynamically adjusted according to the decoding and caching conditions during video playback.
[0025] After introducing the technical terms involved in this application, next, the application scenarios and design concepts of the embodiments of this application will be briefly introduced.
[0026] Existing Web players face a dilemma when playing media streams: setting a large cache for smoothness will result in high live broadcast latency, and reducing the cache for real-time performance may cause the picture to freeze when the network is poor, both of which affect the viewing experience.
[0027] Based on this, the embodiments of this application provide a media stream real-time playback method, device, electronic device, and storage medium.
[0028] Embodiment 1 This application provides a method for real-time media stream playback, which combines Figure 1 As shown, the method includes: S110, obtaining the target frame rate of the video source and the frame rate of the player's decoded frames.
[0029] S120, adjusting the input buffer threshold of the decoded frames according to the comparison relationship between the frame rate of the decoded frames and the target frame rate.
[0030] S130, obtaining the value of the frame data cached by the player.
[0031] S140, adjusting the decoding playback multiple according to the comparison relationship between the frame data value and the current input buffer threshold to adjust the input buffer of the decoded frames.
[0032] The method for real-time media stream playback provided by this application dynamically adjusts the input buffer threshold of the decoded frames based on the comparison relationship between the frame rate of the decoded frames and the target frame rate, and then dynamically adjusts the decoding playback multiple according to the comparison relationship between the true data value and the current input buffer threshold, so that the decoded and played media stream adapts to the current playback conditions, thereby realizing real-time media stream playback, reducing latency, improving the smoothness of media stream playback, and reducing frame freezes.
[0033] Among them, the frame rate (Frames Per Second, FPS) refers to the number of image frames displayed per second. Common frame rates include 24 fps (movies), 25 fps (PAL television standard), 30 fps (NTSC television standard), 60 fps, etc. The higher the frame rate, the better the video smoothness, but the file size will also increase.
[0034] 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 through 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.
[0035] In step S120, the function of dynamically adjusting the input buffer threshold according to the comparison relationship between the frame rate of the decoded frames and the target frame rate can help optimize video playback performance and ensure that the player can process the video stream more stably, especially in cases where network conditions are unstable or hardware performance is limited.
[0036] Step S130 adopts different methods according to the player used to obtain the cached frame data (including the number of cached frames or the time length), such as obtaining the cached frame data through command-line tools, programming interfaces, or monitoring the buffer status output in the log. Determine a reasonable cache threshold as a reference point. This value should be large enough to ensure smooth playback without causing obvious delays. It can be adjusted according to factors such as network conditions and content type.
[0037] Step S140 periodically checks whether the frame data value (i.e., the current buffer level) is lower or higher than a set target threshold during playback, and dynamically changes the speed setting of the player based on the above comparison results to improve the playback smoothness and real-time performance of the media stream.
[0038] Combined with the first aspect, step S120 includes: 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.
[0039] Specifically, if the frame rate of the decoded frame is less than the target frame rate, it indicates that the player may not be able to keep up with the speed of the video source. At this time, the input buffer threshold should be increased. This can allow more data to enter the buffer in advance and reduce the phenomenon of frame freezing caused by untimely decoding.
[0040] S122, if the frame rate of the decoded frame is greater than or equal to the target frame rate, decrease the input buffer threshold of the decoded frame.
[0041] Specifically, if the frame rate of the decoded frame 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. At this time, the input buffer threshold should be decreased to avoid excessive data accumulation in the buffer, save resources and reduce latency.
[0042] Continue to monitor and dynamically adjust after the adjustment based on step S120 to ensure the best playback effect.
[0043] Combined with the first aspect, step S140 includes: S141, if the frame data value is greater than the current input buffer threshold, increase the decoding playback multiple.
[0044] Specifically, if the frame data value is greater than the current input buffer threshold, it indicates that the current buffer is too large. The playback rate can be increased by increasing the decoding playback multiple to speed up the buffer release speed. For example, play at a decoding playback multiple of 3 times.
[0045] S142, if the frame data value is less than or equal to the current input buffer threshold, use the preset decoding playback multiple as the target decoding playback multiple.
[0046] 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. The playback can be performed at a specified playback rate by maintaining the preset decoding playback multiple. In this embodiment, the preset decoding playback multiple is 1 time.
[0047] It can be seen that 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, and at the same time, the decoded playback multiple 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 delay.
[0048] 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, and at the same time, the decoded playback multiple 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 increase the input buffer of the decoded frame, thereby ensuring the smoothness of playback and reducing phenomena such as frame freezing.
[0049] Combined with the first aspect, specifically, increasing the decoded playback multiple in step S141 includes: S1410, calculating the difference between the frame data value and the current input buffer threshold.
[0050] S1411, determining the target decoded playback multiple based on the comparison relationship between the difference and multiple preset thresholds.
[0051] S1412, adjusting the current decoded playback multiple according to the target decoded playback multiple.
[0052] It can be understood that as the difference between the frame data value and the current input buffer threshold is different, the decoded playback multiple to be adjusted is also different. Therefore, first calculate the difference between the two, and then compare the difference with multiple preset thresholds to determine the threshold interval corresponding to the difference. Furthermore, based on the determined threshold interval, determine the target decoded multiple. Among them, the corresponding relationship between each threshold interval and the target decoded multiple is preset.
[0053] For example, 6 thresholds such as D 1 、D 2 、D 3 、D 4 、D 5 、D 6 are preset, and the corresponding 5 threshold intervals are D 1 ~D 2 、D 2 ~D 3 、D 3 ~D 4 、D 4 ~D 5 、D 5 ~D 6 . The decoded multiples corresponding to these five threshold intervals are A 1 、A 2 、A 3 、A 4 、A 5At this time, if the calculated difference is compared with the above six thresholds and the determined threshold interval is D 4 ~D 5 , and then the decoding multiple A 4 corresponding to this threshold interval is used as the target decoding multiple.
[0054] Combined with the first aspect, step S1412 includes: S14120, gradually increase the decoding and playback multiple until the target decoding and playback multiple is reached.
[0055] In this embodiment, the method of gradually increasing the decoding and playback multiple is adopted until the target decoding and playback multiple is reached, rather than adjusting it in one step. The advantage of doing this is to avoid the impact on the user experience caused by sudden changes, and it can also give the system enough time to respond and stabilize the new playback rate.
[0056] It can be understood that it can be adjusted step by step by presetting an adjustment step size. For example, if the current decoding and playback speed is 1 time and the target decoding and playback multiple is 2 times, and the adjustment step size is 0.5 times, then two adjustments are required. First, adjust it to 1.5 times, and then adjust it to 2 times.
[0057] In the second aspect, an embodiment of the present application provides 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.
[0058] 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.
[0059] The first adjustment module 20 is used to adjust the input buffer threshold of the decoded frames according to the comparison relationship between the frame rate of the decoded frames and the target frame rate.
[0060] The second acquisition module 30 is used to acquire the frame data value of the buffer of the player.
[0061] The second adjustment module 40 is used to adjust the decoding and playback multiple according to the comparison relationship between the frame data value and the current input buffer threshold, so as to adjust the input buffer of the decoded frames.
[0062] 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 decoded frames to ensure that the video can be played as closely as possible to the frame rate standard set by the video source itself while monitoring the actual performance during the player's decoding process.
[0063] The first adjustment module 20 optimizes the input buffer strategy to reduce the phenomenon of playback jitter or large delay caused by network jitter and other situations, and improves the playback smoothness and real-time performance.
[0064] The second acquisition module 30 monitors in real time how many frames of data are stored in the current buffer of the player, that is, the buffer capacity, providing a basis for subsequent judgment on whether to adjust the playback rate to maintain an appropriate buffer level, avoiding frame freezes or even playback interruptions caused by too low a buffer, or large delays and excessive memory resource occupation caused by too high a buffer.
[0065] The second adjustment module 40 compares the buffer frame data value with the currently set input buffer threshold to decide whether and how to adjust the decoding playback multiple. When the buffer is insufficient, it appropriately reduces the playback rate to accumulate more frame data; conversely, it can increase the playback rate to improve real-time performance, but will not exceed the maximum playback multiple limit set by the user.
[0066] Combined with the second aspect, the first adjustment module 20 includes: a first buffer threshold adjustment module 21 and a second buffer threshold adjustment module 22 (as Figure 3 shown).
[0067] 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.
[0068] The second buffer threshold adjustment module 22 is used to decrease 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.
[0069] Combined with the first aspect, the second adjustment module 40 includes a first decoding playback multiple adjustment module 41 and a second decoding playback multiple adjustment module 42 (as Figure 4 shown).
[0070] The first decoding playback multiple adjustment module 41 is used to increase the decoding playback multiple when the frame data value is greater than the current input buffer threshold.
[0071] The second decoding playback multiple adjustment module 42 is used to use the preset decoding playback multiple as the target decoding playback multiple when the frame data value is less than or equal to the current input buffer threshold.
[0072] In a third aspect, an embodiment of the present application provides an electronic device. Combined with Figure 5 shown, the electronic device includes a memory 131 and a processor 130. The memory 131 is used to store a computer program, and the processor 130 runs the computer program to enable the electronic device to execute the above method.
[0073] Further, the electronic device combined with Figure 5 shown further includes a bus 132 and a communication interface 133. The processor 130, the communication interface 133, and the memory 131 are connected through the bus 132.
[0074] Among them, the memory 131 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 132 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 5 only a bidirectional arrow is used in Figure 5 , but it does not mean that there is only one bus or one type of bus.
[0075] The processor 130 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method can be completed by the integrated logic circuit in the hardware of the processor 130 or the instructions in the form of software. The above-mentioned processor 130 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and combines its hardware to complete the steps of the method in the foregoing embodiments.
[0076] In a fourth aspect, an embodiment of the present application provides a readable storage medium. When computer program instructions stored in the readable storage medium are read and run by a processor, the above method is executed.
[0077] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0078] In addition, in the description of the embodiments of the present invention, unless otherwise clearly defined and limited, the terms "installed", "connected", and "coupled" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0079] If the above functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0080] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0081] Finally, it should be noted that the above embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope 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 within the technical scope disclosed by the present invention can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements for some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for real-time playback of media streams, characterized in that: The method comprises: Get the target frame rate of the video source and the frame rate of the player's decoded frames; According to a comparison relationship between the frame rate of the decoded frame and the target frame rate, adjusting an input buffer threshold of the decoded frame; Obtain the frame data value cached by the player; The decoding playback multiple is adjusted according to the comparison relationship between the frame data value and the current input buffer threshold value to adjust the input buffer of the decoded frame.
2. The method according to claim 1, characterized in that The step of 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 comprises: If the frame rate of the decoded frame is lower than the target frame rate, increasing 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.
3. The method according to claim 1, characterized in that The step of adjusting the decoding playback multiple according to the comparison relationship between the frame data value and the current input buffer threshold comprises: If the frame data value is greater than the current input buffer threshold, increase the decoding playback multiple; If the frame data value is less than or equal to the current input buffer threshold, a preset decoding playback multiple is used as the target decoding playback multiple.
4. The method according to claim 3, characterized in that The step of increasing the decoding playback multiple includes: Calculating a difference between the frame data value and the current input buffer threshold; Determining a target decoding playback multiple based on a comparison relationship between the difference and a plurality of preset thresholds; According to the target decoding playback multiple, the current decoding playback multiple is adjusted.
5. The method according to claim 4, characterized in that The step of adjusting the current decoding playback multiple according to the target decoding playback multiple includes: The decoding playback multiple is gradually increased until the target decoding playback multiple is reached.
6. A media stream real-time playback device, characterized in that: The device comprises: A first acquisition module is used to acquire a target frame rate of a video source and a frame rate of a decoded frame of a player; A first adjustment module, configured to adjust an input buffer threshold of a decoded frame according to a comparison relationship between the frame rate of the decoded frame and the target frame rate; A second acquisition module, used to acquire the frame data value of the buffer of the player; The second adjustment module is used to adjust the decoding playback multiple according to the comparison relationship between the frame data value and the current input buffer threshold, so as to adjust the input buffer of the decoded frame.
7. The device according to claim 6, characterized in that The first adjustment module includes: A first cache threshold adjustment module, configured to increase an input cache threshold of the decoded frame when the frame rate of the decoded frame is lower 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.
8. The device according to claim 6, characterized in that The second adjustment module includes: A first decoding playback multiple adjustment module, configured to increase the decoding playback multiple when the frame data value is greater than the current input buffer threshold; The second decoding playback magnification adjustment module is used to use a preset decoding playback magnification as a target decoding playback magnification when the frame data value is less than or equal to the current input buffer threshold.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the method according to any one of claims 1 to 5.
10. A storage medium, characterized in that: The storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the method according to any one of claims 1 to 5 is executed.
Citation Information
Patent Citations
Video playing method and device
CN106713855A
Decision tree-based self-adaptive video stream transcoding method and device
CN110149534A
Video playing method, device and equipment and readable storage medium
CN115695922A
Video playing method and device
CN117395463A
Live video playing method and device, storage medium and computer program product
CN119071519A