Video playing method and system
By sending a domain name request to the domain name server to obtain the media server address and video parameters, the problem of slow broadcasting speed in the prior art is solved, and the effect of reducing delay and error probability is achieved and improving user experience is achieved.
Patent Information
- Application Number
- CN202510346228.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-24
AI Technical Summary
Among the existing video playback technologies, the starting speed is slow, resulting in high delay and error probability, affecting the user experience.
By sending a domain name request to the domain name server, receiving the media server address list and preset video parameters in the analysis result, establishing a connection and obtaining the target video data, and playing the video according to the video parameters.
Reduces latency and error probability, improves response speed, and improves user viewing experience.
Smart Images

Figure CN120201252A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video playback technology, and in particular to a video playback method and system. Background Art
[0002] In today's booming digital information age, video has become a vital medium for information dissemination. Compared with pictures and text, video has a stronger information carrying capacity, which can display various products and services in front of the public in a more intuitive and accurate way. With the continued rapid development of video services, the start speed has become a decisive factor affecting user experience, and it is also a core indicator that focuses on the field of video playback. In the existing technology, before the video screen is displayed, the player needs to go through multiple links such as streaming, detection, demultiplexing, reading data, decoding and rendering. These links lead to complex interactions, multiple requests and corresponding interactions, and also involve detection. Multiple network requests increase the delay and error probability, reduce the response speed, and affect the user's viewing experience. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a video playback method and system, which can reduce delay and error probability, increase response speed, and enhance user viewing experience.
[0004] In a first aspect, an embodiment of the present invention provides a video playback method, the method comprising:
[0005] Send a domain name request to the domain name server;
[0006] Receiving a parsing result sent by the domain name server, the parsing result including an address list of a media server and a preset first video parameter, the preset first video parameter including an encapsulation format, a decoding format, and a pixel format;
[0007] Establishing a connection with the media server according to the address list;
[0008] Obtain target video data to be played from the media server;
[0009] The target video is played according to the target video data and the first video parameters.
[0010] In some embodiments, sending a domain name request to a domain name server includes:
[0011] Query historical domain name resolution results in the local cache;
[0012] In response to the historical domain name resolution result being a valid resolution result, determining the address list according to the valid resolution result;
[0013] In response to the historical domain name resolution result being an invalid resolution result, send a domain name request to the domain name server to re-obtain the address list.
[0014] In some embodiments, the obtaining the target video data to be played from the media server includes:
[0015] Send a video stream acquisition request to the media server;
[0016] Receive the video stream response returned by the media server, where the video stream response includes the target video data to be played.
[0017] In some embodiments, the playing the target video according to the target video data and the preset first video parameters includes:
[0018] Parse the first video parameters to obtain the encapsulation format, decoding format, and pixel format;
[0019] Separate the video stream and audio stream from the target video data according to the encapsulation format;
[0020] Read data blocks from the separated video stream and audio stream;
[0021] Decode the data blocks according to the decoding format to obtain the original image frames and sound samples;
[0022] Render and play the target video according to the original image frames, sound samples, and the pixel format.
[0023] In some embodiments, the playing the target video according to the target video data and the preset first video parameters includes:
[0024] Send a data verification request to the media server;
[0025] Obtain verification data from the media server;
[0026] Perform matching verification on the first video parameters according to the verification data.
[0027] In some embodiments, the separating the video stream and audio stream from the target video data according to the encapsulation format includes:
[0028] Determine the corresponding demultiplexing tool according to the encapsulation format;
[0029] Decompose the target video data into a video stream and an audio stream through the demultiplexing tool.
[0030] In some embodiments, the reading the video data frames from the media server includes:
[0031] Send a read request to the media server, where the read request includes the progress of the currently playing video;
[0032] Obtain corresponding video request data from the media server;
[0033] Read video data frames from the video request data.
[0034] In some embodiments, the method further includes:
[0035] Cache the played video stream data to the local cache area;
[0036] Generate a video mapping table according to the played video stream data, where the video mapping table is used to store the mapping relationship between the played video stream data and the time stamps corresponding to each segment of video stream data;
[0037] In response to replaying the played video stream data, determine the start playing time point of the played video stream data according to the video mapping table.
[0038] In some embodiments, the method further includes:
[0039] Send a play request to the media server so that the media server predicts the next video to be played according to the service characteristics and user behavior characteristics;
[0040] Obtain the second video parameters corresponding to the to-be-played video, where the second video parameters include the encapsulation format, decoding format, and pixel format of the to-be-played video.
[0041] In a second aspect, an embodiment of the present invention provides a video playing system, where the system includes:
[0042] A domain name server, configured to send a resolution result according to a domain name request to the player;
[0043] A media server, configured to establish a connection with the player and send target video data to the player;
[0044] A player, configured to send a domain name request to the domain name server, obtain the resolution result sent by the domain name server, where the resolution result includes a list of addresses of the media server and preset first video parameters, the preset first video parameters include an encapsulation format, a decoding format, and a pixel format, establish a connection with the media server according to the address list, obtain the target video data to be played from the media server, and play the target video according to the target video data and the first video parameters.
[0045] The technical solution of the embodiment of the present invention sends a domain name request to a domain name server, receives the parsing result sent by the domain name server, the parsing result includes an address list of a media server and preset first video parameters, the preset first video parameters include an encapsulation format, a decoding format, and a pixel format, establishes a connection with the media server according to the address list, obtains target video data to be played from the media server, and plays the target video according to the target video data and the first video parameters. Thus, by presetting video parameters in advance, the latency and error probability can be reduced, the response speed can be improved, and the user's viewing experience can be enhanced. Description of the Drawings
[0046] Through the following description of the embodiments of the present invention with reference to the drawings, the above and other objects, features, and advantages of the present invention will become clearer. In the drawings:
[0047] Figure 1 is a schematic diagram of a video playback system according to an embodiment of the present invention;
[0048] Figure 2 is an information interaction diagram of a video playback system according to an embodiment of the present invention for obtaining target video data;
[0049] Figure 3 is an information interaction diagram of a video playback system according to an embodiment of the present invention for playing a target video;
[0050] Figure 4 is a flowchart of a video playback method according to an embodiment of the present invention;
[0051] Figure 5 is a schematic diagram of a video playback device according to an embodiment of the present invention;
[0052] Figure 6 is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Embodiments
[0053] The following is a description of the present application based on embodiments, but the present application is not limited to these embodiments. In the following detailed description of the present application, some specific details are described in detail. Those skilled in the art can fully understand the present application without the description of these details. To avoid obscuring the essence of the present application, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0054] In addition, those of ordinary skill in the art should understand that the drawings provided herein are for illustrative purposes only, and the drawings are not necessarily drawn to scale.
[0055] Unless the context clearly requires otherwise, words such as "including" and "comprising" in the entire application document shall be construed in an inclusive sense rather than an exclusive or exhaustive sense; that is, in the sense of "including but not limited to".
[0056] In the description of this application, it should be understood that terms such as "first", "second", etc. are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "a plurality of" is two or more than two.
[0057] With the continuous development of network technology, online video playback has become an indispensable part of people's daily lives. When a user starts a player, the player first needs to send the domain name of the video media server to the domain name server to obtain a list of addresses of the media server. Subsequently, the player establishes a connection with the media server based on this address list and sends a request to obtain video data, and the media server responds to the request. Then, the player performs a probing operation and sends a request to obtain information related to the video stream. After that, a demultiplexing operation is also required to separate the composite media stream into different tracks such as audio and video. After the demultiplexing is completed, the player continuously sends requests to the media server to read data, and the media server responds after each read. After a data frame is read, the player also needs to perform decoding processing on the data frame to convert the encoded video data into a displayable image format, and finally presents the video picture on the player interface through a rendering operation. The whole process has many links, not only involving multiple network interactions, increasing the transmission delay and the risk of errors, but also posing relatively high requirements on the processing ability of the player, resulting in a slow startup speed of video playback and affecting the user experience. In addition, the complex process also leads to an increase in development difficulty, and compatibility problems between different components are more likely to occur, restricting the further development and application of video playback technology.
[0058] Figure 1 It is a schematic diagram of the video playback system according to an embodiment of the present invention. In Figure 1 In the shown embodiment, the video playback system includes a video playback terminal 11, a domain name server 12, a media server 13, and a network 14. The video playback terminal 11 obtains the address and video parameters of the media server 13 from the domain name server 12 through the network 14, and establishes a connection with the media server 13 through the network 14 and performs data interaction to achieve video playback.
[0059] Among them, the video playback terminal 11 includes a player, and the player is a software module or component for implementing functions such as video playback, preloading, and continuous playback. Before the player sends a domain name request to the domain name server 12, it will first query the historical domain name resolution results in the local cache. If there is a valid resolution result for this domain name in the cache, the player can directly determine the media server 13 address list based on this result without sending a request to the domain name server 12 again, thus improving the efficiency of obtaining address information and reducing the network interaction overhead; if the resolution result in the cache is invalid for this domain name, the player will then send a domain name request to the domain name server 12 to re-obtain the address list.
[0060] In the connection establishment stage, the player establishes a connection with the media server 13 according to the media server 13 address list obtained from the domain name server 12, laying a foundation for subsequent data transmission.
[0061] In the data acquisition stage, the player sends a video stream acquisition request to the media server and receives a video stream response containing the target video data returned by the media server 13. It will also send a read request including the current video playback progress to the media server 13, obtain the corresponding video request data from the media server 13, and read video data frames from the video track.
[0062] In the video playback processing stage, the player will parse the first video parameters obtained from the domain name server 12 to obtain information such as the encapsulation format, decoding format, and pixel format. Determine the corresponding demultiplexing tool according to the encapsulation format, and decompose the target video data into a video stream and an audio stream. Read data blocks from the separated video stream and audio stream, decode the data blocks according to the decoding format, and obtain the original image frames and sound samples. Render and play the target video according to the original image frames, sound samples, and pixel format. At the same time, it will also send a data verification request to the media server 13 to obtain verification data and perform matching verification on the first video parameters to ensure the accuracy of video playback. In addition, the player caches the played video stream data in the local cache area, generates a video mapping table according to the played video stream data, and stores the mapping relationship between the played video stream data and the time stamps corresponding to each segment of the video stream data. When re-playing the played video stream data, determine the start playback time point according to the video mapping table. The player will also send a playback request to the media server 13, enabling the media server 13 to predict the next video to be played and obtain the second video parameters corresponding to the video to be played, preparing for subsequent playback of the video to be played.
[0063] The domain name server 12, namely the DNS (Domain Name System) server, is a crucial component in the Internet infrastructure. It is mainly responsible for converting the domain names that are easy for people to remember into IP (Internet Protocol) addresses that can be recognized and used by computer networks. When the player needs to obtain media resources, it needs to first send a domain name request to the domain name server 12. The domain name request is like the player asking the domain name server 12: "What is the IP address corresponding to the media server where the video I want to play is located?" After receiving the domain name request sent by the player, the domain name server 12 will perform a search operation in its database. The database may store the mapping relationship between domain names and IP addresses. The domain name server 12 accurately locates the address list of the media server 13 corresponding to the received domain name in the database. The domain name server 12 returns the found address list of the media server 13 to the player. Thus, the player can establish a TCP (Transmission Control Protocol) connection with the media server 13 and obtain media data such as videos from the media server 13 to achieve subsequent playback and other functions. At the same time, when the domain name server 12 sends the address list of the media server to the player, the domain name server 12 will also send the preset first video parameters to the player. The first video parameters include the encapsulation format, decoding format, and pixel format.
[0064] The media server 13 is a server specifically used for storing, managing, and distributing multimedia content such as audio and video. After the player establishes a TCP connection with the media server 13, the player can send a video stream acquisition request to the media server 13. The media server 13 returns a video stream response containing the target video data to be played, providing the original video data source for the player. When the player sends a read request including the current playback progress of the video, the media server 13 obtains the corresponding video request data and provides it to the player, enabling the player to read video data frames as needed. When the player sends a data verification request to the media server 13, the media server 13 provides verification data for matching and verifying the preset first video parameters. At the same time, after receiving the play request sent by the player, the media server 13 predicts the next video to be played based on the service characteristics and user behavior characteristics and provides the second video parameters corresponding to the video to be played to the player, including the encapsulation format, decoding format, pixel format, etc.
[0065] Among them, the domain name server 12 and the media server 13 can be separate servers or a server cluster composed of multiple servers.
[0066] The network 14 can be implemented through a wired or wireless network to ensure that the video playback terminal 11 can effectively obtain the address and video parameters of the media server 13 from the domain name server 12 and establish a connection with the media server 13 for data interaction.
[0067] In an embodiment of the present invention, a domain name request is sent to a domain name server, and a resolution result sent by the domain name server is received. The resolution result includes a list of addresses of media servers and preset first video parameters. The preset first video parameters include an encapsulation format, a decoding format, and a pixel format. A connection is established with the media server according to the address list, target video data to be played is obtained from the media server, and the target video is played according to the target video data and the first video parameters. Thus, by presetting video parameters in advance, the delay and error probability can be reduced, the response speed can be increased, and the user's viewing experience can be improved.
[0068] Figure 2 It is an information interaction diagram of a video playback system in an embodiment of the present invention for obtaining target video data. Figure 2 It shows a flowchart of information interaction in which a player establishes a connection with a media server through a domain name server and obtains target video data, specifically including the following steps:
[0069] Step S101, query the historical domain name resolution result.
[0070] Specifically, when a player needs to access a new video resource, it can query whether there is a domain name resolution result for this domain name stored in the local cache.
[0071] Step S102, determine whether the historical resolution result is valid.
[0072] Specifically, for the domain name resolution result existing in the local cache, the player needs to verify its validity, that is, check whether the caching time of the domain name resolution result on the domain name server has expired, or check whether there is a historical domain name resolution result corresponding to this domain name in the local cache. If the caching time of the domain name resolution result on the domain name server has not expired, or there is a historical domain name resolution result corresponding to this domain name in the local cache, then step S103 is executed; if the caching time of the domain name resolution result on the domain name server has expired, or there is no historical domain name resolution result corresponding to this domain name in the local cache, then step S104 is executed.
[0073] Step S103, determine the address list according to the valid resolution result.
[0074] Specifically, if the player checks that the caching time of the domain name resolution result on the domain name server has not expired, or checks that there is a historical domain name resolution result corresponding to this domain name in the local cache, it is considered that the domain name resolution result is still valid, and the address list corresponding to the domain name can be directly used to determine the media server address list, without sending a new domain name request to the domain name server.
[0075] Step S104: Send a domain name request.
[0076] Specifically, if the player checks that the caching time of the domain name resolution result on the domain name server has expired, or checks that no valid domain name resolution result is found in the local cache, it is considered that the domain name resolution result is invalid, and the player needs to send a new domain name request to the domain name server.
[0077] Step S105: Resolve the domain name request to determine the address list.
[0078] Specifically, after receiving the domain name request sent by the player, the domain name server will check and parse the data packet to ensure that the request format is correct and contains valid domain name information. After the check is correct, the domain name server starts to prepare for domain name resolution. The domain name server will first look for whether there is a resolution record of this domain name in its local cache. If a corresponding record is found in the cache and the record has not expired, then the domain name server will directly obtain the media server address list from the cache. This address list may contain the IP addresses of one or more media servers. If no valid resolution record is found in the local cache, the domain name server will start a recursive query. It will send a request to the root domain name server to inquire about the address of the top-level domain name server for this domain name. The root domain name server will return the information of the corresponding top-level domain name server. After the domain name server obtains the media server address list, it will encapsulate this address list and information such as preset video parameters that may be included into a domain name resolution result data packet, so that the player can obtain the accurate media server address.
[0079] Step S106: Send the address list and preset first video parameters.
[0080] Specifically, the domain name service sends the domain name resolution result data packet back to the player, enabling the player to obtain the accurate media server address, and then establish a connection with the media server to obtain the target video data. At the same time, the domain name server will also send the preset first video parameters including the encapsulation format, decoding format, and pixel format to the player, so that the player can save time and improve work efficiency during the detection, demultiplexing, and decoding and rendering stages.
[0081] Step S107: Establish a connection.
[0082] Specifically, the player extracts the address list of the media server from the resolution result returned by the domain name server, and sets connection parameters such as the target address and port number of the socket according to the selected media server address. The player can initiate a connection request to the media server through the socket and establish a connection with the media server.
[0083] Step S108: Send a video stream acquisition request.
[0084] Specifically, after the player and the media server establish a connection, the player sends a video stream acquisition request to the media server. The video stream acquisition request includes identification information of the target video file, as well as information such as the transmission protocol and encoding format supported by the player.
[0085] Step S109: Send the target video data.
[0086] Specifically, the media server parses the video stream acquisition request sent by the player to determine the target video data and the required transmission protocol and encoding format, encapsulates the processed target video data into data packets according to the selected transmission protocol and format, and sends them to the player through the network.
[0087] Step S110: Play the target video.
[0088] Specifically, the specific implementation manner of step S110 is consistent with Figure 3 the method described in
[0089] The process of the player in the embodiment of the present invention establishing a connection with the media server and obtaining the target video data with the help of the domain name server, that is, when the player accesses a new video resource, it first checks the historical domain name resolution result cached locally and judges its validity. If it is valid, it directly determines the address list. If it is invalid, it sends a new request to the domain name server. After receiving the request, the domain name server first checks its local cache. If there is no record, it recursively queries, and then encapsulates the address list and the preset first video parameters into data packets and sends them to the player. Then the player selects the address list to establish a connection with the server, sends a video stream acquisition request containing information such as the target video identifier, and after the media server parses the request, it encapsulates and sends the target video data as required. The player can reduce domain name requests, save time and network resources, improve the efficiency of obtaining addresses, and the preset parameters of the domain name server can help the player improve efficiency in subsequent stages. The entire process link is closely coordinated, ensuring the accurate and efficient acquisition of video data and bringing a smooth playback experience to users.
[0090] Figure 3 It is an information interaction diagram of the video playback system in the embodiment of the present invention for playing the target video. Figure 3The flowchart of information interaction for the player to read data blocks from the media server and play the target video according to the first video parameter is shown, specifically including the following steps:
[0091] Step S201: Send a data verification request.
[0092] Specifically, after the player establishes a connection with the media server and obtains the first video parameter provided by the domain name server, to ensure the accuracy of the first video parameter, a data verification request will be constructed and sent to the media server.
[0093] Step S202: Send verification data.
[0094] Specifically, after the media server receives and parses the data verification request sent by the player, it looks up the actual video parameters of the video in its own database according to the video identifier in the request, such as the real encapsulation format, decoding format, and pixel format, etc. The actual video parameters are sent back to the player as verification data.
[0095] Step S203: Perform matching verification on the first video parameter.
[0096] Specifically, after the player receives the verification data returned by the media server, it parses the data and compares the actual video parameters with the first video parameter obtained from the domain name server one by one for matching verification. Check whether the encapsulation format, decoding format, pixel format, etc. are consistent.
[0097] Step S204: Parse the first video parameter.
[0098] Specifically, the player parses the verified first video parameter and extracts key information such as the encapsulation format, decoding format, and pixel format.
[0099] Step S205: Separate the target video data according to the encapsulation format.
[0100] Specifically, the player determines the corresponding demultiplexing tool according to the parsed encapsulation format. For example, if the encapsulation format of the target video data is MP4 (MPEG-4, Moving Picture Experts Group - 4), a tool that supports MP4 demultiplexing is used to decompose the target video data obtained from the media server into video track information, and the video track information includes video streams and audio streams.
[0101] Step S206: Send a read request.
[0102] Specifically, the player sends a read request to the media server, and the request contains information such as the current playing progress of the video, informing the media server of the range of video data to be obtained.
[0103] Step S207: Send video request data.
[0104] Specifically, after receiving the read request from the player, the media server extracts the corresponding video request data from the stored video data according to the progress information in the request and sends it to the player.
[0105] Step S208: Read data blocks from the video request data.
[0106] Specifically, according to the parsed video track information, the player finds the corresponding data blocks in the video request data and reads these data blocks in sequence according to the order and requirements of video playback, preparing for the subsequent decoding and rendering playback processes.
[0107] Step S209: Decode the data blocks to obtain the original image frames and audio samples.
[0108] Specifically, the player checks whether the hardware of the device supports the hardware decoding of the decoding format in the first video parameter. If the device supports it, the Media Codec is used to decode the input data blocks by the hardware decoding module of the device. The hardware decoding module processes the data blocks according to the decoding format in the first video parameter using the corresponding decoding algorithm to obtain the original image frames and audio samples; if the device does not support it, it may switch to other software decoding methods or prompt the user that the device does not meet the requirements.
[0109] Step S210: Render and play the target video.
[0110] Specifically, when the player completes the decoding of the data block through Media Codec and obtains the original image frame, it directly writes the image frame data into its Surface buffer according to the interfaces and methods provided by Surface View. When writing, the player will correctly arrange the image data according to the rules of the pixel format to ensure that the displayed image is complete and correct. Similarly, after decoding the data block, the player obtains the audio samples. According to the relevant audio information in the first video parameter and the audio output capability of the device, the player will perform parameter adaptation on the audio samples. For example, adjusting the sampling rate, number of channels, etc. of the audio samples to make them meet the audio playback requirements of the device. The adapted audio samples are played through the audio playback module of the device, synchronously with the display of the image frame, so as to realize the normal playback of the video. To ensure the smoothness of video playback, the player will control the speed of writing the image frame into the Surface buffer according to the frame rate requirement of the video. For example, if the video frame rate is 30 frames per second, the player will ensure that an image frame is written into the buffer every about 1 / 30 second to avoid frame freezing or skipping. And during the entire playback process, the player will continuously detect the display of the image frame and the playback of the audio samples, and through some synchronization algorithms and mechanisms, ensure the synchronization of sound and picture. For example, aligning the image frame and the audio sample through timestamps so that the sound and the corresponding picture can be presented to the user simultaneously, improving the viewing experience.
[0111] Step S211: Send a play request.
[0112] Specifically, the player can be internally equipped with a play progress monitoring module to continuously track the play progress of the current video. When the play progress is close to the total duration of the video, for example, when it reaches more than 90% of the total duration, it is regarded as approaching the end of playback. When the player detects that the user is about to end the playback of the current video, it sends a play request to the media server to obtain the next video to be played.
[0113] Step S212: Predict the next video to be played according to the service characteristics and user behavior characteristics.
[0114] Specifically, the media server, based on the data related to the user collected by the player in the background, including the user's historical play records, search records, favorite records, like and comment records, etc. Using data analysis algorithms and machine learning models, it analyzes the collected data to predict the videos that the current user may be interested in and determines the next video to be played.
[0115] Step S213: Send the second video parameter corresponding to the video to be played.
[0116] Specifically, after predicting the next video to be played, the media server queries the corresponding second video parameters in its database according to the identification information of the video. The database stores the detailed parameter information of each video, including the encapsulation format, decoding format, pixel format, audio encoding format, frame rate, resolution, etc. The media server sends the second video parameters to the player to shorten the time-consuming of the player in pulling the stream, detecting, demultiplexing, and reading data.
[0117] After the player in this embodiment connects to the media server and obtains the first video parameters, it sends a verification request, and the media server returns the actual parameter verification to ensure the accuracy of the parameters. The player parses the parameters, separates the video data according to the encapsulation format, requests data according to the playback progress, and reads the data block. During decoding, it uses Media Codec hardware decoding to obtain the original image frames and sound samples, and uses the Surface View component to render and play. At the same time, the player monitors the playback progress. When approaching the end, it requests the next video, and the media server predicts and sends the corresponding video parameters according to the user behavior data, shortening the time-consuming of the subsequent links and improving the playback efficiency and smoothness.
[0118] Figure 4 It is a flowchart of the video playback method according to an embodiment of the present invention. Figure 4 The video playback method shown specifically includes the following steps:
[0119] Step S310: Send a domain name request to the domain name server.
[0120] Step S320: Receive the parsing result sent by the domain name server.
[0121] Step S330: Establish a connection with the media server according to the address list.
[0122] Step S340: Obtain the target video data to be played from the media server.
[0123] Among them, the specific implementation manners of steps S310 - S340 are the same as the methods described in steps S101 - S109, and will not be described here again.
[0124] Step S350: Play the target video according to the target video data and the first video parameters.
[0125] Among them, the specific implementation manner of step S350 is the same as the methods described in steps S201 - S210, and will not be described here again.
[0126] In an embodiment of the present invention, a domain name request is sent to a domain name server, and a parsing result sent by the domain name server is received. The parsing result includes an address list of a media server and preset first video parameters. The preset first video parameters include an encapsulation format, a decoding format, and a pixel format. A connection is established with the media server according to the address list, target video data to be played is obtained from the media server, and the target video is played according to the target video data and the first video parameters. Thus, by presetting video parameters in advance, the startup speed of the video can be increased, and the viewing experience of the user can be improved.
[0127] Figure 5 is a schematic diagram of a video playback device according to an embodiment of the present invention. As Figure 5 shown, the video playback device according to the embodiment of the present invention includes a domain name request module 61 for sending a domain name request to a domain name server; a parsing result acquisition module 62 for receiving the parsing result sent by the domain name server, where the parsing result includes an address list of a media server and preset first video parameters, and the preset first video parameters include an encapsulation format, a decoding format, and a pixel format; a connection establishment module 63 for establishing a connection with the media server according to the address list; a target video data acquisition module 64 for obtaining target video data to be played from the media server; and a target video playback module 65 for playing the target video according to the target video data and the first video parameters.
[0128] In an embodiment of the present invention, a domain name request is sent to a domain name server, and a parsing result sent by the domain name server is received. The parsing result includes an address list of a media server and preset first video parameters. The preset first video parameters include an encapsulation format, a decoding format, and a pixel format. A connection is established with the media server according to the address list, target video data to be played is obtained from the media server, and the target video is played according to the target video data and the first video parameters. Thus, by presetting video parameters in advance, the startup speed of the video can be increased, and the viewing experience of the user can be improved.
[0129] Figure 6 is a schematic diagram of an electronic device according to an embodiment of the present invention. As Figure 6 shown, Figure 6The electronic device shown is a video playback device, which includes a general computer hardware structure, and at least includes a processor 71 and a memory 72. The processor 71 and the memory 72 are connected through a bus 73. The memory 72 is adapted to store instructions or programs executable by the processor 71. The processor 71 can be an independent microprocessor or a set of one or more microprocessors. Thus, by executing the instructions stored in the memory 72, the processor 71 executes the method flow of the embodiment of the present invention as described above to implement data processing and control of other devices. The bus 73 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to a display controller 74, a display device, and an input / output (I / O) device 75. The input / output (I / O) device 75 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a body sensor input device, a printer, and other devices well-known in the art. Typically, the input / output (I / O) device 75 is connected to the system through an input / output (I / O) controller 76.
[0130] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device (equipment), or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0131] The present application is described with reference to the flowcharts of methods, devices (equipment), and computer program products according to the embodiments of the present application. It should be understood that each process in the flowchart can be implemented by computer program instructions.
[0132] These computer program instructions can be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, and the instruction device implements the process Figure 1 specified functions in one process or multiple processes.
[0133] These computer program instructions can also be provided to the processor of a general computer, a special computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices produce a device for implementing the Figure 1 specified functions in one process or multiple processes.
[0134] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, which is used for a computer to execute the above-mentioned partial or all method embodiments.
[0135] That is, those skilled in the art can understand that all or part of the steps in implementing the above-mentioned embodiment methods can be completed by specifying relevant hardware through a program. The program is stored in a storage medium, including several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0136] For the solutions described in this specification and the embodiments, if they involve personal information processing, they will be processed on the premise of having a legal basis (such as obtaining the consent of the personal information subject, or being necessary for performing a contract, etc.), and will only be processed within the specified or agreed scope. If a user refuses to process personal information other than the necessary information required for basic functions, it will not affect the user's use of the basic functions.
[0137] The foregoing are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, various modifications and changes can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A video playback method, characterized in that: The method comprises: Send a domain name request to the domain name server; Receiving a parsing result sent by the domain name server, the parsing result including an address list of a media server and a preset first video parameter, the preset first video parameter including an encapsulation format, a decoding format, and a pixel format; Establishing a connection with the media server according to the address list; Obtain target video data to be played from the media server; The target video is played according to the target video data and the first video parameters.
2. The method according to claim 1, characterized in that Sending a domain name request to a domain name server includes: Query historical domain name resolution results in the local cache; In response to the historical domain name resolution result being a valid resolution result, determining the address list according to the valid resolution result; In response to the historical domain name resolution result being an invalid resolution result, a domain name request is sent to the domain name server to reacquire an address list.
3. The method according to claim 1, characterized in that The acquiring target video data to be played from the media server comprises: Send a video stream acquisition request to the media server; A video stream response returned by the media server is received, where the video stream response includes the target video data to be played.
4. The method according to claim 1, characterized in that: Playing the target video according to the target video data and the preset first video parameter includes: Parsing the first video parameters to obtain encapsulation format, decoding format and pixel format; Separating a video stream and an audio stream from the target video data according to the encapsulation format; Read data chunks from the separated video and audio streams; Decoding the data block according to the decoding format to obtain original image frames and sound samples; The target video is rendered and played according to the original image frame, the sound sample and the pixel format.
5. The method according to claim 1, characterized in that Playing the target video according to the target video data and the preset first video parameter includes: Sending a data verification request to the media server; Obtain verification data from the media server; The first video parameter is matched and verified according to the verification data.
6. The method according to claim 4, characterized in that The separating the video stream and the audio stream from the target video data according to the encapsulation format comprises: Determine a corresponding demultiplexing tool according to the encapsulation format; The target video data is decomposed into a video stream and an audio stream by the demultiplexing tool.
7. The method according to claim 6, characterized in that The reading of the video data frame from the media server comprises: Sending a read request to the media server, wherein the read request includes the current playback progress of the video; Obtain corresponding video request data from the media server; A video data frame is read from the video request data.
8. The method according to claim 1, characterized in that The method further comprises: Cache the played video stream data into the local cache area; Generate a video mapping table according to the played video stream data, wherein the video mapping table is used to store a mapping relationship between the played video stream data and a timestamp corresponding to each segment of video stream data; In response to replaying the played video stream data, a start time point of the played video stream data is determined according to the video mapping table.
9. The method according to claim 1, characterized in that: The method further comprises: Sending a play request to the media server so that the media server predicts the next video to be played based on the service characteristics and user behavior characteristics; A second video parameter corresponding to the video to be played is obtained, where the second video parameter includes an encapsulation format, a decoding format, and a pixel format of the video to be played.
10. A video playback system, characterized in that: The system comprises: Domain name server, used to send the resolution result to the player according to the domain name request; A media server, used for establishing a connection with the player and sending target video data to the player; The player is used to send a domain name request to a domain name server, obtain a resolution result sent by the domain name server, the resolution result includes an address list of a media server and preset first video parameters, the preset first video parameters include an encapsulation format, a decoding format and a pixel format, establish a connection with the media server according to the address list, obtain target video data to be played from the media server, and play the target video according to the target video data and the first video parameters.