Video playing method and system based on HLS, terminal and storage medium
By detecting network status and dynamically adjusting URL requests, the problem of slow live video launch speed in the prior art is solved, and faster launch speed and better user experience are achieved.
Patent Information
- Application Number
- CN202411257188.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-20
AI Technical Summary
The prior art causes the live video to start slowly when requesting URLs of different resolutions, especially when the network environment is poor, seriously affecting the user experience.
Detect the network status through the ffmpeg multimedia framework. When the current network speed is lower than the preset threshold, cancel the high-resolution URL request, request a low-resolution URL, and restore the high-resolution URL request after the video is displayed, and switch according to the network situation. TS stream.
Quickly improve the start-up speed, shorten the time from clicking on the video to displaying the first frame, and improve the user's viewing experience.
Smart Images

Figure CN119172557A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video playback technology, and in particular to a video playback method, system, terminal and computer-readable storage medium based on HLS. Background Art
[0002] Many foreign http live streaming (HLS, HTTP Live Streaming) websites have too high TCP connection delays, and a single connection may take seconds. The http request is very time-consuming, and these websites also support multi-resolution M3U8 adaptive bitrate playback. Currently, ffmpeg and other mainstream software (such as gstreamer) for adaptive bitrate M3U8 are connected to URLs of different resolutions at the same time, so as to achieve the effect of adaptive seamless dynamic switching. However, because the network server requests in some foreign regions are very slow, the simultaneous request of URLs of different resolutions makes the start-up speed very slow, that is, the speed of starting to play live video is very slow.
[0003] That is to say, the prior art will request multiple URLs with different resolutions at the same time regardless of whether the network environment is bad or not, which will affect the start-up speed of the live video. Especially when the network environment is poor, the start-up speed becomes very slow, seriously affecting the user's viewing experience.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] The main purpose of the present invention is to provide a video playback method, system, terminal and computer-readable storage medium based on HLS, aiming to solve the problem in the prior art that when URLs of different resolutions are requested simultaneously, the start-up speed of the live video is affected, especially when the network environment is poor, the start-up speed becomes very slow, which seriously affects the user's viewing experience.
[0006] To achieve the above object, the present invention provides a video playback method based on HLS, and the video playback method based on HLS comprises the following steps:
[0007] When the target HLS live video is selected and clicked in the browser, the URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status;
[0008] According to the detection result, determining whether the current network speed is lower than a preset network speed threshold, if the current network speed is lower than the preset network speed threshold, canceling the high-resolution URL request and requesting a low-resolution URL;
[0009] When the target HLS live video has finished displaying the first frame, the canceled high-resolution URL request is restored so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status.
[0010] Optionally, the HLS-based video playback method, wherein when the target HLS live video is selected and clicked in the browser, a URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status, specifically includes:
[0011] Obtain a selection operation instruction from the user, and select and click a target HLS live video in the browser according to the selection operation instruction;
[0012] When the user clicks on the browser, the browser initiates a request to the server and receives the URL sent by the server through the ffmpeg multimedia framework;
[0013] The network status is detected according to the URL sent by the server through the ffmpeg multimedia framework, and the detection result of the network status is obtained.
[0014] Optionally, in the HLS-based video playback method, the detection result of the network status includes the current network speed.
[0015] Optionally, the HLS-based video playback method, wherein judging whether the current network speed is lower than a preset network speed threshold according to the detection result, and if the current network speed is lower than the preset network speed threshold, canceling the high-resolution URL request and requesting a low-resolution URL, specifically includes:
[0016] Pre-acquire a preset network speed threshold according to a preset command, and obtain the current network speed in the detection result;
[0017] Compare the current network speed with the preset network speed threshold to determine whether the current network speed is lower than the preset network speed threshold;
[0018] If it is determined that the current network speed is lower than the preset network speed threshold, all high-resolution URL requests in the multiple M3U8 files with different resolutions are canceled, and only one low-resolution URL is requested.
[0019] Optionally, in the HLS-based video playback method, the M3U8 file is an HTTP-based media playlist file, including multiple media resource links.
[0020] Optionally, the HLS-based video playback method, wherein when the target HLS live video displays the first frame, the canceled high-resolution URL request is restored so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status, specifically includes:
[0021] When the first frame of the target HLS live video is displayed, it indicates that the target HLS live video is fully started to play, and the canceled high-resolution URL request is restored;
[0022] The ffmpeg multimedia framework requests a high-resolution TS stream from the server, monitors the network conditions, and switches the target HLS live video to TS streams of different resolutions for playback according to the network conditions, wherein the TS stream belongs to a fragment in the target HLS live video.
[0023] Optionally, in the HLS-based video playback method, the target HLS live video represents a real-time generated HLS stream and allows a user to watch real-time video content; and the TS stream is used to store encoded audio and video data.
[0024] In addition, to achieve the above object, the present invention further provides a video playback system based on HLS, wherein the video playback system based on HLS includes:
[0025] The network status detection module is used to receive the URL sent by the server through the ffmpeg multimedia framework when the target HLS live video is selected and clicked in the browser, and detect the network status to obtain the detection result of the network status;
[0026] A URL request processing module, configured to determine whether the current network speed is lower than a preset network speed threshold according to the detection result, and if the current network speed is lower than the preset network speed threshold, cancel the high-resolution URL request and request a low-resolution URL;
[0027] The video playback control module is used to restore the canceled high-resolution URL request when the target HLS live video displays the first frame, so that the ffmpeg multimedia framework monitors the network situation and switches the target HLS live video to TS streams of different resolutions for playback according to the network situation.
[0028] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and an HLS-based video playback program stored in the memory and executable on the processor, and when the HLS-based video playback program is executed by the processor, the steps of the HLS-based video playback method as described above are implemented.
[0029] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a HLS-based video playback program, and when the HLS-based video playback program is executed by a processor, the steps of the HLS-based video playback method as described above are implemented.
[0030] In the present invention, when the target HLS live video is selected and clicked in the browser, the URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status; according to the detection result, it is determined whether the current network speed is lower than the preset network speed threshold, if the current network speed is lower than the preset network speed threshold, the high-resolution URL request is canceled, and a low-resolution URL is requested; when the target HLS live video displays the first frame, the high-resolution URL request that is canceled is restored, so that the ffmpeg multimedia framework monitors the network situation, and switches the target HLS live video to TS streams of different resolutions for playback according to the network situation. The present invention can quickly improve the start-up speed, shorten the time from the user clicking the video to the display of the first frame of the video screen, and avoid requesting multiple URLs to cause a long time of card, thereby improving the user viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flow chart of a preferred embodiment of the HLS-based video playback method of the present invention;
[0032] Figure 2 It is a schematic diagram of an M3U8 file including a plurality of media playlists of different quality levels in a preferred embodiment of the HLS-based video playback method of the present invention;
[0033] Figure 3 It is a schematic diagram of a link of an actual media file (TS stream) included in an M3U8 file in a preferred embodiment of the HLS-based video playback method of the present invention;
[0034] Figure 4 It is a structural diagram of a preferred embodiment of the HLS-based video playback system of the present invention;
[0035] Figure 5 It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0037] The HLS-based video playback method described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the HLS-based video playback method includes the following steps:
[0038] Step S10: When the target HLS live video is selected and clicked in the browser, the URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status.
[0039] Specifically, obtain the user's selection operation instruction, select and click the target HLS live video in the browser according to the selection operation instruction (live videos are usually sent as ts streams); when the user clicks the browser, a request is initiated to the server through the browser, and the URL sent by the server is received through the ffmpeg multimedia framework (a player framework, most players need to use it, it is an indispensable tool or library (lib) in most players, and audio and video are converted into streams through it). For example, a live video has only one corresponding url, but this main.m3u8 file contains many other m3us. For example, select and click a live video in the browser, and initiate a playlist.m3u8 related request, wherein playlist.m3u8 contains multiple m3u8 files with different resolutions, such as the following:
[0040] 1280*720_3071200_0_f.m3u8;
[0041] 960*540_1927200_1_f.m3u8;
[0042] 854*480_1355200_2_f.m3u8;
[0043] 640*360_1126400_3_f.m3u8;
[0044] 1920*1080_478200_4_f.m3u8;
[0045] The above m3u8 file contains ts file.
[0046] The network status is detected by the ffmpeg multimedia framework according to the URL sent by the server, and the detection result of the network status is obtained. The detection result of the network status includes the current network speed.
[0047] Step S20: According to the detection result, determine whether the current network speed is lower than the preset network speed threshold. If the current network speed is lower than the preset network speed threshold, cancel the high-resolution URL request and request a low-resolution URL.
[0048] Specifically, according to preset command (such as vnstat-i wlan0-1), a preset network speed threshold is obtained in advance, and the current network speed in the detection result is obtained; The current network speed is compared with the preset network speed threshold, and it is judged whether the current network speed is lower than the preset network speed threshold; If it is judged that the current network speed is lower than the preset network speed threshold, all high-resolution URL requests (i.e. m3u8 requests, after a total m3u8 (master playlist (Master Playlist)) is downloaded, its content will include multiple m3u8 (media playlist (MediaPlaylist)), and the multimedia framework will parse it) in the M3U8 files of multiple different resolutions are canceled, and only a low-resolution URL is requested. High-resolution URL refers to the resolution of the corresponding download ts stream, such as a total m3u8 includes m3u8 files of different resolutions, if the maximum resolution is 1920*1080, then download this video, its required network bandwidth requirement is just higher, if the network is very poor, downloading will be very slow, which will cause slow start-up, cancel it, and then select low-resolution, which can improve the start-up speed.
[0049] The M3U8 file is a media playlist file based on HTTP. It follows the HTTP Live Streaming (HLS) protocol. It is a text file that contains a series of media resource links, usually links to TS (Transport Stream) files. M3U8 files are usually divided into two types:
[0050] Master Playlist: contains multiple media playlists with different quality levels, such as Figure 2 shown.
[0051] Media Playlist: Contains links to actual media files (TS streams). The player will download and play TS files in the order in this list, such as Figure 3 shown.
[0052] For live broadcast, the player will periodically request the latest M3U8 playlist, then download and play the TS stream in the playlist to achieve the live broadcast effect.
[0053] Step S30: When the first frame of the target HLS live video is displayed, the canceled high-resolution URL request is restored so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status.
[0054] Specifically, when the first frame of the target HLS live video is displayed, it indicates that the target HLS live video has completely started playing, and the canceled high-resolution URL request will be restored. The live video will continuously and regularly request the media playlist, because the TS in the media playlist is limited and needs to be constantly updated to maintain live playback. The high-resolution request is restored because if the network gets better later, the multimedia framework can request a high-resolution ts stream from the server; the ffmpeg multimedia framework requests a high-resolution TS stream from the server, monitors the network situation, and switches the target HLS live video to TS streams of different resolutions for playback according to the network situation.
[0055] The TS stream belongs to the fragment in the target HLS live video. The target HLS live video represents the HLS stream generated in real time, and allows users to watch real-time video content; the TS stream is used to store encoded audio and video data. HLS is a new generation of streaming media transmission protocol. Its basic implementation principle is to fragment a large media file, and this fragment is ts.
[0056] TS stream (Transport Stream): It is a container format used to store encoded audio and video data. It follows the MPEG transport stream standard. In HLS, TS streams usually contain encoded H.264 video and AAC audio data. TS files are the basic units of HLS streams. They are referenced by M3U8 playlists, and the player will download these files in sequence for playback. HLS live video: HLS is a streaming network transmission protocol that allows audio, video, and subtitle streams to be transmitted over the HTTP protocol. HLS live video refers to HLS streams generated in real time, which allows users to watch real-time video content. Encoder: Encodes real-time video signals into H.264 video and AAC audio, and then encapsulates them into TS streams. Packager: Packages the encoded TS stream into an M3U8 playlist. Server: Stores TS files and M3U8 playlists, and provides them to clients for download via the HTTP protocol. Player: Downloads the M3U8 playlist and TS stream, and then decodes and plays the video.
[0057] In HLS live broadcast, the encoder generates TS streams in real time, and then the packager organizes these TS streams into M3U8 playlists. The player framework periodically requests the latest M3U8 playlist, then downloads and plays the TS streams in the playlist to achieve the live broadcast effect. This process is dynamic. As the live broadcast progresses, new TS streams will be added to the playlist and old TS streams will be removed.
[0058] Compared with the prior art, the present invention quickly improves the start-up speed, shortens the time from when a user clicks on a video to when the first frame of the video is displayed, avoids requesting multiple URLs and causing a long time of blocking, thereby improving the user's video viewing experience.
[0059] Furthermore, if Figure 4 As shown, based on the above-mentioned HLS-based video playback method, the present invention also provides a HLS-based video playback system, wherein the HLS-based video playback system includes:
[0060] The network status detection module 51 is used to receive the URL sent by the server through the ffmpeg multimedia framework when the target HLS live video is selected and clicked in the browser, and detect the network status to obtain the detection result of the network status;
[0061] The URL request processing module 52 is used to determine whether the current network speed is lower than a preset network speed threshold according to the detection result, and if the current network speed is lower than the preset network speed threshold, cancel the high-resolution URL request and request a low-resolution URL;
[0062] The video playback control module 53 is used to restore the canceled high-resolution URL request when the target HLS live video displays the first frame, so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status.
[0063] Furthermore, if Figure 5 As shown, based on the above-mentioned HLS-based video playback method and system, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Figure 5 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0064] The memory 20 may be an internal storage unit of the terminal in some embodiments, such as a hard disk or memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Furthermore, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a video playback program 40 based on HLS is stored on the memory 20, and the video playback program 40 based on HLS can be executed by the processor 10, thereby realizing the video playback method based on HLS in the present application.
[0065] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the HLS-based video playback method.
[0066] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0067] In one embodiment, when the processor 10 executes the HLS-based video playback program 40 in the memory 20, the following steps are implemented:
[0068] When the target HLS live video is selected and clicked in the browser, the URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status;
[0069] According to the detection result, determining whether the current network speed is lower than a preset network speed threshold, if the current network speed is lower than the preset network speed threshold, canceling the high-resolution URL request and requesting a low-resolution URL;
[0070] When the target HLS live video has finished displaying the first frame, the canceled high-resolution URL request is restored so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status.
[0071] When the target HLS live video is selected and clicked in the browser, the URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status, which specifically includes:
[0072] Obtain a selection operation instruction from the user, and select and click a target HLS live video in the browser according to the selection operation instruction;
[0073] When the user clicks on the browser, the browser initiates a request to the server and receives the URL sent by the server through the ffmpeg multimedia framework;
[0074] The network status is detected according to the URL sent by the server through the ffmpeg multimedia framework, and the detection result of the network status is obtained.
[0075] The detection result of the network status includes the current network speed.
[0076] The step of determining whether the current network speed is lower than a preset network speed threshold value according to the detection result, and if the current network speed is lower than the preset network speed threshold value, canceling the high-resolution URL request and requesting a low-resolution URL specifically includes:
[0077] Pre-acquire a preset network speed threshold according to a preset command, and obtain the current network speed in the detection result;
[0078] Compare the current network speed with the preset network speed threshold to determine whether the current network speed is lower than the preset network speed threshold;
[0079] If it is determined that the current network speed is lower than the preset network speed threshold, all high-resolution URL requests in the multiple M3U8 files with different resolutions are canceled, and only one low-resolution URL is requested.
[0080] The M3U8 file is a media playlist file based on HTTP, including multiple media resource links.
[0081] When the target HLS live video displays the first frame, the high-resolution URL request that was canceled is restored so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status, specifically including:
[0082] When the first frame of the target HLS live video is displayed, it indicates that the target HLS live video is fully started to play, and the canceled high-resolution URL request is restored;
[0083] The ffmpeg multimedia framework requests a high-resolution TS stream from the server, monitors the network conditions, and switches the target HLS live video to TS streams of different resolutions for playback according to the network conditions, wherein the TS stream belongs to a fragment in the target HLS live video.
[0084] The target HLS live video represents a real-time generated HLS stream, and allows users to watch real-time video content; the TS stream is used to store encoded audio and video data.
[0085] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an HLS-based video playback program, and when the HLS-based video playback program is executed by a processor, the steps of the HLS-based video playback method as described above are implemented.
[0086] In summary, the present invention provides a video playback method, system, terminal and computer-readable storage medium based on HLS, the method comprising: when selecting and clicking the target HLS live video in the browser, receiving the URL issued by the server through the ffmpeg multimedia framework, and detecting the network status to obtain the detection result of the network status; according to the detection result, judging whether the current network speed is lower than the preset network speed threshold, if the current network speed is lower than the preset network speed threshold, canceling the high-resolution URL request and requesting a low-resolution URL; when the target HLS live video displays the first frame, the canceled high-resolution URL request is restored, so that the ffmpeg multimedia framework monitors the network situation, and switches the target HLS live video to TS streams of different resolutions for playback according to the network situation. The present invention can quickly improve the start-up speed, shorten the time from the user clicking the video to the display of the first frame of the video screen, and avoid requesting multiple URLs to cause a long time of card, thereby improving the user's viewing experience.
[0087] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or terminal including the element.
[0088] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0089] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A video playback method based on HLS, characterized in that: The HLS-based video playback method includes: When the target HLS live video is selected and clicked in the browser, the URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status; According to the detection result, determining whether the current network speed is lower than a preset network speed threshold, if the current network speed is lower than the preset network speed threshold, canceling the high-resolution URL request and requesting a low-resolution URL; When the target HLS live video has finished displaying the first frame, the canceled high-resolution URL request is restored so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status.
2. The HLS-based video playback method according to claim 1, characterized in that: When the target HLS live video is selected and clicked in the browser, the URL sent by the server is received through the ffmpeg multimedia framework, and the network status is detected to obtain the detection result of the network status, which specifically includes: Obtain a selection operation instruction from the user, and select and click a target HLS live video in the browser according to the selection operation instruction; When the user clicks on the browser, the browser initiates a request to the server and receives the URL sent by the server through the ffmpeg multimedia framework; The network status is detected according to the URL sent by the server through the ffmpeg multimedia framework, and the detection result of the network status is obtained.
3. The HLS-based video playback method according to claim 2, characterized in that: The detection result of the network status includes the current network speed.
4. The HLS-based video playback method according to claim 1, characterized in that: The step of determining whether the current network speed is lower than a preset network speed threshold value according to the detection result, and if the current network speed is lower than the preset network speed threshold value, canceling the high-resolution URL request and requesting a low-resolution URL, specifically includes: Pre-acquire a preset network speed threshold according to a preset command, and obtain the current network speed in the detection result; Compare the current network speed with the preset network speed threshold to determine whether the current network speed is lower than the preset network speed threshold; If it is determined that the current network speed is lower than the preset network speed threshold, all high-resolution URL requests in the multiple M3U8 files with different resolutions are canceled, and only one low-resolution URL is requested.
5. The HLS-based video playback method according to claim 4, characterized in that: The M3U8 file is a media playlist file based on HTTP, including multiple media resource links.
6. The HLS-based video playback method according to claim 1, characterized in that: When the target HLS live video displays the first frame, the canceled high-resolution URL request is restored so that the ffmpeg multimedia framework monitors the network status and switches the target HLS live video to TS streams of different resolutions for playback according to the network status, specifically including: When the first frame of the target HLS live video is displayed, it indicates that the target HLS live video is fully started to play, and the canceled high-resolution URL request is restored; The ffmpeg multimedia framework requests a high-resolution TS stream from the server, monitors the network conditions, and switches the target HLS live video to TS streams of different resolutions for playback according to the network conditions, wherein the TS stream belongs to a fragment in the target HLS live video.
7. The HLS-based video playback method according to claim 1 or 6, characterized in that: The target HLS live video represents an HLS stream generated in real time and allows users to watch real-time video content; the TS stream is used to store encoded audio and video data.
8. A video playback system based on HLS, characterized in that: The HLS-based video playback system includes: The network status detection module is used to receive the URL sent by the server through the ffmpeg multimedia framework when the target HLS live video is selected and clicked in the browser, and detect the network status to obtain the detection result of the network status; A URL request processing module, configured to determine whether the current network speed is lower than a preset network speed threshold according to the detection result, and if the current network speed is lower than the preset network speed threshold, cancel the high-resolution URL request and request a low-resolution URL; The video playback control module is used to restore the canceled high-resolution URL request when the target HLS live video displays the first frame, so that the ffmpeg multimedia framework monitors the network situation and switches the target HLS live video to TS streams of different resolutions for playback according to the network situation.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and an HLS-based video playback program stored in the memory and executable on the processor. When the HLS-based video playback program is executed by the processor, the steps of the HLS-based video playback method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an HLS-based video playback program, and when the HLS-based video playback program is executed by a processor, the steps of the HLS-based video playback method according to any one of claims 1 to 7 are implemented.
