[go: up one dir, main page]

CN113438513B - Video resolution switching method, device, equipment and storage medium - Google Patents

Video resolution switching method, device, equipment and storage medium Download PDF

Info

Publication number
CN113438513B
CN113438513B CN202110710212.9A CN202110710212A CN113438513B CN 113438513 B CN113438513 B CN 113438513B CN 202110710212 A CN202110710212 A CN 202110710212A CN 113438513 B CN113438513 B CN 113438513B
Authority
CN
China
Prior art keywords
video
video segment
address
resolution
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110710212.9A
Other languages
Chinese (zh)
Other versions
CN113438513A (en
Inventor
杨自清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202110710212.9A priority Critical patent/CN113438513B/en
Publication of CN113438513A publication Critical patent/CN113438513A/en
Application granted granted Critical
Publication of CN113438513B publication Critical patent/CN113438513B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234381Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440263Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明实施例提供了一种视频分辨率切换方法、装置、设备及存储介质,涉及显示技术领域,其中,该方法包括:接收客户端发送的将播放的视频从当前分辨率切换至目标分辨率的切换请求;基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给客户端,可以实现分辨率的无缝切换,避免分辨率切换过程中的黑屏现象。

Figure 202110710212

Embodiments of the present invention provide a video resolution switching method, device, device, and storage medium, which relate to the field of display technology, wherein the method includes: receiving a video sent by the client to switch the played video from the current resolution to the target resolution A switching request; based on the switching request, redirect the address of the set video slice corresponding to the current resolution to the address of the video slice corresponding to the target resolution; wherein, the set video slice includes The video fragment after the current video fragment played by the client, or the next video fragment, or all video fragments; receive the download request of the next video fragment sent by the client, based on the download request from The address of the video fragment corresponding to the target resolution is queried for the next video fragment, and the next video fragment is fed back to the client, which can realize seamless resolution switching and avoid the resolution switching process Black screen phenomenon in .

Figure 202110710212

Description

一种视频分辨率切换方法、装置、设备及存储介质A video resolution switching method, device, equipment and storage medium

技术领域technical field

本发明实施例涉及显示技术领域,尤其涉及一种视频分辨率切换方法、装置、设备及存储介质。Embodiments of the present invention relate to the field of display technology, and in particular, to a video resolution switching method, device, device, and storage medium.

背景技术Background technique

在很多场景下,经常根据用户操作或者其他需求,对视频的分辨率进行切换。In many scenarios, the video resolution is often switched according to user operations or other requirements.

在分辨率切换过程中,客户端需要停止正在播放的当前分辨率的视频内容,重新向服务端下载目标分辨率对应的索引文件,重新找到之前的停止播放的时间点,基于索引文件重新获取目标分辨率对应的视频,并基于停止播放的时间点播放目标分辨率对应的视频。但是在该情况下,即使网络状况非常良好,客户端容易出现短暂的黑屏现象,影响用户体验。During the resolution switching process, the client needs to stop the video content of the current resolution being played, re-download the index file corresponding to the target resolution to the server, find the previous stop playback time point, and reacquire the target based on the index file. The video corresponding to the resolution, and play the video corresponding to the target resolution based on the time point when the playback is stopped. However, in this case, even if the network condition is very good, the client is prone to a short-term black screen phenomenon, which affects user experience.

发明内容Contents of the invention

本发明实施例提供了一种视频分辨率切换方法、装置、设备及存储介质,可以实现分辨率的无缝切换,避免分辨率切换过程中的黑屏现象。Embodiments of the present invention provide a video resolution switching method, device, device, and storage medium, which can realize seamless switching of resolutions and avoid black screen phenomena during the resolution switching process.

第一方面,本发明实施例提供了一种视频分辨率切换方法,所述方法应用于服务端,包括:In the first aspect, the embodiment of the present invention provides a video resolution switching method, the method is applied to the server, including:

接收客户端发送的将播放的视频从当前分辨率切换至目标分辨率的切换请求;Receive the switching request sent by the client to switch the playing video from the current resolution to the target resolution;

基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Based on the switching request, redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution; wherein, the setting of the video segment includes playing on the client The video segment after the current video segment, or the next video segment, or all video segments;

接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端。Receive the download request of the next video fragment sent by the client, query the next video fragment from the address of the video fragment corresponding to the target resolution based on the download request, and send the next The video fragments are fed back to the client.

第二方面,本发明实施例还提供了一种视频分辨率切换方法,所述方法应用于客户端,所述方法包括:In the second aspect, the embodiment of the present invention also provides a video resolution switching method, the method is applied to a client, and the method includes:

向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Sending a switching request for switching the played video from the current resolution to the target resolution to the server; the switching request is used to instruct the server to redirect the address of the set video segment corresponding to the current resolution The address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments piece;

向所述服务端发送下一个视频分片的下载请求;Send a download request for the next video segment to the server;

接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片。Receive the next video segment fed back by the server from the address of the video segment corresponding to the target resolution based on the download request, and when the current video segment is played, play the next video segment A video segment.

第三方面,本发明实施例提供了一种视频分辨率切换装置,所述装置应用于服务端,包括:In the third aspect, the embodiment of the present invention provides a video resolution switching device, the device is applied to the server, including:

接收模块,用于接收客户端发送的将视频从当前分辨率切换至目标分辨率的切换请求;The receiving module is configured to receive a switch request sent by the client to switch the video from the current resolution to the target resolution;

重定向模块,用于基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;A redirection module, configured to redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution based on the switching request; wherein, the set video segment The segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments;

接收/反馈模块,用于接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端。The receiving/feedback module is configured to receive the download request of the next video fragment sent by the client, and query the next video fragment from the address of the video fragment corresponding to the target resolution based on the download request , and feed back the next video segment to the client.

第四方面,本发明实施例提供了一种视频分辨率切换装置,所述装置应用于客户端,所述装置包括:In a fourth aspect, an embodiment of the present invention provides a video resolution switching device, the device is applied to a client, and the device includes:

第一发送模块,用于向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;The first sending module is used to send a switch request to the server to switch the played video from the current resolution to the target resolution; the switch request is used to instruct the server to set the current resolution corresponding to The address of the video segment is redirected to the address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client, or the next video segment Fragments, or all video fragments;

第二发送模块,用于向所述服务端发送下一个视频分片的下载请求;The second sending module is used to send a download request of the next video segment to the server;

接收/播放模块,用于接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片。The receiving/playing module is configured to receive the next video segment fed back by the server from the address of the video segment corresponding to the target resolution based on the download request, and play the current video segment When finished, the next video segment is played.

第五方面,本发明实施例提供了一种电子设备,包括:In a fifth aspect, an embodiment of the present invention provides an electronic device, including:

一个或多个处理器;one or more processors;

存储装置,用于存储一个或多个程序,storage means for storing one or more programs,

当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明实施例提供的方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the method provided by the embodiment of the present invention.

第六方面,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本发明实施例提供的方法。In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method provided in the embodiment of the present invention is implemented.

本发明实施例提供的技术方案,服务端接收视频从当前分辨率切换至目标分辨率的切换请求,基于该切换请求将当前分辨率对应的设定视频分片的地址重定向为目标分辨率对应的视频分片的地址,其中,设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;若接收到下一个视频分片的下载请求,通过基于该下载请求从目标分辨率对应的视频分片的地址中查询下一个视频分片,并反馈给客户端;即通过对视频分片的地址的重定向,在播放下一个视频分片的情况下,可以避免索引文件的重新下载,实现分辨率无缝切换,避免出现分辨率切换过程中的黑屏现象,提高用户体验。In the technical solution provided by the embodiment of the present invention, the server receives a switch request from the current resolution to the target resolution, and based on the switch request, redirects the address of the set video segment corresponding to the current resolution to the address corresponding to the target resolution. The address of the video segment, where the set video segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments; if the next video segment is received Based on the download request of the video clip, query the next video clip from the address of the video clip corresponding to the target resolution based on the download request, and feed it back to the client; that is, by redirecting the address of the video clip, the In the case of a video segment, it can avoid re-downloading of index files, realize seamless resolution switching, avoid black screen phenomenon during resolution switching, and improve user experience.

附图说明Description of drawings

图1a是M3U8 playlis文件的示意图;Figure 1a is a schematic diagram of the M3U8 playlis file;

图1b是本发明实施例提供的一种视频分辨率切换方法流程图;Fig. 1b is a flowchart of a video resolution switching method provided by an embodiment of the present invention;

图1c是服务端重定向的原理图;Figure 1c is a schematic diagram of server-side redirection;

图1d是本发明实施例提供的视频分辨率切换方法的流程示意图;Fig. 1d is a schematic flowchart of a video resolution switching method provided by an embodiment of the present invention;

图2是本发明实施例提供的一种视频分辨率切换方法流程图;FIG. 2 is a flowchart of a video resolution switching method provided by an embodiment of the present invention;

图3是本发明实施例提供的一种视频分辨率切换方法流程图;FIG. 3 is a flowchart of a video resolution switching method provided by an embodiment of the present invention;

图4是本发明实施例提供的一种视频分辨率切换方法流程图;FIG. 4 is a flowchart of a video resolution switching method provided by an embodiment of the present invention;

图5是本发明实施例提供的一种视频分辨率切换装置结构框图;FIG. 5 is a structural block diagram of a video resolution switching device provided by an embodiment of the present invention;

图6是本发明实施例提供的一种视频分辨率切换装置结构框图;FIG. 6 is a structural block diagram of a video resolution switching device provided by an embodiment of the present invention;

图7是本发明实施例提供的一种电子设备结构示意图。Fig. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings but not all structures.

相关技术中,基于HTTP的流媒体网络传输协议,(HTTP Live Streaming,HLS)基本原理是:服务端把一个视频分成一个个小的视频分片(segment,TS/fmp4容器格式),同时生成一个包含这些视频分片信息和地址的索引文件,该地址例如可以是统一资源定位符(Uniform Resource Locator,URL),该索引文件可以称为M3U8节目播放列表(playlist)文件。客户端向服务端发送下载请求,先请求下载M3U8 playlist文件,然后通过解释该文件,获取节目信息,如分辨率,视频编码,音频编码,视频分片的长度和持续时间(duration)等信息,以及各个视频分片的地址(URL),然后客户端就可以向服务端一片片连续请求下载视频分片,经过解容器封装,解码后,最终呈现出来。In related technologies, the basic principle of the HTTP-based streaming media network transmission protocol (HTTP Live Streaming, HLS) is: the server divides a video into small video segments (segment, TS/fmp4 container format), and generates a An index file comprising these video segment information and addresses, the address may be, for example, a Uniform Resource Locator (Uniform Resource Locator, URL), and the index file may be called an M3U8 program playlist (playlist) file. The client sends a download request to the server, first requesting to download the M3U8 playlist file, and then interpreting the file to obtain program information, such as resolution, video encoding, audio encoding, length and duration of video fragments, etc. And the address (URL) of each video segment, and then the client can request the server to download the video segments one by one, after decontainer encapsulation, decoding, and finally presenting.

M3U8 playlist文件一般分Main M3U8和Sub M3U8,其中,Main M3u8描述SubM3U8,以及对应节目流的带宽,即比特率,不同分辨率对应的比特率不同,Sub M3U8描述视频分片的信息。M3U8 playlist文件的信息可以参考图1a,如图1a所示,M3U8 playlist文件包括Main M3U8和Sub M3U8,其中,Sub M3U8包含各个子Sub M3U8,例如可以是Sub M3U8720P,Sub M3U8 1080P、Sub M3U8 4K等。M3U8 playlist files are generally divided into Main M3U8 and Sub M3U8. Among them, Main M3u8 describes SubM3U8 and the bandwidth of the corresponding program stream, that is, the bit rate. Different resolutions correspond to different bit rates, and Sub M3U8 describes the information of video fragmentation. The information of the M3U8 playlist file can refer to Figure 1a. As shown in Figure 1a, the M3U8 playlist file includes Main M3U8 and Sub M3U8. Among them, Sub M3U8 includes each sub-M3U8, such as Sub M3U8720P, Sub M3U8 1080P, Sub M3U8 4K, etc. .

相关技术中,客户端可以根据当前的网络情况,选择相应带宽(或比特率)的节目内容的视频分片,很多服务商为了区别服务不同的客户,如游客,可能允许观看720P以下的分辨率的视频,普通登录用户可以观看1080P以下的分辨率的视频,VIP客户可以观看4K的视频,甚至更高分辨率的视频。因此,服务端往往只会分发一级M3U8,即Sub M3U8给客户端,客户端选择不同分辨率时,例如,如从720P切换到4K,需要停止当前正在呈现的720P的视频播放,重新向服务端请求下载4K对应的Sub M3U8,重新找到之前的播放点,接着呈现4K分辨率的视频内容,这样,即使网络状况非常良好的情况下,过程中也会出现短暂的黑屏。In related technologies, the client can select the video fragmentation of the program content with the corresponding bandwidth (or bit rate) according to the current network conditions. In order to distinguish and serve different customers, such as tourists, many service providers may allow watching resolutions below 720P Ordinary login users can watch videos with a resolution below 1080P, and VIP customers can watch videos with a resolution of 4K or even higher resolutions. Therefore, the server often only distributes one-level M3U8, that is, Sub M3U8 to the client. When the client chooses a different resolution, for example, if switching from 720P to 4K, it needs to stop the currently being displayed 720P video playback and re-submit to the service. The terminal requests to download the Sub M3U8 corresponding to 4K, find the previous playback point again, and then present the video content with 4K resolution. In this way, even if the network condition is very good, there will be a short black screen during the process.

为了解决上述问题,本发明实施例提供了一种视频分辨率切换方法,其中,图1b是本发明实施例提供的一种视频分辨率切换方法流程图,所述方法可以由视频分辨率切换装置来执行,所述装置可以由软件和/或硬件来实现,所述装置可以配置在服务端,其中,服务端可以包含一个或者多个服务器,所述方法可以应用于视频播放场景中。In order to solve the above problems, an embodiment of the present invention provides a video resolution switching method, wherein, FIG. The device may be implemented by software and/or hardware, and the device may be configured on a server, where the server may include one or more servers, and the method may be applied in a video playback scenario.

S110:接收客户端发送的将播放的视频从当前分辨率切换至目标分辨率的切换请求。S110: Receive a switch request sent by the client to switch the played video from the current resolution to the target resolution.

在本发明实施例中,包含节目内容的视频划分为视频分片,按照视频分片的顺序进行播放。若满足视频分辨率切换的条件或者接收到视频分辨率切换的指令,客户端可以向服务端发送视频从当前分辨率切换至目标分辨率的切换请求,服务端接收该切换请求。其中,满足视频分辨率切换条件可以是网络满足分辨率切换条件,或者用户信息满足分辨率切换条件等;其中,若检测到用户触发分辨率切换的操作,接收到视频分辨率切换的指令。In the embodiment of the present invention, the video containing program content is divided into video segments, and the video segments are played in sequence. If the conditions for switching the video resolution are satisfied or an instruction for switching the video resolution is received, the client can send a switching request for switching the video from the current resolution to the target resolution to the server, and the server receives the switching request. Wherein, satisfying the video resolution switching condition may be that the network meets the resolution switching condition, or user information meets the resolution switching condition, etc.; wherein, if it is detected that the user triggers the resolution switching operation, an instruction for video resolution switching is received.

在本发明实施例中,可选的,在接收切换请求之前,还可以包括:将不同分辨率的视频分片进行内容对齐,以及将相同分辨率的视频分片存储在相同位置。具体的,可以通过内容存储服务器将同一节目的视频内容编码成不同分辨率的视频分片,将不同分辨率的视频分片进行内容对齐。例如,如720P的第一个视频分片和1080P,4K的第一个视频分片要完全对齐,编码方式(如H264),持续时间等需要对齐,只是分辨率的不同。由此,后续的视频分片也需要进行内容对齐。内容存储服务器将同一分辨率的视频分片存储在一个存储位置,不同分辨率的视频分片存储不同的存储位置,然后针对同一节目的视频内容制作一个通用的Sub M3U8文件,Sub M3U8文件列举每一个视频分片的地址,例如,可以是每个视频分片的URL地址。In the embodiment of the present invention, optionally, before receiving the switching request, it may further include: performing content alignment on video slices with different resolutions, and storing video slices with the same resolution in the same location. Specifically, the video content of the same program may be encoded into video segments with different resolutions through the content storage server, and the content of the video segments with different resolutions may be aligned. For example, the first video fragment of 720P and the first video fragment of 1080P and 4K must be completely aligned, and the encoding method (such as H264), duration, etc. need to be aligned, but the resolution is different. Therefore, subsequent video fragments also need to perform content alignment. The content storage server stores the video fragments of the same resolution in one storage location, and the video fragments of different resolutions are stored in different storage locations, and then creates a general Sub M3U8 file for the video content of the same program, and the Sub M3U8 file lists each An address of a video segment, for example, may be a URL address of each video segment.

S120:基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片。S120: Based on the switching request, redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution; wherein, the set video segment is included in the client The video segment after the current video segment played by the terminal, or the next video segment, or all video segments.

在本发明实施例中,服务端接收到切换请求,可以基于该切换请求将设定视频分片的地址重定向目标分辨率的视频分片对应的地址。In the embodiment of the present invention, upon receiving the switch request, the server may redirect the address of the set video segment to the address corresponding to the video segment of the target resolution based on the switch request.

其中,设定视频分片可以包括客户端当前播放的视频的当前视频分片之后的视频分片,具体地,设定视频分片所包括的当前视频分片之后的视频分片的数目可以是一个或多个。可选地,设定视频分片除了包括客户端当前播放的视频的当前视频分片之后的一个或多个视频分片之外,还可以包括当前视频分片或者当前视频分片之前的一个或多个视频分片。可选地,设定视频也可以只包括当前视频分片之后的下一个视频分片。可选地,设定视频分片也可以包括客户端当前播放的视频的所有视频分片。其中,可以根据需要确定设定视频分片,本申请对设定视频分片包含的具体视频分片不作限定。由此,通过将设定视频分片的地址进行重定向,可以使客户端访问目标分辨率对应的视频分片的地址,从而拉取目标分辨率对应的视频分片的地址中的视频分片,从而完成分辨率的切换。其中,可以通过内容分发服务器将设定视频分片的地址重定向为目标分辨率对应的视频分片的地址。Wherein, setting the video segment can include the video segment after the current video segment of the video currently played by the client, specifically, the number of video segments after the current video segment included in the setting video segment can be one or more. Optionally, in addition to including one or more video segments after the current video segment of the video currently played by the client, the set video segment may also include the current video segment or one or more video segments before the current video segment. Multiple video slices. Optionally, the set video may also only include the next video segment after the current video segment. Optionally, the set video segments may also include all video segments of the video currently played by the client. Wherein, the set video slices may be determined as required, and the present application does not limit the specific video slices included in the set video slices. Thus, by redirecting the address of the set video segment, the client can access the address of the video segment corresponding to the target resolution, thereby pulling the video segment from the address of the video segment corresponding to the target resolution , so as to complete the resolution switching. Wherein, the address of the set video segment may be redirected to the address of the video segment corresponding to the target resolution through the content distribution server.

在本发明实施例的一个实施方式中,可选的,在重定向之前,本发明实施例提供的方法还可以包括:将所述当前分辨率对应的视频分片的地址和标识信息存储在索引文件中;相应的,将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址,包括:基于所述索引文件将所述当前分辨率对应的设定视频分片的地址向所述目标分辨率对应的视频分片的地址进行映射。In an implementation of the embodiment of the present invention, optionally, before redirection, the method provided by the embodiment of the present invention may further include: storing the address and identification information of the video segment corresponding to the current resolution in the index In the file; correspondingly, redirecting the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution, including: based on the index file, resetting the current resolution The address of the corresponding set video slice is mapped to the address of the video slice corresponding to the target resolution.

其中,设定视频分片的地址与目标分辨率对应的视频分片的地址为对应关系。其中,设定视频分片的地址可以是设定视频分片的URL地址,客户端可以基于索引文件中的当前分辨率对应的视频分片的URL地址访问服务端中目标分辨率对应的视频分片的地址,从而获取目标分辨率对应的视频分片。例如,切换请求为分辨率从2k切换到4k的切换请求,如图1c所示,服务端可以在索引文件Sub M3U8中的视频分片的URL地址重定向到分辨率4k对应的视频分片的地址。Wherein, the address of the video segment and the address of the video segment corresponding to the target resolution are set as a corresponding relationship. Wherein, the address of setting the video segment can be the URL address of setting the video segment, and the client can access the video segment corresponding to the target resolution in the server based on the URL address of the video segment corresponding to the current resolution in the index file. slice address to obtain the video slice corresponding to the target resolution. For example, the switching request is a switching request for switching the resolution from 2k to 4k. As shown in Figure 1c, the server can redirect the URL address of the video segment in the index file Sub M3U8 to the URL address of the video segment corresponding to the resolution 4k. address.

S130:接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端。S130: Receive the download request of the next video fragment sent by the client, query the next video fragment from the address of the video fragment corresponding to the target resolution based on the download request, and send the The next video segment is fed back to the client.

在本发明实施例中,客户端在播放视频内容之前,可以向服务端发送下载索引文件的请求,并接收服务端反馈的索引文件,通过解析索引文件,可以得到视频分片的地址(可以是URL地址)、标识信息、视频分辨长度、持续时间等信息,客户端按照索引文件一片片连续请求下载视频分片,从而播放视频分片。客户端可以基于索引文件中的标识信息确定下一个视频分片的标识信息,当客户端向服务端发送下载请求时,该下载请求中携带当前分辨率对应的下一个视频分片的地址以及下一个视频分片的标识信息,服务端接收该下载请求,将该下载请求中携带的视频分片的地址定向到目标分辨率对应的视频分片的地址,从目标分辨率的视频分片的地址中基于标识信息查询下一个视频分片。需要说明的是,此处的查询也可以理解为从地址中获取视频分片的意思。In the embodiment of the present invention, before playing the video content, the client can send a request for downloading the index file to the server, and receive the index file fed back by the server. By parsing the index file, the address of the video segment can be obtained (which can be URL address), identification information, video resolution length, duration and other information, the client continuously requests to download video fragments according to the index file piece by piece, so as to play the video fragments. The client can determine the identification information of the next video segment based on the identification information in the index file. When the client sends a download request to the server, the download request carries the address of the next video segment corresponding to the current resolution and the next video segment. The identification information of a video fragment. The server receives the download request, and directs the address of the video fragment carried in the download request to the address of the video fragment corresponding to the target resolution. From the address of the video fragment of the target resolution Query the next video segment based on the identification information. It should be noted that the query here can also be understood as the meaning of obtaining video fragments from the address.

具体的,可以由内容分发服务器接收该下载请求,基于该下载请求中携带的视频分片的地址确定目标分辨率对应的视频分片的地址,基于目标分辨率对应的视频分片的地址从内容存储服务器中查询并获取下一个视频分片,并将下一个视频分片反馈给客户端,客户端接收该下一个视频分片,若当前分辨率对应的当前视频分片播放完毕,播放下一个视频分片。Specifically, the content distribution server may receive the download request, determine the address of the video segment corresponding to the target resolution based on the address of the video segment carried in the download request, and determine the address of the video segment corresponding to the target resolution based on the address of the video segment corresponding to the target resolution. The storage server queries and obtains the next video fragment, and feeds back the next video fragment to the client. The client receives the next video fragment. If the current video fragment corresponding to the current resolution is played, the next video fragment is played. Video fragmentation.

在本实施例中,对本发明实施例提供的技术方案进行举例说明,例如,如图1d所示,若分辨率从720P切换至4K,客户端发送分辨率切换请求(或者切换分辨率请求),内容分发服务器将Sub M3U8文件中视频分片的地址由分辨率720P对应的地址重定向为分辨率4k对应的地址。客户端发送下一个视频分片的下载请求,内容分发服务器基于Sub M3U8文件中视频分片的地址查询对应的分辨率4k对应的视频分片的地址,从内容存储服务器中的分辨率4k对应的视频分片的地址中获取下一个视频分片,并反馈给客户端。In this embodiment, the technical solution provided by the embodiment of the present invention is illustrated. For example, as shown in FIG. 1d, if the resolution is switched from 720P to 4K, the client sends a resolution switching request (or switching resolution request), The content distribution server redirects the address of the video segment in the Sub M3U8 file from the address corresponding to the resolution 720P to the address corresponding to the resolution 4k. The client sends a download request for the next video fragment, and the content distribution server queries the address of the corresponding video fragment with a resolution of 4k based on the address of the video fragment in the Sub M3U8 file, and obtains the address of the video fragment corresponding to the resolution of 4k from the content storage server. Get the next video segment from the address of the video segment and feed it back to the client.

需要说明的是,本发明实施例提供存储服务器和内容分发服务器可以是分别独立的设备,在本发明的其他实施例中,内容存储服务器和内容分发服务器可以合成为一个设备,该设备同时具有内容存储服务器和内容分发服务器的功能。It should be noted that the embodiment of the present invention provides that the storage server and the content distribution server can be independent devices. In other embodiments of the present invention, the content storage server and the content distribution server can be combined into one device, and the device also has Functions of storage server and content distribution server.

本发明实施例提供的技术方案,服务端接收视频从当前分辨率切换至目标分辨率的切换请求,基于该切换请求将当前分辨率对应的设定视频分片的地址重定向为目标分辨率对应的视频分片的地址,其中,设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;若接收到下一个视频分片的下载请求,通过基于该下载请求从目标分辨率对应的视频分片的地址中查询下一个视频分片,并反馈给客户端;即通过对视频分片的地址的重定向,在播放下一个视频分片的情况下,可以避免索引文件的重新下载,实现分辨率无缝切换,避免出现分辨率切换过程中的黑屏现象,提高用户体验。In the technical solution provided by the embodiment of the present invention, the server receives a switch request from the current resolution to the target resolution, and based on the switch request, redirects the address of the set video segment corresponding to the current resolution to the address corresponding to the target resolution. The address of the video segment, where the set video segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments; if the next video segment is received Based on the download request of the video clip, query the next video clip from the address of the video clip corresponding to the target resolution based on the download request, and feed it back to the client; that is, by redirecting the address of the video clip, the In the case of a video segment, it can avoid re-downloading of index files, realize seamless resolution switching, avoid black screen phenomenon during resolution switching, and improve user experience.

图2是本发明实施例提供的一种视频分辨率切换方法流程图,所述方法可以由视频分辨率切换装置来执行,所述装置可以由软件和/或硬件来实现;所述装置可以配置在客户端,所述客户端可以播放视频,所述方法可以应用于视频播放场景中,其中,客户端与服务端之间的视频数据的传输基于HTTP的流媒体网络传输协议进行传输。Fig. 2 is a flow chart of a video resolution switching method provided by an embodiment of the present invention, the method can be executed by a video resolution switching device, and the device can be implemented by software and/or hardware; the device can be configured On the client side, the client side can play video, and the method can be applied in a video playing scene, wherein the transmission of video data between the client side and the server side is based on the HTTP streaming media network transmission protocol.

如图2所示,本发明实施例提供的技术方案包括:As shown in Figure 2, the technical solutions provided by the embodiments of the present invention include:

S210:向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片。S210: Send to the server a switching request for switching the played video from the current resolution to the target resolution; the switching request is used to instruct the server to segment the address of the set video segment corresponding to the current resolution Redirection is the address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client, or the next video segment, or all Video fragmentation.

在本发明实施例中,包含节目内容的视频划分为视频分片,按照视频分片的顺序进行播放。若满足视频分辨率切换的条件或者接收到视频分辨率切换的指令,客户端可以向服务端发送视频从当前分辨率切换至目标分辨率的切换请求,服务端接收该切换请求,基于该切换请求将当前分辨率对应的设定视频分片的地址重定向为目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片。其中,满足视频分辨率切换条件可以是网络满足分辨率切换条件,或者用户信息满足分辨率切换条件等;其中,若检测到用户触发分辨率切换的操作,接收到视频分辨率切换的指令。In the embodiment of the present invention, the video containing program content is divided into video segments, and the video segments are played in sequence. If the conditions for video resolution switching are met or a video resolution switching instruction is received, the client can send a video switching request from the current resolution to the target resolution to the server, and the server receives the switching request, and based on the switching request Redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client slice, or the next video slice, or all video slices. Wherein, satisfying the video resolution switching condition may be that the network meets the resolution switching condition, or user information meets the resolution switching condition, etc.; wherein, if it is detected that the user triggers the resolution switching operation, an instruction for video resolution switching is received.

在本发明实施例中,可选的,在接收切换请求之前,还可以包括:将不同分辨率的视频分片进行内容对齐,以及将相同分辨率的视频分片存储在相同位置。具体的,可以通过内容存储服务器将同一节目的视频内容编码成不同分辨率的视频分片,将不同分辨率的视频分片进行内容对齐。例如,如720P的第一个视频分片和1080P,4K的第一个视频分片要完全对齐,编码方式(如H264),持续时间等需要对齐,只是分辨率的不同。由此,后续的视频分片也需要进行内容对齐。内容存储服务器将同一分辨率的视频分片存储在一个存储位置,不同分辨率的视频分片存储不同的存储位置,然后针对同一节目的视频内容制作一个通用的Sub M3U8文件,Sub M3U8文件列举每一个视频分片的地址,例如,可以是每个视频分片的URL地址。In the embodiment of the present invention, optionally, before receiving the switching request, it may further include: performing content alignment on video slices with different resolutions, and storing video slices with the same resolution in the same location. Specifically, the video content of the same program may be encoded into video segments with different resolutions through the content storage server, and the content of the video segments with different resolutions may be aligned. For example, the first video fragment of 720P and the first video fragment of 1080P and 4K must be completely aligned, and the encoding method (such as H264), duration, etc. need to be aligned, but the resolution is different. Therefore, subsequent video fragments also need to perform content alignment. The content storage server stores the video fragments of the same resolution in one storage location, and the video fragments of different resolutions are stored in different storage locations, and then creates a general Sub M3U8 file for the video content of the same program, and the Sub M3U8 file lists each An address of a video segment, for example, may be a URL address of each video segment.

S220:向所述服务端发送下一个视频分片的下载请求。S220: Send a download request of the next video segment to the server.

在本发明实施例中,客户端向服务端发送从当前分辨率切换至目标分辨率的切换请求,并不停止播放视频,而是继续播放当前分辨率对应的当前视频分片,并向服务端发送下一个视频分片的下载请求。In the embodiment of the present invention, the client sends a switching request from the current resolution to the target resolution to the server, does not stop playing the video, but continues to play the current video segment corresponding to the current resolution, and sends a request to the server Send a download request for the next video segment.

在本发明实施例的一个实施方式中,可选的,在播放视频之前,本发明实施例提供的方法还可以包括向所述服务端发送下载索引文件的请求,并接收所述服务端反馈的所述索引文件;其中,所述索引文件包括当前分辨率对应的视频分片的地址和标识信息;相应的,在向所述服务端发送下一个视频分片的下载请求之前,还包括:基于所述索引文件确定下一个视频分片。In an implementation manner of the embodiment of the present invention, optionally, before playing the video, the method provided by the embodiment of the present invention may further include sending a request for downloading the index file to the server, and receiving a request fed back by the server The index file; wherein, the index file includes the address and identification information of the video fragment corresponding to the current resolution; correspondingly, before sending the download request of the next video fragment to the server, it also includes: The index file determines the next video segment.

其中,在播放视频之前,客户端可以向服务端发送下载索引文件的请求,并接收服务端反馈的索引文件,通过解析索引文件,可以得到视频分片的地址(可以是URL地址)、标识信息、视频分辨长度、持续时间等信息,客户端按照索引文件一片片连续请求下载视频分片,从而播放视频分片。客户端可以基于索引文件中的标识信息确定下一个视频分片的标识信息,当客户端向服务端发送下载请求时,该下载请求中携带下一个视频分片的地址以及下一个视频分片的标识信息,服务端基于下载请求中携带的视频分片的地址定向到目标分辨率对应的视频分片的地址,从目标分辨率对应的视频分片的地址中基于标识信息查询下一个视频分片。Among them, before playing the video, the client can send a request for downloading the index file to the server, and receive the index file fed back by the server. By parsing the index file, the address of the video segment (which can be a URL address) and identification information can be obtained. , video resolution length, duration and other information, the client requests to download video fragments one by one according to the index file, so as to play the video fragments. The client can determine the identification information of the next video segment based on the identification information in the index file. When the client sends a download request to the server, the download request carries the address of the next video segment and the address of the next video segment. Identification information, the server directs to the address of the video segment corresponding to the target resolution based on the address of the video segment carried in the download request, and queries the next video segment based on the identification information from the address of the video segment corresponding to the target resolution .

需要说明的是,可以将步骤“向服务端发送下一个视频分片的下载请求”在“继续播放当前分辨率对应的当前视频分片”过程中执行,或者可以是当接收到服务端反馈的重定向成功的消息时,客户端向服务端发送下一个视频分片的下载请求,或者还可以是其他时机,客户端向服务端发送下一个视频分片的下载请求。It should be noted that the step "sending a download request for the next video fragment to the server" can be performed during the process of "continuing to play the current video fragment corresponding to the current resolution", or it can be performed when receiving the feedback from the server When the redirection is successful, the client sends a download request of the next video segment to the server, or at other times, the client sends a download request of the next video segment to the server.

S230:接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片。S230: Receive the next video fragment queried from the address of the video fragment corresponding to the target resolution based on the download request fed back by the server, and play the current video fragment when the playback of the current video fragment is completed. Describe the next video segment.

在本发明实施例中,由于下一个视频分片是从目标分辨率对应的视频分片的地址中查询的视频分片,故下一个视频分片的分辨率为目标分辨率。In the embodiment of the present invention, since the next video segment is the video segment queried from the address of the video segment corresponding to the target resolution, the resolution of the next video segment is the target resolution.

在本发明实施例中,若当前分辨率对应的当前视频分片播放完毕,播放目标分辨率对应的下一个视频分片。其中,由于下一个视频分片的地址已经重定向目标分辨率对应的视频分片的地址,则客户端后续拉取的视频分片即为目标分辨率对应的视频分片,从而完成视频分辨率的切换。In the embodiment of the present invention, if the current video segment corresponding to the current resolution is played completely, the next video segment corresponding to the target resolution is played. Among them, since the address of the next video segment has been redirected to the address of the video segment corresponding to the target resolution, the subsequent video segment pulled by the client is the video segment corresponding to the target resolution, thus completing the video resolution switch.

本发明实施例提供的技术方案,向服务端发送从当前分辨率切换至目标分辨率的切换请求,该切换请求用于指示服务端将设定视频分片的地址重定向为目标分辨率对应的地址,客户端向服务端发送下一个视频分片的下载请求,并接收服务端基于该下载请求从目标分辨率对应的视频分片的地址中查询的下一个视频分片;若当前视频分片播放完毕,播放下一个视频分片,即在需要切换分辨率的情况下,通过重定向,可以基于下载请求拉取目标分辨率对应的下一个视频分片,若当前视频分片播放完毕,播放目标分辨率对应的下一个视频分片,可以实现分辨率无缝切换,避免出现分辨率切换过程中的黑屏现象,提高用户体验,提高产品竞争力。In the technical solution provided by the embodiment of the present invention, a switch request from the current resolution to the target resolution is sent to the server, and the switch request is used to instruct the server to redirect the address of the set video segment to the address corresponding to the target resolution. address, the client sends a download request for the next video segment to the server, and receives the next video segment that the server queries from the address of the video segment corresponding to the target resolution based on the download request; if the current video segment After the playback is complete, play the next video segment. That is, if you need to switch the resolution, you can pull the next video segment corresponding to the target resolution based on the download request through redirection. If the current video segment is played, play The next video segment corresponding to the target resolution can realize seamless resolution switching, avoid black screen phenomenon during the resolution switching process, improve user experience, and improve product competitiveness.

图3是本发明实施例提供的一种视频分辨率切换方法流程图,在本实施例中,可选的,本发明实施例提供的方法还可以包括:Fig. 3 is a flow chart of a video resolution switching method provided by an embodiment of the present invention. In this embodiment, optionally, the method provided by this embodiment of the present invention may further include:

若本地缓存除所述当前视频分片之外的其他视频分片,将所述其他视频分片进行删除。If other video fragments except the current video fragment are locally cached, the other video fragments are deleted.

可选的,在播放视频之前,还包括:Optionally, before playing the video, include:

向所述服务端发送下载索引文件的请求,并接收所述服务端反馈的所述索引文件;其中,所述索引文件包括当前分辨率对应的视频分片的地址和标识信息;Sending a request for downloading an index file to the server, and receiving the index file fed back by the server; wherein, the index file includes the address and identification information of the video segment corresponding to the current resolution;

相应的,在向所述服务端发送下一个视频分片的下载请求之前,还包括:Correspondingly, before sending the download request of the next video segment to the server, it also includes:

基于所述索引文件确定下一个视频分片。A next video segment is determined based on the index file.

如图3所示,本发明实施例提供的技术方案包括:As shown in Figure 3, the technical solutions provided by the embodiments of the present invention include:

S310:向所述服务端发送下载索引文件的请求,并接收所述服务端反馈的所述索引文件;其中,所述索引文件包括当前分辨率对应的视频分片的地址和标识信息。S310: Send a request for downloading an index file to the server, and receive the index file fed back by the server; wherein, the index file includes addresses and identification information of video segments corresponding to the current resolution.

S320:基于所述索引文件拉取视频分片,并按照视频分片进行视频播放。S320: Extract video segments based on the index file, and perform video playback according to the video segments.

在本发明实施例中,客户端解析索引文件中的信息,基于索引文件一片片连续发送下载请求,从而拉取视频分片,并按照视频分片的顺序进行视频播放。In the embodiment of the present invention, the client parses the information in the index file, and continuously sends download requests piece by piece based on the index file, so as to pull video fragments and play the video in the order of the video fragments.

S330:向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片。S330: Send a switch request to the server to switch the played video from the current resolution to the target resolution; the switch request is used to instruct the server to segment the address of the set video segment corresponding to the current resolution Redirection is the address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client, or the next video segment, or all Video fragmentation.

S340:若本地缓存除所述当前视频分片之外的当前分辨率对应的其他视频分片,将所述其他视频分片进行删除。S340: If other video fragments corresponding to the current resolution other than the current video fragment are cached locally, delete the other video fragments.

在本发明实施例中,若本地存在多余的缓存,可以将多余的缓存进行清除,其中,多余的缓存为除当前视频分片之外的当前分辨率对应的其他视频分片。In the embodiment of the present invention, if there is redundant cache locally, the redundant cache may be cleared, wherein the redundant cache is other video fragments corresponding to the current resolution other than the current video fragment.

由此,通过将多余的缓存进行删除,可以避免长时间播放当前分辨率的视频分片,可以快速实现分辨率的切换。Therefore, by deleting redundant buffers, it is possible to avoid playing video fragments of the current resolution for a long time, and to realize switching of resolutions quickly.

S350:基于所述索引文件确定下一个视频分片,并向所述服务端发送下一个视频分片的下载请求。S350: Determine the next video segment based on the index file, and send a download request of the next video segment to the server.

S360:接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片地址中查询的下一个视频分片,并当所述当前视频分片播放完毕,播放所述下一个视频分片。S360: Receive the next video fragment queried from the video fragment address corresponding to the target resolution based on the download request fed back by the server, and play the next video fragment when the current video fragment is played. A video segment.

图4是本发明实施例提供的一种视频分辨率切换方法,所述方法可以由客户端和服务端来实现,如图4所示,本发明实施例提供的技术方案包括:Fig. 4 is a video resolution switching method provided by an embodiment of the present invention. The method can be implemented by a client and a server. As shown in Fig. 4, the technical solution provided by an embodiment of the present invention includes:

S410:客户端向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求。S410: the client sends a switch request to the server to switch the played video from the current resolution to the target resolution.

S420:所述服务端接收所述切换请求,基于所述切换请求将设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片。S420: The server receives the switch request, and based on the switch request, redirects the address of the set video segment to the address of the video segment corresponding to the target resolution; wherein, the set video segment Including the video segment after the current video segment played by the client, or the next video segment, or all video segments.

S430:所述客户端向所述服务端发送下一个视频分片的下载请求。S430: The client sends a download request of the next video segment to the server.

S440:所述服务端接收所述下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询下一个视频分片,并将所述下一个视频分片反馈给所述客户端。S440: The server receives the download request of the next video segment, queries the next video segment from the address of the video segment corresponding to the target resolution based on the download request, and sends the next The video fragments are fed back to the client.

S450:所述客户端接收所述下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片。S450: The client receives the next video segment, and plays the next video segment when the current video segment is finished playing.

其中,S410-S450的介绍可以参考上述实施例的介绍。For the introduction of S410-S450, reference may be made to the introduction of the foregoing embodiments.

针对客户端和服务端执行的其他步骤可以参考上述实施例的介绍。For other steps performed by the client and the server, reference may be made to the introduction of the foregoing embodiments.

图5是本发明实施例提供的一种视频分辨率切换装置的结构框图,所述装置配置在客户端,如图5所示,所述装置包括:第一发送模块510、第二发送模块520和接收/播放模块530。Fig. 5 is a structural block diagram of a video resolution switching device provided by an embodiment of the present invention, the device is configured on a client, as shown in Fig. 5 , the device includes: a first sending module 510, a second sending module 520 And receiving/playing module 530.

其中,第一发送模块510,用于向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Wherein, the first sending module 510 is configured to send a switch request for switching the played video from the current resolution to the target resolution to the server; the switch request is used to instruct the server to match the current resolution to the target resolution. The address of the set video segment is redirected to the address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client, or The next video segment, or all video segments;

第二发送模块520,用于向所述服务端发送下一个视频分片的下载请求;The second sending module 520 is configured to send a download request of the next video segment to the server;

接收/播放模块530,用于接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片。The receiving/playing module 530 is configured to receive the next video fragment queried from the address of the video fragment corresponding to the target resolution based on the download request fed back by the server, and when the current video fragment When the playback is finished, the next video segment is played.

可选的,所述装置还包括删除模块,用于若本地缓存除所述当前视频分片之外的当前分辨率对应的其他视频分片,将所述其他视频分片进行删除。Optionally, the device further includes a deletion module, configured to delete other video segments other than the current video segment corresponding to the current resolution if the other video segments are locally cached.

可选的,第一发送模块510,还用于在播放视频之前,向所述服务端发送下载索引文件的请求,并接收所述服务端反馈的所述索引文件;其中,所述索引文件包括当前分辨率对应的视频分片的地址和标识信息;Optionally, the first sending module 510 is further configured to send a request for downloading an index file to the server before playing the video, and receive the index file fed back by the server; wherein the index file includes The address and identification information of the video segment corresponding to the current resolution;

所述装置还包括确定模块,用于在向所述服务端发送下一个视频分片的下载请求之前,还包括:基于所述索引文件确定下一个视频分片。The device further includes a determining module, configured to, before sending a download request of the next video segment to the server, further include: determining the next video segment based on the index file.

上述装置可执行本发明任意实施例所提供的方法,具备执行方法相应的功能模块和有益效果。The above-mentioned device can execute the method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

图6是本发明实施例提供的一种视频分辨率切换装置结构框图,所述装置配置于服务端,如图6所示,所述装置包括:接收模块610、重定向模块620和接收/反馈模块630。Fig. 6 is a structural block diagram of a video resolution switching device provided by an embodiment of the present invention. The device is configured on the server side. As shown in Fig. 6, the device includes: a receiving module 610, a redirection module 620 and a receiving/feedback Module 630.

其中,接收模块610,用于接收客户端发送的将视频从当前分辨率切换至目标分辨率的切换请求;Wherein, the receiving module 610 is configured to receive a switch request sent by the client to switch the video from the current resolution to the target resolution;

重定向模块620,用于基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;The redirection module 620 is configured to redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution based on the switching request; wherein, the set video Fragments include video fragments after the current video fragment played by the client, or the next video fragment, or all video fragments;

接收/反馈模块630,用于接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端。The receiving/feedback module 630 is configured to receive the download request of the next video segment sent by the client, and query the next video segment from the address of the video segment corresponding to the target resolution based on the download request. segment, and feed back the next video segment to the client.

可选的,所述装置还包括对齐/存储模块,用于将不同分辨率的视频分片进行内容对齐,以及将相同分辨率的视频分片存储在相同位置。Optionally, the device further includes an alignment/storage module, configured to perform content alignment on video slices with different resolutions, and store video slices with the same resolution in the same location.

可选的,所述装置还包括存储模块,用于将所述当前分辨率对应的视频分片的地址和标识信息存储在索引文件中;Optionally, the device further includes a storage module, configured to store the address and identification information of the video segment corresponding to the current resolution in an index file;

相应的,将视频分片的地址重定向为所述目标分辨率对应的地址,包括:基于所述索引文件将当前分辨率对应的设定视频分片的地址向所述目标分辨率对应的视频分片的地址进行映射。Correspondingly, redirecting the address of the video segment to the address corresponding to the target resolution includes: based on the index file, redirecting the address of the set video segment corresponding to the current resolution to the video address corresponding to the target resolution The addresses of the fragments are mapped.

上述装置可执行本发明任意实施例所提供的方法,具备执行方法相应的功能模块和有益效果。The above-mentioned device can execute the method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

图7是本发明实施例提供的一种电子设备结构示意图,如图7所示,该设备包括:Fig. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As shown in Fig. 7, the device includes:

一个或多个处理器710,图7中以一个处理器710为例;One or more processors 710, one processor 710 is taken as an example in FIG. 7;

存储器720;memory 720;

所述设备还可以包括:输入装置730和输出装置740。The device may also include: an input device 730 and an output device 740 .

所述设备中的处理器710、存储器720、输入装置730和输出装置740可以通过总线或者其他方式连接,图7中以通过总线连接为例。The processor 710, the memory 720, the input device 730 and the output device 740 in the device may be connected through a bus or in other ways. In FIG. 7, connection through a bus is taken as an example.

存储器720作为一种非暂态计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本发明实施例中的一种视频分辨率切换方法对应的程序指令/模块(例如,附图5所示的第一发送模块510、第二发送模块520和接收/播放模块530,或者图6所示的接收模块610、重定向模块620和接收/反馈模块630)。处理器710通过运行存储在存储器720中的软件程序、指令以及模块,从而执行计算机设备的各种功能应用以及数据处理,即实现上述方法实施例的一种视频分辨率切换方法,即:The memory 720, as a non-transitory computer-readable storage medium, can be used to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to a video resolution switching method in the embodiment of the present invention (for example, The first sending module 510, the second sending module 520 and the receiving/playing module 530 shown in FIG. 5, or the receiving module 610, the redirecting module 620 and the receiving/feedback module 630 shown in FIG. 6). The processor 710 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 720, that is, realizes a video resolution switching method in the above method embodiment, namely:

接收客户端发送的将播放的视频从当前分辨率切换至目标分辨率的切换请求;Receive the switching request sent by the client to switch the playing video from the current resolution to the target resolution;

基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Based on the switching request, redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution; wherein, the setting of the video segment includes playing on the client The video segment after the current video segment, or the next video segment, or all video segments;

接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端。Receive the download request of the next video fragment sent by the client, query the next video fragment from the address of the video fragment corresponding to the target resolution based on the download request, and send the next The video fragments are fed back to the client.

或者,or,

向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Sending a switching request for switching the played video from the current resolution to the target resolution to the server; the switching request is used to instruct the server to redirect the address of the set video segment corresponding to the current resolution The address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments piece;

向所述服务端发送下一个视频分片的下载请求;Send a download request for the next video segment to the server;

接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片。Receive the next video segment fed back by the server from the address of the video segment corresponding to the target resolution based on the download request, and when the current video segment is played, play the next video segment A video segment.

存储器720可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据计算机设备的使用所创建的数据等。此外,存储器720可以包括高速随机存取存储器,还可以包括非暂态性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态性固态存储器件。在一些实施例中,存储器720可选包括相对于处理器710远程设置的存储器,这些远程存储器可以通过网络连接至终端设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the computer device, and the like. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the storage 720 may optionally include storages that are remotely located relative to the processor 710, and these remote storages may be connected to the terminal device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

输入装置730可用于接收输入的数字或字符信息,以及产生与计算机设备的用户设置以及功能控制有关的键信号输入。输出装置740可包括显示屏等显示设备,或者输出接口等。The input device 730 can be used to receive input numbers or character information, and generate key signal input related to user settings and function control of the computer device. The output device 740 may include a display device such as a display screen, or an output interface or the like.

本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明实施例提供的一种视频分辨率切换方法:An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, a video resolution switching method as provided in the embodiment of the present invention is implemented:

接收客户端发送的将播放的视频从当前分辨率切换至目标分辨率的切换请求;Receive the switching request sent by the client to switch the playing video from the current resolution to the target resolution;

基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Based on the switching request, redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution; wherein, the setting of the video segment includes playing on the client The video segment after the current video segment, or the next video segment, or all video segments;

接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端。Receive the download request of the next video fragment sent by the client, query the next video fragment from the address of the video fragment corresponding to the target resolution based on the download request, and send the next The video fragments are fed back to the client.

或者,or,

向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Sending a switching request for switching the played video from the current resolution to the target resolution to the server; the switching request is used to instruct the server to redirect the address of the set video segment corresponding to the current resolution The address of the video segment corresponding to the target resolution; wherein, the set video segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments piece;

向所述服务端发送下一个视频分片的下载请求;Send a download request for the next video segment to the server;

接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片。Receive the next video segment fed back by the server from the address of the video segment corresponding to the target resolution based on the download request, and when the current video segment is played, play the next video segment A video segment.

可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (non-exhaustive list) of computer readable storage media include: electrical connections with one or more leads, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a data signal carrying computer readable program code in baseband or as part of a carrier wave. Such propagated data signals may take many forms, including - but not limited to - electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including - but not limited to - wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out the operations of the present invention may be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.

Claims (8)

1.一种视频分辨率切换方法,其特征在于,所述方法应用于服务端,包括:1. A video resolution switching method, characterized in that the method is applied to the server, including: 接收客户端发送的将播放的视频从当前分辨率切换至目标分辨率的切换请求;Receive the switching request sent by the client to switch the playing video from the current resolution to the target resolution; 基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括所述客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Based on the switching request, redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution; wherein, the set video segment includes the client The video segment after the current video segment played, or the next video segment, or all video segments; 接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端;Receive the download request of the next video fragment sent by the client, query the next video fragment from the address of the video fragment corresponding to the target resolution based on the download request, and send the next The video segment is fed back to the client; 其中,将所述当前分辨率对应的视频分片的地址和标识信息存储在索引文件中;Wherein, the address and identification information of the video slice corresponding to the current resolution are stored in the index file; 相应的,所述将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址,包括:Correspondingly, the redirecting the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution includes: 基于所述索引文件将所述当前分辨率对应的设定视频分片的地址向所述目标分辨率对应的视频分片的地址进行映射;mapping the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution based on the index file; 其中,客户端在播放视频内容之前,向服务端发送下载索引文件的请求,并接收服务端反馈的索引文件。Wherein, before playing the video content, the client sends a request for downloading the index file to the server, and receives the index file fed back by the server. 2.根据权利要求1所述的方法,其特征在于,还包括:2. The method according to claim 1, further comprising: 将不同分辨率的视频分片进行内容对齐,以及将相同分辨率的视频分片存储在相同位置。Content alignment of video fragments of different resolutions, and storage of video fragments of the same resolution in the same location. 3.一种视频分辨率切换方法,其特征在于,所述方法应用于客户端,所述方法包括:3. A video resolution switching method, characterized in that, the method is applied to a client, and the method comprises: 向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;服务端将所述当前分辨率对应的视频分片的地址和标识信息存储在索引文件中;其中,所述设定视频分片包括在所述客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;Sending a switching request for switching the played video from the current resolution to the target resolution to the server; the switching request is used to instruct the server to redirect the address of the set video segment corresponding to the current resolution is the address of the video segment corresponding to the target resolution; the server stores the address and identification information of the video segment corresponding to the current resolution in the index file; wherein, the set video segment is included in the The video segment after the current video segment played by the client, or the next video segment, or all video segments; 向所述服务端发送下一个视频分片的下载请求;Send a download request for the next video segment to the server; 接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片;Receive the next video segment fed back by the server from the address of the video segment corresponding to the target resolution based on the download request, and when the current video segment is played, play the next video segment a video segment; 其中,所述用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址,包括:Wherein, the address for instructing the server to redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution includes: 指示服务端基于所述索引文件将所述当前分辨率对应的设定视频分片的地址向所述目标分辨率对应的视频分片的地址进行映射;Instructing the server to map the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution based on the index file; 其中,在播放视频之前,还包括:Among them, before playing the video, it also includes: 向所述服务端发送下载索引文件的请求,并接收所述服务端反馈的所述索引文件;其中,所述索引文件包括当前分辨率对应的视频分片的地址和标识信息;Sending a request for downloading an index file to the server, and receiving the index file fed back by the server; wherein, the index file includes the address and identification information of the video segment corresponding to the current resolution; 相应的,在向所述服务端发送下一个视频分片的下载请求之前,还包括:Correspondingly, before sending the download request of the next video segment to the server, it also includes: 基于所述索引文件确定下一个视频分片。A next video segment is determined based on the index file. 4.根据权利要求3所述的方法,其特征在于,还包括:4. The method according to claim 3, further comprising: 若本地缓存除所述当前视频分片之外的当前分辨率对应的其他视频分片,将所述其他视频分片进行删除。If other video segments corresponding to the current resolution other than the current video segment are cached locally, the other video segments are deleted. 5.一种视频分辨率切换装置,其特征在于,所述装置应用于服务端,包括:5. A video resolution switching device, characterized in that the device is applied to a server, including: 接收模块,用于接收客户端发送的将视频从当前分辨率切换至目标分辨率的切换请求;The receiving module is configured to receive a switch request sent by the client to switch the video from the current resolution to the target resolution; 重定向模块,用于基于所述切换请求将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;A redirection module, configured to redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution based on the switching request; wherein, the set video segment The segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments; 接收/反馈模块,用于接收所述客户端发送的下一个视频分片的下载请求,基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询所述下一个视频分片,并将所述下一个视频分片反馈给所述客户端;The receiving/feedback module is configured to receive the download request of the next video fragment sent by the client, and query the next video fragment from the address of the video fragment corresponding to the target resolution based on the download request , and feed back the next video segment to the client; 存储模块,用于将所述当前分辨率对应的视频分片的地址和标识信息存储在索引文件中;A storage module, configured to store the address and identification information of the video slice corresponding to the current resolution in an index file; 请求模块,用于客户端在播放视频内容之前,向服务端发送下载索引文件的请求,并接收服务端反馈的索引文件;The request module is used for the client to send a request for downloading the index file to the server before playing the video content, and receive the index file fed back by the server; 所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址,包括:The address of the set video segment corresponding to the current resolution is redirected to the address of the video segment corresponding to the target resolution, including: 基于所述索引文件将当前分辨率对应的设定视频分片的地址向所述目标分辨率对应的视频分片的地址进行映射。Based on the index file, the address of the set video slice corresponding to the current resolution is mapped to the address of the video slice corresponding to the target resolution. 6.一种视频分辨率切换装置,其特征在于,所述装置应用于客户端,所述装置包括:6. A video resolution switching device, characterized in that the device is applied to a client, and the device comprises: 第一发送模块,用于向服务端发送将播放的视频从当前分辨率切换至目标分辨率的切换请求;所述切换请求,用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址;服务端将所述当前分辨率对应的视频分片的地址和标识信息存储在索引文件中;其中,所述设定视频分片包括在客户端播放的当前视频分片之后的视频分片,或者下一个视频分片,或者所有视频分片;The first sending module is used to send a switch request to the server to switch the played video from the current resolution to the target resolution; the switch request is used to instruct the server to set the current resolution corresponding to The address of the video segment is redirected to the address of the video segment corresponding to the target resolution; the server stores the address and identification information of the video segment corresponding to the current resolution in the index file; wherein, the setting The specified video segment includes the video segment after the current video segment played by the client, or the next video segment, or all video segments; 第二发送模块,用于向所述服务端发送下一个视频分片的下载请求;The second sending module is used to send a download request of the next video segment to the server; 接收/播放模块,用于接收所述服务端反馈的基于所述下载请求从所述目标分辨率对应的视频分片的地址中查询的下一个视频分片,并当所述当前视频分片播放完毕时,播放所述下一个视频分片;The receiving/playing module is configured to receive the next video segment fed back by the server from the address of the video segment corresponding to the target resolution based on the download request, and play the current video segment When finished, play the next video segment; 其中,所述用于指示所述服务端将所述当前分辨率对应的设定视频分片的地址重定向为所述目标分辨率对应的视频分片的地址,包括:Wherein, the address for instructing the server to redirect the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution includes: 指示服务端基于所述索引文件将所述当前分辨率对应的设定视频分片的地址向所述目标分辨率对应的视频分片的地址进行映射;Instructing the server to map the address of the set video segment corresponding to the current resolution to the address of the video segment corresponding to the target resolution based on the index file; 其中,第一发送模块,还用于在播放视频之前,向所述服务端发送下载索引文件的请求,并接收所述服务端反馈的所述索引文件;其中,所述索引文件包括当前分辨率对应的视频分片的地址和标识信息;Wherein, the first sending module is further configured to send a request for downloading an index file to the server before playing the video, and receive the index file fed back by the server; wherein, the index file includes the current resolution The address and identification information of the corresponding video segment; 所述装置还包括确定模块,用于在向所述服务端发送下一个视频分片的下载请求之前,还包括:基于所述索引文件确定下一个视频分片。The device further includes a determining module, configured to, before sending a download request of the next video segment to the server, further include: determining the next video segment based on the index file. 7.一种电子设备,其特征在于,包括:7. An electronic device, characterized in that it comprises: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-4任一项所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-4. 8.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-4任一项所述的方法。8. A computer-readable storage medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method according to any one of claims 1-4 is implemented.
CN202110710212.9A 2021-06-25 2021-06-25 Video resolution switching method, device, equipment and storage medium Active CN113438513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110710212.9A CN113438513B (en) 2021-06-25 2021-06-25 Video resolution switching method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110710212.9A CN113438513B (en) 2021-06-25 2021-06-25 Video resolution switching method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113438513A CN113438513A (en) 2021-09-24
CN113438513B true CN113438513B (en) 2023-05-02

Family

ID=77754446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110710212.9A Active CN113438513B (en) 2021-06-25 2021-06-25 Video resolution switching method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113438513B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116527992A (en) * 2022-01-21 2023-08-01 腾讯科技(深圳)有限公司 Video playing resolution switching method and device
CN114466220B (en) * 2022-01-29 2025-01-03 维沃移动通信有限公司 Video downloading method and electronic device
CN115086708B (en) * 2022-06-06 2024-03-08 北京奇艺世纪科技有限公司 Video playing method and device, electronic equipment and storage medium
CN116647729A (en) * 2023-06-06 2023-08-25 中国工商银行股份有限公司 Video processing method, device, electronic device and storage medium
CN118555449A (en) * 2024-07-30 2024-08-27 四川天邑康和通信股份有限公司 HLS video stream playing method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011110117A2 (en) * 2011-04-21 2011-09-15 华为技术有限公司 Method, device and system for positioning playing of multi-code rate based on hypertext transfer protocol
CN106131610A (en) * 2016-06-28 2016-11-16 乐视控股(北京)有限公司 The online broadcasting method of video, equipment and device
WO2017035786A1 (en) * 2015-09-01 2017-03-09 深圳好视网络科技有限公司 Method, device, and system for playing and checking streaming media file
CN110933517A (en) * 2019-11-30 2020-03-27 咪咕视讯科技有限公司 Code rate switching method, client and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109995743B (en) * 2018-01-02 2021-11-05 腾讯科技(深圳)有限公司 Multimedia file processing method and terminal
CN110519656B (en) * 2018-05-22 2021-11-26 中国电信股份有限公司 Self-adaptive streaming media playing method, system and server
CN111836076B (en) * 2019-04-18 2023-01-20 腾讯科技(深圳)有限公司 Video resolution switching method and device and electronic equipment
CN110677727B (en) * 2019-09-10 2022-05-10 北京奇艺世纪科技有限公司 Audio and video playing method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011110117A2 (en) * 2011-04-21 2011-09-15 华为技术有限公司 Method, device and system for positioning playing of multi-code rate based on hypertext transfer protocol
WO2017035786A1 (en) * 2015-09-01 2017-03-09 深圳好视网络科技有限公司 Method, device, and system for playing and checking streaming media file
CN106131610A (en) * 2016-06-28 2016-11-16 乐视控股(北京)有限公司 The online broadcasting method of video, equipment and device
CN110933517A (en) * 2019-11-30 2020-03-27 咪咕视讯科技有限公司 Code rate switching method, client and computer readable storage medium

Also Published As

Publication number Publication date
CN113438513A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN113438513B (en) Video resolution switching method, device, equipment and storage medium
US11539989B2 (en) Media content redirection
US11477262B2 (en) Requesting multiple chunks from a network node on the basis of a single request message
JP6444398B2 (en) Stream segmented content
US9356985B2 (en) Streaming video to cellular phones
US20150256600A1 (en) Systems and methods for media format substitution
US20120282951A1 (en) Anchoring and sharing locations and enjoyment experience information on a presentation timeline for multimedia content streamed over a network
JP2016509421A (en) Method and apparatus for performing adaptive streaming on media content
CN109587514B (en) A video playback method, medium and related device
US20220060532A1 (en) Method for transmitting resources and electronic device
CN106797488A (en) switch between media streams
JP2016519895A (en) Media file reception and media file transmission method, apparatus, and system
CN110933517A (en) Code rate switching method, client and computer readable storage medium
WO2015192683A1 (en) Content distribution method, device and system based on adaptive streaming technology
US20210021655A1 (en) System and method for streaming music on mobile devices
CN118474481A (en) Method, apparatus and non-volatile computer readable medium for receiving media data
KR102428194B1 (en) Methods, systems, and media for delivering manifestless streaming media content
JP6063952B2 (en) Method for displaying multimedia assets, associated system, media client, and associated media server
US20080104267A1 (en) Systems and methods for reducing display latency between streaming digital media
JP7387209B2 (en) Method and apparatus for dynamic adaptive streaming over HTTP
HK40052233A (en) Method and apparatus for receiving media content, storage medium and computer device
CN113364728A (en) Media content receiving method, device, storage medium and computer equipment
KR20200018890A (en) Wireless streaming method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant