Video playback method, device, electronic device, and computer-readable storage medium

By storing only the video encoding information of the baseline resolution in the server and determining the encoding information of the target resolution based on the mapping relationship, the problem of storage resource waste is solved and efficient video clarity switching and seamless playback are achieved.

CN115643429BActive Publication Date: 2025-09-05TENCENT TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110819698.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-20
Publication Date
2025-09-05
Estimated Expiration
2041-07-20

AI Technical Summary

Technical Problem

In the prior art, the need to store film sources of various resolutions results in a waste of storage resources.

Method used

The server only stores the encoding information of the basic video at the reference resolution, and determines the encoding information of the target resolution through a pre-stored mapping relationship. The user terminal decodes the target encoding file to obtain the video corresponding to the target resolution and plays it.

Benefits of technology

Save storage resources, improve the quality and efficiency of clarity switching, reduce switching time, and ensure seamless switching of video images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115643429B_ABST
    Figure CN115643429B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a video playback method, device, electronic device and computer-readable storage medium, which relate to the fields of video processing and blockchain technology. The method comprises: in response to a video definition switching operation, sending a video definition switching request to a server, wherein the video definition switching request includes a target resolution and a video identifier; receiving a target encoding file sent by the server, and decoding the target encoding file based on the target encoding file to obtain a video corresponding to the target resolution and play it. In the solution of the present application, since the server only stores the encoding information (first encoding information) and multiple encoding information of a film source of one resolution, videos of other resolutions can be determined based on the target encoding information corresponding to the basic video and the target resolution. Therefore, the solution based on the present application can save storage resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical fields of network media, video processing and playback control. Specifically, the present application relates to a video playback method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of video services, users' demand for online video viewing is increasing. Video clarity and playback smoothness are key factors affecting user experience. To meet the needs of different users, video playback platforms often offer different resolutions for the same source, such as standard definition, high definition, and ultra-high definition.

[0003] In the prior art, film sources of various resolutions are usually stored separately first. When a resolution switching request is received, the film source corresponding to the target resolution corresponding to the resolution switching request is sent to the terminal for playback. Since film sources of various resolutions need to be stored, storage resources are wasted. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a video playback method, device, electronic device and computer-readable storage medium that can reduce storage resources.

[0005] In one aspect, an embodiment of the present application provides a video playback method, the method comprising:

[0006] In response to the video definition switching operation, sending a video definition switching request to the server, wherein the video definition switching request includes a target resolution and a video identifier;

[0007] Receive the target coded file sent by the server, decode the target coded file to obtain the video corresponding to the target resolution and play it, wherein the target coded file is obtained by the server in the following way:

[0008] Determine first encoding information of a basic video corresponding to the video identifier, where the resolution of the basic video is a reference resolution;

[0009] If the target resolution is the reference resolution, sending the target encoding file including the first encoding information to the user terminal;

[0010] If the target resolution is not the reference resolution, and the target resolution is a resolution that is not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier, and sending a target encoding file including the first encoding information and the target encoding information to the user terminal;

[0011] The target encoding information includes encoding information of video parameters required to obtain a video of a target resolution from a basic video, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, wherein the at least two resolutions include the target resolution.

[0012] On the other hand, an embodiment of the present application provides a video playback method, the method comprising:

[0013] receiving a video definition switching request, wherein the video definition switching request includes a target resolution and a video identifier;

[0014] Determining first encoding information of a basic video corresponding to the video identifier, wherein a resolution of the basic video is a reference resolution;

[0015] If the target resolution is not the reference resolution, and the target resolution is a resolution that is not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier;

[0016] The target encoding information includes encoding information of video parameters required to obtain a video of a target resolution from a basic video, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, wherein the at least two resolutions include the target resolution.

[0017] The target coding file is sent to the user terminal so that the user terminal decodes the target coding file to obtain and play the video corresponding to the target resolution. If the target resolution is not the benchmark resolution, the target coding file includes first coding information and target coding information. If the target resolution is the benchmark resolution, the target coding file includes the first coding information.

[0018] In another aspect, an embodiment of the present application provides a video playback device, comprising:

[0019] A definition switching request sending module is used to send a video definition switching request to the server in response to the video definition switching operation, where the video definition switching request includes a target resolution and a video identifier;

[0020] The video determination and playback module is used to receive the target coded file sent by the server, decode the target coded file based on the target coded file, obtain the video corresponding to the target resolution, and play it. The target coded file is obtained by the server in the following way:

[0021] Determine first encoding information of a basic video corresponding to the video identifier, where the resolution of the basic video is a reference resolution;

[0022] If the target resolution is the reference resolution, sending the target encoding file including the first encoding information to the user terminal;

[0023] If the target resolution is not the reference resolution, and the target resolution is a resolution that is not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier, and sending a target encoding file including the first encoding information and the target encoding information to the user terminal;

[0024] The target encoding information includes encoding information of video parameters required to obtain a video of a target resolution from a basic video, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, and the at least two resolutions include the target resolution.

[0025] Optionally, when the above-mentioned video determination and playback module obtains the video corresponding to the target resolution based on the target coding file decoding and plays it, it is specifically used to: adjust the resolution of the basic video based on the video parameters corresponding to the target coding information, obtain the video corresponding to the target resolution and play it.

[0026] Optionally, when the above-mentioned video determination and playback module decodes the target encoding file corresponding to the target resolution to obtain the video corresponding to the target resolution and plays it, it is specifically used to: decode the first encoding information and the target encoding information respectively to obtain the basic video and the video parameters corresponding to the target encoding information; adjust the resolution of the basic video based on the video parameters corresponding to the target encoding information to obtain the video corresponding to the target resolution and play it.

[0027] Optionally, the above-mentioned target coding file also includes a resolution identifier, which is used to represent the target resolution; when the above-mentioned video determination and playback module decodes the target coding file corresponding to the target resolution to obtain the video corresponding to the target resolution and plays it, it is specifically used to: parse the target coding file to obtain the resolution identifier, the first coding information and the target coding information; use the decoding parameters corresponding to the resolution identifier to decode the first coding information and the target coding information to obtain the video corresponding to the target resolution and play it.

[0028] In another aspect, an embodiment of the present application provides a video playback device, comprising:

[0029] A definition switching request receiving module is used to receive a video definition switching request, wherein the video definition switching request includes a target resolution and a video identifier;

[0030] A first coding information determining module, configured to determine first coding information of a basic video corresponding to the video identifier, wherein the resolution of the basic video is a reference resolution;

[0031] a target coding information determining module, configured to determine target coding information corresponding to the target resolution from pre-stored video coding information corresponding to the video identifier when the target resolution is not the reference resolution and the target resolution is a resolution not adjacent to the reference resolution;

[0032] The target encoding information includes encoding information of video parameters required to obtain a video of a target resolution from a basic video, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, where the at least two resolutions include the target resolution.

[0033] The target coding file processing module is used to send the above-mentioned target coding file to the user terminal so that the user terminal can decode the target coding file based on the target coding file to obtain the video corresponding to the target resolution and play it. If the above-mentioned target resolution is not the benchmark resolution, the above-mentioned target coding file includes first coding information and target coding information; if the above-mentioned target resolution is the benchmark resolution, the above-mentioned target coding file includes the first coding information.

[0034] Optionally, the above-mentioned device is included in at least one of the video server or the CDN server; if the device is included in the video server and the CDN server, the above-mentioned video playback module, when receiving a video playback request, is specifically used for: the video server receives the video playback request, determines the address information of the CDN server corresponding to the video identifier, and sends the address information to the user terminal so that the user terminal establishes a connection with the CDN server; the CDN server sends the encoded file corresponding to the set resolution to the user terminal.

[0035] Optionally, the above-mentioned target encoding file also includes a resolution identifier, which is used to represent the target resolution. The resolution identifier is used by the user terminal to use the decoding parameters corresponding to the resolution identifier to decode the first encoding information and the target encoding information, obtain the video corresponding to the target resolution, and play it.

[0036] Optionally, the device also includes: a video playback module, which is used to receive a video playback request before receiving a video clarity switching request, the video playback request including a video identifier; and send the encoded file corresponding to the set resolution to the user terminal, so that the user terminal decodes the encoded file corresponding to the set resolution to obtain the video of the set resolution and plays it.

[0037] Optionally, if the above-mentioned device is included in a video server and a CDN server, the above-mentioned clarity switching request receiving module is specifically used when receiving a video clarity switching request: the video server receives the video clarity switching request and sends the target resolution to the CDN server; the above-mentioned target encoding file processing module is specifically used when sending the target encoding file to the user terminal: the above-mentioned CDN server sends the target encoding file to the user terminal.

[0038] On the other hand, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the video playback method provided in any optional embodiment of the present application when running the computer program.

[0039] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes the video playback method provided in any optional embodiment of the present application.

[0040] In another aspect, embodiments of the present application further provide a computer program product or computer program that, when executed on a computer device, causes the computer device to perform any of the optional implementation methods provided herein. The computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of the computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the video playback method provided in any of the optional implementation methods of the present application.

[0041] The beneficial effects brought about by the technical solution provided by the present application are as follows: the solution provided by the embodiment of the present application, when receiving a video definition switching request, can first determine the first encoding information of the basic video corresponding to the video identifier, and then determine the target encoding information corresponding to the target resolution based on the target resolution and the mapping relationship corresponding to the pre-stored video identifier. When the target resolution is not the reference resolution, the user terminal decodes and plays the video corresponding to the target resolution based on the target encoding file containing the first encoding information and the target encoding information. When the target resolution is the reference resolution, the user terminal decodes and plays the video corresponding to the target resolution based on the target encoding file containing the first encoding information. In this solution, since the server only stores the encoding information (first encoding information) of the film source of one resolution and the encoding information corresponding to each resolution, videos of other resolutions can be determined based on the basic video. Therefore, the solution based on the present application can save storage resources.

[0042] Additional aspects and advantages of the present application will be given in part in the following description, which will become apparent from the following description, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application.

[0044] Figure 1A flowchart of a video playback method provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of adding a setting identifier provided in an embodiment of the present application;

[0046] Figure 3 A flowchart of another video playback method provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of a resolution selection interface provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of encoding information provided in an embodiment of the present application;

[0049] Figure 6 A flowchart of a video playback method provided in an embodiment of the present application;

[0050] Figure 7 A schematic diagram of the structure of a video playback system provided in an embodiment of the present application;

[0051] Figure 8 A schematic structural diagram of a video playback device provided in an embodiment of the present application;

[0052] Figure 9 A schematic structural diagram of another video playback device provided in an embodiment of the present application;

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

[0054] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present invention.

[0055] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.

[0056] The video playback method involved in the embodiment of the present application can be implemented using cloud technology. For example, the data storage involved in the processing process can use cloud storage, and the data calculation involved in the processing process can use cloud computing.

[0057] The solutions provided in the embodiments of the present application can be executed by any electronic device, including a user terminal device or a server. The server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can include at least one of the following: a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, or a smart car device.

[0058] In one possible implementation, the user terminal and the server may form a blockchain, and the server and the user terminal may be nodes on the blockchain. The video playback method in the embodiment of the present application may be executed by at least one node on the blockchain, that is, the server or server cluster in the embodiment of the present application may be one or at least two nodes on the blockchain, and the user terminal in the embodiment of the present application may be a node on the blockchain.

[0059] This application addresses the problem of wasted storage resources in the prior art and proposes a video playback method. In this solution, the server can only store the first encoding information of a basic video at a base resolution, and the encoding information corresponding to each resolution of at least one resolution. For a resolution, the encoding information corresponding to the resolution is the encoding information of the video parameters required to obtain a video of that resolution based on the base video. Videos of other resolutions can be determined based on the base video. The solution of this application can save storage resources compared to the solutions of the prior art.

[0060] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0061] The present application embodiment provides a possible implementation method, such as Figure 1 As shown, a flowchart of a video playback method is provided, which can be executed by any electronic device. For example, the solution of the embodiment of the present application can be executed on a user terminal or a server, or executed interactively by a user terminal and a server.

[0062] Figure 1 The flow chart of a video playback method provided by an embodiment of the present application is shown. The method can be executed by a server, wherein the server can be an application server of a video application (also called a video server), a content delivery network (CDN) server, or a server cluster composed of a video server and a CDN server; the video server can send the video to the user terminal through the CDN server, thereby improving the efficiency of video distribution and providing users with a better service experience. Figure 1 As shown in , in this example, the execution subject may be a video server or a CDN server, and the method may include the following steps:

[0063] Step S110: receiving a video definition switching request, where the video definition switching request includes a target resolution and a video identifier.

[0064] The video definition switching request refers to a request to switch the resolution of the currently playing video to the target resolution. For the convenience of description, the currently playing video that appears below is referred to as the first video. The video definition switching request is generated based on the video definition switching operation on the client interface of the video application displayed on the user terminal. The target resolution is the resolution that the user selects on the client interface to switch to. The embodiment of this application does not limit the form of the above-mentioned video application. It can be a web version of the video application, an application installed on the terminal device, or a mini-program, etc.

[0065] For example, if you want to watch a clearer video, you can select a higher resolution than the current resolution of the video being played as the target resolution on the client interface. For another example, if the current network is unstable, causing the first video currently being played to be stuck, the user can select a lower resolution than the current resolution as the target resolution. Of course, in actual applications, you can also configure the "Auto" option. If the user selects this option, the target resolution ratio will be the pre-configured specified resolution or the resolution determined by the terminal device / server based on the current network status.

[0066] It is understandable that, for the user, the first video, the video corresponding to the target resolution described below (hereinafter referred to as the target video for ease of description), and the basic video corresponding to the video identifier described below are essentially videos corresponding to the same video content, differing only in their video resolution (clarity). The first video may be the video that the user opened the video with, i.e., the default resolution, or it may be a video that has undergone at least one resolution switch from the default resolution.

[0067] For example, a user chooses to open a video in a video application installed on his terminal device. At this time, the resolution of the video played is the default resolution. During video playback or when the video is paused, the user can choose to switch the video resolution according to needs, that is, the above-mentioned video clarity switching operation. Optionally, as an example, the video playback interface can display a video clarity switching control, for example, it can be a control that displays the current resolution. After the user triggers the control, various optional video resolution options can be displayed. The user can select one of them as the target resolution according to needs. For example, after the user clicks on one of the video resolution options, the resolution corresponding to the option is the target resolution.

[0068] Among them, the video identifier is used to represent the identity of the video. One video corresponds to one video identifier. The server can store information of multiple videos at the same time. When you want to switch the resolution of the video, the server can determine which video to switch the clarity based on the video identifier in the video clarity switching request.

[0069] Step S120 : determining first encoding information of a basic video corresponding to the video identifier, wherein the resolution of the basic video is a reference resolution.

[0070] Among them, for videos with the same video content, only one copy of the first encoding information of the basic video is stored in the server. For videos with multiple different video contents, the first encoding information of multiple basic videos can be stored in the server accordingly. In the present application scheme, the first encoding information of the basic video corresponding to the video identifier can be determined based on the video identifier, that is, the basic video has the same video identifier as the first video, and the basic video and the first video have the same video content but different resolutions.

[0071] It can be understood that the first coding information is changing. The timing of clarity switching is different, and the corresponding first coding information may be different. For example, the first coding information determined when the first video is played to the 10th minute may be different from the first coding information determined when the video is played to the 30th minute.

[0072] Among them, the basic video is used as a reference video, and the resolution of the video is used as a reference resolution. Based on the basic video of the benchmark resolution, videos of other resolutions can be obtained. The obtained videos of other resolutions have the same video content as the basic video, but only have different resolutions.

[0073] Step S130: If the target resolution is not the baseline resolution, and the target resolution is a resolution that is not adjacent to the baseline resolution, then based on the mapping relationship between the target resolution and the pre-stored video identifier, the target encoding information corresponding to the target resolution is determined; wherein the above-mentioned target encoding information includes encoding information of video parameters required when obtaining a video of the target resolution from the basic video, and the above-mentioned pre-stored video encoding information includes encoding information corresponding to at least two resolutions (for the convenience of description, the encoding information corresponding to each stored resolution will be referred to as second encoding information hereinafter), and the at least two resolutions include the target resolution.

[0074] For a resolution, the video parameters corresponding to the resolution refer to the video parameters required to obtain a video of the resolution based on the base video. The video parameters are parameters related to the resolution. Based on the video parameters, the resolution of the base video can be adjusted to obtain a video of the resolution. It is understood that adjusting the resolution includes increasing the resolution of the base video or decreasing the resolution of the base video.

[0075] Among them, the target resolution can be a benchmark resolution or other resolutions. If the resolution of the first video is the benchmark resolution, the target resolution is usually other resolutions. If the resolution of the first video is not the benchmark resolution, the target resolution can be the benchmark resolution or other resolutions except the first video resolution.

[0076] The target resolution being adjacent to the base resolution means that the target resolution is the closest resolution to the base resolution among at least two resolutions, while the target resolution being non-adjacent to the base resolution means that the target resolution is not the closest resolution to the base resolution among at least two resolutions. For example, if the at least two resolutions include 480P and 720P, and the base resolution is 270P, and 480P is the closest resolution to 270P among the at least two resolutions, then the target resolution can only be 720P, not 480P.

[0077] Step 140: Send the target encoding file to the user terminal so that the user terminal decodes the target encoding file to obtain the video corresponding to the target resolution and plays it; wherein, if the target resolution is not the benchmark resolution, the above-mentioned target encoding file includes the first encoding information and the target encoding information corresponding to the target resolution; if the target resolution is the benchmark resolution, the target encoding file includes the first encoding information.

[0078] The target encoding file is the encoding file corresponding to the target resolution, and different encoding files correspond to different resolutions. When the target resolution is the base resolution, indicating that the resolution of the first video is to be switched to the base resolution, the target encoding file includes first encoding information, and the basic video is the video corresponding to the target resolution. When the target resolution is not the base resolution, indicating that the resolution of the first video is to be switched to another resolution, the target encoding file includes, in addition to the first encoding information, target encoding information corresponding to the target resolution. Based on the target encoding information and the first encoding information, the video corresponding to the target resolution can be obtained.

[0079] In an optional embodiment of the present application, the above-mentioned decoding based on the target encoding file to obtain the video corresponding to the target resolution includes: adjusting the resolution of the basic video based on the video parameters corresponding to the second encoding information to obtain the video corresponding to the target resolution.

[0080] How the user terminal adjusts the resolution of the basic video based on the video parameters corresponding to the second coding information to obtain a video corresponding to the target resolution will be described in detail below and will not be repeated here.

[0081] Since videos with resolutions other than the baseline resolution can be obtained based on the basic video, based on the solution of the present application, after determining the target encoding information corresponding to the target resolution, the basic video can be directly adjusted in resolution based on the video parameters corresponding to the target encoding information to obtain a video corresponding to the target resolution. As an example, assuming that the baseline resolution is 270P, the target resolution is 720P, and the target encoding information is the second encoding information corresponding to 720P, the basic video can be adjusted in resolution based on the video parameters corresponding to the second encoding information to obtain a 7200P video, i.e., a video corresponding to the target resolution.

[0082] Among them, after the user terminal obtains the video corresponding to the target resolution based on the above-mentioned first encoding information and target encoding information, it can play the video corresponding to the target resolution. In order not to affect the user's viewing experience, the playback end position of the first video is consistent with the playback start position of the video corresponding to the target resolution. Specifically, when receiving a video clarity switching request, the playback position of the first video can be obtained (which can be the playback time point or the position of the played video frame), and based on the playback position, the starting position of the video corresponding to the target resolution during playback is determined. After the video clarity is switched, a seamless switching viewing experience can be provided to the user.

[0083] The solution provided by the embodiment of the present application, when receiving a video definition switching request, can first determine the first encoding information of the basic video corresponding to the video identifier, and then determine the target encoding information corresponding to the target resolution based on the target resolution and the mapping relationship corresponding to the pre-stored video identifier. When the target resolution is not the reference resolution, the user terminal decodes and plays the video corresponding to the target resolution based on the target encoding file containing the first encoding information and the target encoding information. When the target resolution is the reference resolution, the user terminal decodes and plays the video corresponding to the target resolution based on the target encoding file containing the first encoding information. In this solution, since the server only stores the encoding information (first encoding information) and various encoding information of the film source of one resolution, videos of other resolutions can be determined based on the basic video. Therefore, the solution based on the present application can save storage resources, and the video images before and after the switch can be aligned to improve the switching quality. The solution based on the present application does not need to restart the player when switching the definition, thereby reducing the switching time.

[0084] On the other hand, since the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, the target encoding information corresponding to the target resolution can be directly determined in the stored video encoding information based on the target resolution, thereby avoiding the situation where the pre-stored video encoding information is not in the above-mentioned form and the information is incomplete, resulting in the video played after the clarity is switched to have a flowery screen, a black screen, etc.

[0085] In an optional solution of the present application, if the target resolution is not the base resolution and the target resolution is a resolution adjacent to the base resolution, the method further includes: determining target encoding information corresponding to the target resolution based on a mapping relationship between the target resolution and a pre-stored video identifier, wherein the target encoding information includes encoding information of video parameters required to obtain a video at the target resolution from a base video, the pre-stored video encoding information includes encoding information corresponding to at least one resolution, and the at least two resolutions include the target resolution. After determining the target encoding information corresponding to the target resolution, step S140 may be executed to implement resolution switching.

[0086] Optionally, the video data of the basic video can be segmented into video streams to obtain multiple video stream segments (the video stream segments can be TS segments). One video stream segment corresponds to a video segment in the basic video. For a resolution, the second encoding information is the encoding information of the video parameters required to obtain the video segment corresponding to the TS segment of the resolution based on the basic video.

[0087] Optionally, multiple video stream fragments can be generated m3u8 index according to time sequence, and this index has characterized the sequence number of each video stream fragment and the corresponding relation between each fragment.Then basic video can include at least two video fragments, and the first video is the video fragment corresponding to any one TS fragment in the at least two video fragments. Then when responding to the video definition switching operation, based on this index, the next TS fragment of this arbitrary TS fragment can be found, and this TS fragment is processed to obtain the video fragment corresponding to the target resolution and played.That is to say, the server can know which video fragment of the TS fragment currently being played is corresponding, and which video fragment of the TS fragment corresponding is played next based on this index.

[0088] Optionally, the currently playing video (the first video) may be a video segment corresponding to a TS segment. After the user terminal determines that the video corresponding to the target resolution is obtained (the video is a video segment corresponding to a TS segment), the video corresponding to the target resolution may be played again when the currently playing video segment ends.

[0089] It is understood that if the video segment corresponds to the video frequency band of the last TS segment among multiple video stream segments, then when the user terminal receives a video definition switching operation, the server may generate a prompt message in response to the operation and send the prompt message to the user terminal for display, thereby notifying the user through the prompt message that definition switching is not possible at this time. In this case, in response to the definition switching operation, the user terminal will continue to play the video at the resolution corresponding to the last TS segment.

[0090] Optionally, during encoding, in addition to the first encoding information, for a resolution, the second encoding information can be encoding information of video parameters required when obtaining a video of the resolution based on the first adjacent video, or can be encoding information of video parameters required when directly obtaining a video of the resolution based on the basic video, that is, the target encoding information is the second encoding information.

[0091] In an optional embodiment of the present application, if the second encoding information can be encoding information of video parameters required when obtaining a video of the resolution based on the first adjacent video, then the above-mentioned pre-stored video encoding information includes second encoding information corresponding to at least one resolution, the second encoding information corresponding to one resolution is encoding information of video parameters required when obtaining a video of the resolution from a third video, the above-mentioned third video is a video corresponding to an adjacent resolution of the resolution, and the above-mentioned target encoding information includes second encoding information corresponding to the target resolution, and second encoding information corresponding to each resolution between the target resolution and the reference resolution.

[0092] Among them, each resolution is a resolution between the target resolution and the reference resolution. If the second encoding information can be encoding information of video parameters required when obtaining a video of the resolution based on the first adjacent video, then the target encoding information corresponding to the target resolution determined from the pre-stored video encoding information includes the second encoding information corresponding to the target resolution, and the second encoding information corresponding to each resolution between the target resolution and the reference resolution. In an optional scheme of the present application, if the above-mentioned target encoding information is at least two second encoding information, the basic video is used as the initial video to be processed, and the video parameters corresponding to the resolutions adjacent to the reference resolution among the video parameters corresponding to each second encoding information are used as the initial current parameters. The following operations are repeated until the video corresponding to the target resolution is obtained:

[0093] Based on the current parameters, the resolution of the video to be processed is adjusted to obtain a second video corresponding to a resolution adjacent to the base resolution, and the video parameters corresponding to the resolution adjacent to the resolution corresponding to the current parameters are used as new current parameters, and the second video is used as a new video to be processed.

[0094] Among them, since videos of other resolutions besides the baseline resolution can be obtained based on the basic video, if the target coding information includes at least two second coding information, indicating that there is at least one resolution between the baseline resolution and the target resolution, the basic video is used as the video to be processed, and the resolution of the basic video is adjusted based on the video parameters (current parameters) corresponding to the resolution (resolution 1) closest to the baseline resolution among at least one resolution, to obtain the video (adjacent video) corresponding to resolution 1 closest to the baseline resolution, and then the above steps are repeated, using the video as the new video to be processed, based on the video parameters (new current parameters) corresponding to the resolution (resolution 2) closest to resolution 1, the resolution of the video corresponding to resolution 1 is adjusted to obtain the video corresponding to resolution 2, until the final video is the video obtained by resolution-adjusting the video parameters corresponding to the target resolution.

[0095] There is at least one resolution between the base resolution and the target resolution. The conversion from the basic video at the base resolution to the video at the target resolution needs to be based on at least two second encoding information. Each second encoding information is the encoding information of the video parameters required for converting one resolution to another of two adjacent resolutions. Compared with the target encoding information corresponding to the conversion from the base resolution to the target resolution only including one second encoding information, the amount of data storage can be reduced when encoding the video parameters corresponding to each resolution.

[0096] As an example, assume the base resolution is 270P and the target resolution is 720P. There is a 480P range between 270P and 720P. Therefore, the target encoding information includes two second encoding information: the second encoding information corresponding to the range from 270P to 480P (hereinafter referred to as encoding information 1 for ease of description), and the second encoding information corresponding to the range from 480P to 720P (hereinafter referred to as encoding information 2 for ease of description). The base video is first resolution-adjusted based on the video parameters corresponding to encoding information 1 to obtain a 480P video. Then, the 480P video is resolution-adjusted based on the video parameters corresponding to encoding information 2 to obtain a 720P video, i.e., the video corresponding to the target resolution. If the target encoding information includes the second encoding information, i.e., the second encoding information is encoded based on the video parameters required for the range from 270P to 720P, then the corresponding encoding information stored is the encoding information for the video parameters required for the range from 270P to 720P. Compared to the second encoding information corresponding to the range from 480P to 720P, the data volume is larger.

[0097] Among them, the processing principle for obtaining the first video based on the target coding information corresponding to the set resolution and the first coding information of the basic video is the same as the above-mentioned processing principle based on the first coding information and the target coding information corresponding to the target resolution, and will not be repeated here.

[0098] Optionally, the video parameters may include video parameters corresponding to each pixel in each frame image in the basic video, and then the basic video is resolution enhanced based on the target video parameters, including: based on the target video parameters, the basic video is resolution enhanced for each pixel in each frame image in the basic video.

[0099] Before receiving the video definition switching request, the method may further include:

[0100] Receive a video playback request, where the video playback request includes a video identifier;

[0101] The encoded file corresponding to the set resolution is sent to the user terminal, so that the user terminal decodes the encoded file corresponding to the set resolution to obtain the video with the set resolution and plays it.

[0102] Among them, if the set resolution is the benchmark resolution, the encoding file corresponding to the set resolution includes the first encoding information (the first encoding information is different from the first encoding information determined corresponding to the switching request described above); if the set resolution is not the benchmark resolution, the encoding file corresponding to the set resolution includes the first encoding information and the target encoding information corresponding to the set resolution.

[0103] The video play request refers to the video that the user opens. The video play request can be generated based on a user's play operation in the client interface of a video application. For example, if a user opens a video in a video application installed on their terminal device, that video is the target video, and the operation of opening the video is the play operation. In this case, the resolution of the video requested for playback is the default resolution. The first video may or may not be the video requested for playback.

[0104] The video ID is used to represent the identity of the video. One video corresponds to one video ID. When a server wants to play a certain video, it can determine which video to play based on the video ID of the video.

[0105] Among them, the set resolution can be a base resolution or other resolutions. In the optional scheme of the present application, if the set resolution is a base resolution, the encoding file corresponding to the set resolution is set. Specifically, the first encoding information can be sent to the user terminal so that the user terminal decodes the first encoding information and uses the decoded basic video as the video corresponding to the set resolution and plays it.

[0106] If the set resolution is not the base resolution, the encoding file corresponding to the set resolution includes first encoding information and target encoding information corresponding to the set resolution. Specifically, the target encoding information corresponding to the set resolution can be determined based on the set resolution and a pre-stored mapping relationship; the first encoding information and the target encoding information corresponding to the set resolution are sent to the user terminal, so that the user terminal obtains and plays the video corresponding to the set resolution based on the first encoding information and the target encoding information corresponding to the set resolution. How the user terminal obtains the video corresponding to the set resolution based on the first encoding information and the target encoding information corresponding to the set resolution will be described below and will not be repeated here.

[0107] In an optional solution of the present application, the target coding file also includes a resolution identifier, which is used to characterize the target resolution. The resolution identifier is used by the user terminal to use the decoding parameters corresponding to the resolution identifier to decode the first coding information and the target coding information, obtain the video corresponding to the target resolution, and play it.

[0108] The above-mentioned sending of the target coded file to the user terminal so that the user terminal decodes the target coded file to obtain a video corresponding to the target resolution and plays it includes:

[0109] The target encoded file is sent to the user terminal, so that the user terminal can obtain and play the video corresponding to the target resolution by performing the following operations:

[0110] Parsing the target coding file to obtain the resolution identifier, the first coding information, and the target coding information corresponding to the target resolution;

[0111] The first coding information and the target coding information are decoded using decoding parameters corresponding to the resolution identifier to obtain and play a video corresponding to the target resolution.

[0112] After determining the target encoding information corresponding to the target resolution, a target encoding file can be generated based on the first encoding information, the target encoding information corresponding to the target resolution, and a header file containing a resolution identifier for the target resolution. The header file contains attribute information representing the video corresponding to the target resolution, such as video resolution and video playback duration. The resolution identifier represents the target resolution. Since encoding information of different resolutions is different, the decoding parameters used to decode encoding information of different resolutions may also be different. Therefore, when the resolution identifier for the target resolution is parsed, the decoding parameters corresponding to the target resolution can be determined. Based on the decoding parameters, the first encoding information and the target encoding information are decoded to obtain the video corresponding to the target resolution.

[0113] The decoding parameters may be related information corresponding to the decoded information, such as cache space. A higher resolution corresponds to a larger cache space required after decoding the encoded information. Therefore, when decoding encoded information corresponding to different resolutions, the decoding parameters need to be re-determined.

[0114] Optionally, the encoded information may be decoded by a decoder, and the target decoding parameters corresponding to the target resolution may be determined by restarting the decoder.

[0115] As an example, Figure 2 Schematic diagram of the target coding file shown in the figure. In this example, it is assumed that the resolution of the first video is 480P (Progressive, line-by-line scanning), the base resolution is 270P, and the target resolution is 720P. Based on 480P and the pre-stored mapping relationship, the target coding information corresponding to 480P (Enhaance1, 2 shown in the figure) can be determined first. The target coding information includes the second coding information corresponding to 480P (for the convenience of description, it can be referred to as coding information 1 below), and the second coding information corresponding to 720P (for the convenience of description, it can be referred to as coding information 2 below); then based on the first coding information of the basic video corresponding to the first video (Base shown in the figure, for the convenience of description , hereinafter referred to as coding information 3), coding information 1, coding information 2 and a header file containing a resolution identifier of 720P, to obtain a target coding file (SVC720P.ts shown in the figure), and then based on the target coding file, using the decoding parameters corresponding to the resolution identifier, respectively decode the coding information 1, coding information 2 and coding information 3 to obtain video parameter 1 corresponding to coding information 1, video parameter 2 corresponding to coding information 2, and a basic video corresponding to coding information 3, adjust the resolution of the basic video based on video parameter 1 to obtain a 480P video, and adjust the resolution of the 480P video based on video parameter 2 to obtain a 720P video (video corresponding to the target resolution).

[0116] Among them, the first video (480P video) can also be obtained in the same way as mentioned above, specifically: first, based on 480P and the pre-stored mapping relationship, determine the target encoding information corresponding to 480P, and the target encoding information includes the second encoding information corresponding to 480P (Enhaance1 shown in the figure, which can be referred to as encoding information 1), and then based on the first encoding information of the basic video corresponding to the first video (Base shown in the figure, for convenience of description, it can be referred to as encoding information 3 below), encoding information 1 and the header file containing the resolution identifier of 4800P, obtain the target encoding file (SVC480P.ts shown in the figure), and then based on the target encoding file, use the decoding parameters corresponding to the resolution identifier to decode the encoding information 1 and the encoding information 3 respectively to obtain the video parameter 1 corresponding to the encoding information 1, and the basic video corresponding to the encoding information 3, and adjust the resolution of the basic video based on the video parameter 1 to obtain a 480P video (the first video of 480P).

[0117] In the solution of the present application, the execution subject of the method can be a video server, a CDN server, or a video server and a CDN server. When the execution subject is a video server and a CDN server, the above-mentioned receiving a video playback request includes:

[0118] The video server receives the video playback request, determines the address information of the CDN server corresponding to the video identifier, and sends the address information to the user terminal so that the user terminal establishes a connection with the CDN server;

[0119] Sending the encoded file corresponding to the set resolution to the user terminal includes:

[0120] The CDN server sends the encoded file corresponding to the set resolution to the user terminal.

[0121] In the solution of this application, encoding information for videos with different video content can be stored by different CDN servers. A CDN server can store encoding information for at least one video. For videos with the same video content, the CDN server stores the first encoding information and each second encoding information of the video at the baseline resolution. When a video server receives a video playback request, it can determine which CDN server should process the request based on the video ID, and then perform subsequent processing based on the CDN server corresponding to the video ID.

[0122] The address information refers to the IP address (Internet Protocol Address) of the CDN server. After the user terminal establishes a connection with the CDN server based on the address information of the CDN server, the user terminal can download the corresponding encoded file (the encoded file corresponding to the set resolution) from the corresponding CDN server based on the address information.

[0123] Based on the solution of the present application, since the CDN server only stores the encoding information of a film source of one resolution, videos of other resolutions can be determined based on the basic video. Therefore, when requesting to play a certain video, the encoding file corresponding to the set resolution can be determined based on the CDN server corresponding to the video identifier of the video requested to be played.

[0124] In an optional solution of the present application, if the method is performed by a video server and a CDN server, the above-mentioned receiving a video definition switching request includes:

[0125] The video server receives the video resolution switching request and sends the target resolution to the CDN server;

[0126] Send the target encoded file to the user terminal, including:

[0127] The CDN server sends the target encoded file to the user terminal.

[0128] Since the CDN server only stores the encoding information of a film source with one resolution, videos of other resolutions can be determined based on the basic video. Therefore, when switching the clarity, the target encoding files corresponding to other resolutions can still be determined through the CDN server, and there is no need to switch the CDN server. Compared with the prior art, videos of different clarity are stored on different CND servers. When switching the clarity, it is necessary to switch to the CDN server corresponding to the video of the target resolution to determine the video corresponding to the target resolution to play the video. This may cause switching freezes, black screens, and screen jumps. The present application solution can play videos of the target resolution without switching the CDN server, which can improve the switching quality and thus improve the user experience.

[0129] Based on Figure 1 The same principle as the video playback method shown in , the embodiment of the present application also provides a video playback method, the execution subject of the video playback method is a user terminal, see Figure 3 The video playback method shown in FIG. 1 includes the following steps:

[0130] Step S210: In response to the video definition switching operation, a video definition switching request is sent to the server, where the video definition switching request includes a target resolution and a video identifier.

[0131] Among them, the above-mentioned currently playing video (for the convenience of description, it may be referred to as the first video below) can be obtained based on the first encoding information of the basic video corresponding to the video identifier. The baseline video and the first video are two videos with the same video content but different resolutions.

[0132] Among them, the video clarity switching operation refers to the operation of switching the resolution of the first video to another resolution. The operation can be triggered based on the clarity switching mark on the client interface of the video application of the user terminal. The triggering operation for the clarity switching mark is the video clarity switching operation. The triggering operation can be a long press operation, a click operation, etc. The specific form of the triggering operation is not limited in this application. The clarity switching mark can be text, characters, pictures, etc. The specific form of the clarity switching mark is not limited in this application. The resolution corresponding to the clarity switching mark is the target resolution you want to switch to.

[0133] The resolution of the first video may be the default resolution (set resolution) or other resolutions; the default resolution may be the base resolution or other resolutions. Before playing the first video, the following steps are also included:

[0134] In response to the video playback operation, the video identifier is sent to the server, so that the server determines the first encoding information of the basic video corresponding to the video identifier based on the video identifier, determines the target encoding information corresponding to the set resolution based on the set resolution and the mapping relationship corresponding to the video identifier, and sends the encoding file corresponding to the set resolution to the user terminal, so that the user terminal decodes the video of the set resolution based on the encoding file corresponding to the set resolution and plays it.

[0135] Among them, if the set resolution is the benchmark resolution, the encoding file corresponding to the set resolution includes the first encoding information; if the set resolution is not the benchmark resolution, the encoding file corresponding to the set resolution includes the first encoding information and the target encoding information corresponding to the set resolution.

[0136] In an optional embodiment of the present application, a definition switching mark is also displayed on the playback interface corresponding to the currently playing video, and the method further includes:

[0137] In response to a triggering operation on the definition switching flag, a resolution selection interface corresponding to the resolution of the currently playing video is displayed, wherein the resolution selection interface displays at least two resolution flags (to distinguish them from the resolution flags shown above, the resolution flags may be referred to as definition flags hereinafter), each corresponding to a resolution, and the at least two definition flags include a first flag corresponding to the resolution of the currently playing video;

[0138] Responding to a video definition switching operation includes:

[0139] In response to a selection confirmation operation for a second identifier among at least two clarity identifiers, the selection confirmation operation is used as a video clarity switching operation, and the resolution corresponding to the second identifier is used as the target resolution, wherein the second identifier is any identifier among the at least two clarity identifiers except the first identifier.

[0140] The video definition switching mark can be text, characters, images, etc., and the specific form of the definition switching mark is not limited in this application. The triggering operation of the video definition switching mark can be a long press operation, a click operation, etc., and the specific form of the triggering operation is not limited in this application.

[0141] Among them, in the resolution selection interface, in order to distinguish the set resolution from other resolutions, the display form of the first identifier can be different from the display form of other clarity identifiers. In actual applications, the first identifier and other clarity identifiers can be distinguished by different colors, or the first identifier can be highlighted to distinguish the first identifier from other clarity identifiers. This application does not limit the specific display form of the first identifier and other clarity identifiers. The display methods that can distinguish these two identifiers are both within the protection scope of this application.

[0142] The clarity mark can be expressed in the form of text, numbers, or a combination of text and numbers. The specific form of the clarity mark is not limited in this application.

[0143] Optionally, when the second identifier is selected, i.e., in response to a confirmation operation on the selection of the second identifier, the display mode corresponding to the second identifier may be changed, and the display mode corresponding to the first identifier may be changed. The change in display mode may inform the user of the specific target resolution being switched to and whether it is consistent with the resolution they want to switch to.

[0144] As an example, Figure 4The schematic diagram of the resolution selection interface shown is shown, in which the clarity switching mark is represented by text, for example, "image quality", and each resolution mark is represented by a combination of numbers and text, including but not limited to, 270P standard definition, 480P high definition, 720P ultra-clear, 1080P Blu-ray, HDR (High Dynamic Range, high dynamic range, greater than 1080P) Zhencai Vision. The resolution of the currently playing video is 1080P (the resolution corresponding to the first mark), then the display color corresponding to 1080P is the set color, and the set color is different from the display colors corresponding to other resolutions. Based on at least two clarity marks in the resolution selection interface, the user can select the target resolution they want to switch to. For example, if the current network status is unstable and the 1080P video is stuck when playing, you can choose to switch from 1080P to 720P. Based on the selection and determination operation of the mark corresponding to 720P, 720P can be determined as the target resolution.

[0145] Optionally, the resolution selection interface can be displayed floating on the playback interface corresponding to the first video.

[0146] Optionally, in order not to affect the viewing of the first video, the size of the resolution selection interface may be smaller than the size of the playback interface corresponding to the first video.

[0147] The optional first video can be played based on the player corresponding to the APP (Application) that plays the video. For members of the APP (VIP, Very Important Person), the resolution can be switched to a higher resolution, that is, the target resolution can be a higher resolution, such as Figure 4 As shown in the figure, 1080P and HDR are higher resolutions. Members can switch the resolution to either of these two resolutions. If you are not a member, you can only switch to 720P at most.

[0148] Step S220: Receive the target coded file sent by the server, decode the target coded file to obtain a video corresponding to the target resolution, and play the video. The target coded file is obtained by the server in the following manner:

[0149] Determine first encoding information of a basic video corresponding to the video identifier, where the resolution of the basic video is a reference resolution;

[0150] If the target resolution is the reference resolution, sending the target encoding file including the first encoding information to the user terminal;

[0151] If the target resolution is not the reference resolution, and the target resolution is a resolution that is not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier, and sending a target encoding file including the first encoding information and the target encoding information to the user terminal;

[0152] The target encoding information includes encoding information of video parameters required to obtain a video of a target resolution from a basic video, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, wherein the at least two resolutions include the target resolution.

[0153] The server stores the first encoding information of the basic video corresponding to the video identifier and each second encoding information. For a resolution, the second encoding information is the encoding information of the video parameters required to obtain a video of the resolution based on the basic video. If the target resolution is the reference resolution, the first encoding information of the basic video can be directly sent to the user terminal as the target encoding file. If the resolution of the first video is another resolution (for example, the second resolution), and the target resolution is not adjacent to the reference resolution, the target encoding information corresponding to the target resolution is determined from the pre-stored video encoding information corresponding to the video identifier. Then, based on the first encoding information of the basic video and the target encoding information corresponding to the target resolution, the video corresponding to the target resolution can be determined.

[0154] In an optional embodiment of the present application, decoding the target coded file corresponding to the target resolution to obtain a video corresponding to the target resolution includes:

[0155] Decoding the first coding information and the target coding information respectively to obtain video parameters corresponding to the basic video and the target coding information;

[0156] The resolution of the basic video is adjusted based on the video parameters corresponding to the target coding information to obtain a video corresponding to the target resolution.

[0157] The first encoding information is decoded to obtain a base video, and the target encoding information corresponding to the target resolution is decoded to obtain video parameters corresponding to the target encoding information. Based on the base video and the video parameters, a video corresponding to the target resolution is obtained. After obtaining the video corresponding to the target resolution, the video corresponding to the target resolution is played to complete the definition switching of the currently playing video.

[0158] In an optional embodiment of the present application, the target coded file further includes a resolution identifier, which is used to represent the target resolution; based on the target coded file corresponding to the target resolution, decoding to obtain a video corresponding to the target resolution includes:

[0159] Parsing the target coding file to obtain a resolution identifier, first coding information, and target coding information;

[0160] The first coding information and the target coding information are decoded using decoding parameters corresponding to the resolution identifier to obtain a video corresponding to the target resolution.

[0161] The solution has been specifically explained on the server side in the previous article and will not be repeated here.

[0162] Among them, the above solution is completed by the interaction between the user terminal and the server. Figure 1 The principle of the video playback method shown in is the same. For related content, please refer to the solution described above and will not be repeated here.

[0163] Based on the method provided by the present application, when a video definition switching request is received, the first encoding information of the basic video corresponding to the video identifier can be determined first, and then the target encoding information corresponding to the target resolution can be determined based on the target resolution and the mapping relationship corresponding to the pre-stored video identifier. When the target resolution is not the reference resolution, the user terminal decodes and plays the video corresponding to the target resolution based on the target encoding file containing the first encoding information and the target encoding information. When the target resolution is the reference resolution, the user terminal decodes and plays the video corresponding to the target resolution based on the target encoding file containing the first encoding information. In this solution, since the server only stores the encoding information (first encoding information) and each second encoding information of the film source of one resolution, videos of other resolutions can be determined based on the basic video. Therefore, the solution based on the present application can save storage resources, and the video images before and after the switch can be aligned to improve the switching quality. The solution based on the present application does not need to restart the player when switching the definition, thereby reducing the switching time.

[0164] In an optional embodiment of the present application, for a resolution, the second encoding information is encoding information of video parameters required to obtain a video of the resolution based on a base video of the currently played video, and the target encoding information includes the second encoding information corresponding to the target resolution, including the following two cases:

[0165] The first type is that the above-mentioned pre-stored video encoding information includes second encoding information corresponding to at least one resolution, and the second encoding information corresponding to a resolution is the encoding information of video parameters required when obtaining a video of the resolution from a third video. The above-mentioned third video is a video corresponding to an adjacent resolution of the resolution, and the target encoding information includes the second encoding information corresponding to the target resolution, and the second encoding information corresponding to each resolution between the target resolution and the reference resolution.

[0166] Among them, referring to the above example of switching the resolution from 480P to 720P, in order to obtain a 720P video, it is necessary to first adjust the resolution of the 270P basic video based on the video parameters corresponding to the second encoding information of 480P to obtain a 480P video (this video is the third video), and then adjust the resolution of the 480P video based on the video parameters corresponding to the second encoding information of 720P to obtain a 720P video.

[0167] Second, the pre-stored video encoding information includes target encoding information corresponding to at least one resolution, and the at least one resolution includes a target resolution.

[0168] In the second case, the resolution of the basic video can be adjusted directly based on the video parameters corresponding to the second encoding information corresponding to the target resolution (the second encoding information is the target encoding information) to obtain the video with the target resolution.

[0169] As an example, still taking the example of switching the resolution from 480P to 720P, the target resolution is 720P, and the resolution of the basic video is adjusted based on the video parameters corresponding to 720P to obtain the video of the target resolution (720P video).

[0170] Optionally, the adjustment of the video resolution described above includes raising or lowering the resolution of the video. For example, the reference resolution of the basic video in the above text is 270P, and the target resolution is usually greater than the reference resolution. In this case, the resolution of the basic video needs to be raised based on the video parameters corresponding to the target decoding information corresponding to the target resolution bit rate. If the reference resolution is greater than the target resolution, the resolution of the basic video needs to be lowered based on the video parameters corresponding to the target decoding information corresponding to the target resolution bit rate. It is understandable that different target resolutions require different video parameters. As a video, the video parameters required to switch from 270P (reference resolution) to 480P (target resolution) are different from the video parameters required to switch from 480P (reference resolution) to 270P (target resolution).

[0171] In an optional embodiment of the present application, receiving first encoding information of a basic video corresponding to a currently played video and target encoding information corresponding to a target resolution sent by a server includes:

[0172] Receiving a target encoding file determined by the server based on the target resolution, the target encoding file including first encoding information of a base video corresponding to the currently played video, target encoding information corresponding to the target resolution, and a header file, wherein the file header includes a resolution identifier of the target resolution;

[0173] Decoding the first encoding information of the basic video corresponding to the currently played video and the target encoding information corresponding to the target resolution includes:

[0174] Parse the target encoding file to obtain the first encoding information of the basic video corresponding to the currently played video, the target encoding information corresponding to the target resolution, and the header file;

[0175] The first coding information of the basic video corresponding to the currently played video and the target coding information corresponding to the target resolution are decoded respectively using decoding parameters corresponding to the resolution identifier of the target resolution.

[0176] It is understandable that the Figure 1 The alternative embodiment shown in Figure 1 Other optional embodiments based on the scheme shown in Figure 3 The alternative embodiment shown in Figure 3 Other optional embodiments based on the illustrated solution describe the same technical solution from two different perspectives: one is from the perspective of a user terminal (i.e., from the user's perspective), i.e., the method is performed by the user terminal; the other is from the perspective of a server, i.e., the method is performed by the server. In the foregoing description, when describing from two perspectives, some repeated content may not be repeated too much, but the descriptions from the two different perspectives can refer to and complement each other, which is also clear to those skilled in the art.

[0177] In order to better illustrate and understand the principles of the method provided by this application, the solution of this application is described below in conjunction with an optional specific embodiment. It should be noted that the specific implementation of each step in this specific embodiment should not be understood as a limitation to the solution of this application. Based on the principles of the solution provided by this application, other implementations that can be thought of by those skilled in the art should also be considered within the scope of protection of this application.

[0178] In this example, the process of switching from 480P video to 720P video is taken as an example. Before switching, the basic video with a reference resolution of 270P and the video parameters required for obtaining videos of other resolutions based on the basic video need to be encoded; the Base layer corresponds to the first encoding information of the basic video, the Enhance Layer 1 layer (enhancement layer 1) corresponds to the second encoding information of the video parameters required for obtaining a 480P video based on the 270P video; the Enhance Layer 2 layer (enhancement layer 2) corresponds to the second encoding information of the video parameters required for obtaining a 720P video based on the 270P video, and the Enhance Layer 3 layer (enhancement layer 3) corresponds to the second encoding information of the video parameters required for obtaining a 1080P video based on the 270P video.

[0179] Optionally, the video parameters required for obtaining videos of other resolutions based on the basic video with a reference resolution of 270P and the basic video can be encoded based on SVC (Scalable Video Coding). Figure 5 In the schematic diagram of encoding information shown, the Base layer corresponds to the first encoding information of the basic video, the Enhanced Layer 1 layer (enhancement layer 1) corresponds to the second encoding information of the video parameters required to obtain a 480P video based on a 270P video; the Enhanced Layer 2 layer (enhancement layer 2) corresponds to the second encoding information of the video parameters required to obtain a 720P video based on a 480P video, and the Enhanced Layer 3 layer (enhancement layer 3) corresponds to the second encoding information of the video parameters required to obtain a 1080P video based on a 720P video. This encoding method is not used in this example.

[0180] After obtaining the first encoding information and each second encoding information, the first encoding information and each second encoding information of the basic video can be stored in a server, which is an application server of a video application (also called a video server). The video server can send the video to the user terminal via a CDN server. In this example, the format of the first encoding information and each second encoding information of the basic video is both TS format.

[0181] See also Figure 6 The flow chart of the video playback method shown in the figure shows that the user terminal side includes the APP that plays the video and the player corresponding to the APP. The backend refers to the server side, including the video server and CDN server, and the backend and the user terminal can communicate with each other. The default resolution (also called the start-up resolution) is set in the APP, which is 480P.

[0182] See also Figure 7 As shown in the structural diagram of the video playback system, the player of the user terminal includes a demultiplexing module (demuxer module), a decoder (including decoder 1 (decoder1), decoder 2 (decoder2) in the figure) and a rendering module (render module). In this example, the demultiplexing module is used to separate the video data and audio data of the video to facilitate the subsequent rendering processing of the video data. As an example, decoder 1 is used to decode 480P video, and decoder 2 is used to decode 720P video. It can be understood that the encoding information corresponding to videos of different resolutions can be decoded based on different decoding parameters. For example, the decoding parameter can be a cache space. The larger the resolution of the encoding information, the larger the cache space required after decoding. Then this example may include more than the above two decoders.

[0183] When a user wants to play a certain video (hereinafter referred to as the second video for ease of description) through the APP of the user terminal, the APP layer can trigger the video play identifier (e.g., play button) of the APP application interface. At this time, the APP layer calls the player's start interface to start playback and passes the default resolution to the player. The player generates a video play request based on the default play request and sends it to the video server. The video play request includes the video identifier of the second video and the user's account information corresponding to the APP. The video identifier is used to identify the identity of the second video. The player requests the video server for the play address of the second video based on the video play request (obtaining the SVC play address shown in the figure). That is, the video server receives the account information and video identifier in the video play request sent by the player, and generates the play address of the second video with the default resolution based on the video identifier and account information (corresponding to the SVC source address StsrtURL for generating the start resolution in the figure), for example, http: / / test_svc.m3u8; that is, the video server determines the address information (play address) of the CDN server corresponding to the video identifier. The video server or CDN server can obtain the resolution list corresponding to the default resolution. The playback address and resolution list are sent to the player. After the player receives the resolution list, it can pass it to the APP layer through the interface. After the APP layer receives the list, it can display it on the APP interface.

[0184] At the same time, the player uses the playback address provided by the video server to establish a network connection with the CDN server, and downloads the encoded file of the second video corresponding to the playback address. Usually, the video data is transmitted in the form of a video stream. The downloaded encoded file is processed by the demultiplexing module, decoder and rendering module in the player to obtain the second video and play it.

[0185] In this example, the video data of the basic video corresponding to the playback address can be pre-segmented into video streams to obtain multiple video stream segments (in this example, the video stream segments are TS segments), one video stream segment corresponds to a section of video in the basic video, and multiple video stream segments are generated into an m3u8 index in chronological order, which represents the sequence number of each video stream segment and the correspondence between each segment. When downloading the encoded file of the second video, the CDN server can send the encoded file corresponding to the first TS segment to the player based on the m3u8 index, or the player can request the first TS segment from the CDN server based on the playback request. After the player receives the encoded file corresponding to the first TS segment sent by the CDN server, it downloads the encoded file corresponding to the TS segment. The player processes the encoded file corresponding to the TS segment, obtains the video clip corresponding to the TS segment and plays it. When the player processes the TS segment, it can continue to request the second TS segment from the background or receive the second TS segment sent by the background.

[0186] When playing a video clip corresponding to a certain TS segment (TS segment 1) (the resolution of the video clip is 480P), the user can obtain the resolution list corresponding to the default resolution from the background based on the resolution switching logo displayed on the interface for playing the video clip and based on the triggering operation of the logo. The resolution list includes multiple resolution options, and each resolution option corresponds to one resolution; based on the triggering operation (video clarity switching operation) of any one of the multiple resolution options, a video clarity switching request is generated. If the resolution option corresponding to the video clarity switching operation is 1080P, the target resolution is 1080P. Based on the video clarity switching operation, the user wants to switch the resolution of the video from 480P to 1080P. At this time, the first video is the video clip corresponding to the TS segment 1 corresponding to the second video. The APP layer receives the video clarity switching request, and based on the target resolution, calls the clarity switching interface corresponding to the player, and sends the target resolution to the video server through the interface.

[0187] The video server sends the target resolution to the CDN server. Based on the default resolution, the CDN server modifies the code stream content (encoded file) corresponding to the next TS fragment sent to the player, that is, modifies the encoding information corresponding to the next TS fragment. Specifically: After receiving the video definition switching request, the CDN server determines the target encoding information corresponding to the target resolution based on the target resolution and the pre-stored second encoding information. This target encoding information is the second encoding information corresponding to the enhancement layer 3 (hereinafter referred to as encoding information 1 for ease of description). Based on the video identifier of the second video, the first encoding information of the base video of the second video is determined. Here, the first encoding information can be the first encoding information corresponding to the next TS fragment in the base video of the second video. The second video and the base video have the same video content, and the resolution of the base video is different from that of the second video.

[0188] A target encoding file is generated based on the first encoding information of the base video of the second video, the target encoding information corresponding to the target resolution, and a header file containing a resolution identifier of the target resolution, wherein the resolution identifier indicates that the target resolution is 1080P. The target encoding file can be represented as SVC1080P.ts.

[0189] The CDN server sends the target encoding file to the player. The demultiplexing module of the player first parses the target encoding file. When the header file containing the resolution identifier of the target resolution is parsed, the decoding parameters corresponding to the target resolution are used to decode the first encoding information of the basic video of the second video and the target encoding information corresponding to the target resolution to obtain the basic video of the second video and the video parameters corresponding to the target resolution (the first video parameters corresponding to the encoding information 1). In this example, the decoding parameters corresponding to the target resolution can be determined by restarting the decoder. When the header file containing the resolution identifier of the target resolution is parsed, it indicates that the target encoding file to be decoded next has changed, that is, the resolution has changed. The demultiplexing module of the player will put the updated information into the description structure of the video packet corresponding to the target encoding file.

[0190] The resolution of the base video of the second video is adjusted based on the first video parameter to obtain a 1080P video segment (the target resolution video). Finally, the 1080P video segment is rendered by the player's rendering module. After the video segment corresponding to TS fragment 1 is played, the 1080P video segment is played. At this time, the video viewed by the user on the user terminal has a resolution of 1080P.

[0191] Based on this application Figure 1 The same principle as the method provided, the embodiment of the present application also provides a video playback device, such as Figure 8As shown, the video playback device 30 includes a definition switching request sending module 310 and a video determination and playback module 320; wherein:

[0192] A definition switching request sending module 310 is configured to send a video definition switching request to a server in response to a video definition switching operation, wherein the video definition switching request includes a target resolution and a video identifier;

[0193] The video determination and playback module 320 is configured to receive a target coded file sent by the server, decode the target coded file, obtain a video corresponding to the target resolution, and play the video. The target coded file is obtained by the server in the following manner:

[0194] Determine first encoding information of a basic video corresponding to the video identifier, where the resolution of the basic video is a reference resolution;

[0195] If the target resolution is the reference resolution, sending the target encoding file including the first encoding information to the user terminal;

[0196] If the target resolution is not the reference resolution, and the target resolution is a resolution that is not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier, and sending a target encoding file including the first encoding information and the target encoding information to the user terminal;

[0197] The target encoding information includes encoding information of video parameters required to obtain a video of a target resolution from a base video, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, wherein the at least two resolutions include the target resolution.

[0198] The solution provided in the embodiment of the present application is that since the server only stores the encoding information (first encoding information) and the second encoding information of the film source of one resolution, videos of other resolutions can be determined based on the target encoding information corresponding to the basic video and the target resolution. Therefore, the solution based on the present application can save storage resources, and the video images before and after switching can be aligned to improve the switching quality. The solution based on the present application does not require restarting the player when switching the clarity, thereby reducing the switching time.

[0199] Optionally, when the above-mentioned video determination and playback module obtains the video corresponding to the target resolution based on the target coding file decoding, it is specifically used to: adjust the resolution of the basic video based on the video parameters corresponding to the target coding information, obtain the video corresponding to the target resolution and play it.

[0200] Optionally, when the above-mentioned video determination and playback module decodes the target encoding file corresponding to the target resolution to obtain the video corresponding to the target resolution, it is specifically used to: decode the first encoding information and the target encoding information respectively to obtain the basic video and the video parameters corresponding to the target encoding information; adjust the resolution of the basic video based on the video parameters corresponding to the target encoding information to obtain the video corresponding to the target resolution.

[0201] Optionally, the target coding file also includes a resolution identifier, which is used to characterize the target resolution; when the above-mentioned video determination and playback module decodes the target coding file corresponding to the target resolution to obtain the video corresponding to the target resolution, it is specifically used to: parse the target coding file to obtain the resolution identifier, the first coding information and the target coding information; use the decoding parameters corresponding to the resolution identifier to decode the first coding information and the target coding information to obtain the video corresponding to the target resolution.

[0202] Based on this application Figure 3 The same principle as the method provided, the embodiment of the present application also provides a video playback device, such as Figure 9 As shown, the video playback device 40 includes a definition switching request receiving module 410, a first encoding information determining module 420, a target encoding information determining module 430 and a target encoding file processing module 440; wherein:

[0203] Definition switching request receiving module 410, configured to receive a video definition switching request, wherein the video definition switching request includes a target resolution and a video identifier;

[0204] A first coding information determining module 420 is configured to determine first coding information of a basic video corresponding to the video identifier, wherein the resolution of the basic video is a reference resolution;

[0205] a target coding information determining module 430 configured to determine target coding information corresponding to the target resolution from pre-stored video coding information corresponding to the video identifier when the target resolution is not the reference resolution and the target resolution is a resolution not adjacent to the reference resolution;

[0206] The target encoding information includes encoding information of video parameters required to obtain a video of a target resolution from a basic video, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, wherein the at least two resolutions include the target resolution.

[0207] The target coding file processing module 440 is used to send the target coding file to the user terminal so that the user terminal can decode the target coding file to obtain the video corresponding to the target resolution and play it. If the target resolution is not the benchmark resolution, the target coding file includes the first coding information and the target coding information; if the target resolution is the benchmark resolution, the target coding file includes the first coding information.

[0208] The solution provided in the embodiment of the present application is that since the server only stores the encoding information (first encoding information) and the second encoding information of the film source of one resolution, videos of other resolutions can be determined based on the target encoding information corresponding to the basic video and the target resolution. Therefore, the solution based on the present application can save storage resources, and the video images before and after switching can be aligned to improve the switching quality. The solution based on the present application does not require restarting the player when switching the clarity, thereby reducing the switching time.

[0209] Optionally, the above-mentioned target coding file also includes a resolution identifier, which is used to represent the target resolution. The resolution identifier is used by the user terminal to use the decoding parameters corresponding to the resolution identifier to decode the first coding information and the target coding information, obtain the video corresponding to the target resolution, and play it.

[0210] Optionally, the device also includes: a video playback module, which is used to receive a video playback request before receiving a video clarity switching request, the video playback request including a video identifier; and send the encoded file corresponding to the set resolution to the user terminal, so that the user terminal decodes the encoded file corresponding to the set resolution to obtain the video of the set resolution and plays it.

[0211] Optionally, the above-mentioned device 40 is included in at least one of the video server or the CDN server; if the above-mentioned device 40 is included in the video server and the CDN server, the above-mentioned video playback module, when receiving a video playback request, is specifically used for: the video server receives the video playback request, determines the address information of the CDN server corresponding to the video identifier, and sends the address information to the user terminal so that the user terminal establishes a connection with the CDN server; the CDN server sends the encoded file corresponding to the set resolution to the user terminal.

[0212] Optionally, if the above-mentioned device 40 is included in the video server and the CDN server, the above-mentioned clarity switching request receiving module is specifically used when receiving the video clarity switching request: the video server receives the video clarity switching request and sends the target resolution to the CDN server; the above-mentioned target encoding file processing module is specifically used when sending the target encoding file to the user terminal: the CDN server sends the target encoding file to the user terminal.

[0213] The video playback device of the embodiment of the present application can execute the video playback method provided by the embodiment of the present application, and its implementation principle is similar. The actions performed by each module and unit in the video playback device in each embodiment of the present application correspond to the steps in the video playback method in each embodiment of the present application. For the detailed functional description of each module of the video playback device, please refer to the description in the corresponding video playback method shown in the previous text, and will not be repeated here.

[0214] The video playback device can be a computer program (including program code) running in a computer device, for example, the display device of the user interface is an application software; the device can be used to execute the corresponding steps in the method provided in the embodiment of the present application.

[0215] In some embodiments, the video playback device provided by the embodiments of the present invention can be implemented by a combination of software and hardware. As an example, the video playback device provided by the embodiments of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the video playback method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0216] In other embodiments, the video playback device provided by the embodiment of the present invention can be implemented in software. The video playback device stored in the memory can be software in the form of a program and a plug-in, and includes a series of modules, including a clarity switching request sending module 310 and a video determination and playback module 320 in the video playback device 30, and a clarity switching request receiving module 410, a first encoding information determination module 420, a target encoding information determination module 430 and a target encoding file processing module 440 in the video playback device 40; wherein, each module in the video playback device 30 is used to implement the video playback method provided by the embodiment of the present invention, and each module in the video playback device 40 is used to implement the video playback method provided by the embodiment of the present invention.

[0217] An embodiment of the present application provides a video playback device. Compared with the prior art, since the server only stores the encoding information (first encoding information) and second encoding information of a film source of one resolution, videos of other resolutions can be determined based on the target encoding information corresponding to the basic video and the target resolution. Therefore, the solution based on the present application can save storage resources, and the video images before and after switching can be aligned to improve the switching quality. The solution based on the present application does not require restarting the player when switching the clarity, thereby reducing the switching time.

[0218] The above describes the video playback device of the present application from the perspective of a virtual module or a virtual unit. The following describes the electronic device of the present application from the perspective of a physical device.

[0219] Based on the same principle as the method provided in the embodiments of the present application, an electronic device is provided in the embodiments of the present application, which includes a memory and a processor; a computer program is stored in the memory, and when the computer program is executed by the processor, it can implement the method provided in any optional method of the present application.

[0220] As an alternative, Figure 10 FIG. 1 shows a schematic diagram of the structure of an electronic device applicable to an embodiment of the present application. Figure 10 As shown, Figure 10 The electronic device 4000 shown includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data exchange between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0221] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0222] Bus 4002 may include a path for transmitting information between the above components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0223] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0224] The memory 4003 is used to store the application code (computer program) for executing the solution of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.

[0225] Among them, electronic devices include but are not limited to user terminal devices and servers, among which the server can be a physical server, a cloud server, a single server or a server cluster, etc.

[0226] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the program is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.

[0227] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above-described method embodiments.

[0228] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0229] The above are only some of the embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A video playback method, characterized in that: include: In response to the video definition switching operation, a video definition switching request is sent to the server, wherein the video definition switching request includes a target resolution and a video identifier, and the resolution of the currently playing video is obtained by adjusting the resolution of the basic video based on first encoding information of the basic video corresponding to the video identifier and second encoding information corresponding to the current resolution of the currently playing video, wherein the resolution of the basic video is the reference resolution; Receive a target coded file sent by the server; wherein the server stores the first coding information and each second coding information, the second coding information corresponding to a resolution is coding information of video parameters required when obtaining a video of the resolution from a third video, and the third video is a video corresponding to an adjacent resolution of the resolution; the target coded file is obtained by the server through the following method: determining the first encoding information; if the target resolution is the reference resolution, sending a target encoding file containing the first encoding information to a user terminal; if the target resolution is not the reference resolution, and the target resolution is a resolution not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier, and sending the target encoding file containing the first encoding information and the target encoding information to the user terminal; the target encoding information includes second encoding information corresponding to the target resolution, and second encoding information corresponding to each resolution between the target resolution and the reference resolution, where each resolution is a resolution between the target resolution and the reference resolution, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, where the at least two resolutions include the target resolution; The target coding file also includes a resolution identifier, which is used to represent the target resolution; parsing the target coding file to obtain the resolution identifier, the first coding information, and the target coding information; Using the decoding parameters corresponding to the resolution identifier, the first coding information is decoded to obtain the basic video, and the target coding information is decoded to obtain video parameters corresponding to the target coding information; different decoding parameters are used to decode coding information of different resolutions, and different target resolutions correspond to different video parameters; Adjusting the resolution of the basic video based on the video parameters corresponding to the target encoding information to obtain a video corresponding to the target resolution; and playing the video corresponding to the target resolution; If the target encoding information is at least two second encoding information, the basic video is used as the initial video to be processed, and the video parameters corresponding to the resolutions adjacent to the reference resolution among the video parameters corresponding to the second encoding information are used as the initial current parameters. The following operations are repeated until a video corresponding to the target resolution is obtained: The resolution of the video to be processed is adjusted based on the current parameters to obtain a second video corresponding to a resolution adjacent to the base resolution, and the video parameters corresponding to the resolution adjacent to the resolution corresponding to the current parameters are used as new current parameters, and the second video is used as a new video to be processed.

2. A video playback method, characterized in that: include: receiving a video definition switching request, the video definition switching request including a target resolution and a video identifier, and adjusting the resolution of a currently played video based on first encoding information of a basic video corresponding to the video identifier and second encoding information corresponding to a current resolution of the currently played video, the resolution of the basic video being a reference resolution; determining the first coding information; The server stores the first encoding information and each second encoding information, wherein the second encoding information corresponding to a resolution is encoding information of video parameters required to obtain a video of the resolution from a third video, and the third video is a video corresponding to an adjacent resolution of the resolution; If the target resolution is not the reference resolution, and the target resolution is a resolution not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier; Sending a target coding file including the first coding information and the target coding information to a user terminal; If the target resolution is the reference resolution, sending the target encoding file including the first encoding information to the user terminal; The target encoding information includes second encoding information corresponding to the target resolution, and second encoding information corresponding to each resolution between the target resolution and the reference resolution, wherein each resolution is a resolution between the target resolution and the reference resolution, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, wherein the at least two resolutions include the target resolution; The target coding file also includes a resolution identifier, which is used to represent the target resolution. The user terminal completes resolution switching by performing the following steps based on the target coding file: Parsing the target coding file to obtain the resolution identifier, the first coding information, and the target coding information; Using the decoding parameters corresponding to the resolution identifier, the first coding information is decoded to obtain the basic video, and the target coding information is decoded to obtain video parameters corresponding to the target coding information; different decoding parameters are used to decode coding information of different resolutions, and different target resolutions correspond to different video parameters; Adjusting the resolution of the basic video based on the video parameters corresponding to the target encoding information to obtain a video corresponding to the target resolution; and playing the video corresponding to the target resolution; If the target encoding information is at least two second encoding information, the basic video is used as the initial video to be processed, and the video parameters corresponding to the resolutions adjacent to the reference resolution among the video parameters corresponding to the second encoding information are used as the initial current parameters. The following operations are repeated until a video corresponding to the target resolution is obtained: The resolution of the video to be processed is adjusted based on the current parameters to obtain a second video corresponding to a resolution adjacent to the base resolution, and the video parameters corresponding to the resolution adjacent to the resolution corresponding to the current parameters are used as new current parameters, and the second video is used as a new video to be processed.

3. The method according to claim 2, characterized in that Before receiving the video definition switching request, the method further includes: receiving a video playback request, wherein the video playback request includes the video identifier; The encoded file corresponding to the set resolution is sent to the user terminal, so that the user terminal decodes the encoded file corresponding to the set resolution to obtain the video with the set resolution and plays it.

4. The method according to claim 3, characterized in that The method is performed by at least one of a video server or a CDN server; If the method is performed by the video server and the CDN server, the receiving of the video playback request includes: The video server receives the video playback request, determines the address information of the CDN server corresponding to the video identifier, and sends the address information to the user terminal, so that the user terminal establishes a connection with the CDN server; The sending the encoded file corresponding to the set resolution to the user terminal includes: The CDN server sends the encoded file corresponding to the set resolution to the user terminal.

5. The method according to claim 4, characterized in that If the method is performed by the video server and the CDN server, the receiving a video definition switching request includes: The video server receives the video definition switching request and sends the target resolution to the CDN server; Sending the target encoded file to the user terminal includes: The CDN server sends the target encoded file to the user terminal.

6. A video playback device, characterized in that: include: a definition switching request sending module, configured to send a video definition switching request to a server in response to a video definition switching operation, wherein the video definition switching request includes a target resolution and a video identifier, and the resolution of the currently playing video is obtained by adjusting the resolution of the basic video based on first encoding information of the basic video corresponding to the video identifier and second encoding information corresponding to the current resolution of the currently playing video, wherein the resolution of the basic video is the reference resolution; A video determination and playback module is configured to receive a target coded file sent by the server; wherein the server stores the first coding information and each second coding information, the second coding information corresponding to a resolution is coding information of video parameters required to obtain a video of the resolution from a third video, and the third video is a video corresponding to an adjacent resolution of the resolution; the target coded file is obtained by the server through the following method: determining the first encoding information; if the target resolution is the reference resolution, sending a target encoding file containing the first encoding information to a user terminal; if the target resolution is not the reference resolution, and the target resolution is a resolution not adjacent to the reference resolution, determining target encoding information corresponding to the target resolution from pre-stored video encoding information corresponding to the video identifier, and sending the target encoding file containing the first encoding information and the target encoding information to the user terminal; the target encoding information includes second encoding information corresponding to the target resolution, and second encoding information corresponding to each resolution between the target resolution and the reference resolution, where each resolution is a resolution between the target resolution and the reference resolution, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, where the at least two resolutions include the target resolution; The target encoding file also includes a resolution identifier, which is used to represent the target resolution; the video determination and playback module is further used to: Parsing the target coding file to obtain the resolution identifier, the first coding information, and the target coding information; Using the decoding parameters corresponding to the resolution identifier, the first coding information is decoded to obtain the basic video, and the target coding information is decoded to obtain video parameters corresponding to the target coding information; different decoding parameters are used to decode coding information of different resolutions, and different target resolutions correspond to different video parameters; Adjusting the resolution of the basic video based on the video parameters corresponding to the target encoding information to obtain a video corresponding to the target resolution; and playing the video corresponding to the target resolution; If the target encoding information is at least two second encoding information, the basic video is used as the initial video to be processed, and the video parameters corresponding to the resolutions adjacent to the reference resolution among the video parameters corresponding to the second encoding information are used as the initial current parameters. The following operations are repeated until a video corresponding to the target resolution is obtained: The resolution of the video to be processed is adjusted based on the current parameters to obtain a second video corresponding to a resolution adjacent to the base resolution, and the video parameters corresponding to the resolution adjacent to the resolution corresponding to the current parameters are used as new current parameters, and the second video is used as a new video to be processed.

7. A video playback device, characterized in that: include: a definition switching request receiving module, configured to receive a video definition switching request, wherein the video definition switching request includes a target resolution and a video identifier, and the resolution of the currently playing video is obtained by adjusting the resolution of the basic video based on first encoding information of the basic video corresponding to the video identifier and second encoding information corresponding to the current resolution of the currently playing video, wherein the resolution of the basic video is the reference resolution; A first coding information determining module, configured to determine the first coding information; The server stores the first encoding information and each second encoding information, wherein the second encoding information corresponding to a resolution is encoding information of video parameters required to obtain a video of the resolution from a third video, and the third video is a video corresponding to an adjacent resolution of the resolution; a target coding information determining module, configured to determine target coding information corresponding to the target resolution from pre-stored video coding information corresponding to the video identifier when the target resolution is not the reference resolution and the target resolution is a resolution not adjacent to the reference resolution; a target coding file processing module, configured to send the target coding file including the first coding information and the target coding information to a user terminal; The target encoding file processing module is further configured to send the target encoding file including the first encoding information to a user terminal if the target resolution is the reference resolution; The target encoding information includes second encoding information corresponding to the target resolution, and second encoding information corresponding to each resolution between the target resolution and the reference resolution, wherein each resolution is a resolution between the target resolution and the reference resolution, and the pre-stored video encoding information includes encoding information corresponding to at least two resolutions, wherein the at least two resolutions include the target resolution; The target coding file also includes a resolution identifier, which is used to represent the target resolution. The user terminal completes resolution switching by performing the following steps based on the target coding file: Parsing the target coding file to obtain the resolution identifier, the first coding information, and the target coding information; Using the decoding parameters corresponding to the resolution identifier, the first coding information is decoded to obtain the basic video, and the target coding information is decoded to obtain video parameters corresponding to the target coding information; different decoding parameters are used to decode coding information of different resolutions, and different target resolutions correspond to different video parameters; Adjusting the resolution of the basic video based on the video parameters corresponding to the target encoding information to obtain a video corresponding to the target resolution; and playing the video corresponding to the target resolution; If the target encoding information is at least two second encoding information, the basic video is used as the initial video to be processed, and the video parameters corresponding to the resolutions adjacent to the reference resolution among the video parameters corresponding to the second encoding information are used as the initial current parameters. The following operations are repeated until a video corresponding to the target resolution is obtained: The resolution of the video to be processed is adjusted based on the current parameters to obtain a second video corresponding to a resolution adjacent to the base resolution, and the video parameters corresponding to the resolution adjacent to the resolution corresponding to the current parameters are used as new current parameters, and the second video is used as a new video to be processed.

8. The device according to claim 7, characterized in that The device also includes: a video playback module, which is used to receive a video playback request before receiving the video clarity switching request, wherein the video playback request includes the video identifier; and send the encoded file corresponding to the set resolution to the user terminal, so that the user terminal decodes the encoded file corresponding to the set resolution based on the set resolution to obtain the video with the set resolution and play it.

9. The device according to claim 8, characterized in that The device is included in at least one of a video server or a CDN server; if the device is included in the video server and the CDN server, then when receiving the video playback request, the video playback module is specifically used to: the video server receives the video playback request, determines the address information of the CDN server corresponding to the video identifier, and sends the address information to the user terminal so that the user terminal establishes a connection with the CDN server; the CDN server sends the encoded file corresponding to the set resolution to the user terminal.

10. The device according to claim 9, characterized in that If the device is included in the video server and the CDN server, the definition switching request receiving module, when receiving the video definition switching request, is specifically configured to: the video server receives the video definition switching request and sends the target resolution to the CDN server; When sending the target coded file to the user terminal, the target coded file processing module is specifically configured to: the CDN server sends the target coded file to the user terminal.

11. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the method according to any one of claims 1 to 5 when running the computer program.

12. A computer-readable storage medium, characterized in that The storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the method according to any one of claims 1 to 5.

13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Content distributing method and system

    CN102572548A

  • Method for transmitting a scalable http stream for natural reproduction upon the occurrence of expression-switching during http streaming

    CN103210642A