Video definition switching method, system and device and storage medium

By adding auxiliary tags to the index playlist file, identifying the display timestamps and keyframes of video frames, the video clarity switching is achieved, which solves the problem of stuttering video playback in adaptive clarity technology and improves the user experience.

CN119135991APending Publication Date: 2024-12-13CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411311620.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Current adaptive clarity technology causes video playback to stutter when network conditions are unstable, and the user experience is poor. It is mainly because it requires downloading video slice files of two clarity at the same time for parsing, which occupies too much network bandwidth.

Method used

By adding auxiliary tags to the index playlist file, identifying the display timestamp of the video frame and whether it is a keyframe, downloading and playing the video frame sequence from the target frame, switching video clarity is achieved, and the consumption of network bandwidth resources is reduced. .

Benefits of technology

Quickly complete the time stamp alignment of video frames, optimize the phenomenon of video playback lag, and improve the user's video viewing experience, without downloading two definition video slice files for parsing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135991A_ABST
    Figure CN119135991A_ABST
Patent Text Reader

Abstract

The invention discloses a video definition switching method, system and device and a storage medium, and the method comprises the steps: detecting a playing environment parameter when a target video is played; determining whether definition switching is needed or not according to the playing environment parameters; if it is determined that the definition of the target video needs to be switched, querying an index playlist file corresponding to the target video, and determining a video frame sequence of the target definition in the index playlist file; the index playlist file carries an auxiliary label, and the auxiliary label is used for identifying the display timestamp of each video frame and whether the video frame is a key frame; determining a target frame which is closest to the display timestamp corresponding to the currently played video frame and belongs to the key frame in the video frame sequence; and starting to download and play the video frame sequence from the target frame, so that the target video is switched to the target definition. According to the method, the definition of the video can be automatically switched, so that the video watching experience of a user is improved. The method can be widely applied to the technical field of videos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video technology, and in particular to a method, system, device and storage medium for switching video definition. Background Art

[0002] At present, with the development of information technology, more and more application services have emerged, bringing more convenience and fresh experience to people's work and life. Among them, based on the rapid development of Internet technology, 4G, 5G and other mobile communication technologies, the penetration rate of broadband has continued to increase, making video live broadcast / on-demand applications possible. People can watch high-definition videos anytime and anywhere, which greatly enhances the timeliness and authenticity of information dissemination.

[0003] In related technologies, in order to improve the user's video viewing experience, adaptive definition technology is generally used during video playback, that is, automatically adjusting the video playback definition according to the situation of the playback terminal, which can significantly improve the user experience, especially when the network conditions are unstable. However, the current adaptive definition is often implemented based on the HLS protocol, which will pull additional video files with additional definition for parsing under the current video definition, resulting in further network resource occupation under poor network conditions, making the video playback jamming more serious and the user's viewing experience poor.

[0004] In summary, the problems existing in related technologies need to be solved urgently. Summary of the invention

[0005] The purpose of this application is to solve one of the technical problems existing in the related art to at least a certain extent.

[0006] To this end, an object of embodiments of the present application is to provide a video clarity switching method, system, device and storage medium.

[0007] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present application include:

[0008] On the one hand, an embodiment of the present application provides a video definition switching method, which is applied to a playback terminal, and the method includes:

[0009] When the target video is playing, detecting the playing environment parameters of the target video;

[0010] Determining whether the target video needs to be switched in definition according to the playback environment parameters;

[0011] If it is determined that the target video needs to switch the definition, query the index playlist file corresponding to the target video, and determine the video frame sequence of the target definition in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify the display timestamp of each video frame and whether the video frame is a key frame;

[0012] Determine, in the video frame sequence, a target frame that has a display timestamp closest to the currently played video frame and is a key frame;

[0013] The video frame sequence is downloaded and played starting from the target frame, so that the target video is switched to the target definition.

[0014] In addition, the video definition switching method according to the above embodiment of the present application may also have the following additional technical features:

[0015] Further, in one embodiment of the present application, the index playlist file is created by the following steps:

[0016] The streaming media server receives streaming data from the anchor terminal;

[0017] The streaming media server transcodes the streaming data at a set bit rate through a transcoding cluster according to a source stream timestamp of the streaming data, to obtain multiple groups of video slice clusters; wherein each group of the video slice clusters includes a plurality of video frames at the same definition, and each of the video frames carries the auxiliary tag;

[0018] The streaming media server creates the index playlist file according to the video slice cluster.

[0019] Furthermore, in one embodiment of the present application, the method further includes:

[0020] The streaming media server performs a normative detection on the source stream timestamp of the streaming data;

[0021] If it is determined that the result of the compliance check is abnormal, the streaming media server repairs the source stream timestamp.

[0022] Further, in an embodiment of the present application, detecting the playback environment parameters of the target video and determining whether the target video needs to switch the definition according to the playback environment parameters includes:

[0023] Detecting the network bandwidth of the playback terminal;

[0024] According to the change of the network bandwidth, it is determined whether the definition of the target video needs to be switched.

[0025] Further, in one embodiment of the present application, the target clarity is determined by the following steps:

[0026] Detecting the current original definition of the target video;

[0027] If the playback environment parameters are optimized, a definition higher than the original definition is determined as the target definition; or, if the playback environment parameters are deteriorated, a definition lower than the original definition is determined as the target definition.

[0028] Furthermore, in one embodiment of the present application, the target video includes at least one of on-demand video, live video, user-generated video, virtual reality video, or augmented reality video.

[0029] On the other hand, an embodiment of the present application provides a video definition switching system, the system comprising:

[0030] A detection unit, used to detect playback environment parameters of the target video when the target video is played;

[0031] A determination unit, configured to determine whether the target video needs to be switched in definition according to the playback environment parameters;

[0032] A query unit, configured to query an index playlist file corresponding to the target video if it is determined that the target video needs to switch the definition, and determine a video frame sequence of the target definition in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify a display timestamp of each video frame and whether the video frame is a key frame;

[0033] A processing unit, configured to determine, in the video frame sequence, a target frame that has a display timestamp closest to that of a currently played video frame and is a key frame;

[0034] An execution unit is used to download and play the video frame sequence starting from the target frame, so that the target video is switched to the target definition.

[0035] Further, in one embodiment of the present application, the index playlist file is created by the following steps:

[0036] The streaming media server receives streaming data from the anchor terminal;

[0037] The streaming media server transcodes the streaming data at a set bit rate through a transcoding cluster according to a source stream timestamp of the streaming data, to obtain multiple groups of video slice clusters; wherein each group of the video slice clusters includes a plurality of video frames at the same definition, and each of the video frames carries the auxiliary tag;

[0038] The streaming media server creates the index playlist file according to the video slice cluster.

[0039] On the other hand, an embodiment of the present application provides an electronic device, including:

[0040] at least one processor;

[0041] at least one memory for storing at least one program;

[0042] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned video definition switching method.

[0043] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, which stores a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned video clarity switching method.

[0044] The advantages and benefits of the present application will be partially given in the following description, and partially become apparent from the following description, or be understood through the practice of the present application:

[0045] The video definition switching method, system, device and storage medium disclosed in the embodiment of the present application, when the target video is played, the playback environment parameters of the target video are detected; according to the playback environment parameters, whether the target video needs to switch the definition; if it is determined that the target video needs to switch the definition, the index playlist file corresponding to the target video is queried, and the video frame sequence of the target definition is determined in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify the display timestamp of each video frame and whether the video frame is a key frame; in the video frame sequence, the target frame that is closest to the display timestamp corresponding to the currently played video frame and belongs to the key frame is determined; the video frame sequence is downloaded and played from the target frame, so that the target video switches to the target definition. The method can help quickly complete the timestamp alignment of the video frame and complete the switching of the video frame sequence of different definitions by adding an auxiliary tag containing the display timestamp in the index playlist file, without downloading two video slice files of definition for parsing at the same time, which can reduce the occupation and consumption of network bandwidth resources, optimize the video playback jamming phenomenon, and thus improve the user's video viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present application. For technical personnel in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 A schematic diagram of an implementation environment of a video definition switching method provided in an embodiment of the present application;

[0048] Figure 2 A schematic diagram of a flow chart of a video definition switching method provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of the principle of implementing video definition switching in a related technical solution;

[0050] Figure 4 A schematic diagram of a principle for implementing video definition switching provided in an embodiment of the present application;

[0051] Figure 5 A schematic diagram of a process for establishing an index playlist file provided in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of data transmission for processing live video provided in an embodiment of the present application;

[0053] Figure 7 A schematic diagram of a process for repairing a source stream timestamp provided in an embodiment of the present application;

[0054] Figure 8 A schematic diagram of a process for determining target clarity provided in an embodiment of the present application;

[0055] Fig. 9 A schematic diagram of the structure of a video definition switching system provided in an embodiment of the present application;

[0056] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0058] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0060] 1) HLS (HTTP Live Streaming), a widely used adaptive streaming protocol developed by Apple Inc. It allows the client to dynamically adjust the video quality when playing the video and select the most suitable bit rate according to the current network conditions.

[0061] 2) PTS (Presentation Time Stamp), a time stamp in a digital video stream that indicates the specific time point when a video or audio packet should be decoded and played. PTS plays a key role in multimedia transmission and synchronization, especially in the video encoding and decoding process.

[0062] 3) I frame (Intra-coded Picture) is a basic concept in video compression and encoding. I frame uses intra-frame coding, which means it only uses the data of the image itself without referring to other frames, similar to a complete static picture.

[0063] At present, with the development of information technology, more and more application services have emerged, bringing more convenience and fresh experience to people's work and life. Among them, based on the rapid development of Internet technology, 4G, 5G and other mobile communication technologies, the penetration rate of broadband has continued to increase, making video live broadcast / on-demand applications possible. People can watch high-definition videos anytime and anywhere, which greatly enhances the timeliness and authenticity of information dissemination.

[0064] In related technologies, in order to improve the user's video viewing experience, adaptive definition technology is generally used during video playback, that is, automatically adjusting the video playback definition according to the situation of the playback terminal, which can significantly improve the user experience, especially when the network conditions are unstable. However, the current adaptive definition is often implemented based on the HLS protocol, which will pull additional video files with additional definition for parsing under the current video definition, resulting in further network resource occupation under poor network conditions, making the video playback jamming more serious and the user's viewing experience poor.

[0065] In view of this, a video definition switching method is provided in an embodiment of the present application. The method is applied to a playback terminal. When a target video is played, the playback environment parameters of the target video are detected; according to the playback environment parameters, it is determined whether the target video needs to switch the definition; if it is determined that the target video needs to switch the definition, the index playlist file corresponding to the target video is queried, and a video frame sequence of the target definition is determined in the index playlist file; in the video frame sequence, a target frame that is closest to the display timestamp corresponding to the currently played video frame and belongs to a key frame is determined; the video frame sequence is downloaded and played starting from the target frame, so that the target video switches to the target definition. The method can help quickly complete the timestamp alignment of the video frame and complete the switching of the video frame sequences of different definitions by adding an auxiliary tag containing the display timestamp in the index playlist file, without downloading two video slice files of definition for parsing at the same time, which can reduce the occupation and consumption of network bandwidth resources, optimize the video playback jamming phenomenon, and thus improve the user's video viewing experience.

[0066] Please refer to Figure 1 , Figure 1 A schematic diagram of an implementation environment of a video definition switching method provided in an embodiment of the present application is shown. In the implementation environment, the main hardware and software entities involved include a terminal device 110 and a backend server 120. The terminal device 110 and the backend server 120 are connected in communication. The terminal device 110 can be used to play a video, and the backend server 120 can be used to provide video resources.

[0067] Specifically, the video definition switching method provided in the embodiment of the present application can be executed based on the data interaction between the terminal device 110 and the background server 120. Among them, the terminal device 110 of the above embodiment may include a mobile phone, a computer, a smart wearable device, an intelligent voice interaction device, a vehicle terminal, etc., but is not limited to this. The background server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0068] The terminal device 110 and the backend server 120 may establish a communication connection via a wireless network or a wired network. The wireless network or wired network uses standard communication technology and / or protocols, and the network may be set to the Internet or any other network, such as but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network.

[0069] Of course, it is understandable that Figure 1 The implementation environment in the embodiment of the present application is only some optional application scenarios of the video definition switching method provided in the embodiment of the present application, and the actual application is not fixed. Figure 1 The hardware and software environment shown.

[0070] Below, in combination with the introduction of the aforementioned implementation environment, a video clarity switching method provided in an embodiment of the present application is introduced and explained.

[0071] Please refer to Figure 2 , Figure 2 is a schematic diagram of a video definition switching method provided in an embodiment of the present application. The video definition switching method can be applied to a playback terminal. Specifically, the video definition switching method provided in an embodiment of the present application includes but is not limited to:

[0072] Step 210: When the target video is playing, detecting the playing environment parameters of the target video;

[0073] Step 220: Determine whether the target video needs to switch the definition according to the playback environment parameters;

[0074] Step 230: If it is determined that the target video needs to switch the definition, query the index playlist file corresponding to the target video, and determine the video frame sequence of the target definition in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify the display timestamp of each video frame and whether the video frame is a key frame;

[0075] Step 240: Determine, in the video frame sequence, a target frame that has a display timestamp closest to the currently played video frame and is a key frame;

[0076] Step 250: Download and play the video frame sequence starting from the target frame, so that the target video switches to the target definition.

[0077] In an embodiment of the present application, a method for switching video clarity is provided. The method can help quickly complete the timestamp alignment of video frames and complete the switching of video frame sequences with different clearnesses by adding an auxiliary tag containing a display timestamp in an index playlist file. There is no need to download video slice files of two clearnesses for parsing at the same time, which can reduce the occupancy and consumption of network bandwidth resources and optimize the video playback jamming phenomenon, thereby improving the user's video viewing experience.

[0078] Specifically, in an embodiment of the present application, when performing a video definition switching operation, the video that needs to be switched in video definition is recorded as the target video, and the specific type of the target video is not limited in the present application. Exemplarily, in some embodiments, the target video may be a video on demand, a live video, a user-generated video, a virtual reality video, or an augmented reality video, etc., and the present application does not limit this. Among them, the video on demand is a video content that the user can choose to select from the video library and play immediately, such as a movie, a TV series, a documentary, etc. Live video is content transmitted in real time, and the audience can watch it synchronously, such as live events (sports games, e-sports), live news, concerts or live concerts, etc. User-generated videos are video content created and shared by ordinary users, such as life record videos, travel videos, and gourmet cooking videos. Virtual reality video is video content designed specifically for virtual reality devices, and augmented reality video is video content that combines real scenes and digital elements.

[0079] In an embodiment of the present application, the target video playback environment parameters can be detected when the target video is played, and then it can be determined whether the clarity needs to be switched based on these playback environment parameters. Here, the types of the target video playback environment parameters can be diverse, and the specific principle of determining whether the clarity needs to be switched based on the playback environment parameters can be flexibly set based on the type of playback environment parameters. Exemplarily, in some embodiments, the playback environment parameters that can be detected by the present application mainly include but are not limited to the following categories: 1) Network bandwidth: For example, the current network status can be evaluated by real-time monitoring of the user's network connection speed, and the network bandwidth data can be obtained indirectly through upload / download testing or by analyzing the delay, packet loss rate and other information of the data packet during the video streaming process. 2) Device performance: The device performance can specifically include the CPU usage rate, memory occupancy and other hardware resource utilization conditions, which are used to determine whether the device has sufficient processing power to support high-resolution video playback. 3) Power status: For mobile devices, if the battery is low, it may be desirable to reduce the video quality to save power, so the power status can be used as the playback environment parameter of the target video. 4) User location and time: For example, when the user is in a public place (such as a cafe) and it is not peak time, there may be better network conditions; on the contrary, when taking public transportation during peak hours in the morning and evening, the network may be unstable. Therefore, it is possible to determine whether the target video needs to switch its clarity based on the user's location and time.

[0080] Of course, it should be noted that the playback environment parameters in the embodiments of the present application are not limited to the above types, and can be flexibly set according to actual needs.

[0081] In an embodiment of the present application, when determining whether the target video needs to switch the definition according to the playback environment parameters, it can be determined based on one or more playback environment parameters. Exemplarily, for example, in some embodiments, the network bandwidth of the playback terminal can be detected, and according to the change of the network bandwidth, it is determined whether the target video needs to switch the definition. For example, when it is detected that the network bandwidth is insufficient (becomes less than a predetermined threshold), priority should be given to reducing the video definition to avoid playback interruption due to buffering. In some embodiments, the device load of the playback terminal can be detected. If it is found that the device load is high, in order to ensure a smooth playback experience, the definition can also be appropriately lowered. In some embodiments, the device power of the playback terminal can be detected. When the device power is lower than a certain threshold, it automatically switches to a lower quality version to extend the battery life. In some embodiments, it can be determined in combination with a variety of playback environment parameters. For example, when the network signal is good but the device load is high, it may be selected to slightly reduce the definition instead of drastically reducing it to achieve a balance between the best viewing effect and device performance.

[0082] In an embodiment of the present application, if it is determined that the target video needs to switch the definition, the index playlist file (Index playlist) corresponding to the target video can be queried. The index playlist file is a file used to organize and manage multimedia files (such as audio or video files). For video data, the index playlist file can instruct the player how to play the video. And, generally speaking, there can be multiple index playlist files, each index playlist file corresponds to a video frame sequence of a definition (also called a video slice file). Therefore, in an embodiment of the present application, when it is determined that the definition needs to be switched, the index playlist file corresponding to the target video can be queried to determine the video frame sequence corresponding to the definition that needs to be adjusted. In an embodiment of the present application, the definition that needs to be adjusted can be recorded as the target definition, and the target definition can be specifically determined according to the situation where switching is required, and the present application does not limit its specific size.

[0083] It should be noted that in the embodiment of the present application, after determining the video frame sequence of the target definition, when executing the switching task, it is necessary to align the timestamps of the currently playing video and the switched video. In related applications, taking the switching from a high-definition video stream to a low-definition video stream as an example, when it is determined that a switch is required, the playback terminal needs to download the low-definition video stream while playing the current high-definition video stream, parse it, obtain the display timestamp, and then find a time point close to the timestamp of the I frame (intra-frame coded frame) of the currently playing video stream for switching. For example, please refer to Figure 3 , Figure 3 A schematic diagram showing the principle of implementing video definition switching in a related technical solution is shown. Figure 3 As shown in the figure, assuming that the current target video playback bit rate is 1080p, which is a higher definition, and needs to be switched to 720p, which is a lower definition. Each video frame is numbered separately. Assuming that the current playback reaches 1080p-3.m4s, it is found that it needs to be switched. At this time, the playback terminal will start downloading 720p video data, and after parsing, obtain the display timestamps corresponding to each 720p video data, and then align each video frame according to the display timestamps, as shown in the figure. Figure 3As shown, the display timestamp of the 1080p-1.m4s video frame is the same as the display timestamp of the 720p-1.m4s video frame, the display timestamp of the 1080p-2.m4s video frame is the same as the display timestamp of the 720p-2.m4s video frame, the display timestamp of the 1080p-3.m4s video frame is the same as the display timestamp of the 720p-3.m4s video frame, and so on. However, since it takes a certain amount of time to download and parse the 720p video data, when the display timestamp is obtained, the target video may have continued to play for several frames, for example, it has played to the 1080p-6.m4s frame. At this time, the 720p video data closest to the display timestamp of the frame is the 720p-7.m4s video frame. In this case, the switching action will be performed at the 720p-7.m4s video frame, and the 720p video data will be switched to play. It can be seen that the switching strategy used in the related art requires that the playback terminal needs to download and parse the 720p video data while playing the 1080p video data for a period of time, which will further occupy network bandwidth resources and aggravate the video playback jamming phenomenon. Moreover, since it takes a long time to download and parse the 720p video data, the switching efficiency is also affected, resulting in a poor viewing experience for users.

[0084] In an embodiment of the present application, an auxiliary tag can be added to the index playlist file, and the display timestamp of each video frame and whether the video frame is a key frame (such as an intra-frame coded frame) can be identified by the auxiliary tag. The auxiliary tag is an extended tag and will not affect the compatibility of the original index playlist file. The playback terminal can play the corresponding video data normally.

[0085] For example, taking the HLS protocol as an example, an auxiliary tag can be added, recorded as #EXT-B-AUX, and the data format of #EXT-B-AUX is as follows: PTS timestamp (hexadecimal) | whether it is a key frame (K is a key frame, N is a non-key frame) | file size (hexadecimal) | file crc32 (hexadecimal), where | means separation. The following is an example of a partial index playlist file:

[0086] #EXTM3U

[0087] #EXT-X-VERSION: 7

[0088] #EXT-X-START:TIME-OFFSET=0

[0089] #EXT-X-MEDIA-SEQUENCE: 77734303

[0090] #EXT-X-TARGETDURATION: 1

[0091] #EXT-X-MAP: URI="h1718688058.m4s"

[0092] #EXT-B-AUX:c0f30b|K|9e7b5|7bf4037

[0093] #EXTINF: 1.00, 9e7b5|7bf4037

[0094] 77734303.m4s

[0095] #EXT-B-AUX:c0f6b0|N|6818b|7eaadcdc

[0096] #EXTINF: 1.00, 6818b|7eaadcdc

[0097] 77734304.m4s

[0098] Among them, in the above-mentioned index playlist file, there are two auxiliary tags "#EXT-B-AUX: c0f30b|K|9e7b5|7bf4037" and "#EXT-B-AUX: c0f6b0|N|6818b|7eaadcdc", which can be used to identify the relevant information of the two video frames. Of course, it should be pointed out that the auxiliary tags in the embodiment of the present application are only used for exemplary description, and their specific content can be flexibly set according to actual needs, and the present application does not limit this.

[0099] In the embodiment of the present application, based on the index playlist file with the auxiliary tag added, the video frame with the closest display timestamp to the currently played video frame and belonging to the intra-frame coded frame can be quickly determined, and in the embodiment of the present application, it can be recorded as the target frame. Figure 4 , Figure 4 A schematic diagram showing a principle of implementing video definition switching provided in an embodiment of the present application is shown. Figure 3The background involved is similar, but in the technical solution in the embodiment of the present application, when switching, since the display timestamp of each 720p video frame and the information whether it belongs to a key frame can be directly obtained from the index playlist file, it is not necessary to download the 720p video data to determine which frame to switch from. For example, when the current playback is 1080p-3.m4s, it is found that switching is required. At this time, the playback terminal can directly determine that the 720p-4.m4s video frame is the target frame that is closest to the display timestamp corresponding to the currently played video frame and belongs to the key frame. Therefore, in this case, the 720p video data, that is, the video frame sequence of the target definition, can be downloaded and played directly from the 720p-4.m4s video frame, so as to achieve the definition switching of the target video. Relatively speaking, when switching from low definition to high definition, such as switching from 720p video data to 1080p video data, the above process can also be used to complete the switching efficiently and quickly.

[0100] It can be understood that a video definition switching method is provided in an embodiment of the present application, which is applied to a playback terminal. When a target video is played, the playback environment parameters of the target video are detected; according to the playback environment parameters, it is determined whether the target video needs to switch the definition; if it is determined that the target video needs to switch the definition, the index playlist file corresponding to the target video is queried, and the video frame sequence of the target definition is determined in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify the display timestamp of each video frame and whether the video frame is a key frame; in the video frame sequence, the target frame that is closest to the display timestamp corresponding to the currently played video frame and belongs to the key frame is determined; the video frame sequence is downloaded and played from the target frame, so that the target video switches to the target definition. The method can help quickly complete the timestamp alignment of the video frame and complete the switching of the video frame sequence of different definitions by adding an auxiliary tag containing the display timestamp in the index playlist file, without downloading two video slice files of definition for parsing at the same time, which can reduce the occupation and consumption of network bandwidth resources, optimize the video playback jamming phenomenon, and thus improve the user's video viewing experience.

[0101] Specifically, in some embodiments, referring to Figure 5 The index playlist file is created by the following steps:

[0102] The streaming media server receives streaming data from the anchor terminal;

[0103] The streaming media server transcodes the streaming data at a set bit rate through a transcoding cluster according to a source stream timestamp of the streaming data, to obtain multiple groups of video slice clusters; wherein each group of the video slice clusters includes a plurality of video frames at the same definition, and each of the video frames carries the auxiliary tag;

[0104] The streaming media server creates the index playlist file according to the video slice cluster.

[0105] In an embodiment of the present application, the above-mentioned target video may be a live video. In this case, the data source of the video may be provided by the anchor terminal. In an embodiment of the present application, for the anchor terminal, the streaming media server may receive the streaming data from the anchor terminal. The streaming data may be an audio and video stream transmitted in the original format (such as RTMP, HLS, etc.). Then, the streaming media server may parse the source stream timestamp information in the received data packet. The source stream timestamp is very important in real-time streaming media transmission. It can help maintain audio and video synchronization and ensure that the data is processed and played in the correct order. Based on the extracted timestamp information, the streaming media server will send the original streaming data to the transcoding cluster for processing. For example, please refer to Figure 6 , Figure 6 The following is a schematic diagram of a data transmission method for processing live video provided in an embodiment of the present application. The "transcoding cluster" mentioned in the embodiment of the present application can be a group of servers or virtual machines dedicated to video transcoding, which can process a large amount of video data in parallel. At this stage, the original push stream data will be converted into multiple video streams with different bitrate versions to meet the needs of users under different network conditions, such as Figure 6 The video stream may include 360p, 480p, 720p and other different bit rate versions, and this application does not impose any restrictions on this. In an embodiment of the present application, the transcoded video data will be further divided into a series of small segments (such as video frames), which are recorded as video slice clusters. A video slice cluster includes multiple video frames at the same clarity. For each video frame, their corresponding auxiliary tags can be determined during transcoding. The advantage of this is that it can support fast switching of different video quality levels, and it is also convenient to adjust the playback strategy when the network is unstable. In an embodiment of the present application, after obtaining the video slice cluster, a corresponding index playlist file can be established according to each video slice cluster.

[0106] In the present application embodiment, Figure 6 As shown, the definition scheduling service can combine video data of various definitions according to the generated index playlist file to generate a Master playlist file, which can be saved to a memory-mapped disk to speed up access.

[0107] In some embodiments, reference Figure 7 , the method further comprises:

[0108] The streaming media server performs a normative detection on the source stream timestamp of the streaming data;

[0109] If it is determined that the result of the compliance check is abnormal, the streaming media server repairs the source stream timestamp.

[0110] In the embodiment of the present application, for the original push stream data, each video or audio data in it will be stamped with a timestamp to identify the time when this data should be played, that is, the source stream timestamp. This timestamp is crucial to ensure the order and real-time performance of the playback. In practical applications, the source stream timestamp of the push stream data may be irregular, for example, the timestamp of the I frame may suddenly decrease or remain unchanged, which may cause the player to freeze.

[0111] Therefore, in an embodiment of the present application, the source stream timestamp of the streaming data can be checked for normativeness. This step is mainly to check whether these source stream timestamps meet the expected standards, such as whether there are jumps, repetitions or other abnormal situations. If the result of the normative test is normal, subsequent processing can be performed; if the result of the normative test is abnormal, the server will start the corresponding repair mechanism. For example, recalculate the timestamp, that is, adjust the timestamp of the current data based on the actual arrival time of the received data and the relationship between the previous and subsequent data. Of course, the specific repair strategy adopted can be determined according to actual needs, and this application does not limit this. In some embodiments, the system can also configure a feedback mechanism to inform the streaming end about the modification of the source stream timestamp, so that the streaming end can make adjustments according to the actual situation and reduce the occurrence of similar problems in the future.

[0112] In some embodiments, reference Figure 8 , the target clarity is determined by the following steps:

[0113] Detecting the current original definition of the target video;

[0114] If the playback environment parameters are optimized, a definition higher than the original definition is determined as the target definition; or, if the playback environment parameters are deteriorated, a definition lower than the original definition is determined as the target definition.

[0115] In an embodiment of the present application, when determining the target definition, the current original definition of the target video can be detected first. If it is detected that the playback environment parameters are optimized, then a definition higher than the original definition can be determined as the target definition. The degree of optimization here can be determined according to actual needs. For example, if the bit rate corresponding to the current target video is 480p, the bit rate corresponding to the target definition can be determined as 720p, or it can be determined as 1080p. This application does not impose any restrictions on this. Similarly, if it is detected that the playback environment parameters have deteriorated, then a definition lower than the original definition can be determined as the target definition. The degree of downward switching of the target definition here can also be determined according to actual needs. For example, if the bit rate corresponding to the current target video is 480p, the bit rate corresponding to the target definition can be determined as 360p. This application does not impose any restrictions on this.

[0116] Reference Fig. 9 In an embodiment of the present application, a video definition switching system is also provided, including:

[0117] The detection unit 910 is used to detect the playback environment parameters of the target video when the target video is played;

[0118] A determination unit 920, configured to determine whether the target video needs to be switched in definition according to the playback environment parameter;

[0119] The query unit 930 is used to query the index playlist file corresponding to the target video if it is determined that the target video needs to switch the definition, and determine the video frame sequence of the target definition in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify the display timestamp of each video frame and whether the video frame is a key frame;

[0120] A processing unit 940 is used to determine, in the video frame sequence, a target frame that has a display timestamp closest to the currently played video frame and is a key frame;

[0121] The execution unit 950 is configured to download and play the video frame sequence starting from the target frame, so that the target video is switched to the target definition.

[0122] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0123] Reference Fig.10 , an embodiment of the present application provides an electronic device, including:

[0124] at least one processor 1010;

[0125] At least one memory 1020, used to store at least one program;

[0126] When at least one program is executed by at least one processor 1010, at least one processor 1010 implements the above-mentioned video definition switching method.

[0127] Similarly, the contents of the above method embodiments are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0128] The embodiment of the present application further provides a computer-readable storage medium, in which a program executable by the processor 1010 is stored. The program executable by the processor 1010 is used to execute the above-mentioned video definition switching method when executed by the processor 1010.

[0129] Similarly, the contents of the above method embodiments are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0130] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. The optional embodiment is expected, wherein the order of various operations is changed and the sub-operation described as a part of a larger operation is performed independently.

[0131] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.

[0132] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0133] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0134] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0135] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0136] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0137] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

[0138] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A video definition switching method, characterized in that: Applied to a playback terminal, the method includes: When the target video is playing, detecting the playing environment parameters of the target video; Determining whether the target video needs to be switched in definition according to the playback environment parameters; If it is determined that the target video needs to switch the definition, query the index playlist file corresponding to the target video, and determine the video frame sequence of the target definition in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify the display timestamp of each video frame and whether the video frame is a key frame; Determine, in the video frame sequence, a target frame that has a display timestamp closest to the currently played video frame and is a key frame; The video frame sequence is downloaded and played starting from the target frame, so that the target video is switched to the target definition.

2. A video definition switching method according to claim 1, characterized in that: The index playlist file is created by the following steps: The streaming media server receives streaming data from the anchor terminal; The streaming media server transcodes the streaming data at a set bit rate through a transcoding cluster according to a source stream timestamp of the streaming data, to obtain multiple groups of video slice clusters; wherein each group of the video slice clusters includes a plurality of video frames at the same definition, and each of the video frames carries the auxiliary tag; The streaming media server creates the index playlist file according to the video slice cluster.

3. A video definition switching method according to claim 2, characterized in that: The method further comprises: The streaming media server performs a normative detection on the source stream timestamp of the streaming data; If it is determined that the result of the compliance check is abnormal, the streaming media server repairs the source stream timestamp.

4. The video definition switching method according to claim 1, characterized in that: The detecting the playback environment parameters of the target video and determining whether the target video needs to be switched in definition according to the playback environment parameters includes: Detecting the network bandwidth of the playback terminal; According to the change of the network bandwidth, it is determined whether the definition of the target video needs to be switched.

5. A video definition switching method according to any one of claims 1-4, characterized in that: The target clarity is determined by the following steps: Detecting the current original definition of the target video; If the playback environment parameters are optimized, a definition higher than the original definition is determined as the target definition; or, if the playback environment parameters are deteriorated, a definition lower than the original definition is determined as the target definition.

6. A video definition switching method according to claim 1, characterized in that: The target video includes at least one of a video on demand, a live video, a user-generated video, a virtual reality video, or an augmented reality video.

7. A video definition switching system, characterized in that: The system comprises: A detection unit, used to detect playback environment parameters of the target video when the target video is played; A determination unit, configured to determine whether the target video needs to be switched in definition according to the playback environment parameters; A query unit, configured to query an index playlist file corresponding to the target video if it is determined that the target video needs to switch the definition, and determine a video frame sequence of the target definition in the index playlist file; wherein the index playlist file carries an auxiliary tag, and the auxiliary tag is used to identify a display timestamp of each video frame and whether the video frame is a key frame; A processing unit, configured to determine, in the video frame sequence, a target frame that has a display timestamp closest to that of a currently played video frame and is a key frame; An execution unit is used to download and play the video frame sequence starting from the target frame, so that the target video is switched to the target definition.

8. A video definition switching system according to claim 7, characterized in that: The index playlist file is created by the following steps: The streaming media server receives streaming data from the anchor terminal; The streaming media server transcodes the streaming data at a set bit rate through a transcoding cluster according to a source stream timestamp of the streaming data, to obtain multiple groups of video slice clusters; wherein each group of the video slice clusters includes a plurality of video frames at the same definition, and each of the video frames carries the auxiliary tag; The streaming media server creates the index playlist file according to the video slice cluster.

9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a method according to any one of claims 1 to 6.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement a method according to any one of claims 1 to 6 when executed by the processor.

Citation Information

Cited By

  • File carousel stream pushing method based on live broadcast system and related device

    CN120034680A

  • Audio playing method, device, equipment, medium and program product

    CN121029122A