A video playback method and related equipment and storage medium
By generating content distribution network address information and using a streaming interface to access real-time video slice files directly, the method addresses slow first frame times in P2P video playback, improving speed and user experience.
Patent Information
- Application Number
- CN202110490911.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-06
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-05-06
AI Technical Summary
Existing video playback methods using P2P protocols experience slow first frame times due to multiple interactions between clients and servers, parsing table files, and the need to skip non-key frame data.
A method that generates content distribution network address information based on transmission information, allowing direct access to real-time video slice files through a uniform resource locator, bypassing API interfaces and reducing interactions, and utilizing a streaming interface for parallel data processing to obtain key frame data.
This approach significantly reduces the duration of the first frame time by minimizing server interactions and eliminating the need to download non-critical data, thereby enhancing video playback speed and user experience.
Smart Images

Figure CN115314758B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a video playback method and related equipment. Background Art
[0002] The existing technical solution obtains live streaming data from other user nodes through P2P. First, it needs to go through a series of P2P protocols to connect to the peer user, use the API interface to return data to obtain the content distribution network address information, and then obtain the live streaming data from the user for decoding and playback to display the picture. It requires multiple interactions between clients, interactions between clients and servers, and parsing table files and skipping non-key frame data before starting playback, resulting in a slow first frame time problem. Summary of the invention
[0003] The embodiment of the present invention provides a video playback method and related equipment, which avoids the problem of slow first frame time of video playback.
[0004] In a first aspect, an embodiment of the present invention provides a video playback method, which is used in a user terminal, including:
[0005] Obtaining video playback request information, wherein the video playback request information includes transmission information;
[0006] Generate content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to the server to which the video file requested by the video playback request information belongs;
[0007] Based on the content distribution network address information, the real-time video slice file in the video file is obtained from the server through a uniform resource locator.
[0008] Optionally, the real-time video slice file includes key frame data in the video data and serial number data of the real-time video slice file.
[0009] The method of obtaining the real-time video slice file in the video file from the server through a uniform resource locator based on the content distribution network address information specifically includes:
[0010] According to the video play request information, the server searches for the video to be played and replaces the table file of the video data with the real-time video slice file;
[0011] Based on the content distribution network address information, the real-time video slice file in the video file is obtained from the server through a uniform resource locator.
[0012] Optionally, the real-time video slice file is a file generated by splicing, and the real-time video slice file is generated by:
[0013] The above content distribution network address information, the request method and the channel ID uniquely mapped to the request resource are stitched together to generate the above real-time video slice file;
[0014] Among them, the request method is a method for obtaining the video, and the method for obtaining the video includes a method for obtaining the bit rate information of the video and a method for obtaining the basic information of the video. The channel ID uniquely mapped to the requested resource is calculated based on the bit rate information and the basic information.
[0015] Optionally, before the step of acquiring the real-time video slice file based on the content distribution network address information, the method further includes:
[0016] A mapping rule for the content distribution network address information is defined, wherein the mapping rule is to make the content distribution network address information correspond to the server address information one by one.
[0017] Optionally, the step of generating content distribution network address information according to the transmission information includes:
[0018] The content distribution network address information is generated according to the transmission information in a splicing manner, and the transmission information is the corresponding relationship information with the server.
[0019] Optionally, the step of generating content distribution network address information according to the transmission information in a splicing manner, wherein the transmission information is corresponding relationship information with the server, includes:
[0020] Get a specific address through get_chunk_pack_zero;
[0021] The specific address and the corresponding relationship information of the server are spliced to generate content distribution network address information.
[0022] Optionally, before the step of acquiring the real-time video slice file based on the content distribution network address information, the method further includes:
[0023] A streaming interface is called to connect to the server address information, wherein the streaming interface is a data interface capable of downloading and parsing the video slice file in parallel.
[0024] Optionally, the step of acquiring the real-time video slice file based on the content distribution network address information includes:
[0025] Get the current position information and end position information of the above video slice file;
[0026] The complete real-time video slice file is obtained according to the current position information and the end position information.
[0027] In a second aspect, an embodiment of the present application provides a video playback device, including:
[0028] A data acquisition module, used to obtain video playback request information, wherein the video playback request information includes transmission information;
[0029] A generating module, configured to generate content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to a server to which the video file requested by the video playback request information belongs;
[0030] The playing module is used to obtain the real-time video slice file in the video file from the server through the uniform resource locator based on the content distribution network address information.
[0031] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the above-mentioned memory and executable on the above-mentioned processor, wherein the above-mentioned processor is used to implement the steps of the above-mentioned video playback method when executing the computer program stored in the memory.
[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored: when the above-mentioned computer program is executed by a processor, the steps of the video playback method as described above are implemented.
[0033] The embodiments of the above invention have the following advantages or beneficial effects:
[0034] By obtaining video playback request information, wherein the video playback request information includes transmission information; no longer relying on the API interface to obtain data from the server, thereby reducing the interaction process between the client and the server, thereby reducing the duration of the first frame time; generating content distribution network address information based on the transmission information, wherein the content distribution network address information corresponds to the server to which the video file requested by the video playback request information belongs; generating content distribution network address information based on the transmission information, reducing the process of sending a network request from the client to the server, and reducing the duration of the first frame time of video playback; based on the content distribution network address information, obtaining the real-time video slice file in the video file from the server through the uniform resource locator. The uniform resource locator saves the time consumed by traditional P2P requests to access the server and table files, and automatically removes non-critical data in the key slices in the server, avoiding the download of invalid data, thereby improving the speed of first frame playback. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a flow chart of a video playback method provided by an embodiment of the present application;
[0036] Figure 2 is a structural schematic diagram of a video playback device provided in an embodiment of the present application;
[0037] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0038] Figure 4 It is a structural schematic diagram of a storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0040] Figure 1 This is a flow chart of a video playback method provided in an embodiment of the present application. The video playback method provided in this embodiment can be applied to P2P live broadcast scenarios. The method can be executed by a video playback device, which can be implemented by software and / or hardware, and is usually integrated in a terminal.
[0041] like Figure 1 As shown, an embodiment of the present invention provides a video playback method for a user terminal, which specifically includes the following steps:
[0042] S101, obtaining video play request information, wherein the video play request information includes transmission information;
[0043] Exemplarily, according to the above-mentioned video playback request information, parameters corresponding to the server are obtained, for example, parameter appid and parameter channel, which are used to identify the application type and live stream, wherein the above-mentioned parameter appid is the application software identification code, and the above-mentioned parameter channel is the data channel information. The above-mentioned parameter appid and parameter channel can be used directly, thereby ensuring that the content distribution network address information corresponding to the above-mentioned server side can be obtained without obtaining the data on the server side through the API interface.
[0044] S102, generating content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to a server to which the video file requested by the video playback request information belongs;
[0045] In a possible implementation manner, the step of generating content distribution network address information according to the transmission information includes:
[0046] The content distribution network address information is generated according to the transmission information in a splicing manner, and the transmission information is the corresponding relationship information with the server.
[0047] The content distribution network address information is generated according to the transmission information in a splicing manner. The content distribution network address information corresponding to the above server side can be obtained without obtaining the server side data through the API interface, which reduces the interaction between the client and the above server side once, thereby saving the duration of the first frame time.
[0048] In a possible implementation, the step of generating content distribution network address information according to the transmission information in a splicing manner, wherein the transmission information is corresponding relationship information with the server, includes:
[0049] Get a specific address through get_chunk_pack_zero;
[0050] Wherein, get_chunk_pack_zero represents a specific uniform resource locator, url, agreed in advance with the server, which does not need to be obtained. The corresponding relationship information of the above specific url and the server is spliced to generate content distribution network address information.
[0051] For each live video content distribution network address information, recorded as: CDN address, a single mapping rule is defined. The above CDN address can be mapped to a unique server-side real-time video slice address, which is equivalent to the above server address information. The above server address information contains parameters that uniquely identify this live stream to ensure the speed of video playback and avoid disordered video sharing and errors.
[0052] Exemplarily, the step of generating content distribution network address information according to the transmission information includes:
[0053] The content distribution network address information is generated according to the transmission information in a splicing manner. The transmission information is the corresponding relationship information with the server, including application number data and data transmission channel information. The splicing manner is specifically spliced in the following manner:
[0054] `get_chunk_pack_zero / ${this.options.channel}-${this.options.appid}-123456-0 / ${this.options.appid}-123456-0-0
[0055] Among them, ` is a code symbol for front-end splicing, which can be converted into a more understandable pseudocode form, channel is the above-mentioned data transmission channel information, appid is the above-mentioned application number data, and the above-mentioned specific uniform resource locator get_chunk_pack_zero agreed in advance with the server is spliced with the above-mentioned channel and the above-mentioned appid, and the splicing order cannot be changed. A fixed splicing mode is adopted, thereby avoiding the disorder of the above-mentioned content distribution network address information interacting with the server due to disordered order, and generating a specific address string, so that the generated above-mentioned content distribution network address information can interact with the server accordingly, so that the content distribution network address information can obtain data from the above-mentioned server, and the content distribution network address information can obtain real-time video slice data, so that the role played by the content distribution network address information not generated through the API interface is the same as that of the content distribution network address information generated through the API interface.
[0056] In one possible implementation, when the content distribution network address information is generated according to the above-mentioned transmission information in a splicing manner, the splicing order is not fixed, and the distribution content needs to be identified one by one during distribution, which increases unnecessary calculation amount and easily causes confusion in the distribution network address information, thereby causing errors in the distribution process.
[0057] By adopting a fixed splicing method, the content distribution network address information corresponding to the above server is generated based on the parameters appid and channel, avoiding the use of API interface to obtain content distribution network address information, thereby reducing the interaction process between the client and the server, thereby reducing the duration of the first frame time.
[0058] In a possible implementation manner, before the step of acquiring the real-time video slice file based on the content distribution network address information, the method further includes:
[0059] A streaming interface is called to connect to the server address information, wherein the streaming interface is a data interface capable of downloading and parsing the video slice file in parallel.
[0060] Exemplarily, a streaming interface is used to access the content distribution network address information, wherein the streaming interface can realize the process of downloading and parsing, while the ordinary interface needs to complete the download before parsing, and thus the streaming interface can obtain data faster, thereby further improving the playback speed of the first frame.
[0061] Specifically, different methods are called according to different browsers, and settings are made based on the characteristics of specific browsers. The above streaming interface uses the Fetch API data type in the Chrome browser; and uses the XHR data type in the Firefox browser. The object type of XHR is set, that is, responseType = "moz-chunked-arraybuffer" to implement the process of calling the above streaming interface.
[0062] In a possible implementation manner, before the step of acquiring the real-time video slice file based on the content distribution network address information, the method further includes:
[0063] The mapping rules of the content distribution network address information are defined, wherein the mapping rules are used to make the content distribution network address information correspond to the server address information one by one. By generating the content distribution network address information according to the transmission information, the process of sending a network request from the client to the server is reduced, thereby reducing the duration of the first frame time of the video playback. By defining the mapping rules of the content distribution network address information, it is also ensured that after reducing the process of sending a network request from the client to the server, the content can still be transmitted completely and without error.
[0064] S103: Based on the content distribution network address information, obtain the real-time video slice file in the video file from the server through a uniform resource locator.
[0065] In a possible implementation manner, the real-time video slice file includes key frame data in the video data and serial number data of the real-time video slice file.
[0066] The method of obtaining the real-time video slice file in the video file from the server through a uniform resource locator based on the content distribution network address information specifically includes:
[0067] According to the video play request information, the server searches for the video to be played and replaces the table file of the video data with the real-time video slice file;
[0068] Based on the content distribution network address information, the real-time video slice file in the video file is obtained from the server through a uniform resource locator.
[0069] The table file on the server side records the serial numbers of the latest batch of real-time video slice files, and records the key frame video slice files containing video key frames and the starting offset position of the key frame data in each key frame slice file, thereby avoiding the disadvantage that P2P needs to first access the server side and the table file to obtain the key slice download path, reducing the two front-end and back-end interactions, thereby speeding up the playback speed of the above-mentioned real-time video slices and reducing the duration of the first frame time.
[0070] In a possible implementation manner, the real-time video slice file is a file generated by splicing, and the real-time video slice file is generated by:
[0071] The above content distribution network address information, the request method and the channel ID uniquely mapped to the request resource are stitched together to generate the above real-time video slice file;
[0072] Among them, the request method is a method for obtaining the video, and the method for obtaining the video includes a method for obtaining the bit rate information of the video and a method for obtaining the basic information of the video. The channel ID uniquely mapped to the requested resource is calculated based on the bit rate information and the basic information.
[0073] The above-mentioned real-time video slice file is provided with a fixed uniform resource locator URL, and the client P2PSDK can splice the above-mentioned URL without interacting with the server.
[0074] When requesting the above-mentioned real-time video slice files, the server will automatically search for the latest batch of slice files, find the slice file where the key frame is located, remove the non-key frame data in the slice file header, and return it to the P2P SDK. At the same time, it returns the latest slice file number in the Http-Header so that the P2P SDK can download the subsequent slice files of the key slice instead of the table file.
[0075] In a possible implementation, the step of acquiring the real-time video slice file based on the content distribution network address information includes:
[0076] Get the current position information and end position information of the above video slice file;
[0077] The complete real-time video slice file is obtained according to the current position information and the end position information.
[0078] Key table file information is added to the HTTP response header of the above real-time video slice file, replacing the function of downloading the first table file, avoiding the problem of wasting time downloading unnecessary data and reducing resource usage.
[0079] Before P2P is started, a CDN start-up process is innovatively inserted to allow users to quickly see the picture. At the same time, a special CDN address is obtained through splicing to achieve further improvement. The streaming interface is used to pull the address to further improve the first frame. The streaming interface itself adopts different APIs according to different browsers. The header information returned by the URL carries special parameters to locate the current download and the location to be downloaded later, so that it can be seamlessly aligned with P2P.
[0080] Specifically, some additional parameters will be returned in the returned Header, including the "this-pack" and "cur-pack" parameters, which are used to locate the current start and end positions. Subsequent downloads will be continued according to the "this-pack" and "cur-pack" parameters until the "cur-pack" is downloaded.
[0081] After the download of the above-mentioned real-time video slice files is complete, P2P is started, and connections with other clients are established to share and download data. At this time, since enough data has been downloaded from the CDN for playback, the slower P2P process will not affect the playback, thus ensuring the user's viewing experience. Since the current downloaded location has been located before, after P2P is started, P2P processing can continue after the current location, thereby achieving seamless startup, reducing the time required for P2P startup, making video playback smoother, and improving user experience.
[0082] Exemplarily, the slice data of the key frame slice file from the beginning to the end of the key frame data is returned, and the correct slice number of the above-mentioned real-time video slice file and the current latest slice number are returned; after P2PSDK receives the response of the above-mentioned real-time slice data, it performs key frame data and audio and video decoding of the video, and can directly start playing and displaying the first frame.
[0083] It avoids the time-consuming access to the system and table files required by traditional P2P, and can achieve the same return of video data in a single access as P2P and CDN, effectively reducing the access time. It avoids the download of invalid data by automatically removing non-key frame data in the header of key slices on the server side, effectively improving the speed of rendering the first frame of the player.
[0084] The technical solution of this embodiment is to obtain video playback request information, wherein the video playback request information includes transmission information; no longer rely on the API interface to obtain data on the server side, thereby reducing the interaction process between the client and the server, thereby reducing the duration of the first frame time; generate content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to the server to which the video file requested by the video playback request information belongs; generate content distribution network address information according to the transmission information, reduce the process of sending a network request from the client to the server, and reduce the duration of the first frame time of video playback; obtain the real-time video slice file in the video file from the server through the uniform resource locator based on the content distribution network address information. The uniform resource locator saves the time consumed by traditional P2P requests to access the server and table files, and automatically removes non-critical data in the key slices in the server, avoiding the download of invalid data, thereby improving the speed of first frame playback.
[0085] The following is an embodiment of a video playback device provided by an embodiment of the present invention. The device and the video playback methods of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the video playback device, reference can be made to the embodiment of the above text processing method.
[0086] In one possible real-time approach, Figure 2 As shown, an embodiment of the present application provides a video playback device, including:
[0087] The data acquisition module 201 is used to obtain video playback request information, wherein the video playback request information includes transmission information;
[0088] A generating module 202, configured to generate content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to a server to which the video file requested by the video playback request information belongs;
[0089] The playing module 203 is used to obtain the real-time video slice file in the video file from the server through the uniform resource locator based on the content distribution network address information.
[0090] The process of the server processing the real-time video slice file is as follows:
[0091] The latest batch of slice file serial numbers are recorded in the table file in the server, and which slice files contain video key frames, and the key frame data in each key frame slice file is at the starting offset position of the slice file; for each video live CDN address, a single mapping rule is defined, and the CDN address can be mapped to a unique P2P backend real-time video slice Zero-Package address, which contains parameters that uniquely identify this live stream; when the P2P SDK requests the above Zero-Package address, the server side finds the table file corresponding to this live stream after receiving the Zero-Package request; the server side searches for the slice file where the key frame is located and the starting offset address of the key frame data in the slice file in the found table file; the server side returns the slice data of the key frame slice from the beginning to the end of the key frame data, and also returns the correct slice number of the Zero-Package and the latest slice number.
[0092] By processing the above video slice files on the server side, the disadvantage that the P2P SDK needs to access the access system and table files before obtaining the key slice download path is avoided, reducing the two front-end and back-end interactions. By adding key table file information to the Http response header of Zero-Package, the function of downloading the first table file is replaced. By automatically removing non-key frame data in the key slice header on the P2P backend, the amount of data downloaded is reduced, and the key frame data is accelerated to reach the player in advance, further accelerating the time consumption of the first frame. The Zero-Package function can be seamlessly combined with the traditional table file-based slice file update. When the Zero-Package request fails, it can switch to the table file and try again, ensuring the success rate of video playback.
[0093] By obtaining video playback request information, wherein the video playback request information includes transmission information; no longer relying on the API interface to obtain data from the server, thereby reducing the interaction process between the client and the server, thereby reducing the duration of the first frame time; generating content distribution network address information based on the transmission information, wherein the content distribution network address information corresponds to the server to which the video file requested by the video playback request information belongs; generating content distribution network address information based on the transmission information, reducing the process of sending a network request from the client to the server, and reducing the duration of the first frame time of video playback; based on the content distribution network address information, obtaining the real-time video slice file in the video file from the server through the uniform resource locator. The uniform resource locator saves the time consumed by traditional P2P requests to access the server and table files, and automatically removes non-critical data in the key slices in the server, avoiding the download of invalid data, thereby improving the speed of first frame playback.
[0094] In one possible real-time approach, Figure 3 As shown, an embodiment of the present application provides an electronic device, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320. When the processor 320 executes the computer program 311, it implements: obtaining video playback request information, wherein the video playback request information includes transmission information; generating content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to a server to which the video file requested by the video playback request information belongs; and obtaining a real-time video slice file in the video file from the server through a uniform resource locator based on the content distribution network address information.
[0095] The process of the server processing the real-time video slice file is as follows:
[0096] The latest batch of slice file serial numbers are recorded in the table file in the server, and which slice files contain video key frames, and the key frame data in each key frame slice file is at the starting offset position of the slice file; for each video live CDN address, a single mapping rule is defined, and the CDN address can be mapped to a unique P2P backend real-time video slice Zero-Package address, which contains parameters that uniquely identify this live stream; when the P2P SDK requests the above Zero-Package address, the server side finds the table file corresponding to this live stream after receiving the Zero-Package request; the server side searches for the slice file where the key frame is located and the starting offset address of the key frame data in the slice file in the found table file; the server side returns the slice data of the key frame slice from the beginning to the end of the key frame data, and also returns the correct slice number of the Zero-Package and the latest slice number.
[0097] By processing the above video slice files on the server side, the disadvantage that the P2P SDK needs to access the access system and table files before obtaining the key slice download path is avoided, reducing the two front-end and back-end interactions. By adding key table file information to the Http response header of Zero-Package, the function of downloading the first table file is replaced. By automatically removing non-key frame data in the key slice header on the P2P backend, the amount of data downloaded is reduced, and the key frame data is accelerated to reach the player in advance, further accelerating the time consumption of the first frame. The Zero-Package function can be seamlessly combined with the traditional table file-based slice file update. When the Zero-Package request fails, it can switch to the table file and try again, ensuring the success rate of video playback.
[0098] By obtaining video playback request information, wherein the video playback request information includes transmission information; no longer relying on the API interface to obtain data from the server, thereby reducing the interaction process between the client and the server, thereby reducing the duration of the first frame time; generating content distribution network address information based on the transmission information, wherein the content distribution network address information corresponds to the server to which the video file requested by the video playback request information belongs; generating content distribution network address information based on the transmission information, reducing the process of sending a network request from the client to the server, and reducing the duration of the first frame time of video playback; based on the content distribution network address information, obtaining the real-time video slice file in the video file from the server through the uniform resource locator. The uniform resource locator saves the time consumed by traditional P2P requests to access the server and table files, and automatically removes non-critical data in the key slices in the server, avoiding the download of invalid data, thereby improving the speed of first frame playback.
[0099] In a possible real-time method, an embodiment of the present application provides a computer-readable storage medium 400, on which a computer program 411 is stored, and when the computer program 411 is executed by a processor, it implements: obtaining video playback request information, wherein the above-mentioned video playback request information includes transmission information; generating content distribution network address information according to the above-mentioned transmission information, wherein the above-mentioned content distribution network address information corresponds to the server to which the video file requested by the above-mentioned video playback request information belongs; based on the above-mentioned content distribution network address information, obtaining the real-time video slice file in the above-mentioned video file from the above-mentioned server through a uniform resource locator.
[0100] The process of the server processing the real-time video slice file is as follows:
[0101] The latest batch of slice file serial numbers are recorded in the table file in the server, and which slice files contain video key frames, and the key frame data in each key frame slice file is at the starting offset position of the slice file; for each video live CDN address, a single mapping rule is defined, and the CDN address can be mapped to a unique P2P backend real-time video slice Zero-Package address, which contains parameters that uniquely identify this live stream; when the P2P SDK requests the above Zero-Package address, the server side finds the table file corresponding to this live stream after receiving the Zero-Package request; the server side searches for the slice file where the key frame is located and the starting offset address of the key frame data in the slice file in the found table file; the server side returns the slice data of the key frame slice from the beginning to the end of the key frame data, and also returns the correct slice number of the Zero-Package and the latest slice number.
[0102] By processing the above video slice files on the server side, the disadvantage that the P2P SDK needs to access the access system and table files before obtaining the key slice download path is avoided, reducing the two front-end and back-end interactions. By adding key table file information to the Http response header of Zero-Package, the function of downloading the first table file is replaced. By automatically removing non-key frame data in the key slice header on the P2P backend, the amount of data downloaded is reduced, and the key frame data is accelerated to reach the player in advance, further accelerating the time consumption of the first frame. The Zero-Package function can be seamlessly combined with the traditional table file-based slice file update. When the Zero-Package request fails, it can switch to the table file and try again, ensuring the success rate of video playback.
[0103] By obtaining video playback request information, wherein the video playback request information includes transmission information; no longer relying on the API interface to obtain data from the server, thereby reducing the interaction process between the client and the server, thereby reducing the duration of the first frame time; generating content distribution network address information based on the transmission information, wherein the content distribution network address information corresponds to the server to which the video file requested by the video playback request information belongs; generating content distribution network address information based on the transmission information, reducing the process of sending a network request from the client to the server, and reducing the duration of the first frame time of video playback; based on the content distribution network address information, obtaining the real-time video slice file in the video file from the server through the uniform resource locator. The uniform resource locator saves the time consumed by traditional P2P requests to access the server and table files, and automatically removes non-critical data in the key slices in the server, avoiding the download of invalid data, thereby improving the speed of first frame playback.
[0104] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0105] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0106] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0107] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0108] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0109] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described above, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A video playback method, used in a user terminal, characterized in that: include: Obtaining video playback request information, wherein the video playback request information includes transmission information; Generate content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to a server to which the video file requested by the video playback request information belongs; Based on the content distribution network address information, obtain the real-time video slice file in the video file from the server through a uniform resource locator; Generate content distribution network address information according to the transmission information in a splicing manner, wherein the transmission information is the corresponding relationship information of the server, including: application number data and data transmission channel information; The step of generating content distribution network address information according to the transmission information in a splicing manner, wherein the transmission information is the corresponding relationship information with the server, comprises: Obtain a specific address through get_chunk_pack_zero, wherein get_chunk_pack_zero is used to represent a specific uniform resource locator agreed in advance with the server, and the specific address is a url address; The specific address and the corresponding relationship information of the server are spliced to generate content distribution network address information, wherein the step of splicing the specific address and the corresponding relationship information of the server is: The specific address is first concatenated with the data transmission channel information and then concatenated with the application number data.
2. The video playback method according to claim 1, characterized in that: Before the step of acquiring the real-time video slice file based on the content distribution network address information, the method further includes: A mapping rule for the content distribution network address information is defined, wherein the mapping rule is to make the content distribution network address information correspond to the server address information one by one.
3. The video playback method according to claim 1, characterized in that: The step of acquiring the real-time video slice file based on the content distribution network address information includes: Obtaining the current position information and the end position information of the video slice file; The complete real-time video slice file is obtained according to the current position information and the end position information.
4. A video playback device, characterized in that: include: A data acquisition module, used to obtain video play request information, wherein the video play request information includes transmission information; A generating module, configured to generate content distribution network address information according to the transmission information, wherein the content distribution network address information corresponds to a server to which the video file requested by the video playback request information belongs; A playing module, configured to obtain a real-time video slice file in the video file from the server through a uniform resource locator based on the content distribution network address information; Generate content distribution network address information according to the transmission information in a splicing manner, wherein the transmission information is the corresponding relationship information of the server, including: application number data and data transmission channel information; The step of generating content distribution network address information according to the transmission information in a splicing manner, wherein the transmission information is the corresponding relationship information with the server, comprises: Obtain a specific address through get_chunk_pack_zero, wherein get_chunk_pack_zero is used to represent a specific uniform resource locator agreed in advance with the server, and the specific address is a url address; The specific address and the corresponding relationship information of the server are spliced to generate content distribution network address information, wherein the step of splicing the specific address and the corresponding relationship information of the server is: The specific address is first concatenated with the data transmission channel information and then concatenated with the application number data.
5. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is used to implement the video playback method according to any one of claims 1 to 3 when executing the computer program stored in the memory.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the video playback method according to any one of claims 1 to 3 is implemented.
