[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112584255A - Method and device for playing streaming media data, computer equipment and storage medium - Google Patents

Method and device for playing streaming media data, computer equipment and storage medium Download PDF

Info

Publication number
CN112584255A
CN112584255A CN202011411669.1A CN202011411669A CN112584255A CN 112584255 A CN112584255 A CN 112584255A CN 202011411669 A CN202011411669 A CN 202011411669A CN 112584255 A CN112584255 A CN 112584255A
Authority
CN
China
Prior art keywords
address
transport stream
streaming media
stream file
media data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011411669.1A
Other languages
Chinese (zh)
Other versions
CN112584255B (en
Inventor
冯明创
唐松军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202011411669.1A priority Critical patent/CN112584255B/en
Publication of CN112584255A publication Critical patent/CN112584255A/en
Application granted granted Critical
Publication of CN112584255B publication Critical patent/CN112584255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/438Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving encoded video stream packets from an IP network

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a method, a device, computer equipment and a storage medium for playing streaming media data, wherein the method comprises the following steps: the method comprises the steps of displaying summary information of streaming media data, receiving starting operation acting on the summary information, responding to the starting operation, accessing a first address, and downloading a first target transport stream file of the streaming media data, wherein the first target transport stream file is a transport stream file with the sequence less than or equal to n, if downloading of the first target transport stream file is completed, the first target transport stream file is played, the download address of an initial part of the transport stream file in the streaming media data is separated from a play list, after the first address is obtained, the first address can be accessed, the initial part of the transport stream file can be downloaded for playing, the consumed time is 1-RTT, the time for downloading the play list is saved, the time for starting the playing of the streaming media data is saved, and the second opening rate for playing the streaming media data is improved.

Description

Method and device for playing streaming media data, computer equipment and storage medium
Technical Field
The present invention relates to the field of streaming media technologies, and in particular, to a method and an apparatus for playing streaming media data, a computer device, and a storage medium.
Background
In scenes such as live broadcasting, a streaming media service protocol is mostly used to transmit data, which is also called streaming media data, that is, media data is transmitted in a network by adopting a streaming transmission mode.
The media service protocol includes DASH (dynamic adaptive Streaming over HTTP), HLS (HTTP Live Streaming), and the like.
When streaming media data by a streaming media service protocol, the streaming media data is generally divided into a plurality of Transport Stream files (ts), and a playlist is generated based on information of the plurality of Transport Stream files. In this way, the client downloads a playlist (playlist, e.g., M3u8(extended M3U)), sequentially requests information of each transport stream file according to the playlist, and downloads the transport stream file according to the information of the transport stream file and then plays the same.
This process includes downloading a playlist and downloading a transport stream file, which takes 2-RTT (Round-Trip Time), and the content of the playlist is large, and the Time for loading the playlist is long, resulting in a long Time required to start playing the streaming media data.
Disclosure of Invention
The embodiment of the invention provides a method and a device for playing streaming media data, computer equipment and a storage medium, which are used for solving the problem of long time required for starting playing the streaming media data.
In a first aspect, an embodiment of the present invention provides a method for playing streaming media data, including:
displaying summary information of streaming media data, wherein the streaming media data is configured with a first address;
receiving a start operation acting on the summary information;
responding to the starting operation, accessing the first address to download a first target transport stream file of the streaming media data, wherein the first target transport stream file is a transport stream file with the sequence less than or equal to n;
and if the first target transport stream file is downloaded, playing the first target transport stream file.
In a second aspect, an embodiment of the present invention further provides a device for playing streaming media data, including:
the summary information display module is used for displaying summary information of the streaming media data, and the streaming media data is provided with a first address;
a starting operation receiving module for receiving the starting operation acting on the summary information;
a first target transport stream file downloading module, configured to respond to the start operation, access the first address to download a first target transport stream file of the streaming media data, where the first target transport stream file is a transport stream file with a sequence less than or equal to n;
and the first target transport stream file playing module is used for playing the first target transport stream file if the first target transport stream file is downloaded.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
a memory for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for playing streaming media data according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the method for playing streaming media data according to the first aspect.
In this embodiment, summary information of streaming media data is displayed, a start operation acting on the summary information is received, a first address is accessed in response to the start operation, a first target transport stream file of the streaming media data is downloaded, wherein the first target transport stream file is a transport stream file with a sequence less than or equal to n, if downloading of the first target transport stream file is completed, the first target transport stream file is played, a download address of an initial partial transport stream file in the streaming media data is separated from a playlist, that is, the first address exists in an independent form, does not depend on the playlist, is not recorded in the playlist, after the first address is obtained, the first address can be accessed, the initial partial transport stream file can be downloaded for playing, the consumed time is 1-RTT, the time for downloading the playlist is saved, and therefore, the time required for starting playing the streaming media data is saved, The second-on rate (i.e. the proportion of open motion picture within 1 s) at which the streaming media data is played is increased.
Drawings
Fig. 1 is a flowchart of a method for playing streaming media data according to an embodiment of the present invention;
fig. 2 is an exemplary diagram of a key device displaying summary information according to an embodiment of the present invention;
fig. 3 is an exemplary diagram of a touch device displaying summary information according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for playing streaming media data according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a playing apparatus for streaming media data according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for playing streaming media data according to an embodiment of the present invention, where the method is applicable to a situation where n transport stream files before the streaming media data are directly downloaded for playing, the method may be executed by a playing apparatus of the streaming media data, and the playing apparatus of the streaming media data may be implemented by software and/or hardware, and may be configured in a computer device, for example, a personal computer, a mobile terminal (e.g., a mobile phone, a tablet computer, etc.), a wearable device (e.g., glasses, a watch, etc.), and the method specifically includes the following steps:
step 101, displaying summary information of the streaming media data.
The operating system of the computer device may include Android (Android), iOS, Windows, and the like, and applications supporting playing of streaming media data, such as a live application, a browser, a short video application, a shopping application, and the like, may be installed in the operating system.
The form of the streaming media data may be different in different applications, for example, in a live application, a shopping application, the streaming media data may be live video data, in a browser, the streaming media data may be a tv show, a movie, in a short video application, the streaming media data may be short video data, and the like, which is not limited in this embodiment.
Further, the application may be a stand-alone application, or may be an application configuring a component of the player (e.g., an SDK (Software Development Kit)), which is not limited in this embodiment.
A user starts an application, and the application requests a Web (Web page) server for a page, so that the page of the application is loaded in the application, and in the page, corresponding summary information for displaying streaming media data can be displayed, and the summary information is information for summarizing the streaming media data, such as a thumbnail of the streaming media data, a title of the streaming media data, viewing data (e.g., the number of likes, the number of comments, the number of views, etc.) of the streaming media data, and so on.
For example, for a live broadcast application, the summary information of the live video data may be displayed on a page such as a home page, a page below two levels (e.g., a web game, a stand-alone game, a hand game, a leisure game), a live broadcast room, etc., and for a short video application, the summary information of the live video data may be displayed on a page such as a home page, a producer's detailed page, etc., which is not limited in this embodiment.
Since the update frequency of the download address of the streaming media data is high, the streaming media data is generally managed by an independent streaming media server, the streaming media server divides the streaming media data into a plurality of transport stream files, and each transport stream file is configured with a download address, such as a Uniform Resource Locator (URL).
The streaming media server sorts the plurality of transport stream files of the streaming media data according to a time sequence, so that the plurality of transport stream files are played according to the sorting in the following, that is, the earlier the sorting is, the earlier the playing time is, and conversely, the later the sorting is, the later the playing time is.
In this embodiment, the transport stream files with the sorting less than or equal to n (n is a positive integer, such as 1, 2, 3, 4, etc.) are set as the first target transport stream file, that is, the n transport stream files played first are set as the first target transport stream file, for the convenience of distinguishing, the download address configured for the first target transport stream file is denoted as the first address, that is, the streaming media data is configured with the first address, the first address is the download address of the first target transport stream file in the streaming media data, the first address exists in an independent form and is not dependent on the playlist (such as m3u8), that is, the first address is not recorded in the playlist (such as m3u 8).
It should be noted that the number n of the first target transport stream files can be set by those skilled in the art according to the actual situation of the network, the computer equipment and other factors, the number n of first target transport stream files is typically much smaller than the total number of transport stream files, e.g., if the number of the transport stream files is too large and the performance of the computer device is limited, which results in that the time for the computer device to analyze and transmit the download addresses of the plurality of transport stream files is long, at this time, the number n of first target transport stream files may be set to a larger value, such as 2, 3, for example, if the network quality is better and the download address for transmitting the multiple transport stream files is faster, in order to reduce the influence on the streaming media service protocol, at this time, the number n of the first target transport stream files may be set to a larger value, such as 1, etc., which is not limited by the embodiment.
Generally, after loading a page, an application requests a streaming server for a first address corresponding to an identifier of streaming media data according to the identifier of the streaming media data in the page (e.g., an ID of a live broadcast).
Specifically, the application may send a query request to the streaming media server for the streaming media data (represented by the identifier of the streaming media data), and the streaming media server, upon receiving the query request, queries the database for a first address configured for the streaming media data, encapsulates the first address in a query response, and sends the query response to the application.
At this time, the application may receive a query response sent by the streaming server in response to the query request, and extract the first address from the query response.
Of course, the application may obtain the first address of the streaming media data in other manners besides the first address of the streaming media data distributed by the streaming media server, for example, the streaming media server transmits the first address of the streaming media data to the Web server, the Web server packages the first address of the streaming media data into a document (e.g., an HTML (HyperText Markup Language) document) of a corresponding page, and sends the first address of the streaming media data to the application along with the document of the page, and so on, which is not limited in this embodiment.
Step 102, receiving a start operation acting on summary information.
The user browses the summary information of each streaming media data to obtain the general content of each streaming media data, and for the streaming media data which may be interested, the user can trigger a starting operation aiming at the summary information of the streaming media data to instruct the application to load and play the streaming media data.
The manner in which a user triggers a start operation to act on summary information varies from computer device to computer device.
If the computer device is a device supporting key control operation, such as a personal computer, the user can trigger operations such as clicking and long-time pressing aiming at the summary information by using a key control mode through an external device connected with the computer device, so that the summary information is selected, and the application receives starting operation acting on the summary information. The external device includes, but is not limited to, a mouse, a keyboard, and the like.
For example, as shown in fig. 2, a browser in a personal computer loads a live broadcast room, the live broadcast room includes a first screen area 210 and a non-first screen area 220, information important to live broadcast, such as a navigation bar 201, a live broadcast picture 202, a bulletin board 203, a list 204, an interactive window 205 of the live broadcast room, and the like, can be displayed in the first screen area 210, and information less important to live broadcast, such as a dynamic column 206, a guild column 207, a recommendation column 208, and the like, can be displayed in the non-first screen area 220.
The information in the list 204, the dynamic column 206, and the recommendation column 208 is summary information of live video data (streaming media data), and the user clicks the information in the list 204, the dynamic column 206, and the recommendation column 208 by using a mouse, a keyboard, or the like, and may be regarded as triggering a start operation acting on the summary information.
If the computer device is a device supporting touch operation, such as a mobile terminal, the user may trigger touch operation such as clicking, long-pressing, and the like on the summary information by using a finger or a touch pen in a touch manner, so as to select the summary information, so that the application receives a start operation acting on the summary information.
For example, as shown in fig. 3, a live application of the mobile terminal loads a homepage of a live platform, summary information 301 of a plurality of live rooms, such as thumbnails, head portraits of the anchor, the number of people watching the live rooms, and the like, is displayed in the homepage, and a user clicks the summary information 301 with a finger, which may be regarded as triggering a start operation acting on the summary information.
Step 103, responding to the starting operation, accessing the first address to download the first target transport stream file of the streaming media data.
A player capable of supporting playing of streaming media data, such as a VideoView in an Android system, is configured in the computer device, and the player may be a component independent of an application or a component (such as an SDK) in the application, which is not limited in this embodiment.
When receiving a starting operation acting on the summary information, the application queries a first address configured for the streaming media data to which the summary information belongs, and starts a player, taking a VideoView as an example, the application can add a video _ View, and uses a setplayreview interface to associate the application with a video _ View control which is just added to the interface.
The application transmits the first address to the player, thereby starting the player, which accesses the first address, thereby downloading a first target transport stream file of streaming media data.
And step 104, if the downloading of the first target transport stream file is finished, playing the first target transport stream file.
If the player finishes downloading the first target transport stream file, the player may render the first target transport stream file, thereby playing the first target transport stream file.
In this embodiment, summary information of streaming media data is displayed, a start operation acting on the summary information is received, a first address is accessed in response to the start operation, a first target transport stream file of the streaming media data is downloaded, wherein the first target transport stream file is a transport stream file with a sequence less than or equal to n, if downloading of the first target transport stream file is completed, the first target transport stream file is played, a download address of an initial partial transport stream file in the streaming media data is separated from a playlist, that is, the first address exists in an independent form, does not depend on the playlist, is not recorded in the playlist, after the first address is obtained, the first address can be accessed, the initial partial transport stream file can be downloaded for playing, the consumed time is 1-RTT, the time for downloading the playlist is saved, and therefore, the time required for starting playing the streaming media data is saved, The second-on rate (i.e. the proportion of open motion picture within 1 s) at which the streaming media data is played is increased.
Tests show that the second opening rate of the live video data can be improved by 3% by applying the embodiment to the live on-demand service.
Example two
Fig. 4 is a flowchart of a playing method of streaming media data according to a second embodiment of the present invention, where the present embodiment further adds an operation of parsing a playlist based on the foregoing embodiment, and the method specifically includes the following steps:
step 401, displaying summary information of the streaming media data.
The streaming media server sequences the plurality of transport stream files of the streaming media data according to a time sequence, and records the download addresses of the plurality of transport stream files in a playlist (e.g., m3u8) according to the time sequence, that is, the internal information of the playlist (e.g., m3u8) records a series of media fragment resources (i.e., transport stream files), and plays the media fragment resources in sequence, that is, the streaming media data can be completely displayed.
Taking m3u8 as an example, the format of m3u8 is as follows:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXTINF:9.009,
http://media.example.com/first.ts
#EXTINF:9.009,
http://media.example.com/second.ts
#EXTINF:3.003,
http://media.example.com/third.ts
when m3u8 is used as a Master Playlist (Master Playlist), multiple copies of a Stream list resource (Variant Stream) of the same media resource are provided therein. The format is as follows:
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=150000,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/low/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=240000,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/lo_mid/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=440000,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/hi_mid/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=640000,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2"
http://example.com/high/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=64000,CODECS="mp4a.40.5"
http://example.com/audio/index.m3u8
for a streaming media service Protocol, such as HLS, the whole streaming media data is downloaded by dividing it into small HTTP (hypertext Transfer Protocol) based transport stream files ts, and a part of the transport stream files ts is downloaded each time. When streaming media data is being played, the application may choose to download the same transport stream file ts from many different alternate sources at different rates, allowing the streaming media session to accommodate different data rates. When a streaming media session is started, the application will download a playlist (e.g., m3u8) containing metadata for finding an available media stream.
Of course, besides the download addresses of the plurality of transport stream files, the playlist (e.g., m3u8) may be accompanied by other description information, such as bandwidth information, for providing to the application.
For video-on-demand, such as television drama, movie, short video, etc., the application downloads the transport stream file ts in sequence and plays the files in sequence. For live broadcasting, the application periodically re-requests the playlist (e.g., m3u8), queries a new transport stream file ts, and downloads the new transport stream file ts for playing.
In this embodiment, the streaming media data may be configured with a first address and a second address, where the first address is a download address of a first target transport stream file in the streaming media data, and the second address is a download address of a playlist (e.g., m3u8) in the streaming media data.
Generally, after loading a page, an application requests a streaming media server for a first address and a second address corresponding to an identifier of streaming media data according to the identifier of the streaming media data in the page (e.g., an ID of a live broadcast).
Specifically, the application may send a query request to the streaming media server for the streaming media data (represented by an identifier of the streaming media data), and when receiving the query request, the streaming media server queries the database for a first address and a second address configured for the streaming media data, encapsulates the first address and the second address into a query response, and sends the query response to the application.
At this time, the application may receive a query response sent by the streaming media server in response to the query request, and extract the first address and the second address from the query response.
Since the streaming media service protocol such as HLS is to agree on the download address (i.e. the second address) of the playlist (e.g. m3u8) in the transport stream media data, while the present embodiment transmits the download address (i.e. the second address) of the transport stream file with the rank less than or equal to n in addition to the download address (i.e. the second address) of the playlist (e.g. m3u8), in order to distinguish the first address from the second address, the streaming media server may agree to mark the first tag for the first address and mark the second tag for the second address in the query response.
Therefore, when the query response is analyzed, the first tag and the second tag can be respectively identified in the query response according to convention, on one hand, the character string marking the first tag is searched in the query response to obtain the first address, and on the other hand, the character string marking the second tag is searched in the query response to obtain the second address.
Of course, in addition to distributing the first address and the second address of the streaming media data through the streaming media server, the application may also obtain the first address and the second address of the streaming media data in other manners, for example, the streaming media server transmits the first address and the second address of the streaming media data to the Web server, the Web server packages the first address and the second address of the streaming media data into a document (such as an HTML document) of a corresponding page, and sends the first address and the second address of the streaming media data to the application along with the document of the page, and so on, which is not limited in this embodiment.
Step 402, receive a start operation to act on summary information.
Step 403, in response to the start operation, accessing the first address to download the first target transport stream file of streaming media data.
The first target transmission stream file is a transmission stream file with the sequence less than or equal to n.
Step 404, if the downloading of the first target transport stream file is completed, the first target transport stream file is played.
Step 405, if downloading the first target transport stream file is completed, accessing the second address to download a playlist of streaming media data.
In this embodiment, the Application may transmit the first address to the player and may transmit the second address to the player, so as to distinguish the first address from the second address, when an Application Programming Interface (API) of the Application calling player generates a call request, it may be agreed to mark a third tag for the first address and a fourth tag for the second address in the call request.
Therefore, when the player analyzes the call request, the third tag and the fourth tag can be respectively identified from the call request according to convention, on one hand, the character string marking the third tag is searched in the call request to obtain the first address, and on the other hand, the character string marking the fourth tag is searched in the call request to obtain the second address.
In this embodiment, the player accessing the first address and downloading the first target transport stream file of the streaming media data and the player accessing the second address and downloading the playlist (e.g., m3u8) of the streaming media data belong to a serial operation.
Further, the player first accesses the first address, downloads the first target transport stream file of the streaming media data, and when the first target transport stream file of the streaming media data is completed, then accesses the second address, downloads the playlist (e.g., m3u8) of the streaming media data, avoids the playlist (e.g., m3u8) of the streaming media data from preempting resources (e.g., bandwidth, processor resources, memory resources, etc.) of the computer device, allocates the resources (particularly, bandwidth) of the computer device to the first target transport stream file of the streaming media data as much as possible, increases the speed of downloading the first target transport stream file of the streaming media data, reduces the time consumption of downloading the first target transport stream file of the streaming media data, and thus increases the efficiency of starting the streaming media data.
In addition, after the first target transport stream file of the downloaded streaming media data is completed, the first target transport stream file is not sensitive to bandwidth resources, at this time, the first target transport stream file of the streaming media data played by the player and the playlist (e.g., m3u8) of the player access address and the downloaded streaming media data belong to parallel operations, and the influence of the playlist (e.g., m3u8) of the downloaded streaming media data on the resource of the computer device is small and can be ignored.
Step 406, accessing the third address to download the second target transport stream file in the streaming media data.
A plurality of download addresses of the transport stream file are recorded in the playlist (e.g., m3u8), and the download address of the transport stream file is denoted as a third address for the sake of distinction.
The player traverses each transport stream file in the playlist (e.g., m3u8), and screens out a transport stream file which belongs to the same streaming media file as the first target transport stream file and has a rank greater than n, as a second target transport stream file, that is, the second target transport stream file is a transport stream file having a rank greater than n.
The player accesses a third address corresponding to the second target transport stream file, thereby downloading the second target transport stream file of the streaming media data.
Generally, the time length of one transport stream file ts varies from several seconds to several minutes, and within several seconds, the player may complete downloading a playlist (e.g., m3u8) of streaming media data, parse the playlist, and download a second target transport stream file in the streaming media data, so as to reduce modifications to the streaming media service protocol as much as possible, and maintain the universality of the streaming media service protocol, where n is preferably 1, that is, the client accesses the first address to download the first transport stream file of the streaming media data, and if downloading the first transport stream file is complete, plays the first transport stream file, and accesses the second address to download the playlist of the streaming media data, accesses the third address in the playlist, and downloads the second and subsequent transport stream files in the streaming media data.
In one embodiment of the present invention, the step 406 may include the steps of:
step 4061, query fourth address.
Step 4062 compares the fourth address to the third address.
In order to maintain the generality of the streaming media protocol, the playlist (e.g., m3u8) of the streaming media data may complete recording all the transport stream files ts in the streaming media data, i.e., the playlist (e.g., m3u8) of the streaming media data has the first target transport stream file and the second target transport stream file simultaneously.
Thus, the player screens out the first target transport stream file to distinguish the second target transport stream file while traversing the individual transport stream files in the playlist (e.g., m3u 8).
Specifically, the player may query the current fourth address, which is the download address of the transport stream file that has completed downloading, and compare the fourth address with the third addresses in the playlist (e.g., m3u 8).
It should be noted that, due to the existence of factors such as the aging of the cache, the user switching to other streaming media files, and the like, the fourth address may include a download address of the transport stream file ts in the current streaming media data, or may include a download address of the transport stream file ts in other streaming media data, and the fourth address may be the same as the first address, or may be different from the second address, which is not limited in this embodiment.
Step 4063, if the fourth address is the same as part of the third address, accessing part of the third address different from the fourth address in sequence to download a second target transport stream file in the streaming media data.
And aiming at the comparison result of the fourth address and the third address, if the fourth address is the same as part of the third address, the same part is the download address of the transport stream file ts in the same stream media data, namely the first address, at the moment, the player can sequentially access other third addresses after the first address, and the addresses are different from the fourth address, so that the download address of the second target transport stream file is represented, and the second target transport stream file in the stream media data is downloaded.
In an embodiment of the present invention, the player may be provided with some mechanisms, for example, if the transport stream file is downloaded again due to a failure to play the transport stream file, the transport stream file may be downloaded again by traversing the playlist (e.g., m3u8), and in order to avoid that the mechanism repeatedly downloads the transport stream file by traversing the playlist (e.g., m3u8) to cause repeated downloading of the first target file, which may cause repeated playing of the same content by the streaming media data, a part of the third address that is the same as the fourth address may be deleted in the playlist (e.g., m3u8), that is, the first address may be deleted in the playlist (e.g., m3u8), so as to ensure the content of the streaming media.
In addition, the streaming media server may also delete the first address directly from the playlist (e.g., m3u8), and after the player downloads the playlist (e.g., m3u8), the player sequentially accesses the third address in the playlist (e.g., m3u8) in order to download the second target transport stream file in the streaming media data, which is not limited in this embodiment.
Step 407, when playing the first target transport stream file is completed, playing the second target transport stream file.
During the period of playing the first target transport stream file, the downloading of the second target transport stream file can be usually completed, and when the playing of the first target transport stream file is completed, the playing of the second target transport stream file can be continued in sequence, so that the content of the streaming media data is consistent, and the streaming media data is accurately played.
Further, the player generates a buffer queue, the player reads the transport stream file ts from the buffer queue for playing in a FIFO (First Input First Output, First in First out) manner, the player writes the First target transport stream file into the buffer queue in sequence when downloading the First target transport stream file is completed, and the player writes the second target transport stream file into the buffer queue in sequence when downloading the second target transport stream file is completed.
As for the result of comparing the fourth address with the third address, if the fourth address is different from all the third addresses, it indicates that the fourth address does not have the first address of the current streaming media data, and situations such as a failure of downloading the first target transport stream file, a user jumping to other streaming media data, etc. may occur, at this time, the player accesses the third addresses according to the sequence arranged in the play list (e.g., m3u8), and uses the transport stream file of the following streaming media data as the third target transport stream file, and when downloading of at least one third target transport stream file is completed, the player pauses playing the first target transport stream file, and plays the third target transport stream file, thereby ensuring accurate playing of the streaming media data.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
EXAMPLE III
Fig. 5 is a block diagram of a playing apparatus for streaming media data according to a third embodiment of the present invention, which may specifically include the following modules:
a summary information display module 501, configured to display summary information of streaming media data, where the streaming media data is configured with a first address;
a starting operation receiving module 502, configured to receive a starting operation acting on the summary information;
a first target transport stream file downloading module 503, configured to respond to the start operation, access the first address to download a first target transport stream file of the streaming media data, where the first target transport stream file is a transport stream file with a sequence less than or equal to n;
a first target transport stream file playing module 504, configured to play the first target transport stream file if downloading the first target transport stream file is completed.
In an embodiment of the present invention, the streaming media data is further configured with a second address, and the apparatus further includes:
a playlist downloading module, configured to access the second address to download a playlist of the streaming media data if downloading of the first target transport stream file is completed, where the playlist has a plurality of third addresses;
a second target transport stream file downloading module, configured to access the third address to download a second target transport stream file in the streaming media data, where the second target transport stream file is a transport stream file with a rank greater than n;
and the second target transport stream file playing module is used for playing the second target transport stream file when the playing of the first target transport stream file is finished.
In an embodiment of the present invention, the second target transport stream file downloading module includes:
the download address query submodule is used for querying a fourth address, and the fourth address is a download address of the transport stream file which is downloaded completely;
a download address comparison submodule for comparing the fourth address with the third address;
and the different downloading submodule is used for sequentially accessing part of the third addresses different from the fourth addresses to download a second target transport stream file in the streaming media data if the fourth addresses are the same as part of the third addresses.
In an embodiment of the present invention, the second target transport stream file downloading module further includes:
and the download address deleting submodule is used for deleting the third address which is the same as the fourth address in the playlist.
In one embodiment of the present invention, further comprising:
a third target transport stream file downloading module, configured to, if the fourth address is different from all the third addresses, sequentially access the third addresses to download the transport stream file of the streaming media data as a third target transport stream file;
and the third target transport stream file playing module is used for pausing playing the first target transport stream file and playing the third target transport stream file.
In one example of embodiment of the present invention, said n is 1.
In one embodiment of the present invention, further comprising:
the query request sending module is used for sending a query request to a streaming media server aiming at the streaming media data;
the query response receiving module is used for receiving a query response sent by the streaming media server in response to the query request;
and the download address extraction module is used for extracting a first address and a second address from the query response, wherein the first address is a download address of a first target transport stream file in the streaming media data, and the second address is a download address of a playlist in the streaming media data.
In an embodiment of the present invention, the download address extracting module includes:
the label identification submodule is used for identifying a first label and a second label in the query response;
the first address searching submodule is used for searching the character string for marking the first label in the query response to obtain a first address;
and the second address searching submodule is used for searching the character string for marking the second label in the query response to obtain a second address.
The playing device of the streaming media data provided by the embodiment of the invention can execute the playing method of the streaming media data provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 6 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 6 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 6, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing a playing method of streaming media data provided by an embodiment of the present invention.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the method for playing streaming media data, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
A computer readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (11)

1. A method for playing streaming media data, comprising:
displaying summary information of streaming media data, wherein the streaming media data is configured with a first address;
receiving a start operation acting on the summary information;
responding to the starting operation, accessing the first address to download a first target transport stream file of the streaming media data, wherein the first target transport stream file is a transport stream file with the sequence less than or equal to n;
and if the first target transport stream file is downloaded, playing the first target transport stream file.
2. The method of claim 1, wherein the streaming media data is further configured with a second address, the method further comprising:
if downloading the first target transport stream file is completed, accessing the second address to download a playlist of the streaming media data, wherein the playlist has a plurality of third addresses;
accessing the third address to download a second target transport stream file in the streaming media data, wherein the second target transport stream file is a transport stream file with the sequence greater than n;
and when the first target transport stream file is played, playing the second target transport stream file.
3. The method according to claim 2 or the above, wherein the accessing the third address to download the second target transport stream file in the streaming media data comprises:
inquiring a fourth address, wherein the fourth address is a download address of the transport stream file which is downloaded completely;
comparing the fourth address with the third address;
and if the fourth address is the same as part of the third address, accessing part of the third address different from the fourth address in sequence to download a second target transport stream file in the streaming media data.
4. The method according to claim 3 or the above, wherein the accessing the third address to download the second target transport stream file in the streaming media data further comprises:
deleting a portion of the third address in the playlist that is identical to the fourth address.
5. The method of claim 3, further comprising:
if the fourth address is different from all the third addresses, accessing the third addresses in sequence to download the transport stream file of the streaming media data as a third target transport stream file;
pausing the playing of the first target transport stream file, and playing the third target transport stream file.
6. The method of any one of claims 1 to 5, wherein n is 1.
7. The method of any of claims 1-5, further comprising:
sending a query request to a streaming media server aiming at the streaming media data;
receiving a query response sent by the streaming media server in response to the query request;
and extracting a first address and a second address from the query response, wherein the first address is a download address of a first target transport stream file in the streaming media data, and the second address is a download address of a playlist in the streaming media data.
8. The method of claim 7 or claim 7, wherein extracting the first address, the second address from the query response comprises:
identifying a first tag and a second tag in the query response;
searching a character string for marking the first label in the query response to obtain a first address;
and searching the character string for marking the second label in the query response to obtain a second address.
9. A device for playing streaming media data, comprising:
the summary information display module is used for displaying summary information of the streaming media data, and the streaming media data is provided with a first address;
a starting operation receiving module for receiving the starting operation acting on the summary information;
a first target transport stream file downloading module, configured to respond to the start operation, access the first address to download a first target transport stream file of the streaming media data, where the first target transport stream file is a transport stream file with a sequence less than or equal to n;
and the first target transport stream file playing module is used for playing the first target transport stream file if the first target transport stream file is downloaded.
10. A computer device, characterized in that the computer device comprises:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method for playing streaming media data according to any one of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a method of playing streaming media data according to any one of claims 1 to 8.
CN202011411669.1A 2020-12-04 2020-12-04 Method and device for playing streaming media data, computer equipment and storage medium Active CN112584255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011411669.1A CN112584255B (en) 2020-12-04 2020-12-04 Method and device for playing streaming media data, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011411669.1A CN112584255B (en) 2020-12-04 2020-12-04 Method and device for playing streaming media data, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112584255A true CN112584255A (en) 2021-03-30
CN112584255B CN112584255B (en) 2023-05-26

Family

ID=75127358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011411669.1A Active CN112584255B (en) 2020-12-04 2020-12-04 Method and device for playing streaming media data, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112584255B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259695A (en) * 2021-04-29 2021-08-13 广州虎牙科技有限公司 Video playing method and device, electronic equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103442293A (en) * 2013-08-30 2013-12-11 武汉眸博科技有限公司 Method and system for quickly starting playing of network multimedia files
CN104144357A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Video playing method and system
US20140344410A1 (en) * 2013-05-14 2014-11-20 Morega Systems Inc. Fixed-length segmentation for segmented video streaming to improve playback responsiveness
US20140365491A1 (en) * 2013-05-17 2014-12-11 Envivio France Method for managing personalized playing lists of the type comprising a URL template and a list of segment identifiers
CN105025391A (en) * 2014-04-30 2015-11-04 腾讯科技(深圳)有限公司 Video playing method and apparatus
US20160014482A1 (en) * 2014-07-14 2016-01-14 The Board Of Trustees Of The Leland Stanford Junior University Systems and Methods for Generating Video Summary Sequences From One or More Video Segments
CN105681874A (en) * 2015-06-02 2016-06-15 深圳Tcl数字技术有限公司 Network video online playing method and device
CN105721952A (en) * 2016-01-27 2016-06-29 观止云(北京)信息技术有限公司 Live streaming network transmission method and system for equal-length slices
CN105847990A (en) * 2016-03-30 2016-08-10 华为技术有限公司 Media file playing method and apparatus
CN105872607A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Method, server and terminal device for providing multimedia contents
CN108063769A (en) * 2017-12-26 2018-05-22 中兴通讯股份有限公司 A kind of implementation method of content service, device and content delivery network node
CN109996110A (en) * 2017-12-29 2019-07-09 中兴通讯股份有限公司 A kind of video broadcasting method, terminal, server and storage medium
CN110677737A (en) * 2019-10-08 2020-01-10 烽火通信科技股份有限公司 HLS live broadcast quick playing method and system

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104144357A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Video playing method and system
US20140344410A1 (en) * 2013-05-14 2014-11-20 Morega Systems Inc. Fixed-length segmentation for segmented video streaming to improve playback responsiveness
US20140365491A1 (en) * 2013-05-17 2014-12-11 Envivio France Method for managing personalized playing lists of the type comprising a URL template and a list of segment identifiers
CN103442293A (en) * 2013-08-30 2013-12-11 武汉眸博科技有限公司 Method and system for quickly starting playing of network multimedia files
CN105025391A (en) * 2014-04-30 2015-11-04 腾讯科技(深圳)有限公司 Video playing method and apparatus
US20160014482A1 (en) * 2014-07-14 2016-01-14 The Board Of Trustees Of The Leland Stanford Junior University Systems and Methods for Generating Video Summary Sequences From One or More Video Segments
CN105681874A (en) * 2015-06-02 2016-06-15 深圳Tcl数字技术有限公司 Network video online playing method and device
CN105721952A (en) * 2016-01-27 2016-06-29 观止云(北京)信息技术有限公司 Live streaming network transmission method and system for equal-length slices
CN105847990A (en) * 2016-03-30 2016-08-10 华为技术有限公司 Media file playing method and apparatus
CN105872607A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Method, server and terminal device for providing multimedia contents
CN108063769A (en) * 2017-12-26 2018-05-22 中兴通讯股份有限公司 A kind of implementation method of content service, device and content delivery network node
CN109996110A (en) * 2017-12-29 2019-07-09 中兴通讯股份有限公司 A kind of video broadcasting method, terminal, server and storage medium
CN110677737A (en) * 2019-10-08 2020-01-10 烽火通信科技股份有限公司 HLS live broadcast quick playing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曾俊凯: ""基于DASH技术的动态自适应算法研究与系统实现"" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259695A (en) * 2021-04-29 2021-08-13 广州虎牙科技有限公司 Video playing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112584255B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
US10425684B2 (en) System and method to create a media content summary based on viewer annotations
US8595375B1 (en) Segmenting video based on timestamps in comments
US20100268694A1 (en) System and method for sharing web applications
US20130132833A1 (en) Systems and Methods For Remote Tracking And Replay Of User Interaction With A Webpage
US6175862B1 (en) Hot objects with sequenced links in web browsers
US20170289643A1 (en) Method of displaying advertising during a video pause
US20100077290A1 (en) Time-tagged metainformation and content display method and system
US20130019149A1 (en) Media Recorder
US8805866B2 (en) Augmenting metadata using user entered metadata
WO2021114845A1 (en) Interactive service processing method, system and device, and storage medium
JP2004500651A (en) Streaming media search and playback system
CN112738633B (en) Video playing method, device, equipment and readable storage medium
US20120297429A1 (en) Emulating Television Viewing Experience In A Browser
US20170046023A1 (en) Method and apparatus for processing managing multimedia content
US10516911B1 (en) Crowd-sourced media generation
WO2018133725A1 (en) Method, client, and system for output processing of media file
WO2019154014A1 (en) Video playback method and apparatus, and storage medium and electronic device
US20190098066A1 (en) Dynamic archiving of streaming content
CN109168020A (en) Method for processing video frequency, device, calculating equipment and storage medium based on live streaming
WO2022134555A1 (en) Video processing method and terminal
CN111949807A (en) Data processing method, data processing device, computer equipment and storage medium
WO2015143854A1 (en) Data acquisition and interaction method, set top box, server and multimedia system
US8914409B2 (en) Method and apparatus for callback supplementation of media program metadata
US10743085B2 (en) Automatic annotation of audio-video sequences
JP2010268103A (en) Client terminal and computer program for moving picture distribution service

Legal Events

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