WO2020211731A1 - 一种视频播放方法及相关设备 - Google Patents

一种视频播放方法及相关设备 Download PDF

Info

Publication number
WO2020211731A1
WO2020211731A1 PCT/CN2020/084574 CN2020084574W WO2020211731A1 WO 2020211731 A1 WO2020211731 A1 WO 2020211731A1 CN 2020084574 W CN2020084574 W CN 2020084574W WO 2020211731 A1 WO2020211731 A1 WO 2020211731A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
index file
sequence
play
server
Prior art date
Application number
PCT/CN2020/084574
Other languages
English (en)
French (fr)
Inventor
闫伟
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2020211731A1 publication Critical patent/WO2020211731A1/zh

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/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • 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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/254Management at additional data server, e.g. shopping server, rights management server
    • H04N21/2541Rights Management
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25808Management of client data
    • H04N21/25816Management of client data involving client authentication
    • 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/437Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server
    • 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/835Generation of protective data, e.g. certificates
    • H04N21/8358Generation of protective data, e.g. certificates involving watermark
    • 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/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
    • 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

Definitions

  • This application relates to the field of computer technology, in particular to a video playback method and related equipment.
  • video content providers usually add watermarking to the videos.
  • the watermark added to the video is generally an implicit watermark.
  • the implicit watermark is a digital signal used for identification and will not affect the visual quality of watching the video. If the video is illegally leaked, the watermark information in the leaked video can be traced back to which user leaked the video to protect the legitimate rights and interests of the video content provider.
  • the method of adding a watermark on the cloud side is currently a commonly used method of adding a watermark.
  • the principle of the method is: first, a video is transcoded into two video media of A stream and B stream through a transcoding platform, and the video media of the A stream and the B stream both include multiple video segments.
  • the video content of the video segments at the same segment position in the multiple video segments included in the stream A and stream B are the same (for example, the video content of segment 1 of stream A is the same as segment 1 of stream B),
  • the watermarks added to the video segments of stream A and stream B are different from each other. For different users, different video segments can be selected from A stream and B stream to form a playback sequence.
  • the playback sequence of the video obtained by user 1 may be segment 1, segment 3, segment 4, segment 6,... and segment 2, segment 5, segment 7,... of stream B.
  • the playback sequence of the same video obtained by user 2 may be segment 2, segment 3, segment 4, segment 7,... and segment 1, segment 5, segment 6,... of stream B . Since the watermarks added in the video segments of stream A and stream B are different from each other, the playback sequences of different users correspond to different watermark sequences. By detecting the watermark sequence in the video, it is possible to trace back which user acquired the leaked video of.
  • the user's client will obtain the playback index file from the CDN origin server through the content delivery network (CDN) edge node device (for example, the playback index file can be It is an MPD file or M3U8 file).
  • CDN content delivery network
  • This index file is generated by the CDN origin server in real time according to the unique ID of the user’s playback request, and it includes the download address corresponding to the entire playback sequence of the video (for example, uniform resource locator, URL). )).
  • the CDN origin server will send the index file to the CDN edge node device, and the CDN edge node device will send the index file to the user's client; after that, the user's client will follow the information in the index file
  • the download address downloads video fragments for video playback.
  • start-up delay may be caused, so that the user waits for a long time for the video start-up, which seriously affects the user experience and causes the user's playback abandonment rate to be too high.
  • video-on-demand generally adopts the Dash protocol
  • the MPD (media presentation description) index file adopted by the Dash protocol puts the playback URLs of all video segments of resolutions/bitrates in one index file.
  • the large index file will cause the CDN edge node device to obtain the index file from the CDN origin server and the user's client to obtain the index file from the CDN edge node device will cause a large delay. How to solve the problem of large start delay when playing a video with a watermark is an urgent problem for those skilled in the art.
  • the embodiments of the present application provide a video playback method and related equipment, which can reduce the start-up delay of the video in the case of playing a video with a watermark.
  • an embodiment of the present application provides a method for gait recognition.
  • the method includes: a first server receives a first request from a client from a CDN edge node device of a content distribution network, and the first request is used to request an index of a video File; the first server obtains the initiation play sequence of the video from the second server, where the initiation play sequence is a sequence of partial video fragments of the video; the first server generates the initiation play sequence corresponding to The initiation index file, the initiation index file includes the download address corresponding to the initiation play sequence; the first server sends the initiation index file to the CDN edge node device, so that the client receives the CDN edge node Start playing index files.
  • the client can obtain the initiation index file in a relatively short period of time, and then download it according to the initiation sequence of the video Address to download the video content to start broadcasting. In this way, it is possible to reduce the start-up delay of the video when playing a video with watermark.
  • the method further includes: the first server obtains all the play sequences of the video from the second server; the first server generates a first index according to the all play sequences File; or, the first server obtains from the second server the remaining play sequences of all play sequences of the video except the initiation play sequence; the first server generates a second index file according to the remaining play sequence.
  • the starting index file further includes the download address of the first index file, and the first index file includes the download address corresponding to all the playback sequences of the video, or
  • the initiation index file also includes the download address of the second index file, and the second index file includes the download addresses corresponding to the remaining play sequences in all the play sequences of the video except the initiation play sequence.
  • the method further includes: the first server receives the client's information from the CDN edge node device The second request, the second request is used to request to download the first index file or the second index file corresponding to the client; the first server sends the first index file or the second index file to the CDN edge node device .
  • the client includes multiple clients, and if the first server receives the first request of the multiple clients from the CDN edge node device, the first server generates The priority of the initiation index file corresponding to the multiple clients is higher than the priority of the first server generating the first index file or the second index file corresponding to the multiple clients.
  • the client includes multiple clients, and each of the multiple clients has a priority. If the first server receives from the CDN edge node device For the first request of the multiple clients, the first server preferentially generates the initiation index file corresponding to the client with high priority, and preferentially generates the first index file or the first index file corresponding to the client with high priority. 2. Index file.
  • the method before the first server obtains the starting playback sequence of the video from the second server, the method further includes: the first server judging the playback duration of the video It is greater than the preset duration, or it is determined that the number of slices of the video is greater than the preset value.
  • the method further includes: the first server receives a generation rule for a setting parameter of the initiating play sequence, and the setting parameter includes the first preset play time or the The first preset fragment position may include the second preset playing time or the second preset fragment position; the first server determines the setting parameters of the initiating playing sequence according to the generation rule.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset fragment position is proportional to the number of fragments of the video
  • the generation rule is that the second preset playback time is proportional to the total duration of the video, or the second preset segment position is proportional to the number of segments of the video.
  • the initiating play sequence is a sequence of video segments before the first preset play time of the video, or before the first preset segment position of the video
  • the sequence of video fragments; or, the starting playback sequence is the sequence of video fragments after the playing time of the movie's credits and before the second preset playback time, or the video's credit fragment position
  • an embodiment of the present application provides a video playback method.
  • the method includes: a client sends a first request to a CDN edge node device, and the first request is used to request an index file of the video;
  • the edge node device receives the initiation index file corresponding to the video, and the initiation index file includes the download address corresponding to the initiation and play sequence of the video, wherein the initiation and play sequence is a sequence of partial video segments of the video ;
  • the client downloads the video segment corresponding to the initiating play sequence from the CDN edge node device according to the download address corresponding to the initiating play sequence for video playback.
  • the client can obtain the initiation index file in a relatively short period of time, and then download it according to the initiation sequence of the video Address to download the video content to start broadcasting. In this way, it is possible to reduce the start-up delay of the video when playing a video with watermark.
  • the starting index file further includes the download address of the first index file, and the first index file includes the download address corresponding to all the playback sequences of the video; or,
  • the start index file also includes a download address of a second index file, and the second index file includes download addresses corresponding to the remaining play sequences except the start play sequence in all play sequences of the video.
  • the method further includes: in a case where the video segment corresponding to the initiating play sequence is played to the third preset play time or the third preset segment position,
  • the client sends a second request to the CDN edge node device according to the download address of the first index file or the second index file, where the second request is used to request to download the first index file or the second index file,
  • the third preset play time is less than the maximum value of the play time of the initiation play sequence, and the third preset fragment position is before the maximum value of the fragment position of the initiation play sequence;
  • the client is from the edge of the CDN
  • the node device receives the first index file or the second index file;
  • the client downloads the video segment corresponding to the entire play sequence from the CDN edge node device according to the download address corresponding to the entire play sequence for use Play the unplayed video part of the video; or download the video segment corresponding to the remaining play sequence from the CDN edge node device according to the download address corresponding to the remaining play
  • the method further includes: in the case that the client receives an inputted playback request for the first playback time or the first segment position of the video, the client The terminal sends a second request to the CDN edge node device according to the download address of the first index file or the second index file, where the second request is used to request to download the first index file or the second index file, and the A play time is greater than the maximum value of the play time of the initiating play sequence, and the first segment position is after the maximum value of the segment position of the initiation play sequence; the client receives the first segment from the CDN edge node device An index file or the second index file; the client downloads the video segment corresponding to the entire play sequence from the CDN edge node device according to the download address corresponding to the entire play sequence, so as to use the first play time Or play the video from the first segment position; or download the video segment corresponding to the remaining play sequence from the CDN edge node device according to the download address corresponding to the remaining play sequence,
  • the setting parameter of the initiating play sequence is determined by the generation rule received by the CDN origin server, and the setting parameter includes the first preset play time or the first
  • the preset fragment position may include the second preset playing time or the second preset fragment position.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset fragment position is proportional to the number of fragments of the video
  • the generation rule is that the second preset playback time is proportional to the total duration of the video, or the second preset segment position is proportional to the number of segments of the video.
  • the initiating play sequence is a sequence of video segments before the first preset play time of the video, or before the first preset segment position of the video
  • the sequence of video fragments; or, the starting playback sequence is the sequence of video fragments after the playing time of the movie's credits and before the second preset playback time, or the video's credit fragment position
  • an embodiment of the present application provides a server, which is used as a first server, and the first server includes methods corresponding to the methods described in the first aspect or various possible implementations of the first aspect.
  • the first server may be an electronic device, or a device (for example, an operating system, etc.) for generating a starting index file in the electronic device.
  • the units included in the above first server may be hardware circuits, software, or hardware circuits combined with software.
  • an embodiment of the present application provides a client, and the client includes units corresponding to the second aspect or the methods described in various possible implementations of the second aspect.
  • the client can be an electronic device, or a device for playing videos in the electronic device.
  • the units included in the foregoing client may be hardware circuits, software, or hardware circuits combined with software.
  • the embodiments of the present application provide yet another server.
  • the server is used as a first server.
  • the first server includes a processor and a memory.
  • the memory is used to store program instructions.
  • the first server is caused to execute the method described in the first aspect or any possible implementation of the first aspect.
  • an embodiment of the present application provides yet another client.
  • the client includes a processor and a memory, where the memory is used to store program instructions that, when run by the processor, cause the client to Perform the method described in the foregoing second aspect or any possible implementation of the second aspect.
  • the embodiments of the present application provide a computer-readable storage medium, the computer storage medium stores program instructions, and when the program instructions are executed by a processor, the processor executes the first aspect or the first aspect described above.
  • an embodiment of the present application provides a computer program.
  • the processor executes the method described in the first aspect or any possible implementation of the first aspect, or Perform the method described in the foregoing second aspect or any possible implementation of the second aspect.
  • the CDN origin server after the CDN origin server receives the first request sent by the client through the CDN edge node device, it will generate a start index file in real time, and the start index file includes the download address corresponding to the start play sequence
  • the initiating play sequence is a video segment at the beginning of the video or a sequence corresponding to a video segment after the video skips the title; after that, the CDN origin server sends the initiating index file to the client through the CDN edge node device. Since the initiation index file contains less data and takes less time for generation and transmission, the client can obtain the initiation index file in a shorter time, and then download the video content according to the download address corresponding to the initiation play sequence Start broadcasting, so as to reduce the delay of video starting.
  • FIGS. 1A to 1D are schematic diagrams of the architecture of some video playback systems provided by embodiments of the present application.
  • FIG. 2 is a flowchart of a video playback method provided by an embodiment of the present application
  • 3A to 3D are schematic diagrams of setting parameters of some initiating play sequences provided by embodiments of the present application.
  • FIG. 4 is a flowchart of another video playback method provided by an embodiment of the present application.
  • 5A to 5D are schematic diagrams of some scenarios that trigger a client to send a second request according to embodiments of the present application
  • 6A to 6D are schematic diagrams of some scenarios that trigger a client to send a second request provided by embodiments of the present application;
  • FIG. 7 is a schematic diagram of a server provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a client provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of another server provided by an embodiment of the present application.
  • Fig. 10 is a schematic diagram of another client provided by an embodiment of the present application.
  • the video playback system includes a client, a playback authentication server, a CDN scheduling device, a CDN origin server, a CDN edge node device, and a watermark server.
  • the following is a further introduction to these devices.
  • the client is a device that corresponds to the server and provides local services to customers.
  • a variety of applications can be run on the client. Except for some applications that run locally, the client generally requires the server to provide corresponding services for running applications.
  • the client may be a mobile phone, a computer, a tablet computer, a notebook computer, a wearable device, a multimedia device, and other devices that can perform video playback.
  • the client can play the video through its own application (for example, a video playback application, a social application, or a news application).
  • a user can perform an on-demand operation on a certain video in the client's video playback application.
  • the client can access the content distribution network to request the video Index file. Before the client accesses the content distribution network, it needs to send a playback authentication request to the playback authentication server.
  • the playback authentication request is used to instruct the playback authentication server to determine the access rights of the client. The following will further introduce the playback authentication server.
  • the playback authentication server is a device that can determine the client's access rights to the content distribution network. If the playback authentication server determines that the client has access to the content distribution network, the playback authentication server will feed back the authentication result to the client, and then the client can send to the CDN scheduling device of the content distribution network A scheduling request, which is used to request the CDN scheduling device to allocate a CDN edge node device for the client to the client. If the playback authentication server determines that the client does not have access rights to the content distribution network, the playback authentication server will feed back the result of the authentication failure to the client, and the client will not be able to successfully access the content distribution network.
  • the CDN scheduling device is a CDN edge node device that can be allocated to the client to provide services according to the network status and the status of the CDN edge node device in real time.
  • the CDN scheduling device can allocate CDN edge node devices that provide services to clients based on comprehensive information such as network traffic and the connection status of each CDN edge node device, load status, distance to the client and response time in real time .
  • the CDN scheduling device may feed back the information of the allocated CDN edge node device to the client.
  • the CDN edge node device is a device that can directly respond to client requests and provide services for the client.
  • a content distribution network contains multiple CDN edge node devices.
  • CDN edge node devices are deployed in areas and networks where client access is relatively concentrated.
  • the CDN edge node device may receive a video playback request from the client. In response to the playback request, the CDN edge node device judges the requested video.
  • the CDN edge node device If the CDN edge node device saves the index file of the video, the CDN edge node device feeds back the index file to the client; if the CDN If the edge node device does not save the index file of the video, the CDN edge node device requests the index file of the video from the CDN origin server, and after receiving the index file of the video from the CDN origin server, the index file Feedback to the client.
  • the CDN edge node device since the video requested by the client is a video with a watermark, the index files of the video requested by different clients are incompatible with each other, so the CDN edge node device does not save the index file of the video. It needs to request the index file of the video from the CDN origin server.
  • the CDN origin server is the source device that provides video content in the content distribution network. Operations such as adding, deleting, and changing video content can be performed in the CDN origin server. In addition, all the video content stored in the CDN edge node device also comes from the CDN origin server.
  • the first server in the embodiment of the present application is a CDN origin server.
  • the CDN source site server includes a watermark index file generating module, and the watermark index file generating module can generate an index file of the video requested by the client.
  • the index file contains the download address of the video, and the index file has a corresponding relationship with the client.
  • the CDN origin server may send the request to the CDN edge node
  • the device sends the index file (including the starting index file, the first index file, or the second index file in the embodiment of this application), and then the CDN edge node device forwards the index file to the client.
  • the client can download video fragments for video playback according to the download address of the video in the index file.
  • the CDN origin server will first generate the starting index file of the video requested by the client.
  • the starting index file only includes the download address corresponding to the starting sequence of the video.
  • the starting sequence It is a sequence of partial video slices of the video. Since the initiation index file contains a small amount of data and takes less time for generation and transmission, the client can obtain the initiation index file in a relatively short period of time, and then download it according to the initiation sequence of the video Address to download the video content to start broadcasting. In this way, it is possible to reduce the start-up delay of the video when playing a video with watermark.
  • the watermark server is a device that generates a playback sequence of video fragments.
  • the watermark server may generate a playback sequence of video segments according to the received request.
  • the second server in the embodiment of the present application is a watermark server.
  • the CDN origin server in the process of generating the index file of the video by the CDN origin server, the CDN origin server needs to obtain the fragmented playback sequence of the video from the watermark server.
  • the CDN origin server in the process of the CDN origin server generating the start index file, the CDN origin server sends a third request to the watermark server. The third request is used to request the start playback sequence.
  • the third request also includes Including the setting parameters of the initiating play sequence (for example, the maximum value of the playing time of the initiating play sequence, or the maximum value of the segment position of the initiating play sequence).
  • the watermark server After that, in response to the third request, the watermark server generates the initiation play sequence, and feeds back the initiation play sequence to the CDN origin server.
  • the process of generating all the playback sequences of the video by the watermark server, or the process of generating the remaining playback sequences in all the playback sequences of the video except for the initiation playback sequence can also refer to the above process, which will not be repeated here.
  • the video playback system includes a client, a playback authentication server, a CDN scheduling device, a watermark index file generation server, a CDN origin server, and a CDN Edge node equipment and watermark server.
  • the first server in the embodiment of the present application is a watermark index file generating server.
  • the process of generating the index file by the watermark index file generating server can refer to the watermark in the CDN origin server described above.
  • the index file generation module generates an index file. It should be noted that, in this system architecture, the communication between the first server and the CDN edge node device and the second server all need to pass through the CDN origin server.
  • the process of the first server receiving the first request of the client from the CDN edge node device includes: the CDN origin site server receives the first request of the client from the CDN edge node device, and the first server receives the first request from the CDN origin server. The first request of the client.
  • the process of the first server obtaining the initiation play sequence of the video from the second server includes: the first server sends a third request to the CDN origin server, and the CDN origin server sends the watermark server (the first (2) The server) sends a third request, which is used to request the initiation play sequence; in response to the third request, the watermark server generates the initiation play sequence, and the watermark server sends the initiation play sequence to the CDN origin server To play the sequence, the CDN origin server sends the initiating play sequence to the first server.
  • the process for the first server to obtain all the play sequences of the video, or the process of obtaining the remaining play sequences in the entire play sequence of the video except the initiation play sequence can also refer to the above process, which will not be repeated here. .
  • FIG. 1C is a schematic diagram of the architecture of another video playback system provided by an embodiment of the present application.
  • the video playback system includes a client, a playback authentication server, a CDN scheduling device, a CDN origin server, and a CDN edge node device.
  • the watermark server can be integrated into the CDN origin server as a playback sequence generation module.
  • the first server in this embodiment of the application is the CDN origin server
  • the second server is CDN origin server.
  • the process of generating the playback sequence of video segments by the CDN origin server can refer to the process of generating the playback sequence of video segments by the watermark server described above.
  • the communication between the second server and the CDN origin server is the communication within the device.
  • the manner in which the first server obtains the starting play sequence of the video from the second server may be that the CDN origin server obtains the starting play sequence of the video from its own play sequence generating module.
  • FIG. 1D is a schematic diagram of the architecture of another video playback system provided by an embodiment of the present application.
  • the video playback system includes a client, a playback authentication server, a CDN scheduling device, a watermark index file generation server, a CDN origin server, and a CDN Edge node equipment.
  • the watermark server is integrated into the CDN origin server as a playback sequence generation module.
  • the first server is a watermark index file generating server
  • the second server is a CDN origin server.
  • the method for the first server to obtain the initiation and playback sequence of the video from the second server may be that the watermark index file generation server sends the third request to the CDN origin server, and in response to the third request, the CDN origin server generates Start the play sequence, and send the play sequence to the watermark index file generating server.
  • the manner in which the first server obtains all the play sequences of the video from the second server, or the first server obtains the remaining play sequences of the entire play sequence of the video from the second server except the start play sequence For the method, you can also refer to the above process, which will not be repeated here.
  • the index file of the video (or called the media description file) is used to record the download address (for example, uniform resource locator) of the video segments that make up the video.
  • the index file is composed of data files, which are sequential files with indexes.
  • the index file is composed of two parts: an index table and a main file.
  • the index table is a table indicating the correspondence between logical records and physical records. Each item in the index table is called an index item, and the index items are arranged in the order of the key (or logical record number). If the index file itself is also arranged in the order of keywords, it is called an index sequence file. Otherwise, it is called an indexed non-sequential file.
  • the index file of the video may be a file in UTF-8 encoding format.
  • the index file may be an MPD file or an M3U8 file.
  • the client terminal can download the video segment according to the download address of the video segment recorded in the index file for video playback.
  • a video segment is a segment of a video with a length of 2 seconds to 10 seconds.
  • a video consists of one or more video segments. Different fragmentation methods can be used to perform fragmentation operations on the same video to obtain different fragmentation results.
  • the video has two video media, A stream and B stream (preliminarily processed by a transcoding platform), and the video media of the A stream and the B stream each include multiple video segments.
  • the video content of the video segments at the same segment position in the multiple video segments included in the stream A and stream B are the same (for example, the video content of segment 1 of stream A is the same as segment 1 of stream B),
  • the watermarks added to the video segments of stream A and stream B are different from each other.
  • the sequence of video slices is the sequence of selected video slices of stream A and stream B.
  • the playback sequence of the video obtained by user 1 may be segment 1, segment 3, segment 4, segment 6,... and segment 2, segment 5, segment 7,... of stream B.
  • the playback sequence of the same video obtained by user 2 may be segment 2, segment 3, segment 4, segment 7,... and segment 1, segment 5, segment 6,... of stream B . Since the watermarks added in the video segments of the A stream and the B stream are different from each other, the watermark sequences contained in the sequences of different video segments of the same video are different from each other.
  • FIG. 2 is a flowchart of a video playback method provided by an embodiment of the present application.
  • the method may be implemented based on the architecture shown in FIG. 1A.
  • the first server described below may be a CDN in the system architecture shown in FIG. 1A. Origin server. It should be noted that in the system architecture shown in FIG. 1B to FIG. 1D, this method can also be applied, and only the communication process between the devices needs to be adjusted (refer to the above example).
  • the method includes but is not limited to the following steps.
  • S201 The client sends a first request to the CDN edge node device.
  • the first request is used to request an index file of the video.
  • the video corresponding to the first request is not a video stored locally on the client, and the video is a video with a watermark.
  • the client receives the video-on-demand request input by the user. If the first video is not a video stored locally on the client, and the video is a video with a watermark, the client will send a playback authentication request to the playback authentication server. The playback authentication request is used to instruct the playback authentication.
  • the right server determines the access right of the client.
  • the playback authentication server determines that the client has access to the content distribution network
  • the playback authentication server will feed back the authentication result to the client, and then the client can send to the CDN scheduling device of the content distribution network Scheduling request.
  • the CDN scheduling device will feed back the information of the allocated CDN edge node device to the client. Then, the client can send the first request to the allocated CDN edge node device.
  • the CDN edge node device After the CDN edge node device receives the first request from the client, the CDN edge node device sends the first request of the client to the first server.
  • the CDN edge node device determines whether the video corresponding to the first request is a video stored locally by the CDN edge node device. If the video is a watermarked video, then different clients will correspond to different index files, and the CDN edge node device determines that it does not store the index file of the video, and the CDN edge node device will send the CDN source site server (the first A server) requests the index file of the video. Therefore, the CDN edge node device sends the first request of the client to the first server, and correspondingly, the first server receives the first request of the client from the CDN edge node device.
  • the first server After the first server receives the first request of the client from the CDN edge node device, the first server sends a third request to the second server.
  • the third request is used to request the initiating play sequence, and the third request also includes the setting parameters of the initiating play sequence (for example, the maximum value of the play time of the initiating play sequence, or the division of the initiating play sequence). Maximum value of slice position).
  • the third request further includes the playing time of the video title, or the segment position of the video title.
  • the initiating play sequence is a sequence of partial video segments of the video.
  • the initiating play sequence is a sequence of video segments before the first preset play time of the video, or a sequence of video segments before the first preset segment position of the video.
  • the initiating play sequence is a sequence of video fragments after the playing time of the video's credit and before the second preset playing time, or after the video's credit fragment position and after The sequence of video slices before the second preset slice position.
  • the maximum value of the play time of the initiating play sequence may be the first preset play time or the second preset play time; the maximum value of the segment position of the initiation play sequence may be the first The preset fragment position may also be the second preset fragment position. It should be noted that if the user sets "skip intro" in the client, the initiating play sequence should be the second case above. If the user has not set the "skip intro", the initiating play sequence It should be the first case above. It can be seen that the initiating play sequence is a sequence of video fragments included in a video segment at the beginning of the video or a video segment after the video skips the credits.
  • the first preset play time, the first preset segment position, the second preset play time, or the second preset segment position, the setting parameters of the initiating play sequence can be set according to requirements.
  • the first preset playing time may be the first minute, the second minute, etc.
  • the second preset segment position may be the 12th segment, the 13th segment, and so on.
  • the second preset playback time may be the 4th minute, the 5th minute, etc.
  • the second preset segment position may be the 48th segment, the 50th segment, and so on.
  • FIGS. 3A to 3D are schematic diagrams of setting parameters of some initiating play sequences provided by embodiments of the present application. It should be noted that the dark cells illustrated in FIG. 3B and FIG.
  • 3D represent video segments included in the initiating play sequence
  • blank cells represent video segments that are not included in the initiating play sequence.
  • the gap between adjacent video segments shown in the figure is to distinguish different video segments, and does not mean that there are gaps between adjacent video segments during the playback process.
  • the second preset playback time may also be determined by adding a preset time interval to the title time of the video
  • the second preset segment position may be determined by adding a preset time interval to the title segment position of the video.
  • the fragmentation interval is determined.
  • the second server sends the initiating play sequence of the video to the first server.
  • the first server After the first server obtains the initiation play sequence of the video from the second server, the first server generates the initiation index file corresponding to the initiation play sequence, and the initiation index file includes the initiation play Download address corresponding to the sequence.
  • the download address (for example, URL) of each video segment in the two video media of the A stream and the B stream of the video (preliminarily processed by the transcoding platform) is stored in advance.
  • the first server may generate the initiation index file according to the initiation play sequence and the download addresses of each video segment in the two video media of the A stream and the B stream of the video.
  • the starting index file includes the download address corresponding to the starting sequence of the video. Since the initiation play sequence is a sequence of partial video segments of the video, the generated initiation index file contains a small amount of data, so that less time is taken to generate and transmit the initiation index file.
  • starting index file listing the index file information of resolution/bitrate
  • the first server sends the initiation index file to the CDN edge node device, so that the client receives the initiation index file from the CDN edge node.
  • the CDN edge node device After the CDN edge node device receives the starting index file from the first server, the CDN edge node device sends the starting index file corresponding to the video to the client.
  • the client After the client receives the initiation index file corresponding to the video from the CDN edge node device, the client downloads the initiation and playback from the CDN edge node device according to the download address corresponding to the initiation and playback sequence. The video segment corresponding to the sequence is played.
  • the client can obtain the initiation index file in a relatively short period of time, and then download it according to the initiation sequence of the video Address to download the video content to start broadcasting. In this way, it is possible to reduce the start-up delay of the video when playing a video with watermark.
  • the first request may also include a user identifier corresponding to the user logged in on the client (for example, the user's account information).
  • the starting index file, the first index file, or the second index file in the embodiment of the present application all have an association relationship with the user identifier, indicating that the broadcast index file, the first index file or the second index file is associated with the The user indicated by the user ID corresponds to the user. After the watermarked video is illegally leaked, the user who leaked the video information can be found through the association relationship.
  • the method before step S203, further includes: the first server determines that the playing duration of the video is greater than a preset duration, or determines that the number of slices of the video is greater than a preset value. Wherein, both the preset duration and the preset value can be set according to requirements. If the first server determines that the playing duration of the video is greater than the preset duration, or determines that the number of fragments of the video is greater than the preset value, it means that the video is longer, and the index file containing the download addresses of all parts of the video is larger Therefore, the method provided in the embodiment of this application can be used to first generate the starting index file of the video.
  • the first server determines that the playback duration of the video is not greater than the preset duration, or determines that the number of fragments of the video is not greater than the preset value, it means that the video is short and contains the download address of all parts of the video
  • the index file of is relatively small, so a method of generating an index file containing download addresses of all parts of the video can be adopted.
  • the method for the first server to determine the first preset play time, the first preset segment position, the second preset play time or the second preset segment position may be: the first server receives The rules for generating the setting parameters of the initiating play sequence, where the setting parameters include the first preset play time or the first preset segment position, or include the second preset play time or the second preset segment Film position; the first server then determines the setting parameters of the initiating play sequence according to the generation rule.
  • the generation rule is a specific value of the first preset playing time, the first preset fragment position, the second preset playing time, or the second preset fragment position.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset segment position is proportional to the number of segments of the video; or, The generation rule is that the second preset playing time is proportional to the total duration of the video, or the second preset segment position is proportional to the number of segments of the video.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset segment position is proportional to the number of segments of the video; or, The generation rule is that the second preset playing time is proportional to the remaining duration of the total duration of the video minus the duration of the title, or the second preset segment position is the number of segments of the video minus the segment of the title The number of remaining shards is proportional to the number.
  • FIG. 4 is a flowchart of another video playback method provided by an embodiment of the present application.
  • This method may be implemented based on the architecture shown in FIG. 1A, and the first server described below may be the CDN origin server in the system architecture shown in FIG. 1A. It should be noted that in the system architecture shown in Figs. 1B to 1D, this method can also be applied, and only the communication process between devices needs to be adjusted (refer to the above example).
  • the start index file further includes the download address of the first index file, the first index file includes the download addresses corresponding to all the play sequences of the video, or the start index file also includes The download address of the second index file, the second index file includes the download addresses corresponding to the remaining play sequences in all play sequences of the video except the start play sequence.
  • the client can obtain the download address of the first index file or the second index file from the starting index file.
  • the client can download the first index file or the second index file according to the download address of the first index file or the second index file.
  • the client can download the video segment to play the unplayed video part of the video according to the download address corresponding to all the play sequences of the video in the first index file.
  • the client may download the video segment to play the unplayed video part of the video according to the download address corresponding to the remaining play sequence in the second index file.
  • steps from S401 to S409 in FIG. 4 can refer to the execution manner of the steps from S201 to S209 in FIG. 2, which will not be repeated here.
  • the steps from S410 to S418 are specifically introduced below.
  • the first server sends a fourth request to the second server.
  • the fourth request is used to request all the play sequences of the video, or request the remaining play sequences in all the play sequences of the video except the start play sequence.
  • the second server After the second server receives the fourth request from the first server, the second server generates all the play sequences of the video, or the rest of the play sequences of the video except the start play sequence sequence.
  • S412 The second server sends all the play sequences of the video to the first server, or the remaining play sequences of the entire play sequences of the video except the start play sequence.
  • the first server After the first server receives all the play sequences of the video from the second server, or the remaining play sequences of the video except the initiation play sequence, the first server generates a first index File or second index file.
  • the first server generates the first index file or the second index file in a manner: the first server obtains all the playback sequences of the video from the second server; and then generates the first index file or the second index file according to the entire playback sequence.
  • the first index file obtains from the second server the remaining play sequences of all play sequences of the video except the initiation play sequence; and then generates a second index file according to the remaining play sequences.
  • the way that the first server generates the first index file according to all the playing sequences, or the way that the second index file is generated according to the remaining playing sequences can refer to the start of the first server to generate the starting playing sequence introduced in step S204. The method of broadcasting the index file will not be repeated here.
  • the first server may immediately generate the first index file or the second index file of the video requested by the client.
  • the client can start the video according to the start index file.
  • the first server can generate the first index file or the second index file during the start of the video.
  • the first server has sufficient time to generate the first index file or the second index file.
  • the method of the embodiment of the present application can shorten the time for generating and transmitting the starting index file, and the first server has Sufficient time to generate the first index file and the second index file corresponding to the subsequent video content reduces the load on the first server and the performance requirements on the first server.
  • the first index file and the second index file can refer to the start index file in S206, which will not be listed here.
  • S414 The client sends a second request to the CDN edge node device.
  • the second request is used to request to download the first index file or the second index file.
  • the client sends the second request to the CDN edge node device. These two situations are introduced below.
  • the video segment corresponding to the initiating play sequence is played to the third preset play time or the third preset segment position.
  • the third preset play time is less than the maximum value of the play time of the initiating play sequence
  • the third preset segment position is before the maximum value of the segment position of the initiation play sequence.
  • the third preset play time is a time value close to the maximum value of the play time of the initiating play sequence, for example, the third preset play time is the maximum value of the play time of the initiation play sequence Subtract the time value of 5 seconds (just an example, can be set as needed).
  • the third preset fragment position is a position close to the maximum value of the fragment position of the initiation play sequence, for example, the third preset fragment position is the maximum value of the fragment position of the initiation play sequence minus The position of 1 slice position (just an example, can be set as required).
  • the maximum value of the play time of the initiation play sequence may be the first preset play time or the second preset play time; the maximum value of the fragment position of the initiation play sequence may be the first
  • the preset fragment position may also be the second preset fragment position. This situation indicates that the client is about to finish playing the content of the video fragment contained in the starting index file, and the client needs to continue to obtain the index file of the unplayed video part in the video. Referring to FIG. 5A to FIG.
  • FIGS. 5B and 5D there are some schematic diagrams of scenarios that trigger the client to send the second request provided by the embodiments of the present application.
  • the dark cells illustrated in FIGS. 5B and 5D represent video segments included in the initiating play sequence
  • blank cells represent video segments that are not included in the initiating play sequence.
  • the gap between adjacent video segments shown in the figure is to distinguish different video segments, and does not mean that there are gaps between adjacent video segments during the playback process.
  • the client receives an inputted play request for the first play time or the first segment position of the video.
  • the first play time is greater than the maximum value of the play time of the initiating play sequence
  • the first segment position is after the maximum value of the segment position of the initiation play sequence.
  • the CDN edge node device After the CDN edge node device receives the second request from the client, the CDN edge node device sends the second request to the first server.
  • the first server After the first server receives the second request of the client from the CDN edge node device, the first server sends the first index file or the second index file to the CDN edge node device.
  • the CDN edge node device After the CDN edge node device receives the first index file or the second index file from the first server, the CDN edge node device sends the first index file or the second index file to the client.
  • the client After the client receives the first index file or the second index file from the CDN edge node device, the client downloads video fragments according to the first index file or the second index file and performs processing on the unplayed video content. Play.
  • the client will download the corresponding download sequence from the CDN edge node device according to the download address corresponding to the entire playback sequence.
  • the video segment is used to play the unplayed part of the video; or according to the download address corresponding to the remaining play sequence, the video segment corresponding to the remaining play sequence is downloaded from the CDN edge node device for use To play the unplayed part of the video.
  • the client downloads the corresponding download sequence from the CDN edge node device according to the download address corresponding to the entire play sequence Video segmentation to play the video from the first play time or from the first segment position; or download the remaining play sequence from the CDN edge node device according to the download address corresponding to the remaining play sequence
  • the corresponding video segment is used to play the video from the first play time or from the first segment position.
  • the client may include multiple clients. If the first server receives the first request of the multiple clients from the CDN edge node device, the first server generates the multiple clients The priority of the starting index file corresponding to the client is higher than the priority of the first server generating the first index file or the second index file corresponding to the multiple clients. In this way, the first server can preferentially generate initiation index files corresponding to multiple clients, which can further reduce the time for generating the initiation index files, thereby reducing the start-up delay of playing the watermarked video.
  • the client includes multiple clients, and each client of the multiple clients has a priority.
  • the first server receives the multiple clients from the CDN edge node device With the first request, the first server preferentially generates the initiation index file corresponding to the client with high priority, and preferentially generates the first index file or the second index file corresponding to the client with high priority.
  • the high-low relationship between the priority of various index files can be "the starting index file corresponding to the client with high priority> the starting index file corresponding to the client with low priority> the first index file corresponding to the user with high priority.
  • A>B means that the priority of A is higher than the priority of B.
  • the first server can give priority to responding to the first request of the client with high priority, further reducing the time to generate the initiation index file of the client with high priority, thereby further reducing the playback of watermarked by the client with high priority The start time delay of the video.
  • the server is used as a first server.
  • the first server includes a receiving unit 701, an acquiring unit 702, a generating unit 703, and a sending unit 704. Specific introduction.
  • the receiving unit 701 is configured to receive a first request of the client from the CDN edge node device, and the first request is used to request an index file of the video.
  • the receiving unit 701 may be a circuit or component that can be configured to receive information, such as a data transmission interface, a communication interface, or a receiver.
  • the acquiring unit 702 is configured to acquire the initiating play sequence of the video from the second server, where the initiating play sequence is a sequence of partial video segments of the video.
  • the generating unit 703 is configured to generate an initiating index file corresponding to the initiating play sequence, and the initiating index file includes a download address corresponding to the initiating play sequence.
  • the sending unit 704 is configured to send the starting index file to the CDN edge node device, so that the client receives the starting index file from the CDN edge node.
  • the sending unit 704 may be a circuit or component that can be configured to receive information, such as a data transmission interface, a communication interface, or a receiver.
  • the obtaining unit is further configured to: obtain the entire playback sequence of the video from the second server; the generating unit is further configured to: generate a first index file according to the entire playback sequence; or, The acquiring unit is further used for: acquiring the remaining playback sequence of all playback sequences of the video from the second server except the starting playback sequence; the generating unit is also used for: generating a second index according to the remaining playback sequence file.
  • the starting index file further includes the download address of the first index file, and the first index file includes the download address corresponding to all playing sequences of the video, or the starting index file
  • the download address of the second index file is also included in the second index file, and the second index file includes the download addresses corresponding to the remaining play sequences in all play sequences of the video except the start play sequence.
  • the receiving unit is further configured to: receive a second request of the client from the CDN edge node device, and the second request is used to request to download the first index file or the second index file corresponding to the client.
  • Index file the sending unit is further configured to send the first index file or the second index file to the CDN edge node device.
  • the client includes multiple clients, and if the first server receives the first request of the multiple clients from the CDN edge node device, the first server generates the multiple clients
  • the priority of the corresponding starting index file is higher than the priority of the first server generating the first index file or the second index file corresponding to the multiple clients.
  • the client includes multiple clients, and each client of the multiple clients has a priority. If the first server receives the multiple clients from the CDN edge node device With the first request, the first server preferentially generates the initiation index file corresponding to the client with high priority, and preferentially generates the first index file or the second index file corresponding to the client with high priority.
  • the first server further includes a judging unit configured to judge whether the playing duration of the video is greater than a preset duration, or judging whether the number of slices of the video is greater than a preset value.
  • the receiving unit is further configured to: receive a generation rule for setting parameters of the initiating play sequence, where the setting parameters include the first preset play time or the first preset fragment position , Or include, the second preset playing time or the second preset segment position; the first server further includes a determining unit configured to determine the setting parameters of the initiating play sequence according to the generation rule.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset segment position is proportional to the number of segments of the video; or, The generation rule is that the second preset playing time is proportional to the total duration of the video, or the second preset segment position is proportional to the number of segments of the video.
  • the initiating play sequence is a sequence of video segments before the first preset play time of the video, or a sequence of video segments before the first preset segment position of the video. Sequence; or, the initiating play sequence is the sequence of video fragments after the play time of the video's credit and before the second preset play time, or after the video's credit fragment position, and in the first 2. The sequence of the video segment before the preset segment position.
  • each operation in FIG. 7 may also correspond to the corresponding description of the method embodiment shown in FIG. 2 or FIG. 4.
  • the above-mentioned units can be implemented in hardware, software or a combination of software and hardware.
  • the acquiring unit 702 and the generating unit 703 may be functional modules implemented by software.
  • the functions of these functional modules are implemented by programs or codes stored in a memory.
  • the server executes these programs or codes through at least one processor. Realize the functions of each functional module.
  • the server after the server receives the first request sent by the client through the CDN edge node device, it will generate a start index file in real time, and the start index file includes the download address corresponding to the start play sequence
  • the initiating play sequence is a video segment at the beginning of the video or a sequence corresponding to a video segment after the video skips the title; after that, the server sends the initiating index file to the client through the CDN edge node device. Since the initiation index file contains less data and takes less time for generation and transmission, the client can obtain the initiation index file in a shorter time, and then download the video content according to the download address corresponding to the initiation play sequence Start broadcasting, so as to reduce the delay of video starting.
  • the client includes a sending unit 801, a receiving unit 802, and a downloading unit 803.
  • the above-mentioned units will be specifically introduced below.
  • the sending unit 801 is configured to send a first request to the CDN edge node device, where the first request is used to request an index file of the video.
  • the receiving unit 801 may be a circuit or component that can be configured to receive information, such as a data transmission interface, a communication interface, or a receiver.
  • the receiving unit 802 is configured to receive the initiation index file corresponding to the video from the CDN edge node device, the initiation index file includes the download address corresponding to the initiation play sequence of the video, wherein the initiation play sequence It is a sequence of partial video slices of the video.
  • the receiving unit 802 may be a circuit or component that can be configured to receive information, such as a data transmission interface, a communication interface, or a receiver.
  • the download unit 803 is configured to download the video segment corresponding to the initiation and play sequence from the CDN edge node device according to the download address corresponding to the initiation and play sequence for video playback.
  • the starting index file further includes the download address of the first index file, and the first index file includes the download address corresponding to all playing sequences of the video; or, the starting index file The file also includes the download address of the second index file, and the second index file includes the download addresses corresponding to the remaining play sequences in all play sequences of the video except the start play sequence.
  • the sending unit is further configured to: when the video segment corresponding to the initiating play sequence is played to the third preset play time or the third preset segment position, the client The terminal sends a second request to the CDN edge node device according to the download address of the first index file or the second index file, where the second request is used to request to download the first index file or the second index file, and the 3.
  • the preset playing time is less than the maximum value of the playing time of the initiating play sequence, and the third preset fragment position is before the maximum value of the fragment position of the initiating play sequence;
  • the receiving unit is further configured to:
  • the CDN edge node device receives the first index file or the second index file;
  • the download unit is further configured to: according to the download address corresponding to the entire playback sequence, download the video corresponding to the entire playback sequence from the CDN edge node device Fragmentation for playing the unplayed video part of the video; or downloading the video fragmentation corresponding to the remaining playback sequence from the CDN edge node device according to the download address corresponding to the remaining playback sequence for use Play the unplayed part of the video.
  • the sending unit is further configured to: in the case that the client receives an inputted playback request for the first playback time or the first segment position of the video, the client according to The download address of the first index file or the second index file sends a second request to the CDN edge node device, where the second request is used to request to download the first index file or the second index file, and the first player The time is greater than the maximum value of the playing time of the initiating play sequence, and the first fragment position is after the maximum value of the fragment position of the initiating play sequence; the receiving unit is further configured to: receive from the CDN edge node device The first index file or the second index file; the downloading unit is further used for: according to the download address corresponding to the entire playback sequence, download the video fragments corresponding to the entire playback sequence from the CDN edge node device for use Play the video from the first play time or from the first segment position; or download the video segment corresponding to the remaining play sequence from the CDN edge node device according to the download address corresponding to the
  • the setting parameters of the initiating play sequence are determined by the generation rule received by the CDN origin server, and the setting parameters include the first preset play time or the first preset segment Location, or include the second preset play time or the second preset segment location.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset segment position is proportional to the number of segments of the video; or , The generation rule is that the second preset playing time is proportional to the total duration of the video, or the second preset segment position is proportional to the number of segments of the video.
  • the initiating play sequence is a sequence of video segments before the first preset play time of the video, or is a video segment before the first preset segment position of the video
  • the starting sequence is the sequence of video fragments after the playing time of the video's credit and before the second preset playback time, or after the video's credit fragment position, and after The sequence of video slices before the second preset slice position.
  • each operation in FIG. 8 may also correspond to the corresponding description of the method embodiment shown in FIG. 2 or FIG. 4.
  • the above-mentioned units can be implemented in hardware, software or a combination of software and hardware.
  • the server after the server receives the first request sent by the client through the CDN edge node device, it will generate a start index file in real time, and the start index file includes the download corresponding to the start play sequence Address, the initiation play sequence is a video segment at the beginning of the video or a sequence corresponding to a video segment after the video skips the title; after that, the server sends the initiation index file to the client through the CDN edge node device. Since the initiation index file contains less data and takes less time for generation and transmission, the client can obtain the initiation index file in a shorter time, and then download the video content according to the download address corresponding to the initiation play sequence Start broadcasting, so as to reduce the delay of video starting.
  • the first server includes a processor 901, a memory 902, and a communication interface 903.
  • the processor 901, the memory 902, and the communication interface 903 are connected to each other through a bus 904.
  • the memory 902 includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (erasable programmable read-only memory, EPROM), or A portable read-only memory (compact disc read-only memory, CD-ROM), the memory 902 is used for related instructions and data.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • the communication interface 903 may be a circuit or component that can be configured to receive information, such as a data transmission interface, a communication interface, or a receiver.
  • the processor 901 may be one or more central processing units (CPUs).
  • CPUs central processing units
  • the processor 901 is a CPU
  • the CPU may be a single-core CPU or a multi-core CPU.
  • the processor 901 in the server performs the following operations by reading and executing the program code stored in the memory 902:
  • the first request of the client is received from the edge node device of the CDN of the content distribution network through the communication interface 903, and the first request is used to request an index file of the video.
  • the initiating play sequence of the video is acquired from the second server through the communication interface 903, where the initiating play sequence is a sequence of partial video segments of the video.
  • the initiating index file corresponding to the initiating play sequence is generated, and the initiating index file includes the download address corresponding to the initiating play sequence.
  • the initiation index file is sent to the CDN edge node device through the communication interface 903, so that the client receives the initiation index file from the CDN edge node.
  • the processor 901 is further configured to: obtain the entire playback sequence of the video from the second server; generate a first index file according to the entire playback sequence; or, from the second server Obtain the remaining play sequences of all play sequences of the video except the start play sequence; generate a second index file according to the remaining play sequences.
  • the starting index file further includes the download address of the first index file, and the first index file includes the download address corresponding to all playing sequences of the video, or the starting index file
  • the download address of the second index file is also included in the second index file, and the second index file includes the download addresses corresponding to the remaining play sequences in all play sequences of the video except the start play sequence.
  • the processor 901 is further configured to: receive a second request of the client from the CDN edge node device, and the second request is used to request to download the first index file or the first index file corresponding to the client.
  • Two index files sending the first index file or the second index file to the CDN edge node device.
  • the client includes multiple clients, and if the first server receives the first request of the multiple clients from the CDN edge node device, the first server generates the multiple clients
  • the priority of the corresponding starting index file is higher than the priority of the first server generating the first index file or the second index file corresponding to the multiple clients.
  • the client includes multiple clients, and each client of the multiple clients has a priority. If the first server receives the multiple clients from the CDN edge node device With the first request, the first server preferentially generates the initiation index file corresponding to the client with high priority, and preferentially generates the first index file or the second index file corresponding to the client with high priority.
  • the processor 901 is further configured to: determine that the playing duration of the video is greater than a preset duration, or determine that the number of slices of the video is greater than a preset value.
  • the processor 901 is further configured to: receive a generation rule for setting parameters of the initiating play sequence, where the setting parameters include the first preset play time or the first preset segment
  • the position may include the second preset play time or the second preset segment position; the setting parameters of the initiating play sequence are determined according to the generation rule.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset segment position is proportional to the number of segments of the video; or, The generation rule is that the second preset playing time is proportional to the total duration of the video, or the second preset segment position is proportional to the number of segments of the video.
  • the initiating play sequence is a sequence of video segments before the first preset play time of the video, or a sequence of video segments before the first preset segment position of the video. Sequence; or, the initiating play sequence is the sequence of video fragments after the play time of the video's credit and before the second preset play time, or after the video's credit fragment position, and in the first 2. The sequence of the video segment before the preset segment position.
  • the server after the server receives the first request sent by the client through the CDN edge node device, it will generate a starting index file in real time, and the starting index file includes the download address corresponding to the starting sequence
  • the initiating play sequence is a video segment at the beginning of the video or a sequence corresponding to a video segment after the video skips the title; after that, the server sends the initiating index file to the client through the CDN edge node device. Since the initiation index file contains less data and takes less time for generation and transmission, the client can obtain the initiation index file in a shorter time, and then download the video content according to the download address corresponding to the initiation play sequence Start broadcasting, so as to reduce the delay of video starting.
  • the client includes a processor 1001, a memory 1002, and a communication interface 1003.
  • the processor 1001, the memory 1002, and the communication interface 1003 are connected to each other through a bus 1004.
  • the memory 1002 includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or A portable read-only memory (compact disc read-only memory, CD-ROM), the memory 1002 is used for related instructions and data.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • the communication interface 1003 may be a circuit or component such as a data transmission interface, a communication interface, or a receiver that can be configured to receive information.
  • the processor 1001 may be one or more central processing units (CPUs). In the case where the processor 1001 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
  • the processor 1001 in the client performs the following operations by reading and executing the program code stored in the memory 1002:
  • a first request is sent to the CDN edge node device through the communication interface 1003, where the first request is used to request an index file of the video.
  • the initiation index file includes the download address corresponding to the initiation play sequence of the video, where the initiation play sequence is the video A sequence of parts of the video segment.
  • the video segment corresponding to the initiating play sequence is downloaded from the CDN edge node device for video playback.
  • the starting index file further includes the download address of the first index file, and the first index file includes download addresses corresponding to all playing sequences of the video; or, the starting index file
  • the download address of the second index file is also included in the second index file, and the second index file includes the download addresses corresponding to the remaining play sequences in all play sequences of the video except the start play sequence.
  • the processor 1001 is further configured to: in the case where the video segment corresponding to the initiating play sequence is played to the third preset play time or the third preset segment position, according to the The download address of the first index file or the second index file sends a second request to the CDN edge node device, where the second request is used to request to download the first index file or the second index file, and the third preset The playing time is less than the maximum value of the playing time of the initiating play sequence, and the third preset fragment position is before the maximum value of the fragment position of the initiating play sequence; receiving the first index from the CDN edge node device File or the second index file; according to the download address corresponding to the full playback sequence, download the video fragments corresponding to the full playback sequence from the CDN edge node device for playing the unplayed video part of the video Or according to the download address corresponding to the remaining play sequence, download the video fragments corresponding to the remaining play sequence from the CDN edge node device for playing the unplayed video
  • the processor 1001 is further configured to: in the case that the client receives an inputted play request for the first play time or the first segment position of the video, according to the first The download address of the index file or the second index file sends a second request to the CDN edge node device, where the second request is used to request to download the first index file or the second index file, and the first play time is greater than the The maximum value of the play time of the initiating play sequence, the first segment position is after the maximum value of the segment position of the initiating play sequence; receiving the first index file or the second index from the CDN edge node device File; according to the download address corresponding to the entire play sequence, download the video segment corresponding to the entire play sequence from the CDN edge node device for the video from the first play time or from the first segment position To play; or download the video segment corresponding to the remaining play sequence from the CDN edge node device according to the download address corresponding to the remaining play sequence, so as to match from the first play time or from the first segment position
  • the setting parameter of the initiating play sequence is determined by the generation rule received by the CDN origin server, and the setting parameter includes the first preset play time or the first preset segment position , Or include the second preset playing time or the second preset segment position.
  • the generation rule is that the first preset playback time is proportional to the total duration of the video, or the first preset segment position is proportional to the number of segments of the video; or, The generation rule is that the second preset playing time is proportional to the total duration of the video, or the second preset segment position is proportional to the number of segments of the video.
  • the initiating play sequence is a sequence of video segments before the first preset play time of the video, or a sequence of video segments before the first preset segment position of the video. Sequence; or, the initiating play sequence is the sequence of video fragments after the play time of the video's credit and before the second preset play time, or after the video's credit fragment position, and in the first 2. The sequence of the video segment before the preset segment position.
  • the server after the server receives the first request sent by the client through the CDN edge node device, it will generate a starting index file in real time, and the starting index file includes the download address corresponding to the starting sequence.
  • the initiating play sequence is a video segment at the beginning of the video or a sequence corresponding to a video segment after the video skips the title; after that, the server sends the initiating index file to the client through the CDN edge node device. Since the initiation index file contains less data and takes less time for generation and transmission, the client can obtain the initiation index file in a shorter time, and then download the video content according to the download address corresponding to the initiation play sequence Start broadcasting, so as to reduce the delay of video starting.
  • a computer program product is provided.
  • the method of the embodiment shown in FIG. 2 or FIG. 4 is implemented.
  • a computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method of the embodiment shown in FIG. 2 or FIG. 4 is implemented.

Abstract

本申请实施例公开了一种视频播放方法及相关设备,可以在播放带水印的视频的情况下,降低视频的起播时延。其中,CDN源站服务器在通过CDN边缘节点设备接收到客户端发送的第一请求之后,将实时生成起播索引文件,起播索引文件中包括起播播放序列对应的下载地址,起播播放序列为视频开始的一段视频片段或者视频跳过片头之后的一段视频片段对应的序列;之后,CDN源站服务器再通过CDN边缘节点设备向客户端发送该起播索引文件。由于起播索引文件包含的数据量较少,生成和传输占用的时间较少,客户端可以在较短的时间内获取到起播索引文件,再根据起播播放序列对应的下载地址下载视频内容进行起播,从而达到降低视频起播时延的目的。

Description

一种视频播放方法及相关设备
本申请要求在2019年4月19日提交中国国家知识产权局、申请号为201910319993.1、发明名称为“一种视频播放方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种视频播放方法及相关设备。
背景技术
视频内容提供商为了避免视频被非法泄露,通常会在视频中添加水印(watermarking)。视频中添加的水印一般为隐式水印,隐式水印是用于识别的数字信号,不会影响观看视频的视觉质量。若视频被非法泄露,可以通过泄露出去的视频中的水印信息,追溯到是哪一个用户将此视频泄露出去,以保护视频内容提供商的合法权益。
云侧添加水印的方法是目前常用的添加水印的方法。该方法的原理是:首先通过转码平台将一个视频转码为A流、B流两个视频媒介,该A流和B流的视频媒介中均包括多个视频分片。其中,该A流和B流包含的多个视频分片中相同分片位置的视频分片的视频内容相同(例如,A流的分片1与B流的分片1的视频内容相同),但A流和B流的视频分片中添加的水印互不相同。针对不同的用户,可以在A流及B流中选取不同的视频分片组成播放序列。例如,用户1获取到的视频的播放序列可能是A流的分片1、分片3、分片4、分片6、…及B流的分片2、分片5、分片7、…;用户2获取到的同一视频的播放序列可能是A流的分片2、分片3、分片4、分片7、…及B流的分片1、分片5、分片6、…。由于A流和B流的视频分片中添加的水印互不相同,那么不同用户的播放序列对应着不同的水印序列,通过检测视频中的水印序列,可以追溯泄露的视频是哪一个用户获取到的。
现阶段,在点播带有水印的视频文件的过程中,用户的客户端将通过内容分发网络(content delivery network,CDN)边缘节点设备从CDN源站服务器获取播放索引文件(例如,播放索引文件可以为MPD文件或M3U8文件)。这个索引文件,是CDN源站服务器依据用户播放请求的用户唯一标识(unique ID)实时生成的,其中包括了视频的整个播放序列对应的下载地址(例如,统一资源定位符(uniform resource locator,URL))。这个索引文件生成后,CDN源站服务器将发送该索引文件到CDN边缘节点设备,CDN边缘节点设备再将该索引文件发送给用户的客户端;之后,用户的客户端将依据该索引文件中的下载地址下载视频分片进行视频播放。
在上述过程中,可能会造成较大的起播时延,从而使得用户等待视频起播的时间过长,严重影响用户体验,造成用户播放放弃率过高。造成起播时延的主要原因是起播放索引文件的生成时间和传送时间较长。举例而言,对于一个时长为2个小时的视频,若5s一个分片,一个视频生成7种码率介质,及1路音频;则该索引文件共有2*3600/5*8=11520(条)分片的信息,分片信息量太大造成CDN源站服务器生成索引文件的时间较长。另外,视频点播一般采用Dash协议,Dash协议采用的MPD(media presentation description)索引文件将所有分辨率/码率的视频分片的播放URL放于一个索引文件中。索引文件较大,将使得CDN边缘节点 设备从CDN源站服务器获取索引文件,以及用户的客户端从CDN边缘节点设备获取索引文件都会产生较大的时延。如何解决播放带有水印的视频时,起播时延较大的问题是本领域技术人员亟待解决的问题。
发明内容
本申请实施例提供一种视频播放方法及相关设备,可以在播放带水印的视频的情况下,降低视频的起播时延。
第一方面,本申请实施例提供了一种步态识别的方法,该方法包括:第一服务器从内容分发网络CDN边缘节点设备接收客户端的第一请求,该第一请求用于请求视频的索引文件;该第一服务器从第二服务器中获取该视频的起播播放序列,其中,该起播播放序列为该视频的部分视频分片的序列;该第一服务器生成该起播播放序列对应的起播索引文件,该起播索引文件中包括起播播放序列对应的下载地址;该第一服务器向该CDN边缘节点设备发送该起播索引文件,以使得该客户端从该CDN边缘节点接收该起播索引文件。由于该起播索引文件包含的数据量较小,生成和传输占用的时间较少,客户端可以在较短的时间内获取到该起播索引文件,再根据视频的起播播放序列对应的下载地址下载视频内容进行起播。通过这种方式,可以在播放带有水印的视频的情况下,降低视频的起播时延。
结合第一方面,在一种可能的实现方式中,该方法还包括:该第一服务器从该第二服务器中获取该视频的全部播放序列;该第一服务器根据该全部播放序列生成第一索引文件;或者,该第一服务器从该第二服务器中获取该视频的全部播放序列中除该起播播放序列之外的剩余播放序列;该第一服务器根据该剩余播放序列生成第二索引文件。
结合第一方面,在一种可能的实现方式中,该起播索引文件中还包括该第一索引文件的下载地址,该第一索引文件中包括该视频的全部播放序列对应的下载地址,或者该起播索引文件中还包括该第二索引文件的下载地址,该第二索引文件中包括该视频的全部播放序列中除该起播播放序列之外的剩余播放序列对应的下载地址。
结合第一方面,在一种可能的实现方式中,该第一服务器向该CDN边缘节点设备发送该起播索引文件之后,该方法还包括:该第一服务器从该CDN边缘节点设备接收客户端的第二请求,该第二请求用于请求下载该客户端对应的第一索引文件或者该第二索引文件;该第一服务器向该CDN边缘节点设备发送该第一索引文件或者该第二索引文件。
结合第一方面,在一种可能的实现方式中,该客户端包括多个客户端,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器生成该多个客户端对应的起播索引文件的优先级,高于该第一服务器生成该多个客户端对应的该第一索引文件或者该第二索引文件的优先级。
结合第一方面,在一种可能的实现方式中,该客户端包括多个客户端,且该多个客户端中的每个客户端具有优先级,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器优先生成优先级高的客户端对应的起播索引文件,并优先生成该优先级高的客户端对应的该第一索引文件或者该第二索引文件。
结合第一方面,在一种可能的实现方式中,在该第一服务器从该第二服务器中获取该视频的起播播放序列之前,该方法还包括:该第一服务器判断该视频的播放时长大于预设时长,或者判断该视频的分片数大于预设值。
结合第一方面,在一种可能的实现方式中,该方法还包括:该第一服务器接收针对该起 播播放序列的设置参数的生成规则,该设置参数包括该第一预设播放时间或者该第一预设分片位置,或者包括,该第二预设播放时间或者该第二预设分片位置;该第一服务器根据该生成规则确定该起播播放序列的设置参数。
结合第一方面,在一种可能的实现方式中,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长成正比,或者该第二预设分片位置与该视频的分片数量成正比。
结合第一方面,在一种可能的实现方式中,该起播播放序列为该视频的第一预设播放时间之前的视频分片的序列,或者为该视频的第一预设分片位置之前的视频分片的序列;或者,该起播播放序列为该视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为该视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。
第二方面,本申请实施例提供了一种视频播放方法,该方法包括:客户端向CDN边缘节点设备发送第一请求,该第一请求用于请求视频的索引文件;该客户端从该CDN边缘节点设备中接收该视频对应的起播索引文件,该起播索引文件中包括该视频的起播播放序列对应的下载地址,其中,该起播播放序列为该视频的部分视频分片的序列;该客户端根据该起播播放序列对应的下载地址,从该CDN边缘节点设备中下载该起播播放序列对应的视频分片进行视频播放。由于该起播索引文件包含的数据量较小,生成和传输占用的时间较少,客户端可以在较短的时间内获取到该起播索引文件,再根据视频的起播播放序列对应的下载地址下载视频内容进行起播。通过这种方式,可以在播放带有水印的视频的情况下,降低视频的起播时延。
结合第二方面,在一种可能的实现方式中,该起播索引文件中还包括第一索引文件的下载地址,该第一索引文件中包括该视频的全部播放序列对应的下载地址;或者,该起播索引文件中还包括第二索引文件的下载地址,该第二索引文件中包括该视频的全部播放序列中除该起播播放序列之外的剩余播放序列对应的下载地址。
结合第二方面,在一种可能的实现方式中,该方法还包括:在该起播播放序列对应的视频分片播放到第三预设播放时间或者第三预设分片位置的情况下,该客户端根据该第一索引文件或者第二索引文件的下载地址向该CDN边缘节点设备发送第二请求,其中,该第二请求用于请求下载该第一索引文件或者该第二索引文件,该第三预设播放时间小于该起播播放序列的播放时间的最大值,该第三预设分片位置在该起播播放序列的分片位置的最大值之前;该客户端从该CDN边缘节点设备中接收该第一索引文件或者该第二索引文件;该客户端根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放。
结合第二方面,在一种可能的实现方式中,该方法还包括:在该客户端接收到输入的对该视频的第一播放时间或者第一分片位置的播放请求的情况下,该客户端根据该第一索引文件或者第二索引文件的下载地址向该CDN边缘节点设备发送第二请求,其中,该第二请求用于请求下载该第一索引文件或者该第二索引文件,该第一播放时间大于该起播播放序列的播放时间的最大值,该第一分片位置在该起播播放序列的分片位置的最大值之后;该客户端从 该CDN边缘节点设备中接收该第一索引文件或者该第二索引文件;该客户端根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放。
结合第二方面,在一种可能的实现方式中,该起播播放序列的设置参数由该CDN源站服务器接收到的生成规则确定,该设置参数包括该第一预设播放时间或者该第一预设分片位置,或者包括该第二预设播放时间或者该第二预设分片位置。
结合第二方面,在一种可能的实现方式中,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长成正比,或者该第二预设分片位置与该视频的分片数量成正比。
结合第二方面,在一种可能的实现方式中,该起播播放序列为该视频的第一预设播放时间之前的视频分片的序列,或者为该视频的第一预设分片位置之前的视频分片的序列;或者,该起播播放序列为该视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为该视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。。
第三方面,本申请实施例提供了一种服务器,该服务器用作第一服务器,该第一服务器包括用于执行第一方面或第一方面的各种可能的实现方式所描述的方法所对应的单元。该第一服务器可以是电子设备,也可以是电子设备中的用于生成起播索引文件的装置(例如,操作系统等)。上述第一服务器包括的单元可以是硬件电路,也可是软件,也可以是硬件电路结合软件实现。
第四方面,本申请实施例提供了一种客户端,客户端包括用于执行第二方面或第二方面的各种可能的实现方式所描述的方法所对应的单元。该客户端可以是电子设备,也可以是电子设备中的用于播放视频的装置。上述客户端包括的单元可以是硬件电路,也可是软件,也可以是硬件电路结合软件实现。
第五方面,本申请实施例提供了又一种服务器,该服务器用作第一服务器,该第一服务器包括处理器和存储器,其中,该存储器用于存储程序指令,该程序指令当被该处理器运行时,使得该第一服务器执行上述第一方面或者第一方面的任一可能的实现方式所描述的方法。
第六方面,本申请实施例提供了又一种客户端,该客户端包括处理器和存储器,其中,该存储器用于存储程序指令,该程序指令当被该处理器运行时,使得该客户端执行上述第二方面或者第二方面的任一可能的实现方式所描述的方法。
第七方面,本申请实施例提供了一种计算机可读存储介质,该计算机存储介质存储有程序指令,该程序指令当被处理器运行时,该处理器执行上述第一方面或者第一方面的任一可能的实现方式所描述的方法,或者该处理器执行上述第二方面或者第二方面的任一可能的实现方式所描述的方法。
第八方面,本申请实施例提供了一种计算机程序,该计算机程序在处理器上运行时,该处理器执行上述第一方面或者第一方面的任一可能的实现方式所描述的方法,或者执行上述第二方面或者第二方面的任一可能的实现方式所描述的方法。
在本申请实施例中,CDN源站服务器在通过CDN边缘节点设备接收到客户端发送的第 一请求之后,将实时生成起播索引文件,起播索引文件中包括起播播放序列对应的下载地址,起播播放序列为视频开始的一段视频片段或者视频跳过片头之后的一段视频片段对应的序列;之后,CDN源站服务器再通过CDN边缘节点设备向客户端发送该起播索引文件。由于起播索引文件包含的数据量较少,生成和传输占用的时间较少,客户端可以在较短的时间内获取到起播索引文件,再根据起播播放序列对应的下载地址下载视频内容进行起播,从而达到降低视频起播时延的目的。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。
图1A~图1D是本申请实施例提供的一些视频播放系统的架构示意图;
图2是本申请实施例提供的一种视频播放方法的流程图;
图3A~图3D是本申请实施例提供的一些起播播放序列的设置参数的示意图;
图4是本申请实施例提供的又一种视频播放方法的流程图;
图5A~图5D是本申请实施例提供的一些触发客户端发送第二请求的场景示意图;
图6A~图6D是本申请实施例提供的一些触发客户端发送第二请求的场景示意图;
图7是本申请实施例提供的一种服务器的示意图;
图8是本申请实施例提供的一种客户端的示意图;
图9是本申请实施例提供的又一种服务器的示意图;
图10是本申请实施例提供的又一种客户端的示意图。
具体实施方式
下面对本申请实施例中的技术方案进行更详细地描述。
参见图1A,是本申请实施例提供的一种视频播放系统的架构示意图,该视频播放系统包括客户端,播放鉴权服务器,CDN调度设备,CDN源站服务器,CDN边缘节点设备和水印服务器。以下对这这些设备进行进一步的介绍。
客户端,或称为用户端,是与服务器相对应,为客户提供本地服务的设备。该客户端上可以运行多种应用程序,除了一些在本地运行的应用程序之外,客户端运行应用程序一般需要服务器为其提供相应的服务。在本申请实施例中,该客户端可以是手机、计算机、平板电脑、笔记本电脑、可穿戴设备、多媒体设备等可以进行视频播放的设备。可选的,客户端可以通过自身承载的应用程序(例如,视频播放类应用程序、社交类应用程序、或者新闻资讯类应用程序)对视频进行播放。举例而言,用户可以对客户端的视频播放应用程序中的某个视频执行点播操作,若该点播的视频是客户端本地未存储的视频,则该客户端可以访问内容分发网络以请求该视频的索引文件。客户端对内容分发网络进行访问之前,需要向播放鉴权服务器发送播放鉴权请求,该播放鉴权请求用于指示该播放鉴权服务器对该客户端进行访问权限的判定。下面将对播放鉴权服务器作进一步的介绍。
播放鉴权服务器,是可以判定客户端对内容分发网络的访问权限的设备。若该播放鉴权服务器判定该客户端具有对内容分发网络的访问权限,则该播放鉴权服务器将向客户端反馈鉴权通过的结果,之后,客户端可以向内容分发网络的CDN调度设备发送调度请求,该调度请求用于请求CDN调度设备为该客户端分配一个为该客户端提供服务的CDN边缘节点设备。 若该播放鉴权服务器判定该客户端不具有对内容分发网络的访问权限,则该播放鉴权服务器将向客户端反馈鉴权不通过的结果,该客户端将不能成功访问内容分发网络。
CDN调度设备,是可以实时地根据网络状况以及CDN边缘节点设备的状态,为客户端分配为其提供服务的CDN边缘节点设备。可选的,该CDN调度设备能够实时地根据网络流量和各个CDN边缘节点设备的连接情况、负载状况以及到客户端的距离和响应时间等综合信息为客户端分配为其提供服务的CDN边缘节点设备。可选的,该CDN调度设备在从客户端接收了调度请求之后,可以向该客户端反馈分配的CDN边缘节点设备的信息。
CDN边缘节点设备,是可以直接响应客户端请求,为客户端提供服务的设备。在一个内容分发网络中包含多个CDN边缘节点设备,通常情况下,CDN边缘节点设备部署在客户端访问相对集中的地区和网络中。可选的,在CDN调度设备向客户端反馈分配的CDN边缘节点设备的信息之后,该CDN边缘节点设备可以从客户端接收针对视频的播放请求。响应于该播放请求,该CDN边缘节点设备对请求的视频进行判断,若该CDN边缘节点设备保存有该视频的索引文件,则该CDN边缘节点设备将该索引文件反馈给客户端;若该CDN边缘节点设备没有保存该视频的索引文件,则该CDN边缘节点设备向CDN源站服务器请求该视频的索引文件,在从CDN源站服务器中接收了该视频的索引文件之后,再将该索引文件反馈给客户端。在本申请实施例中,由于客户端请求的视频为带有水印的视频,不同的客户端请求的视频的索引文件均互不相容,因此CDN边缘节点设备中没有保存该视频的索引文件,需要通过向CDN源站服务器请求该视频的索引文件。
CDN源站服务器,是内容分发网络中提供视频内容的来源设备。在CDN源站服务器中可以执行视频内容的添加、删除和更改等操作。另外,CDN边缘节点设备中存储的视频内容也全部来自于CDN源站服务器。在一种可能的实现方式中,本申请实施例中的第一服务器为CDN源站服务器。可选的,在该CDN源站服务器中包括水印索引文件生成模块,该水印索引文件生成模块可以生成客户端请求的视频的索引文件。其中,该索引文件中包含该视频的下载地址,并且该索引文件与该客户端具有对应关系。可选的,在该CDN源站服务器从CDN边缘节点设备接收了客户端的请求,并且该水印索引文件生成模块生成了客户端请求的视频的索引文件之后,该CDN源站服务器可以向CDN边缘节点设备发送该索引文件(在本申请实施例中包括起播索引文件、第一索引文件或者第二索引文件),接着,该CDN边缘节点设备将该索引文件转发给客户端。之后,客户端可以根据索引文件中视频的下载地址下载视频分片进行视频播放。在本申请实施例中,该CDN源站服务器会首先生成客户端请求的视频的起播索引文件,该起播索引文件中仅包括视频的起播播放序列对应的下载地址,该起播播放序列为该视频的部分视频分片的序列。由于该起播索引文件包含的数据量较小,生成和传输占用的时间较少,客户端可以在较短的时间内获取到该起播索引文件,再根据视频的起播播放序列对应的下载地址下载视频内容进行起播。通过这种方式,可以在播放带有水印的视频的情况下,降低视频的起播时延。
水印服务器,是生成视频分片的播放序列的设备。可选的,该水印服务器可以根据接收到的请求,生成视频分片的播放序列。在一种可能的实现方式中,本申请实施例中的第二服务器为水印服务器。在本申请实施例中,在CDN源站服务器生成视频的索引文件的过程中,该CDN源站服务器需要从该水印服务器中获取视频的分片播放序列。在一个实施例中,在CDN源站服务器生成起播索引文件的过程中,CDN源站服务器向水印服务器发送第三请求,该第三请求用于请求起播播放序列,该第三请求中还包括该起播播放序列的设置参数(例如, 起播播放序列的播放时间的最大值,或者起播播放序列的分片位置的最大值)。之后,响应于该第三请求,该水印服务器生成起播播放序列,并将该起播播放序列反馈给该CDN源站服务器。相似的,该水印服务器生成视频的全部播放序列的过程,或者生成视频的全部播放序列中除该起播播放序列之外的剩余播放序列的过程,也可以参照上述过程,此处不再赘述。
参见图1B,是本申请实施例提供的又一种视频播放系统的架构示意图,该视频播放系统包括客户端,播放鉴权服务器,CDN调度设备,水印索引文件生成服务器,CDN源站服务器,CDN边缘节点设备和水印服务器。在这种可能的系统架构中,本申请实施例中的第一服务器为水印索引文件生成服务器,该水印索引文件生成服务器生成索引文件的过程,均可以参照上述介绍的CDN源站服务器中的水印索引文件生成模块生成索引文件的过程。需要说明的是,在这种系统架构中,第一服务器与CDN边缘节点设备以及与第二服务器的通信,均需要通过CDN源站服务器。举例而言,该第一服务器从CDN边缘节点设备接收客户端的第一请求的流程包括,CDN源站服务器从CDN边缘节点设备接收客户端的第一请求,第一服务器从CDN源站服务器中接收该客户端的第一请求。在一个实施例中,该第一服务器从第二服务器中获取该视频的起播播放序列的流程包括,第一服务器向CDN源站服务器发送第三请求,CDN源站服务器再向水印服务器(第二服务器)发送第三请求,该第三请求用于请求起播播放序列;响应于该第三请求,该水印服务器生成了起播播放序列,该水印服务器向该CDN源站服务器发送该起播播放序列,CDN源站服务器再向该第一服务器发送该起播播放序列。相似的,该第一服务器获取视频的全部播放序列的过程,或者获取视频的全部播放序列中除该起播播放序列之外的剩余播放序列的过程,也可以参照上述过程,此处不再赘述。
参见图1C,是本申请实施例提供的又一种视频播放系统的架构示意图,该视频播放系统包括客户端,播放鉴权服务器,CDN调度设备,CDN源站服务器,CDN边缘节点设备。在这种可能的系统架构中,水印服务器可以作为播放序列生成模块集成在CDN源站服务器中,在这种情况下,本申请实施例中的第一服务器为CDN源站服务器,第二服务器为CDN源站服务器。该CDN源站服务器生成视频分片的播放序列的过程可以参照上述介绍的水印服务器生成视频分片的播放序列的过程。需要说明的是,在这种系统架构中,第二服务器与CDN源站服务器的通信为设备内部的通信。举例而言,该第一服务器从第二服务器中获取视频的起播播放序列的方式可以为,CDN源站服务器从自身的播放序列生成模块中获取视频的起播播放序列。
参见图1D,是本申请实施例提供的又一种视频播放系统的架构示意图,该视频播放系统包括客户端,播放鉴权服务器,CDN调度设备,水印索引文件生成服务器,CDN源站服务器,CDN边缘节点设备。在这种实施例中,水印服务器作为播放序列生成模块集成在CDN源站服务器中。本申请实施例中的第一服务器为水印索引文件生成服务器,第二服务器为CDN源站服务器。该第一服务器从第二服务器中获取视频的起播播放序列的方式可以为,水印索引文件生成服务器向CDN源站服务器发送该第三请求,响应于该第三请求,该CDN源站服务器生成起播播放序列,并向该水印索引文件生成服务器发送该起播播放序列。相似的,该第一服务器从第二服务器中获取视频的全部播放序列的方式,或者第一服务器从第二服务器中获取视频的全部播放序列中除该起播播放序列之外的剩余播放序列的方式,也可以参照上述过程,此处不再赘述。
以下将对本申请实施例中涉及到的一些概念进行进一步的介绍。
视频的索引文件(或者称为媒体描述文件),用于记录组成该视频的视频分片的下载地址(例如,统一资源定位符)。索引文件由数据文件组成,它是带索引的顺序文件。索引文件由索引表和主文件两部分构成,索引表是一张指示逻辑记录和物理记录之间对应关系的表。索引表中的每项称作索引项,索引项是按照键(或逻辑记录号)的顺序排列。若索引文件本身也是按关键字顺序排列,则称为索引顺序文件。否则,称为索引非顺序文件。举例而言,在本申请实施例中,该视频的索引文件可以是UTF-8编码格式的文件,例如,该索引文件可以为MPD文件或M3U8文件。客户端可以根据索引文件中记录的视频分片的下载地址下载视频分片进行视频播放。
视频分片,为一个视频中时长为2秒~10秒大小的片断。一个视频由一个或多个视频分片组成。对同一个视频采用不同的分片方式进行分片操作,可以得到不同的分片结果。对于同一个视频而言,该视频存在A流、B流两个视频媒介(事先通过转码平台处理),该A流和B流的视频媒介中均包括多个视频分片。其中,该A流和B流包含的多个视频分片中相同分片位置的视频分片的视频内容相同(例如,A流的分片1与B流的分片1的视频内容相同),但A流和B流的视频分片中添加的水印互不相同。
视频分片的序列,即选取的A流以及B流的视频分片的序列。例如,用户1获取到的视频的播放序列可能是A流的分片1、分片3、分片4、分片6、…及B流的分片2、分片5、分片7、…;用户2获取到的同一视频的播放序列可能是A流的分片2、分片3、分片4、分片7、…及B流的分片1、分片5、分片6、…。由于A流和B流的视频分片中添加的水印互不相同,因此同一个视频的不同视频分片的序列中包含的水印序列互不相同。
参见图2,是本申请实施例提供一种视频播放方法的流程图,该方法可以基于图1A所示的架构来实现,下面描述的第一服务器可以是图1A所示的系统架构中的CDN源站服务器。需要说明的是,图1B~图1D所示的系统架构中,也可以应用该方法,仅需要调整设备间的通信过程(可参照上述示例)。该方法包括但不限于如下步骤。
S201、客户端向CDN边缘节点设备发送第一请求。
其中,该第一请求用于请求视频的索引文件。可选的,在本申请实施例中,该第一请求所对应的视频不是该客户端本地已存储的视频,并且该视频为带有水印的视频。在客户端向CDN边缘节点设备发送第一请求之前,客户端会接收用户输入的针对视频的点播请求。若该第一视频不是该客户端本地已存储的视频,并且该视频为带有水印的视频,客户端将向播放鉴权服务器发送播放鉴权请求,该播放鉴权请求用于指示该播放鉴权服务器对该客户端进行访问权限的判定。若该播放鉴权服务器判定该客户端具有对内容分发网络的访问权限,则该播放鉴权服务器将向客户端反馈鉴权通过的结果,之后,客户端可以向内容分发网络的CDN调度设备发送调度请求。响应于该调度请求,CDN调度设备将向客户端反馈分配的CDN边缘节点设备的信息。接着,该客户端可以向该分配的CDN边缘节点设备发送该第一请求。
S202、在该CDN边缘节点设备从该客户端接收了第一请求之后,CDN边缘节点设备向第一服务器发送该客户端的第一请求。
可选的,响应于该第一请求,CDN边缘节点设备判定该第一请求所对应的视频是否是该CDN边缘节点设备在本地已存储的视频。若该视频为带有水印的视频,那么,不同客户端将对应有不同的索引文件,CDN边缘节点设备判定自身未存储该视频的索引文件,该CDN边缘节点设备将向CDN源站服务器(第一服务器)请求该视频的索引文件。因此,该CDN边 缘节点设备向第一服务器发送该客户端的第一请求,相应的,该第一服务器从CDN边缘节点设备接收客户端的第一请求。
S203、在该第一服务器从CDN边缘节点设备接收客户端的第一请求之后,该第一服务器向第二服务器发送第三请求。
其中,该第三请求用于请求起播播放序列,该第三请求中还包括该起播播放序列的设置参数(例如,起播播放序列的播放时间的最大值,或者起播播放序列的分片位置的最大值)。在一种可能的实现方式中,该第三请求中还包括该视频片头的播放时间,或者该视频片头的分片位置。
S204、在第二服务器从第一服务器接收该第三请求之后,该第二服务器生成起播播放序列。
其中,该起播播放序列为该视频的部分视频分片的序列。可选的,该起播播放序列可以存在两种可能的情况。第一种情况,该起播播放序列为该视频的第一预设播放时间之前的视频分片的序列,或者为该视频的第一预设分片位置之前的视频分片的序列。第二种情况,该起播播放序列为该视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为该视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。即,该起播播放序列的播放时间的最大值可能为该第一预设播放时间,也可能为该第二预设播放时间;起播播放序列的分片位置的最大值可能为该第一预设分片位置,也可能为该第二预设分片位置。需要说明的是,若用户在客户端中设置了“跳过片头”,该起播播放序列应为上述的第二种情况,若用户未进行“跳过片头”的设置,该起播播放序列应为上述的第一种情况。可以看出,该起播播放序列为视频开始的一段视频片段或者视频跳过片头之后的一段视频片段中包含的视频分片的序列。
可选的,该第一预设播放时间、第一预设分片位置、第二预设播放时间或者第二预设分片位置,这些起播播放序列的设置参数均可以根据需求进行设置。例如,该第一预设播放时间可以是第1分钟,第2分钟,等等;该第二预设分片位置可以是第12分片,第13分片,等等。该第二预设播放时间可以是第4分钟,第5分钟等等;该第二预设分片位置可以是第48分片,第50分片等等。参见图3A~图3D,是本申请实施例提供的一些起播播放序列的设置参数的示意图。需要说明的是,图3B和图3D中示意的深色格代表起播播放序列中包含的视频分片,空白格代表该起播播放序列中不包含的视频分片。另外,图中示意的相邻的视频分片间存在间隙,是为了区分不同的视频分片,不代表在播放过程中相邻的视频分片间存在间隙。
可选的,该第二预设播放时间还可以通过视频的片头时间加上预设的时间间隔来确定,该第二预设分片位置可以通过视频的片头的分片位置加上预设的分片间隔来确定。通过对第一预设播放时间、第一预设分片位置、第二预设播放时间或者第二预设分片位置的调整,可以调整起播播放序列的长短,即可以间接调整起播索引文件的大小。
S205、该第二服务器向该第一服务器发送该视频的起播播放序列。
S206、在该第一服务器从该第二服务器中获取该视频的起播播放序列之后,该第一服务器生成该起播播放序列对应的起播索引文件,该起播索引文件中包括起播播放序列对应的下载地址。
在第一服务器中,预先存储了该视频的A流、B流两个视频媒介(事先通过转码平台处理)中的各个视频分片的下载地址(例如,URL)。该第一服务器可以根据该起播播放序列, 以及该视频的A流、B流两个视频媒介中的各个视频分片的下载地址,生成起播索引文件。该起播索引文件中包括该视频的起播播放序列对应的下载地址。由于该起播播放序列为该视频的部分视频分片的序列,则生成的起播索引文件包含的数据量较小,从而使得生成和传输该起播索引文件所占用的时间较少。
如下是一个起播索引文件(列出了分辨率/码率的索引文件信息)的例子:
<?xml version="1.0"encoding="UTF-8"?>
<NextMPDURL MPD="http://cdn.bitmovie.net/bbb/video-1500.mpd>
<Representation id="1"codecs="hev1"height="358"width="854"bandwidth="1513463">
<SegmentList duration="5">
<initialization sourceURL="http://cdn.bitmovie.net/bbb/video-1500/video480.mp4">
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480zcx.m4s">//A流分片1URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480bcy.m4s">//B流分片2URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480yzcy.m4s">//B流分片3URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480ydzy.m4s">//A流分片4URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480dcxy.m4s">//B流分片5URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480uxi.m4s">//B流分片6URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480qed.m4s">//B流分片7URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480ipxe.m4s">//A流分片8URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480erv.m4s">//A流分片9URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480uci.m4s">//A流分片10URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480x9y.m4s">//A流分片11URL
<segmentURL media="http://cdn.bitmovie.net/bbb/video-1500/video480op7.m4s">//B流分片12URL
</segmentlist>
</Representation>
S207、该第一服务器向该CDN边缘节点设备发送该起播索引文件,以使得该客户端从该CDN边缘节点接收该起播索引文件。
S208、在该CDN边缘节点设备从该第一服务器接收了该起播索引文件之后,该CDN边缘节点设备向该客户端中发送该视频对应的起播索引文件。
S209、在该客户端从该CDN边缘节点设备中接收该视频对应的起播索引文件之后,该客户端根据该起播播放序列对应的下载地址,从该CDN边缘节点设备中下载该起播播放序列对应的视频分片进行视频播放。
由于该起播索引文件包含的数据量较小,生成和传输占用的时间较少,客户端可以在较短的时间内获取到该起播索引文件,再根据视频的起播播放序列对应的下载地址下载视频内容进行起播。通过这种方式,可以在播放带有水印的视频的情况下,降低视频的起播时延。
在步骤S201中,该第一请求中还可以包括该客户端上登录的用户对应的用户标识(例如,该用户的账号信息)。可选的,本申请实施例中的起播索引文件、第一索引文件或者第二索引文件均与该用户标识具有关联关系,表示该播索引文件、第一索引文件或者第二索引文件与该用户标识指示的用户相对应。在带水印的视频被非法泄露之后,可以通过该关联关系,查找到泄露该视频信息的用户。
在一个实施例中,在上述步骤S203之前,该方法还包括:该第一服务器判断该视频的播放时长大于预设时长,或者判断该视频的分片数大于预设值。其中,该预设时长与该预设值均可以按照需求进行设置。若第一服务器判断该视频的播放时长大于预设时长,或者判断该视频的分片数大于预设值,则说明该视频较长,包含该视频的全部分片的下载地址的索引文件较大,因此可以采用本申请实施例提供的方法,首先生成该视频的起播索引文件。若该第一服务器判断该视频的播放时长不大于该预设时长,或者判断该视频的分片数不大于该预设值,则说明该视频较短,包含该视频的全部分片的下载地址的索引文件较小,因此可以采用生成包含该视频的全部分片的下载地址的索引文件的方法。
在一个实施例中,第一服务器确定第一预设播放时间、第一预设分片位置、第二预设播放时间或者第二预设分片位置的方式可以为:该第一服务器接收针对该起播播放序列的设置参数的生成规则,该设置参数包括该第一预设播放时间或者该第一预设分片位置,或者包括,该第二预设播放时间或者该第二预设分片位置;该第一服务器再根据该生成规则确定该起播播放序列的设置参数。其中,一种可能的实现方式为,该生成规则为第一预设播放时间、第一预设分片位置、第二预设播放时间或者第二预设分片位置具体的值。又一种可能的实现方式为,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长成正比,或者该第二预设分片位置与该视频的分片数量成正比。又一种可能的实现方式为,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长减去片头的时长的剩余时长成正比,或者该第二预设分片位置与该视频的分片数量减去片头的分片数量的剩余分片数量成正比。另外,还可以存在其他的起播播放序列的设置参数的生成规则,此处不再赘述。
参见图4,是本申请实施例提供的又一种视频播放方法的流程图。该方法可以基于图1A所示的架构来实现,下面描述的第一服务器可以是图1A所示的系统架构中的CDN源站服务器。需要说明的是,图1B~图1D所示的系统架构中,也可以应用该方法,仅需要调整设备 间的通信过程(可参照上述示例)。
在该实施例中,该起播索引文件中还包括该第一索引文件的下载地址,该第一索引文件中包括该视频的全部播放序列对应的下载地址,或者该起播索引文件中还包括该第二索引文件的下载地址,该第二索引文件中包括该视频的全部播放序列中除该起播播放序列之外的剩余播放序列对应的下载地址。通过这种方式,客户端可以从起播索引文件中获取到第一索引文件或者第二索引文件的下载地址。该客户端可以根据该第一索引文件或者第二索引文件的下载地址下载该第一索引文件或者第二索引文件。之后,该客户端可以根据第一索引文件中的该视频的全部播放序列对应的下载地址,下载视频分片对该视频中未播放的视频部分进行播放。或者,该客户端可以根据第二索引文件中的剩余播放序列对应的下载地址,下载视频分片对该视频中未播放的视频部分进行播放。
需要说明的是,图4中S401~S409的步骤可以参照上述图2中S201~S209的步骤的执行方式,此处不再赘述。以下对S410~S418的步骤进行具体的介绍。
S410、第一服务器向该第二服务器发送第四请求。
其中,该第四请求用于请求该视频的全部播放序列,或者请求该视频的全部播放序列中除该起播播放序列之外的剩余播放序列。
S411、在该第二服务器从该第一服务器接收该第四请求之后,该第二服务器生成该视频的全部播放序列,或者该视频的全部播放序列中除该起播播放序列之外的剩余播放序列。
S412、该第二服务器向该第一服务器发送该视频的全部播放序列,或者该视频的全部播放序列中除该起播播放序列之外的剩余播放序列。
S413、在该第一服务器从该第二服务器接收该视频的全部播放序列,或者该视频的全部播放序列中除该起播播放序列之外的剩余播放序列之后,该第一服务器生成第一索引文件或者第二索引文件。
在一个实施例中,该第一服务器生成第一索引文件或者第二索引文件的方式可以为:该第一服务器从该第二服务器中获取该视频的全部播放序列;再根据该全部播放序列生成第一索引文件。或者,该第一服务器从该第二服务器中获取该视频的全部播放序列中除该起播播放序列之外的剩余播放序列;再根据该剩余播放序列生成第二索引文件。该第一服务器根据全部播放序列生成第一索引文件的方式,或者根据剩余播放序列生成第二索引文件的方式,可以参考上述步骤S204中介绍的该第一服务器生成该起播播放序列对应的起播索引文件的方式,此处不再赘述。
需要说明的是,在第一服务器向该客户端反馈了起播索引文件之后,该第一服务器可以紧接着生成该客户端请求的视频的第一索引文件或者第二索引文件,与此同时,客户端可以根据该起播索引文件进行视频的起播。通过这种方式,第一服务器可以在视频起播的过程中生成第一索引文件或者第二索引文件。在客户端对起播索引文件对应的视频分片进行播放的过程中,第一服务器有充足的时间生成第一索引文件或者第二索引文件。不同于现有技术中第一服务器一次生成包含该视频的全部分片的下载地址的索引文件的方式,本申请实施例的方法可以缩短生成以及传输起播索引文件的时间,并且第一服务器有充足的时间生成后续视频内容对应的第一索引文件和第二索引文件,降低了该第一服务器的负载以及对第一服务器的性能需求。
第一索引文件和第二索引文件可以参考S206中起播索引文件,在此不再列出。
S414、客户端向CDN边缘节点设备发送第二请求。
其中,该第二请求用于请求下载该第一索引文件或者该第二索引文件。可选的,客户端向CDN边缘节点设备发送第二请求可能存在两种情况。以下对这两种情况进行介绍。
第一种情况,该起播播放序列对应的视频分片播放到第三预设播放时间或者第三预设分片位置。其中,该第三预设播放时间小于该起播播放序列的播放时间的最大值,该第三预设分片位置在该起播播放序列的分片位置的最大值之前。需要说明的是,该第三预设播放时间为临近该起播播放序列的播放时间的最大值的时间值,例如,该第三预设播放时间为该起播播放序列的播放时间的最大值减去5秒(仅为示例,可按需设置)的时间值。该第三预设分片位置为临近该起播播放序列的分片位置的最大值的位置,例如,该第三预设分片位置为该起播播放序列的分片位置的最大值减去1个分片位置(仅为示例,可按需设置)的位置。其中,该起播播放序列的播放时间的最大值可能为该第一预设播放时间,也可能为该第二预设播放时间;起播播放序列的分片位置的最大值可能为该第一预设分片位置,也可能为该第二预设分片位置。这种情况表明,客户端即将播放完起播索引文件包含的视频分片的内容,客户端需要继续获取视频中未播放的视频部分的索引文件。参见图5A~图5D,是本申请实施例提供的一些触发客户端发送第二请求的场景示意图。需要说明的是,图5B和图5D中示意的深色格代表起播播放序列中包含的视频分片,空白格代表该起播播放序列中不包含的视频分片。另外,图中示意的相邻的视频分片间存在间隙,是为了区分不同的视频分片,不代表在播放过程中相邻的视频分片间存在间隙。
第二种情况,该客户端接收到输入的对该视频的第一播放时间或者第一分片位置的播放请求。其中,该第一播放时间大于该起播播放序列的播放时间的最大值,该第一分片位置在该起播播放序列的分片位置的最大值之后。这种情况表明,客户端接收到了用户输入的针对不是起播索引文件包含的视频分片的内容的播放请求,客户端需要获取第一播放时间或者该第一分片位置之后的视频部分的索引文件。参见图6A~图6D,是本申请实施例提供的一些触发客户端发送第二请求的场景示意图。需要说明的是,图6B和图6D的示意规则可参照图5B和图5D的示意规则,此处不再赘述。
S415、在CDN边缘节点设备从该客户端接收该第二请求之后,CDN边缘节点设备向该第一服务器发送该第二请求。
S416、在该第一服务器从该CDN边缘节点设备接收了客户端的第二请求之后,该第一服务器向该CDN边缘节点设备发送该第一索引文件或者该第二索引文件。
S417、在该CDN边缘节点设备从该第一服务器中接收第一索引文件或者第二索引文件之后,该CDN边缘节点设备向该客户端发送该第一索引文件或者第二索引文件。
S418、在该客户端从该CDN边缘节点设备中接收该第一索引文件或者该第二索引文件之后,客户端根据第一索引文件或者第二索引文件下载视频分片对未播放的视频内容进行播放。
针对上述提到的第一种触发客户端向CDN边缘节点设备发送第二请求的情况,客户端将根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放。
针对上述提到的第二种触发客户端向CDN边缘节点设备发送第二请求的情况,该客户端根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的 视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放。
在一种可能的实现方式中,该客户端可以包括多个客户端,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器生成该多个客户端对应的起播索引文件的优先级,高于该第一服务器生成该多个客户端对应的该第一索引文件或者该第二索引文件的优先级。通过这种方式,该第一服务器可以优先生成多个客户端对应的起播索引文件,能够进一步减少生成起播索引文件的时间,从而降低播放带水印的视频的起播时延。
在一种可能的实现方式中,该客户端包括多个客户端,且该多个客户端中的每个客户端具有优先级,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器优先生成优先级高的客户端对应的起播索引文件,并优先生成该优先级高的客户端对应的该第一索引文件或者该第二索引文件。其中,各种索引文件的优先级存在的高低关系可以是“优先级高的客户端对应的起播索引文件>优先级低的客户端对应的起播索引文件>优先级高的用户对应的第一索引文件或者第二索引文件>优先级低的用户对应的第一索引文件或者第二索引文件”。需要说明的是“A>B”表示A的优先级高于B的优先级。还可能存在其他的优先级关系,例如对客户端的优先级做更细致的划分,此处不做限制。通过这种方式,第一服务器可以优先响应优先级高的客户端的第一请求,进一步减少生成优先级高的客户端的起播索引文件的时间,从而进一步降低优先级高的客户端播放带水印的视频的起播时延。
以上描述了本申请的方法实施例,下面对实现上述方法的装置实施例进行介绍。
参见图7,是本申请实施例提供的一种服务器,该服务器用作第一服务器,该第一服务器包括接收单元701,获取单元702,生成单元703和发送单元704,以下将对上述单元进行具体的介绍。
该接收单元701,用于从CDN边缘节点设备接收客户端的第一请求,该第一请求用于请求视频的索引文件。在一个实施例中,该接收单元701可以为数据传输接口、通信接口或接收器等可被配置用于接收信息的电路或组件。
该获取单元702,用于从第二服务器中获取该视频的起播播放序列,其中,该起播播放序列为该视频的部分视频分片的序列。
该生成单元703,用于生成该起播播放序列对应的起播索引文件,该起播索引文件中包括起播播放序列对应的下载地址。
该发送单元704,用于向该CDN边缘节点设备发送该起播索引文件,以使得该客户端从该CDN边缘节点接收该起播索引文件。在一个实施例中,该发送单元704可以为数据传输接口、通信接口或接收器等可被配置用于接收信息的电路或组件。
在一种可能的实现方式中,该获取单元还用于:从该第二服务器中获取该视频的全部播放序列;该生成单元还用于:根据该全部播放序列生成第一索引文件;或者,该获取单元还用于:从该第二服务器中获取该视频的全部播放序列中除该起播播放序列之外的剩余播放序列;该生成单元还用于:根据该剩余播放序列生成第二索引文件。
在一种可能的实现方式中,该起播索引文件中还包括该第一索引文件的下载地址,该第一索引文件中包括该视频的全部播放序列对应的下载地址,或者该起播索引文件中还包括该第二索引文件的下载地址,该第二索引文件中包括该视频的全部播放序列中除该起播播放序 列之外的剩余播放序列对应的下载地址。
在一种可能的实现方式中,该接收单元还用于:从该CDN边缘节点设备接收客户端的第二请求,该第二请求用于请求下载该客户端对应的第一索引文件或者该第二索引文件;该发送单元还用于:向该CDN边缘节点设备发送该第一索引文件或者该第二索引文件。
在一种可能的实现方式中,该客户端包括多个客户端,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器生成该多个客户端对应的起播索引文件的优先级,高于该第一服务器生成该多个客户端对应的该第一索引文件或者该第二索引文件的优先级。
在一种可能的实现方式中,该客户端包括多个客户端,且该多个客户端中的每个客户端具有优先级,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器优先生成优先级高的客户端对应的起播索引文件,并优先生成该优先级高的客户端对应的该第一索引文件或者该第二索引文件。
在一种可能的实现方式中,该第一服务器还包括判断单元,该判断单元用于:判断该视频的播放时长是否大于预设时长,或者判断该视频的分片数是否大于预设值。
在一种可能的实现方式中,该接收单元还用于:接收针对该起播播放序列的设置参数的生成规则,该设置参数包括该第一预设播放时间或者该第一预设分片位置,或者包括,该第二预设播放时间或者该第二预设分片位置;该第一服务器还包括确定单元,该确定单元用于:根据该生成规则确定该起播播放序列的设置参数。
在一种可能的实现方式中,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长成正比,或者该第二预设分片位置与该视频的分片数量成正比。
在一种可能的实现方式中,该起播播放序列为该视频的第一预设播放时间之前的视频分片的序列,或者为该视频的第一预设分片位置之前的视频分片的序列;或者,该起播播放序列为该视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为该视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。
另外,图7中的各个操作的实现还可以对应参照图2或图4所示的方法实施例的相应描述。上述各个单元可以以硬件,软件或者软硬件结合的方式来实现。在一个实施例中,获取单元702和生成单元703可以为软件实现的功能模块,这些功能模块的功能由存储在存储器中的程序或代码实现,服务器通过至少一个处理器执行这些程序或代码,可以实现各个功能模块的功能。
在图7所示的服务器中,该服务器在通过CDN边缘节点设备接收到客户端发送的第一请求之后,将实时生成起播索引文件,起播索引文件中包括起播播放序列对应的下载地址,起播播放序列为视频开始的一段视频片段或者视频跳过片头之后的一段视频片段对应的序列;之后,服务器再通过CDN边缘节点设备向客户端发送该起播索引文件。由于起播索引文件包含的数据量较少,生成和传输占用的时间较少,客户端可以在较短的时间内获取到起播索引文件,再根据起播播放序列对应的下载地址下载视频内容进行起播,从而达到降低视频起播时延的目的。
参见图8,是本申请实施例提供的一种客户端,该客户端包括发送单元801,接收单元802和下载单元803,以下将对上述单元进行具体的介绍。
该发送单元801,用于向CDN边缘节点设备发送第一请求,该第一请求用于请求视频的索引文件。在一个实施例中,该接收单元801可以为数据传输接口、通信接口或接收器等可被配置用于接收信息的电路或组件。
该接收单元802,用于从该CDN边缘节点设备中接收该视频对应的起播索引文件,该起播索引文件中包括该视频的起播播放序列对应的下载地址,其中,该起播播放序列为该视频的部分视频分片的序列。在一个实施例中,该接收单元802可以为数据传输接口、通信接口或接收器等可被配置用于接收信息的电路或组件。
该下载单元803,用于根据该起播播放序列对应的下载地址,从该CDN边缘节点设备中下载该起播播放序列对应的视频分片进行视频播放。
在一种可选的实现方式中,该起播索引文件中还包括第一索引文件的下载地址,该第一索引文件中包括该视频的全部播放序列对应的下载地址;或者,该起播索引文件中还包括第二索引文件的下载地址,该第二索引文件中包括该视频的全部播放序列中除该起播播放序列之外的剩余播放序列对应的下载地址。
在一种可选的实现方式中,该发送单元还用于:在该起播播放序列对应的视频分片播放到第三预设播放时间或者第三预设分片位置的情况下,该客户端根据该第一索引文件或者第二索引文件的下载地址向该CDN边缘节点设备发送第二请求,其中,该第二请求用于请求下载该第一索引文件或者该第二索引文件,该第三预设播放时间小于该起播播放序列的播放时间的最大值,该第三预设分片位置在该起播播放序列的分片位置的最大值之前;该接收单元还用于:从该CDN边缘节点设备中接收该第一索引文件或者该第二索引文件;该下载单元还用于:根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放。
在一种可选的实现方式中,该发送单元还用于:在该客户端接收到输入的对该视频的第一播放时间或者第一分片位置的播放请求的情况下,该客户端根据该第一索引文件或者第二索引文件的下载地址向该CDN边缘节点设备发送第二请求,其中,该第二请求用于请求下载该第一索引文件或者该第二索引文件,该第一播放时间大于该起播播放序列的播放时间的最大值,该第一分片位置在该起播播放序列的分片位置的最大值之后;该接收单元还用于:从该CDN边缘节点设备中接收该第一索引文件或者该第二索引文件;该下载单元还用于:根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放。
在一种可选的实现方式中,该起播播放序列的设置参数由该CDN源站服务器接收到的生成规则确定,该设置参数包括该第一预设播放时间或者该第一预设分片位置,或者包括该第二预设播放时间或者该第二预设分片位置。
在一种可选的实现方式中,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长成正比,或者该第二预设分片位置与该视频的分片数量成正比。
在一种可选的实现方式中,该起播播放序列为该视频的第一预设播放时间之前的视频分 片的序列,或者为该视频的第一预设分片位置之前的视频分片的序列;或者,该起播播放序列为该视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为该视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。
另外,图8中的各个操作的实现还可以对应参照图2或图4所示的方法实施例的相应描述。上述各个单元可以以硬件,软件或者软硬件结合的方式来实现。
在图8所示的客户端中,服务器在通过CDN边缘节点设备接收到该客户端发送的第一请求之后,将实时生成起播索引文件,起播索引文件中包括起播播放序列对应的下载地址,起播播放序列为视频开始的一段视频片段或者视频跳过片头之后的一段视频片段对应的序列;之后,服务器再通过CDN边缘节点设备向客户端发送该起播索引文件。由于起播索引文件包含的数据量较少,生成和传输占用的时间较少,客户端可以在较短的时间内获取到起播索引文件,再根据起播播放序列对应的下载地址下载视频内容进行起播,从而达到降低视频起播时延的目的。
参见图9,是本申请实施例提供的又一种服务器,该服务器用作第一服务器。该第一服务器包括处理器901、存储器902和通信接口903,该处理器901、存储器902和通信接口903通过总线904相互连接。
存储器902包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器902用于相关指令及数据。
通信接口903可以为数据传输接口、通信接口或接收器等可被配置用于接收信息的电路或组件。
处理器901可以是一个或多个中央处理器(central processing unit,CPU),在处理器901是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
该服务器中的处理器901通过读取并执行存储器902中存储的程序代码,执行以下操作:
通过通信接口903从内容分发网络CDN边缘节点设备接收客户端的第一请求,该第一请求用于请求视频的索引文件。
通过通信接口903从第二服务器中获取该视频的起播播放序列,其中,该起播播放序列为该视频的部分视频分片的序列。
生成该起播播放序列对应的起播索引文件,该起播索引文件中包括起播播放序列对应的下载地址。
通过通信接口903向该CDN边缘节点设备发送该起播索引文件,以使得该客户端从该CDN边缘节点接收该起播索引文件。
在一种可能的实现方式中,该处理器901还用于:从该第二服务器中获取该视频的全部播放序列;根据该全部播放序列生成第一索引文件;或者,从该第二服务器中获取该视频的全部播放序列中除该起播播放序列之外的剩余播放序列;根据该剩余播放序列生成第二索引文件。
在一种可能的实现方式中,该起播索引文件中还包括该第一索引文件的下载地址,该第一索引文件中包括该视频的全部播放序列对应的下载地址,或者该起播索引文件中还包括该第二索引文件的下载地址,该第二索引文件中包括该视频的全部播放序列中除该起播播放序 列之外的剩余播放序列对应的下载地址。
在一种可能的实现方式中,该处理器901还用于:从该CDN边缘节点设备接收客户端的第二请求,该第二请求用于请求下载该客户端对应的第一索引文件或者该第二索引文件;向该CDN边缘节点设备发送该第一索引文件或者该第二索引文件。
在一种可能的实现方式中,该客户端包括多个客户端,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器生成该多个客户端对应的起播索引文件的优先级,高于该第一服务器生成该多个客户端对应的该第一索引文件或者该第二索引文件的优先级。
在一种可能的实现方式中,该客户端包括多个客户端,且该多个客户端中的每个客户端具有优先级,若该第一服务器从CDN边缘节点设备接收该多个客户端的该第一请求,则该第一服务器优先生成优先级高的客户端对应的起播索引文件,并优先生成该优先级高的客户端对应的该第一索引文件或者该第二索引文件。
在一种可能的实现方式中,该处理器901还用于:判断该视频的播放时长大于预设时长,或者判断该视频的分片数大于预设值。
在一种可能的实现方式中,该处理器901还用于:接收针对该起播播放序列的设置参数的生成规则,该设置参数包括该第一预设播放时间或者该第一预设分片位置,或者包括,该第二预设播放时间或者该第二预设分片位置;根据该生成规则确定该起播播放序列的设置参数。
在一种可能的实现方式中,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长成正比,或者该第二预设分片位置与该视频的分片数量成正比。
在一种可能的实现方式中,该起播播放序列为该视频的第一预设播放时间之前的视频分片的序列,或者为该视频的第一预设分片位置之前的视频分片的序列;或者,该起播播放序列为该视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为该视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。
图9中的处理器901所执行的各个操作的具体细节还可以对应参照图2或者图4所示的方法实施例的相应描述。
在图9所示的服务器中,该服务器在通过CDN边缘节点设备接收到客户端发送的第一请求之后,将实时生成起播索引文件,起播索引文件中包括起播播放序列对应的下载地址,起播播放序列为视频开始的一段视频片段或者视频跳过片头之后的一段视频片段对应的序列;之后,服务器再通过CDN边缘节点设备向客户端发送该起播索引文件。由于起播索引文件包含的数据量较少,生成和传输占用的时间较少,客户端可以在较短的时间内获取到起播索引文件,再根据起播播放序列对应的下载地址下载视频内容进行起播,从而达到降低视频起播时延的目的。
参见图10,是本申请实施例提供的又一种客户端。该客户端包括处理器1001、存储器1002和通信接口1003,该处理器1001、存储器1002和通信接口1003通过总线1004相互连接。
存储器1002包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only  memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器1002用于相关指令及数据。
通信接口1003可以为数据传输接口、通信接口或接收器等可被配置用于接收信息的电路或组件。
处理器1001可以是一个或多个中央处理器(central processing unit,CPU),在处理器1001是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
该客户端中的处理器1001通过读取并执行存储器1002中存储的程序代码,执行以下操作:
通过通信接口1003向CDN边缘节点设备发送第一请求,该第一请求用于请求视频的索引文件。
通过通信接口1003从该CDN边缘节点设备中接收该视频对应的起播索引文件,该起播索引文件中包括该视频的起播播放序列对应的下载地址,其中,该起播播放序列为该视频的部分视频分片的序列。
根据该起播播放序列对应的下载地址,从该CDN边缘节点设备中下载该起播播放序列对应的视频分片进行视频播放。
在一种可能的实现方式中,该起播索引文件中还包括第一索引文件的下载地址,该第一索引文件中包括该视频的全部播放序列对应的下载地址;或者,该起播索引文件中还包括第二索引文件的下载地址,该第二索引文件中包括该视频的全部播放序列中除该起播播放序列之外的剩余播放序列对应的下载地址。
在一种可能的实现方式中,该处理器1001还用于:在该起播播放序列对应的视频分片播放到第三预设播放时间或者第三预设分片位置的情况下,根据该第一索引文件或者第二索引文件的下载地址向该CDN边缘节点设备发送第二请求,其中,该第二请求用于请求下载该第一索引文件或者该第二索引文件,该第三预设播放时间小于该起播播放序列的播放时间的最大值,该第三预设分片位置在该起播播放序列的分片位置的最大值之前;从该CDN边缘节点设备中接收该第一索引文件或者该第二索引文件;根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于对该视频中未播放的视频部分进行播放。
在一种可能的实现方式中,该处理器1001还用于:在该客户端接收到输入的对该视频的第一播放时间或者第一分片位置的播放请求的情况下,根据该第一索引文件或者第二索引文件的下载地址向该CDN边缘节点设备发送第二请求,其中,该第二请求用于请求下载该第一索引文件或者该第二索引文件,该第一播放时间大于该起播播放序列的播放时间的最大值,该第一分片位置在该起播播放序列的分片位置的最大值之后;从该CDN边缘节点设备中接收该第一索引文件或者该第二索引文件;根据该全部播放序列对应的下载地址,从该CDN边缘节点设备中下载该全部播放序列对应的视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放;或者根据该剩余播放序列对应的下载地址,从该CDN边缘节点设备中下载该剩余播放序列对应的视频分片,以用于从该第一播放时间或者从该第一分片位置对该视频进行播放。
在一种可能的实现方式中,该起播播放序列的设置参数由该CDN源站服务器接收到的生成规则确定,该设置参数包括该第一预设播放时间或者该第一预设分片位置,或者包括该第 二预设播放时间或者该第二预设分片位置。
在一种可能的实现方式中,该生成规则为该第一预设播放时间与该视频的总时长成正比,或者该第一预设分片位置与该视频的分片数量成正比;或者,该生成规则为该第二预设播放时间与该视频的总时长成正比,或者该第二预设分片位置与该视频的分片数量成正比。
在一种可能的实现方式中,该起播播放序列为该视频的第一预设播放时间之前的视频分片的序列,或者为该视频的第一预设分片位置之前的视频分片的序列;或者,该起播播放序列为该视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为该视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。
图10中的处理器1001所执行的各个操作的具体细节还可以对应参照图2或者图4所示的方法实施例的相应描述。
在图10所示的设备中,服务器在通过CDN边缘节点设备接收到该客户端发送的第一请求之后,将实时生成起播索引文件,起播索引文件中包括起播播放序列对应的下载地址,起播播放序列为视频开始的一段视频片段或者视频跳过片头之后的一段视频片段对应的序列;之后,服务器再通过CDN边缘节点设备向客户端发送该起播索引文件。由于起播索引文件包含的数据量较少,生成和传输占用的时间较少,客户端可以在较短的时间内获取到起播索引文件,再根据起播播放序列对应的下载地址下载视频内容进行起播,从而达到降低视频起播时延的目的。
在本申请的另一实施例中提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,图2或图4所示实施例的方法得以实现。
在本申请的另一实施例中提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被计算机执行时实现图2或者图4所示实施例的方法。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。

Claims (20)

  1. 一种视频播放方法,其特征在于,包括:
    第一服务器从内容分发网络CDN边缘节点设备接收客户端的第一请求,所述第一请求用于请求视频的索引文件;
    所述第一服务器从第二服务器中获取所述视频的起播播放序列,其中,所述起播播放序列为所述视频的部分视频分片的序列;
    所述第一服务器生成所述起播播放序列对应的起播索引文件,所述起播索引文件中包括起播播放序列对应的下载地址;
    所述第一服务器向所述CDN边缘节点设备发送所述起播索引文件,以使得所述客户端从所述CDN边缘节点接收所述起播索引文件。
  2. 根据权利要求1所述的方法,所述方法还包括:
    所述第一服务器从所述第二服务器中获取所述视频的全部播放序列;
    所述第一服务器根据所述全部播放序列生成第一索引文件;
    或者,所述第一服务器从所述第二服务器中获取所述视频的全部播放序列中除所述起播播放序列之外的剩余播放序列;
    所述第一服务器根据所述剩余播放序列生成第二索引文件。
  3. 根据权利要求2所述的方法,其特征在于,所述起播索引文件中还包括所述第一索引文件的下载地址,所述第一索引文件中包括所述视频的全部播放序列对应的下载地址,或者所述起播索引文件中还包括所述第二索引文件的下载地址,所述第二索引文件中包括所述视频的全部播放序列中除所述起播播放序列之外的剩余播放序列对应的下载地址。
  4. 根据权利要求2所述的方法,其特征在于,所述第一服务器向所述CDN边缘节点设备发送所述起播索引文件之后,所述方法还包括:
    所述第一服务器从所述CDN边缘节点设备接收客户端的第二请求,所述第二请求用于请求下载所述客户端对应的第一索引文件或者所述第二索引文件;
    所述第一服务器向所述CDN边缘节点设备发送所述第一索引文件或者所述第二索引文件。
  5. 根据权利要求2~4任一项所述的方法,其特征在于,所述客户端包括多个客户端,若所述第一服务器从CDN边缘节点设备接收所述多个客户端的所述第一请求,则所述第一服务器生成所述多个客户端对应的起播索引文件的优先级,高于所述第一服务器生成所述多个客户端对应的所述第一索引文件或者所述第二索引文件的优先级。
  6. 根据权利要求2~4任一项所述的方法,其特征在于,所述客户端包括多个客户端,且所述多个客户端中的每个客户端具有优先级,若所述第一服务器从CDN边缘节点设备接收所述多个客户端的所述第一请求,则所述第一服务器优先生成优先级高的客户端对应的起播索 引文件,并优先生成所述优先级高的客户端对应的所述第一索引文件或者所述第二索引文件。
  7. 根据权利要求1~6任一项所述的方法,其特征在于,在所述第一服务器从所述第二服务器中获取所述视频的起播播放序列之前,所述方法还包括:
    所述第一服务器判断所述视频的播放时长大于预设时长,或者判断所述视频的分片数大于预设值。
  8. 根据权利要求2~7任一项所述的方法,其特征在于,所述方法还包括:
    所述第一服务器接收针对所述起播播放序列的设置参数的生成规则,所述设置参数包括所述第一预设播放时间或者所述第一预设分片位置,或者包括,所述第二预设播放时间或者所述第二预设分片位置;
    所述第一服务器根据所述生成规则确定所述起播播放序列的设置参数。
  9. 根据权利要求8所述的方法,其特征在于,所述生成规则为所述第一预设播放时间与所述视频的总时长成正比,或者所述第一预设分片位置与所述视频的分片数量成正比;或者,所述生成规则为所述第二预设播放时间与所述视频的总时长成正比,或者所述第二预设分片位置与所述视频的分片数量成正比。
  10. 根据权利要求1~9任一项所述的方法,其特征在于,所述起播播放序列为所述视频的第一预设播放时间之前的视频分片的序列,或者为所述视频的第一预设分片位置之前的视频分片的序列;或者,所述起播播放序列为所述视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为所述视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。
  11. 一种视频播放方法,其特征在于,包括:
    客户端向CDN边缘节点设备发送第一请求,所述第一请求用于请求视频的索引文件;
    所述客户端从所述CDN边缘节点设备中接收所述视频对应的起播索引文件,所述起播索引文件中包括所述视频的起播播放序列对应的下载地址,其中,所述起播播放序列为所述视频的部分视频分片的序列;
    所述客户端根据所述起播播放序列对应的下载地址,从所述CDN边缘节点设备中下载所述起播播放序列对应的视频分片进行视频播放。
  12. 根据权利要求11所述的方法,其特征在于,所述起播索引文件中还包括第一索引文件的下载地址,所述第一索引文件中包括所述视频的全部播放序列对应的下载地址;或者,所述起播索引文件中还包括第二索引文件的下载地址,所述第二索引文件中包括所述视频的全部播放序列中除所述起播播放序列之外的剩余播放序列对应的下载地址。
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    在所述起播播放序列对应的视频分片播放到第三预设播放时间或者第三预设分片位置的情况下,所述客户端根据所述第一索引文件或者第二索引文件的下载地址向所述CDN边缘节 点设备发送第二请求,其中,所述第二请求用于请求下载所述第一索引文件或者所述第二索引文件,所述第三预设播放时间小于所述起播播放序列的播放时间的最大值,所述第三预设分片位置在所述起播播放序列的分片位置的最大值之前;
    所述客户端从所述CDN边缘节点设备中接收所述第一索引文件或者所述第二索引文件;
    所述客户端根据所述全部播放序列对应的下载地址,从所述CDN边缘节点设备中下载所述全部播放序列对应的视频分片,以用于对所述视频中未播放的视频部分进行播放;或者根据所述剩余播放序列对应的下载地址,从所述CDN边缘节点设备中下载所述剩余播放序列对应的视频分片,以用于对所述视频中未播放的视频部分进行播放。
  14. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    在所述客户端接收到输入的对所述视频的第一播放时间或者第一分片位置的播放请求的情况下,所述客户端根据所述第一索引文件或者第二索引文件的下载地址向所述CDN边缘节点设备发送第二请求,其中,所述第二请求用于请求下载所述第一索引文件或者所述第二索引文件,所述第一播放时间大于所述起播播放序列的播放时间的最大值,所述第一分片位置在所述起播播放序列的分片位置的最大值之后;
    所述客户端从所述CDN边缘节点设备中接收所述第一索引文件或者所述第二索引文件;
    所述客户端根据所述全部播放序列对应的下载地址,从所述CDN边缘节点设备中下载所述全部播放序列对应的视频分片,以用于从所述第一播放时间或者从所述第一分片位置对所述视频进行播放;或者根据所述剩余播放序列对应的下载地址,从所述CDN边缘节点设备中下载所述剩余播放序列对应的视频分片,以用于从所述第一播放时间或者从所述第一分片位置对所述视频进行播放。
  15. 根据权利要求11~14任一项所述的方法,其特征在于,所述起播播放序列的设置参数由所述CDN源站服务器接收到的生成规则确定,所述设置参数包括所述第一预设播放时间或者所述第一预设分片位置,或者包括所述第二预设播放时间或者所述第二预设分片位置。
  16. 根据权利要求15所述的方法,其特征在于,所述生成规则为所述第一预设播放时间与所述视频的总时长成正比,或者所述第一预设分片位置与所述视频的分片数量成正比;或者,所述生成规则为所述第二预设播放时间与所述视频的总时长成正比,或者所述第二预设分片位置与所述视频的分片数量成正比。
  17. 根据权利要求11~16任一项所述的方法,其特征在于,所述起播播放序列为所述视频的第一预设播放时间之前的视频分片的序列,或者为所述视频的第一预设分片位置之前的视频分片的序列;或者,所述起播播放序列为所述视频的片头的播放时间之后,并且在第二预设播放时间之前的视频分片的序列,或者为所述视频的片头的分片位置之后,并且在第二预设分片位置之前的视频分片的序列。
  18. 一种服务器,其特征在于,所述服务器用作第一服务器,所述第一服务器包括处理器和存储器,其中,所述存储器用于存储程序指令,所述程序指令当被所述处理器运行时,使得所述第一服务器执行如权利要求1~10任一项所述的方法。
  19. 一种客户端,其特征在于,包括处理器和存储器,其中,所述存储器用于存储程序指令,所述程序指令当被所述处理器运行时,使得所述客户端执行如权利要求11~17任一项所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机存储介质存储有程序指令,所述程序指令当被计算机执行时使所述计算机执行如权利要求1~17任一项所述的方法。
PCT/CN2020/084574 2019-04-19 2020-04-14 一种视频播放方法及相关设备 WO2020211731A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910319993.1A CN110072122B (zh) 2019-04-19 2019-04-19 一种视频播放方法及相关设备
CN201910319993.1 2019-04-19

Publications (1)

Publication Number Publication Date
WO2020211731A1 true WO2020211731A1 (zh) 2020-10-22

Family

ID=67368255

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/084574 WO2020211731A1 (zh) 2019-04-19 2020-04-14 一种视频播放方法及相关设备

Country Status (2)

Country Link
CN (1) CN110072122B (zh)
WO (1) WO2020211731A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113300875A (zh) * 2021-02-10 2021-08-24 阿里巴巴集团控股有限公司 回源数据校验方法、服务器、系统及存储介质
CN113495843A (zh) * 2021-07-07 2021-10-12 北京百度网讯科技有限公司 用于测试视频播放器的起播性能的方法和装置
CN114025201A (zh) * 2021-10-29 2022-02-08 恒安嘉新(北京)科技股份公司 一种视频播放方法、装置、设备及存储介质
CN115086300A (zh) * 2022-06-16 2022-09-20 乐视云计算有限公司 一种视频文件调度方法和装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110072122B (zh) * 2019-04-19 2022-03-08 华为技术有限公司 一种视频播放方法及相关设备
CN110636340B (zh) * 2019-09-30 2021-11-09 普联技术有限公司 视频文件的上传方法、存储设备、终端设备及存储介质
CN110677737A (zh) * 2019-10-08 2020-01-10 烽火通信科技股份有限公司 一种hls直播快速起播方法及系统
CN110677736B (zh) * 2019-10-08 2022-11-11 烽火通信科技股份有限公司 一种hls点播快速起播方法及系统
CN113613032A (zh) * 2021-08-04 2021-11-05 杭州梦视网络科技有限公司 一种嵌入式远程教学实验系统的视频传输方法
CN114650239B (zh) * 2022-03-23 2024-02-23 腾讯音乐娱乐科技(深圳)有限公司 一种数据的刷量识别方法、存储介质和电子设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140247885A1 (en) * 2011-04-18 2014-09-04 Uplynk, LLC Decoupled slicing and encoding of media content
WO2014173079A1 (zh) * 2013-04-24 2014-10-30 华为技术有限公司 媒体文件接收、媒体文件发送方法和装置及系统
CN105872607A (zh) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 提供多媒体内容的方法、服务器和终端设备
WO2017054552A1 (zh) * 2015-09-30 2017-04-06 华为技术有限公司 终端、缓存服务器及获取视频分片的方法及装置
CN108540868A (zh) * 2018-05-16 2018-09-14 北京百度网讯科技有限公司 Hls直播的处理方法、装置、服务器、终端及存储介质
CN108933764A (zh) * 2017-05-26 2018-12-04 中兴通讯股份有限公司 一种实现快速起播的方法和装置
CN110022482A (zh) * 2019-03-05 2019-07-16 咪咕视讯科技有限公司 视频起播方法、视频服务系统及存储介质
CN110072122A (zh) * 2019-04-19 2019-07-30 华为技术有限公司 一种视频播放方法及相关设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10368142B2 (en) * 2013-03-14 2019-07-30 Comcast Cable Communications, Llc Delivery of content and priority messages
CN103685264A (zh) * 2013-12-06 2014-03-26 乐视致新电子科技(天津)有限公司 轮播媒体分片的方法、客户端及系统
CN105872721A (zh) * 2015-12-14 2016-08-17 乐视云计算有限公司 起播速度的处理方法及装置
CN105898535A (zh) * 2015-12-30 2016-08-24 乐视致新电子科技(天津)有限公司 提高起播速度的方法、视频播放器及电子装置

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140247885A1 (en) * 2011-04-18 2014-09-04 Uplynk, LLC Decoupled slicing and encoding of media content
WO2014173079A1 (zh) * 2013-04-24 2014-10-30 华为技术有限公司 媒体文件接收、媒体文件发送方法和装置及系统
WO2017054552A1 (zh) * 2015-09-30 2017-04-06 华为技术有限公司 终端、缓存服务器及获取视频分片的方法及装置
CN105872607A (zh) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 提供多媒体内容的方法、服务器和终端设备
CN108933764A (zh) * 2017-05-26 2018-12-04 中兴通讯股份有限公司 一种实现快速起播的方法和装置
CN108540868A (zh) * 2018-05-16 2018-09-14 北京百度网讯科技有限公司 Hls直播的处理方法、装置、服务器、终端及存储介质
CN110022482A (zh) * 2019-03-05 2019-07-16 咪咕视讯科技有限公司 视频起播方法、视频服务系统及存储介质
CN110072122A (zh) * 2019-04-19 2019-07-30 华为技术有限公司 一种视频播放方法及相关设备

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113300875A (zh) * 2021-02-10 2021-08-24 阿里巴巴集团控股有限公司 回源数据校验方法、服务器、系统及存储介质
CN113495843A (zh) * 2021-07-07 2021-10-12 北京百度网讯科技有限公司 用于测试视频播放器的起播性能的方法和装置
CN114025201A (zh) * 2021-10-29 2022-02-08 恒安嘉新(北京)科技股份公司 一种视频播放方法、装置、设备及存储介质
CN115086300A (zh) * 2022-06-16 2022-09-20 乐视云计算有限公司 一种视频文件调度方法和装置
CN115086300B (zh) * 2022-06-16 2023-09-08 乐视云网络技术(北京)有限公司 一种视频文件调度方法和装置

Also Published As

Publication number Publication date
CN110072122B (zh) 2022-03-08
CN110072122A (zh) 2019-07-30

Similar Documents

Publication Publication Date Title
WO2020211731A1 (zh) 一种视频播放方法及相关设备
US10764623B2 (en) Method and system for media adaption
US8695054B2 (en) Ingesting heterogeneous video content to provide a unified video provisioning service
US8887215B2 (en) Targeted high-value content in HTTP streaming video on demand
US9749136B2 (en) Method for watermarking content
US7921221B2 (en) Method and apparatus for obtaining digital objects in a communication network
WO2017063399A1 (zh) 一种视频播放方法和装置
US20140297881A1 (en) Downloading and adaptive streaming of multimedia content to a device with cache assist
US11356493B2 (en) Systems and methods for cloud storage direct streaming
KR20130009745A (ko) 인터넷 상에서 컨텐츠를 공개하기 위한 시스템 및 방법
CN102298947A (zh) 一种用于在多媒体播放器间进行播放切换的方法与设备
CN109587514B (zh) 一种视频播放方法、介质和相关装置
CN107517411B (zh) 一种基于GStreamer框架的视频播放方法
CN113329267B (zh) 一种视频播放方法、装置、终端设备及存储介质
JP2015531217A (ja) ストリーミングメディアのための状態情報を搬送すること
US20230412857A1 (en) Per-segment parameters for content
CN105992022A (zh) 一种在线录制下载方法及系统
CN112243158B (zh) 媒体文件处理方法、装置、计算机可读介质及电子设备
US10945028B2 (en) Reception apparatus, reception method, transmission apparatus, and transmission method for controlling termination of application
EP3092780B1 (en) Signaling and handling of forensic marking for adaptive streaming
CN109587517B (zh) 一种多媒体文件的播放方法及装置、服务器及存储介质
US20150026711A1 (en) Method and apparatus for video content distribution
KR20080004826A (ko) 구간정보를 이용한 멀티미디어 콘텐츠의 스트리밍 방법 및그 스트리밍 단말기
CN115460471A (zh) 视频播放方法、装置、电子设备和计算机可读介质
CN115756329A (zh) 一种数据处理方法及装置、存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20792211

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20792211

Country of ref document: EP

Kind code of ref document: A1