CN108391179B - Live broadcast data processing method and device, server, terminal and storage medium - Google Patents

Live broadcast data processing method and device, server, terminal and storage medium Download PDF

Info

Publication number
CN108391179B
CN108391179B CN201810388944.9A CN201810388944A CN108391179B CN 108391179 B CN108391179 B CN 108391179B CN 201810388944 A CN201810388944 A CN 201810388944A CN 108391179 B CN108391179 B CN 108391179B
Authority
CN
China
Prior art keywords
target
video
target video
fragment
live
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810388944.9A
Other languages
Chinese (zh)
Other versions
CN108391179A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810388944.9A priority Critical patent/CN108391179B/en
Publication of CN108391179A publication Critical patent/CN108391179A/en
Application granted granted Critical
Publication of CN108391179B publication Critical patent/CN108391179B/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
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in 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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/475End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data
    • H04N21/4758End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data for providing answers, e.g. voting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream

Landscapes

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

Abstract

The embodiment of the invention discloses a live data processing method, a live data processing device, a server, a terminal and a storage medium, wherein the method comprises the following steps: receiving video stream data and at least one interactive message sent by a main broadcast client of a live broadcast video; processing video stream data to obtain a target video fragment of a live video, and acquiring an address of the target video fragment; selecting target interaction information associated with the target video fragment from the at least one interaction information; establishing an index of a target video fragment in an index file of a live video, wherein the index of the target video fragment comprises an address of the target video fragment and target interaction information; and when receiving a video request sent by a viewer client of the live video, sending the index file to the viewer client. The embodiment of the invention can realize the real-time interaction between the anchor and the audience, simplify the live broadcast interaction process, improve the interaction efficiency in the live broadcast process, reduce the processing burden of the client and the server, and improve the practicability and the user experience.

Description

Live broadcast data processing method and device, server, terminal and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to the field of data processing technologies, and in particular, to a live data processing method, a live data processing apparatus, a server for processing live data, a terminal for processing live data, and a computer storage medium.
Background
Streaming media live video refers to that when media information (such as audio and video information) is collected, the media information being collected is published and transmitted by using a streaming media technology, so that a client can play the media information being collected through the internet. At present, interaction between a main broadcast and audiences can be realized in the process of playing a live video, and the principle mainly comprises the following steps: the method comprises the steps that an anchor client sends interactive information to a server, the server stores the interactive information, a spectator client obtains the serial number of a currently played TS (Transport Stream) fragment in a certain period (for example, 2 seconds and 3 seconds), and the serial number of the TS fragment is transmitted to the server to request the interactive information; the server judges whether the TS fragments have associated interactive information after receiving the request; if yes, returning the interactive information to the audience client for displaying. In the interaction technology in the existing streaming media video live broadcast, interactive information needs to be requested and transmitted in real time in the playing process of the live broadcast video, which causes interaction delay and reduces user experience; moreover, the spectator client sends the request to the server at regular time, which is tedious in operation and increases the processing burden of the spectator client and the server, and if the setting of the timing period is unreasonable, the acquisition of the interactive information may be lost, so that the efficiency is low, the practicability is poor, and the user experience is poor.
Disclosure of Invention
The embodiment of the invention provides a live broadcast data processing method, a live broadcast data processing device, a server, a terminal and a storage medium, which can realize real-time interaction between a main broadcast and audiences, reduce the processing burden of a client and the server and improve the practicability and user experience.
The embodiment of the invention provides a live data processing method, which comprises the following steps:
receiving video stream data and at least one interactive message sent by a main broadcast client of a live broadcast video;
processing the video stream data to obtain a target video fragment of the live video, and acquiring an address of the target video fragment;
selecting target interaction information associated with the target video fragment from the at least one interaction information;
establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and the target interaction information;
when a video request sent by a viewer client of the live video is received, the index file is sent to the viewer client, so that the viewer client acquires and plays the target video fragment according to the address of the target video fragment included in the index of the target video fragment in the index file, and the target interaction information is displayed on a playing interface of the target video fragment.
Another embodiment of the present invention provides a live data processing method, including:
a spectator client of the live video sends a video request to a server;
receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; the target interactive information is selected from at least one interactive information sent by the anchor client by the server;
reading the address of the target video fragment and the target interaction information from the index of the target video fragment included in the index file;
and acquiring and playing the target video fragment according to the address of the target video fragment, and displaying the target interaction information on a playing interface of the target video fragment.
The embodiment of the invention also provides a live broadcast data processing device, which is applied to the server and comprises the following components:
the receiving unit is used for receiving video stream data and at least one piece of interactive information sent by a main broadcasting client of live broadcast video;
the processing unit is used for processing the video stream data to obtain a target video fragment of the live video and acquiring an address of the target video fragment;
a selecting unit, configured to select, from the at least one piece of interaction information, target interaction information associated with the target video segment;
the establishing unit is used for establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and the target interaction information;
and the output unit is used for sending the index file to the audience client when receiving a video request sent by the audience client of the live video, so that the audience client acquires and plays the target video fragment according to the address of the target video fragment included in the index of the target video fragment in the index file, and displays the target interaction information on a playing interface of the target video fragment.
Another embodiment of the present invention provides a live data processing apparatus, applied to a viewer client of a live video, including:
a request unit for sending a video request to a server;
the receiving unit is used for receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; the target interactive information is selected from at least one interactive information sent by the anchor client by the server;
a reading unit, configured to read an address of the target video segment and the target interaction information from an index of the target video segment included in the index file;
and the processing unit is used for acquiring and playing the target video fragment according to the address of the target video fragment and displaying the target interaction information on a playing interface of the target video fragment.
An embodiment of the present invention further provides a server for processing live data, where the server includes:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium storing one or more instructions adapted to be loaded by the processor and to perform the steps of:
receiving video stream data and at least one interactive message sent by a main broadcast client of a live broadcast video;
processing the video stream data to obtain a target video fragment of the live video, and acquiring an address of the target video fragment;
selecting target interaction information associated with the target video fragment from the at least one interaction information;
establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and the target interaction information;
when a video request sent by a viewer client of the live video is received, the index file is sent to the viewer client, so that the viewer client acquires and plays the target video fragment according to the address of the target video fragment included in the index of the target video fragment in the index file, and the target interaction information is displayed on a playing interface of the target video fragment.
The embodiment of the present invention further provides a terminal for processing live broadcast data, where the terminal runs a viewer client of a live broadcast video, and the terminal includes an input device and an output device, and further includes:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium storing one or more instructions adapted to be loaded by the processor and to perform the steps of:
a spectator client of the live video sends a video request to a server;
receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; the target interactive information is selected from at least one interactive information sent by the anchor client by the server;
reading the address of the target video fragment and the target interaction information from the index of the target video fragment included in the index file;
and acquiring and playing the target video fragment according to the address of the target video fragment, and displaying the target interaction information on a playing interface of the target video fragment.
An embodiment of the present invention further provides a computer storage medium, where one or more first instructions are stored in the computer storage medium, and the one or more first instructions are suitable for being loaded by a processor and performing the following steps:
receiving video stream data and at least one interactive message sent by a main broadcast client of a live broadcast video;
processing the video stream data to obtain a target video fragment of the live video, and acquiring an address of the target video fragment;
selecting target interaction information associated with the target video fragment from the at least one interaction information;
establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and the target interaction information;
when a video request sent by a viewer client of the live video is received, the index file is sent to the viewer client, so that the viewer client acquires and plays the target video fragment according to the address of the target video fragment included in the index of the target video fragment in the index file, and the target interaction information is displayed on a playing interface of the target video fragment.
Another embodiment of the present invention provides a computer storage medium storing one or more second instructions adapted to be loaded by a processor and to perform the steps of:
a spectator client of the live video sends a video request to a server;
receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; the target interactive information is selected from at least one interactive information sent by the anchor client by the server;
reading the address of the target video fragment and the target interaction information from the index of the target video fragment included in the index file;
and acquiring and playing the target video fragment according to the address of the target video fragment, and displaying the target interaction information on a playing interface of the target video fragment.
After receiving video stream data and at least one piece of interaction information sent by a main broadcast client of a live broadcast video, the embodiment of the invention can process the video stream data and the at least one piece of interaction information to obtain a target video fragment, an address of the target video fragment and target interaction information associated with the target video fragment. Establishing an index of a target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and target interaction information; when a video request sent by a viewer client of the live video is received, sending the index file to the viewer client; because the index of the target video fragment contains the target interaction information and the index of the target video fragment is contained in the index file of the live video, the audience client can directly read the target interaction information from the index of the target video fragment contained in the index file, so as to avoid constantly requesting the server at regular time in the playing process of the live video, and thus, the resource consumption caused by frequent interaction between the client and the server is avoided; the audience client can display the target interaction information on the playing interface of the target video fragment, so that the real-time interaction between the anchor and the audience is realized, the live broadcast interaction efficiency is high, the practicability is high, and the user experience is good.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic architecture diagram of a live broadcast system according to an embodiment of the present invention;
fig. 2 is a schematic internal structural diagram of a live broadcast system according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a live data processing method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a live data processing method according to another embodiment of the present invention;
FIG. 5a is a schematic illustration showing a playback interface of a viewer client according to an embodiment of the present invention;
FIG. 5b is a schematic illustration of a playback interface of another viewer client according to an embodiment of the present invention;
FIG. 5c is a schematic illustration of a playback interface of another viewer client according to an embodiment of the present invention;
FIG. 6a is a schematic illustration of a playback interface of another viewer client according to an embodiment of the present invention;
FIG. 6b is a schematic illustration of a playback interface of another viewer client according to an embodiment of the present invention;
fig. 7a is a schematic view of an application scenario of a viewer client according to an embodiment of the present invention;
FIG. 7b is a schematic illustration of a playback interface of another viewer client according to an embodiment of the present invention;
fig. 8 is an interaction scene schematic diagram of a live data processing method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a live data processing apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a live data processing apparatus according to another embodiment of the present invention;
fig. 11 is a schematic structural diagram of a server according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Live video refers to the situation that a spectator can watch live audio and video live events, such as sports events, teaching and the like, which are ongoing at a main broadcasting client through the internet. Streaming media may also be called streaming media, and refers to a media format that is played on the internet by streaming. The live video based on the streaming media can be called as the live streaming media, and the live streaming media refers to that the collected media information is released and transmitted by using a streaming media technology while audio and video information is collected, so that a client of an audience can play the collected media information through the internet. The streaming media technology adopts a streaming transmission mode to transmit multimedia files on the Internet, wherein the multimedia files can comprise audio and video files, and then continuous audio and video are released and stored in a network media server after being compressed, so that a client of a viewer can play back the files while downloading the files, and the process of waiting for the completion of the downloading of all the multimedia files is not needed.
The streaming video live broadcast can be implemented in the live broadcast system shown in fig. 1. As shown in fig. 1, a live system may include a server 11, an anchor client 12, and at least one viewer client 13. The anchor client 12 is a client used by a user who issues a live video. The viewer client 13 refers to a client used by a user who requests to view and play the direct video. Both the anchor client 12 and the viewer client 13 may be operating in terminals, such as mobile phones, portable devices such as laptop or tablet computers, desktop computers, and the like. The server 11 may be a service device for providing a live broadcast service, which may be a data processing server, a web server, an application server corresponding to a live video APP, or the like; the server may be an independent service device, or may be a cluster device formed by a plurality of service devices.
In the live broadcasting system, the implementation process of the live broadcasting of the streaming media video is approximately as follows: firstly, a main broadcasting client side for broadcasting video live sends video stream data to a server in real time; the server collects video stream data sent by the anchor client in real time and encodes the video stream data to generate video fragments; video slices herein may refer to TS slices; thirdly, the server stores the generated TS fragments, obtains attribute information such as addresses, lengths, serial numbers and the like of the TS fragments, generates indexes of the TS fragments according to the attribute information, and then adds the indexes of the TS fragments to an index file of the live video; sending a video request to a server by a spectator client end of the live video, and returning an index file of the live video to the spectator client end by the server; after receiving the index file, the client of the audience can analyze the index file to obtain the index of the TS fragment, find the address of the TS fragment according to the index, and then download the TS fragment for playing. It should be noted that, after the video starts live broadcasting, the video stream data received by the server each time is a segment of video stream data in the live video, the video stream data may be encoded into one or more TS segments in real time, and the number of the generated TS segments is determined by the playing time of the video stream data and the playing time of each TS segment; for example, if the playing time of the TS segments is 2 seconds, and the playing time of the video stream data is 4 seconds, the server may process the video stream data to obtain 2 TS segments; for another example, if the playing time of the TS fragment is 2 seconds, and the playing time of the video stream data is 2 seconds, the server may process the video stream data to obtain 1 TS fragment. And the index of each TS fragment is generated in real time and added to the index file in real time, and the index file is updated to the audience client in real time so as to realize continuous real-time playing of the live video at the audience client. For convenience of description, unless otherwise specified, the obtained target video fragment in the embodiment of the present invention may be any one of TS fragments obtained by processing video stream data sent by a host client by a server.
In the process of live streaming media video, the anchor can also send interactive information to the server through the anchor client, and the server receives the interactive information and sends the interactive information to the audience client so as to realize interaction between the anchor and audiences. Aiming at the above process of live streaming media video, the embodiment of the invention improves the following steps: firstly, a main broadcasting client side for broadcasting video sends video stream data and at least one interactive message to a server in real time; the server collects video stream data and at least one piece of interactive information sent by the anchor client in real time, processes the video stream data to obtain a target video fragment of the live video and obtains the address of the target video fragment; selecting target interactive information associated with the target video fragment from at least one piece of interactive information; establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and target interaction information; a viewer client of the live video sends a video request to a server, and the server returns an index file of the live video to the viewer client; after receiving the index file, the viewer client analyzes the index file to obtain an index of the target video fragment, wherein the index not only contains the address of the target video fragment, but also contains target interaction information associated with the target video fragment, so that the viewer client can download the target video fragment for playing, and display the target interaction information in a playing interface. The live data processing method in the embodiment of the invention at least has the following advantages: (1) the server can send the target video fragments and the target interaction information to the audience client together in a file indexing mode, operations such as searching for the target interaction information according to the serial numbers of the target video fragments are not required to be executed, the target interaction information can be sent to the audience client in time, interaction timeliness is improved, and therefore user experience is improved; (2) because the index of the target video fragment comprises the target interaction information associated with the target video fragment, the audience client can know whether the target video file has the associated interaction information according to the index file and can directly obtain the target interaction information, a request for sending the interaction information to the server at fixed time is not needed, and resources are saved.
In the embodiment of the present invention, in the live streaming media video broadcast process, a live broadcast protocol is followed between the client and the server, and the live broadcast protocol may include but is not limited to: RTMP (Real Time Messaging Protocol) Protocol, hls (http Live streaming) Protocol, and the like. Unless otherwise stated, the subsequent embodiments of the present invention all use the HLS protocol as an example, and the HLS protocol is a streaming media solution and includes an index file (m3u8 file), a media fragment file (TS fragment), and an encryption string file (key). Here, the m3u8 file is an m3u file in UTF-8 encoding format, and is a plain text file in which indexes of a plurality of TS clips are recorded. When the audience client side plays the audio/video file, the m3u8 file is not directly played, but the m3u8 file is analyzed, the index of each TS fragment is obtained, and the address of the corresponding TS fragment is found according to the index for playing. The TS fragments are video fragments under the index of the m3u8 file and are also minimum playing content units under the HLS protocol, each TS fragment is a segment of live video content, and all TS fragments in the m3u8 file form a complete live video.
Please refer to the internal structure of the live broadcasting system shown in fig. 2. As shown in fig. 2, the anchor client 12 mainly includes two functional modules, a network module 121 and a protocol processing module 122. The viewer client 13 mainly includes: a network module 131, a protocol parsing module 132, a decoding and rendering module 133, and an interworking information logic processing module 134. The server may include the following functional modules: the system comprises a video live broadcast acquisition module 111, an encoding module 112, a storage address generation module 113, an interaction information management module 114 and a content distribution module 115. The execution principle of each functional module is as follows:
the anchor client 12 processes the video stream data and the interactive information through the protocol processing module 122, and sends to the server through the network module 121.
The server 11 collects, in real time, video stream data and at least one piece of interaction information sent by a host client of a live video through the live video collection module 111. After the at least one interactive information is collected, the at least one interactive information may be stored in the interactive information management module 114; after the video stream data is collected, the collected video stream data may be transmitted to the encoding module 112, and the encoding module 112 performs encoding processing according to the collected video stream data to generate the video slice. The video clips are then distributed by the content distribution module 115 and stored in the corresponding storage system. The storage address generation module 113 may acquire an address of the target video slice when generating the index of the target video slice, and request and acquire target interaction information associated with the target video slice from the interaction information management module 114. And establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and target interaction information.
The viewer client 13 may send a video request to the server through the network module 131 and receive an index file of the live video returned by the server. The protocol parsing module 132 parses the index file, and if target interaction information associated with the target video fragment is obtained, the target interaction information is transmitted to the interaction information logic processing module 134. After receiving the target interactive information, the interactive information logic processing module 134 may parse the content in the target interactive information and display or perform other logic processing on the content (such as displaying a title, an answer, or publishing the current competition progress). If the target video fragment is obtained, the target video fragment is stored in the buffer area, and the decoding and rendering module 133 decodes and renders the buffer data in the buffer area, and plays the data on the playing interface of the viewer client.
Based on the description of the above embodiments, an embodiment of the present invention provides a live data processing method, where the live data processing method may be executed by a server shown in fig. 1 or fig. 2. Referring to fig. 3, the live data processing method may include the following steps S101 to S105:
s101, receiving video stream data and at least one piece of interactive information sent by a main broadcast client of live broadcast video.
The anchor client of the live video refers to a client corresponding to a user who releases the live video. In the live video broadcasting process, the server can collect video stream data and at least one piece of interaction information sent by a main broadcasting client of the live video. The interaction information here may include at least one of: text information, voice information, image information, and the like.
S102, processing the video stream data to obtain a target video fragment of the live video, and acquiring an address of the target video fragment.
After acquiring the video stream data, the server may perform encoding processing on the video stream data to generate a target video slice (target TS slice). In an embodiment, because the requirement on real-time performance is high in the process of live broadcasting a video, when a target video segment is generated, the playing time of the target video segment may be controlled to be smaller than a first preset length threshold, and the first preset length threshold may be determined according to actual service requirements. For example, the playing time of the target video slice can be controlled within 1-2 seconds, so as to improve the real-time performance.
After the encoding is completed, the server may obtain one or more TS fragments. The server may store the one or more TS fragments in a corresponding storage system. In one embodiment, the server may store the one or more TS segments in a Content Delivery Network system, such as a CDN (Content Delivery Network). And the CDN distributes the one or more TS fragments to a storage server closest to the audience client, so that the audience client can acquire the TS fragments at a higher speed. Therefore, the server can store the target video fragment in the content distribution network system; and acquiring the address of the target video fragment from the content distribution network system.
S103, selecting target interactive information associated with the target video fragment from the at least one piece of interactive information.
Since the server may obtain one or more TS segments after encoding the video stream data, and the interaction information received by the server may be one or more TS segments, the server needs to select target interaction information associated with the target video segment from at least one interaction information. In one embodiment, the server may determine the receiving time of the video stream data and the receiving time of the at least one interactive information included in the target video slice according to the receiving time of the video stream data and the receiving time of the at least one interactive information. Specifically, the server may obtain a receiving time of video stream data included in the target video slice; acquiring the receiving time of at least one interactive message; selecting interactive information matched with the receiving time of video stream data contained in the target video fragment from the at least one piece of interactive information according to the receiving time of the at least one piece of interactive information; and determining the selected interaction information as target interaction information associated with the target video fragment. For example, when the server receives video stream data with a time length of 6 seconds at 11:10:06, and the playing time length of a TS fragment is 2 seconds, the server may obtain, from the video stream data, 3 TS fragments of TS1, TS2, and TS3 and the receiving time of the video stream data contained in the 3 TS fragments, as shown in table 1.
TABLE 1
Video slicing Duration of time Time of reception of included video stream data
TS1
2 seconds 11:10:06-11:10:08
TS2 2 seconds 11:10:08-11:10:10
TS3 2 seconds 11:10:10-11:10:12
If the TS1 is the target video segment, the receiving time of the interaction information 1 is 11:10:07, and the receiving time of the interaction information 2 is 11:10:09, it may be determined that the receiving time of the interaction information 1 matches the receiving time of the video stream data included in the target video segment TS1, so that the interaction information 1 may be determined as the target interaction information associated with the target video segment TS 1.
S104, establishing an index of the target video fragment in the index file of the live video, wherein the index of the target video fragment comprises the address of the target video fragment and target interaction information.
After acquiring the address of the target TS fragment and the target interaction information associated with the target TS fragment, the server can establish an index of the target video fragment in an index file of the live video. In one embodiment, an index entry may be allocated to the target TS slice in an index file of the live video, where the index entry includes a data field and an extension field; and storing the address of the target TS fragment into the data field, and storing the target interaction information into the extension field.
In one embodiment, the server may store the target interaction information in the form of program code into the extension field, for example, the extension field name may be "# EXT-QQLIVE-request", and the content of the target interaction information is "query: "1. professional basketball match, the highest score of goal" option: "1: 1 minute "" 2: 2 points and 3 points: 3 minutes ", the program code for writing the content of the target interactive information into the extension field may be as follows:
# EXT-QQLIVE-QUESTION { "QUESTION": 1. in the professional basketball game, the goal is the highest possible score, "" option "{" 1 ": "1 min" } { "2": "2 min" } { "3 min": "3 points" } } ]
In another embodiment, the server may store the target interaction information in a storage address, and then store the storage address in the extension field. If the target interaction information comprises contents such as images, audios and videos, the server may need to transcode the images or the audios and videos before storing the target interaction information in the extension field, and the generation efficiency of the index file is reduced. The target interactive information is stored in the storage address, so that the audience client can obtain the interactive information through the storage address without transcoding, and the generation efficiency of the index file can be improved.
It should be noted that, if the target TS fragment does not have target interaction information associated therewith, the index of the target TS fragment includes an address of the target TS fragment, that is, the index entry may include only a data field, and the address of the target TS fragment is stored in the data field. For example, when the server acquires target interaction information (interaction information 1) associated with the TS1 when establishing the index of the TS1, the index of the TS1 includes the address of the TS1 and the interaction information 1. When the server is generating an index for TS2, and does not obtain the target interaction information associated with TS2, the index for TS2 may include only the address of TS 2.
In one embodiment, the index of the target TS segment further includes a playing time length of the target TS segment, where the playing time length is smaller than a first preset length threshold; the first preset length threshold here may be set according to actual needs, for example: the first preset length threshold is 1 second, 2 seconds, etc.
S105, when a video request sent by a viewer client of a live video is received, sending an index file to the viewer client, enabling the viewer client to acquire and play the target video fragment according to the address of the target video fragment included in the index of the target video fragment in the index file, and displaying the target interaction information on a playing interface of the target video fragment.
In one embodiment, the video request carries an identifier of the live video, where the identifier may be a download address of the live video, a name of the live video, and the like. After receiving a video request sent by a viewer client, the server can obtain an index file of the live video according to identification information carried by the video request. Each live video can correspond to identification information, and the identification information is determined by the audience client according to the selection instruction of the audience to the live video.
After receiving video stream data and at least one piece of interaction information sent by a main broadcast client of a live broadcast video, the embodiment of the invention can process the video stream data and the at least one piece of interaction information to obtain a target video fragment, an address of the target video fragment and target interaction information associated with the target video fragment. Establishing an index of a target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and target interaction information; when a video request sent by a viewer client of the live video is received, sending the index file to the viewer client; because the index of the target video fragment contains the target interaction information and the index of the target video fragment is contained in the index file of the live video, the audience client can directly read the target interaction information from the index of the target video fragment contained in the index file, so as to avoid constantly requesting the server at regular time in the playing process of the live video, and thus, the resource consumption caused by frequent interaction between the client and the server is avoided; the audience client can display the target interaction information on the playing interface of the target video fragment, so that the real-time interaction between the anchor and the audience is realized, the live broadcast interaction efficiency is high, the practicability is high, and the user experience is good.
Based on the description of the above embodiment, another embodiment of the present invention further provides a flowchart of a live data processing method, where the live data processing method can be executed by the viewer client shown in fig. 1 or fig. 2. Referring to fig. 4, the live data processing method may include the following steps S201 to S204:
s201, a spectator client end of the live video sends a video request to a server.
The audience client of the live video refers to a client corresponding to a user watching the live video, and the number of the audience clients can be more than one. After acquiring the trigger instruction, the viewer client of the live video may send a video request to the server to acquire an index file of the live video. In an embodiment, the trigger instruction may be generated according to a detected operation of the viewer inputting a live video website in a browser of the viewer client, or may be generated according to a detected operation of the viewer opening a certain live video APP (Application) in the viewer client.
Because the server can generate a plurality of index files, one index file corresponds to one live video, in one embodiment, the video request can carry identification information of the live video, and the identification information can be used for indicating the server to determine the live video; for example, in a time period in which a viewer wants to watch a live video, there are three live videos in total, which are a sports event, a live answer and a live teaching, respectively, and the live video selected by the viewer is the sports event, so that when the viewer client sends a video request to the server, the video request may carry identification information of the sports event, so as to instruct the server to return an index file of the sports event to the viewer client.
S202, receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment.
The target video fragment is obtained by processing video stream data sent by a main broadcasting client of a live video by a server; the address of the target video fragment is obtained by the server; the target interactive information is selected and obtained from at least one interactive information sent by the anchor client side through the server.
After receiving the index file of the live video returned by the server, the viewer client may perform parsing on the index file to obtain an index of the target TS segment, and may perform step S203 after obtaining the index of the target TS segment.
S203, reading the address of the target video fragment and the target interaction information from the index of the target video fragment included in the index file.
And S204, acquiring and playing the target video fragment according to the address of the target video fragment, and displaying target interaction information on a playing interface of the target video fragment.
In one embodiment, the index file includes an index entry of the target TS fragment, the index of the target TS fragment corresponds to the index entry, and the index entry includes a data field and an extension field; the address of the target TS slice is stored in the data field and the target interaction information is stored in the extension field. Correspondingly, when the viewer client executes step S203, the index item of the target TS segment may be searched in the index file; and acquiring the address of the target TS fragment from the data field of the index entry, and acquiring the target interaction information from the extension field of the index entry. After acquiring the address of the target TS fragment in step S203, the target TS fragment may be acquired from a content distribution network system according to the address of the target TS fragment, and the target TS fragment is played; when playing the target TS segment, the target TS segment may be loaded to the buffer, and the buffer performs decoding and rendering, and plays the target video segment loaded by the buffer. The length of the buffer area is smaller than a second preset length threshold value. The length of the buffer may determine a delay time length of the player when playing the live video, for example, if the length of the buffer is 1.75 seconds, it indicates that the player delays for at most 1.75 seconds when playing the live video. The second preset length threshold may be determined according to actual service requirements.
In an embodiment, if the network address (i.e. the storage address of the target interactive information) is obtained from the extension field of the index entry, the viewer client obtains the interactive information according to the network address, and displays the target interactive information on the playing interface of the target TS segment.
In one embodiment, when the viewer client displays the target interactive information on the playing interface of the target TS fragment, the playing interface may be divided into a first playing area and a second playing area; continuing to play the target TS segment in the first playing area, and displaying the target interactive information in the second playing area, as shown in fig. 5 a. In still another embodiment, an interactive window may pop up in the playing interface; and continuing to play the target TS segments on the play interface, and displaying the target interaction information in the interaction window, as shown in fig. 5 b. In yet another embodiment, the target interaction information may be displayed in the form of a message notification bar on the play interface, as shown in fig. 5 c. It should be noted that the above listed manners of displaying the target interaction information on the playing interface of the target TS segment are only examples, and are not exhaustive.
In one embodiment, the interaction information may include at least one of: questions and options, answers, guessing questions, guessing results. The audience client can also collect audience interaction information of the live video in the playing process and perform service processing on the audience interaction information; the viewer interaction information may include at least one of: the answer information submitted aiming at the questions and the options, the operation information carried out aiming at the answers, the guess information returned aiming at the guess questions and the question information submitted aiming at the guess results.
For example: if the interactive information includes questions and options, the viewer interactive information may be response information submitted by the viewer for the questions and options. The viewer client may display the questions and options in the playback interface of the target TS clip, as shown in fig. 6 a. After seeing the question, the viewer can select the answer which the viewer thinks is correct by clicking the options displayed on the playing interface within a specified time. The spectator client may collect the options selected by the spectator, and after obtaining the correct answer to the question according to the index file, match the correct answer with the answer selected by the spectator to determine whether the answer is correct or not, and output the result on the playing interface, as shown in fig. 6 b. If the viewer client does not collect the viewer's selection instruction within the specified time, i.e. the viewer does not make a selection within the specified time, the error processing can be performed according to the viewer's answer.
For another example, if the interaction information includes an answer, the viewer interaction information may be operation information performed on the answer, and the operation information may be click information in which the viewer clicks the answer to obtain answer details. The viewer client may display the answer in the playing interface of the target TS fragment, and if the viewer is confused about the answer, the viewer may click the answer in the playing interface, as shown in fig. 7 a. After collecting the click command of the viewer on the answer, the viewer client may display details of the answer on a play interface, as shown in fig. 7 b.
In the embodiment of the invention, after the audience client sends the video request to the server and receives the index file of the live video returned by the server, the target TS fragments and the target interaction information can be obtained according to the indexes of the target TS fragments included in the index file. The audience client is not required to continuously request the server for the interactive information through the timed service, so that the resources are saved.
Based on the description of the above method embodiment, an interactive scene schematic diagram of a live data processing method is also provided in the embodiments of the present invention, as shown in fig. 8.
When the anchor A carries out video live broadcasting, information such as limb actions and the like can be recorded through the camera shooting assembly configured on the anchor client, and voice information can be recorded through the microphone configured on the anchor client. The camera shooting component and the microphone may be components configured by the anchor client when the anchor client leaves the factory, or may be external devices externally connected to the anchor client. The anchor client can generate an audio and video file after collecting the information recorded by the anchor A, and the audio and video file is sent to the server in real time as the video streaming data of the live video. After receiving the video stream data, the server may perform encoding processing on the video stream data to obtain a target TS fragment and obtain an address of the target TS fragment.
Anchor a may interact with the audience during the live video by asking questions, such as reciting the question "summary of basketball games in professional, score the highest score for a goal" against the microphone. After the anchor client collects the voice information of the anchor A, the voice information can be sent to the server as interactive information. After receiving the interaction information, the server may determine that the interaction information is associated with the target TS segment, that is, the interaction information is the target interaction information. Therefore, when the server establishes the index of the target TS fragment in the index file of the live video, the target interaction information and the address of the target TS fragment can be filled in the index of the target TS fragment, and the index file containing the index of the target TS fragment is sent to the audience client.
In the process of playing the live video, if it is detected that the player is about to play the target TS segment according to the serial number of the TS segment, the viewer client may acquire and play the target TS segment according to the index of the target TS segment included in the index file, and display the target interaction information on the playing interface of the target TS segment.
After receiving the video stream data and the at least one interactive message sent by the anchor client, the embodiment of the invention can carry out a series of processing on the video stream data and the at least one interactive message to obtain the target TS fragment, the address of the target TS fragment and the target interactive message associated with the target TS fragment. Establishing an index of a target TS fragment in an index file of a live video, wherein the index of the target TS fragment comprises an address of the target TS fragment and target interaction information; when a video request sent by a spectator client side of the live video is received, sending the index file to the spectator client side; because the interactive information is contained in the index file of the live video, the audience client can know which video segments (TS segments) have the interactive information according to the index file and can directly obtain the target interactive information associated with the video segments, and the interactive information can be timely output in the playing process of the live video, so that the purpose of real-time interaction is achieved, and the user experience is improved.
Based on the description of the above live data processing method embodiment, the embodiment of the present invention discloses a live data processing apparatus, which is applied to a server, and the live data processing apparatus may be a computer program (including a program code) running in the server, or may be an entity apparatus included in the server. The live data processing apparatus may perform the method illustrated in fig. 3. Referring to fig. 9, the live data processing apparatus operates as follows:
the receiving unit 101 is configured to receive video stream data and at least one piece of interaction information sent by a main broadcast client of a live broadcast.
And the processing unit 102 is configured to process the video stream data to obtain a target video fragment of the live video, and obtain an address of the target video fragment.
A selecting unit 103, configured to select, from the at least one piece of interaction information, target interaction information associated with the target video slice.
An establishing unit 104, configured to establish an index of the target video segment in an index file of the live video, where the index of the target video segment includes an address of the target video segment and the target interaction information.
And the output unit 105 is configured to send the index file to the viewer client when receiving a video request sent by the viewer client of the live video, so that the viewer client obtains and plays the target video segment according to the address of the target video segment included in the index of the target video segment in the index file, and displays the target interaction information on a playing interface of the target video segment.
In one embodiment, the processing unit 102 may be specifically configured to:
encoding the video stream data to generate target video fragments;
storing the target video fragment into a content distribution network system;
and acquiring the address of the target video fragment from the content distribution network system.
In another embodiment, the selecting unit 103 may be specifically configured to:
acquiring the receiving time of video stream data contained in the target video fragment;
acquiring the receiving time of the at least one interactive message;
selecting interactive information matched with the receiving time of video stream data contained in the target video fragment from the at least one piece of interactive information according to the receiving time of the at least one piece of interactive information;
and determining the selected interaction information as target interaction information associated with the target video fragment.
In another embodiment, the establishing unit 104 may be specifically configured to:
distributing an index item for the target video fragment in an index file of the live video, wherein the index item comprises a data field and an extension field;
and storing the address of the target video fragment into the data field, and storing the target interaction information into the extension field.
In another embodiment, the index of the target video segment further includes a playing time of the target video segment, and the playing time is less than a first preset length threshold.
The steps involved in the method shown in fig. 3 may be performed by units in the live data processing apparatus shown in fig. 9, according to an embodiment of the present invention. For example, steps S101, S102, S103, S104, S105 shown in fig. 3 may be performed by the receiving unit 101, the processing unit 102, the selecting unit 103, the establishing unit 104, and the outputting unit 105 shown in fig. 9, respectively.
According to another embodiment of the present invention, the units in the live data processing apparatus shown in fig. 9 may be respectively or entirely combined into one or several other units to form one or several other units, or some unit(s) may be further split into multiple units with smaller functions to form the same operation, without affecting the achievement of the technical effect of the embodiment of the present invention. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present invention, the live data processing apparatus may also include other units, and in practical applications, these functions may also be implemented by assistance of other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present invention, a live data processing apparatus device as shown in fig. 9 may be constructed by running a computer program (including program codes) capable of executing steps involved in the corresponding method as shown in fig. 3 on a general-purpose computing device such as a computer including a processing element and a storage element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a live data processing method of an embodiment of the present invention may be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded and executed in the above-described computing apparatus via the computer-readable recording medium.
After receiving video stream data and at least one piece of interaction information sent by a main broadcast client of a live broadcast video, the embodiment of the invention can carry out a series of processing on the video stream data and the at least one piece of interaction information to obtain a target video fragment, an address of the target video fragment and target interaction information associated with the target video fragment. Establishing an index of a target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address and interactive information of the target video fragment; when a video request sent by a viewer client of the live video is received, sending the index file to the viewer client; because the interactive information is contained in the index file of the live video, the audience client can know which video clips (TS clips) have the interactive information according to the index file and can directly obtain the target interactive information associated with the video clips, so that the purpose of real-time interaction is achieved, and the user experience is improved.
Based on the above description of the embodiment of the live data processing method, another embodiment of the present invention further discloses a live data processing apparatus, which is applied to a viewer client of a live video, and the live data processing apparatus may be a computer program (including a program code) running in a terminal, or may be an entity apparatus included in the terminal. The live data processing apparatus may perform the method illustrated in fig. 4. Referring to fig. 10, the live data processing apparatus operates as follows:
a request unit 201, configured to send a video request to a server.
A receiving unit 202, configured to receive an index file of a live video returned by the server, where the index file includes an index established by the server for a target video segment of the live video, and the index of the target video segment includes an address of the target video segment and target interaction information associated with the target video segment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; and the target interactive information is selected and obtained from at least one interactive information sent by the anchor client side by the server.
A reading unit 203, configured to read an address of the target video segment and target interaction information according to the index of the target video segment included in the index file.
And the processing unit 204 is configured to acquire and play the target video segment according to the address of the target video segment, and display the target interaction information on a play interface of the target video segment.
In one embodiment, the index file includes an index entry of the target video slice, where the index entry includes a data field and an extension field;
the address of the target video slice is stored in the data field and the target interaction information is stored in the extension field.
In another embodiment, the reading unit 203 can be specifically configured to:
searching an index item of the target video fragment in the index file;
and acquiring the address of the target video fragment from the data field of the index entry, and acquiring the target interaction information from the extension field of the index entry.
In another embodiment, the processing unit 204 may be specifically configured to:
acquiring the target video fragment from a content distribution network system according to the address of the target video fragment;
and playing the target video fragment.
In another embodiment, the processing unit 204 may be specifically configured to:
loading the target video fragment into a buffer area, wherein the length of the buffer area is smaller than a second preset length threshold value;
and playing the target video fragments loaded in the buffer area.
In yet another embodiment, the interaction information includes at least one of: questions and options, answers, guessing questions, guessing results; the processing unit 204 is further configured to:
collecting audience interaction information of the live video in the playing process, and carrying out service processing on the audience interaction information;
the audience interaction information comprises at least one of: the answer information submitted aiming at the questions and the options, the operation information carried out aiming at the answers, the guess information returned aiming at the guess questions and the question information submitted aiming at the guess results.
The steps involved in the method shown in fig. 4 may be performed by units in the live data processing apparatus shown in fig. 10, according to an embodiment of the present invention. For example, steps S201, S202, S203, S204 shown in fig. 4 may be performed by the requesting unit 201, the receiving unit 202, the reading unit 203, and the processing unit 204 shown in fig. 10, respectively.
According to another embodiment of the present invention, the units in the live data processing apparatus shown in fig. 10 may be respectively or entirely combined into one or several other units to form one or several other units, or some unit(s) may be further split into multiple units with smaller functions to form the same operation, without affecting the achievement of the technical effect of the embodiment of the present invention. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present invention, the live data processing apparatus may also include other units, and in practical applications, these functions may also be implemented by assistance of other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present invention, a live data processing apparatus device as shown in fig. 10 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the corresponding method as shown in fig. 4 on a general-purpose computing device such as a computer including a processing element and a storage element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like, and a live data processing method of an embodiment of the present invention may be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded and executed in the above-described computing apparatus via the computer-readable recording medium.
In the embodiment of the invention, after the audience client sends the video request to the server and receives the index file of the live video returned by the server, the target TS fragments and the target interaction information associated with the target TS fragments can be obtained according to the indexes of the target TS fragments included in the index file. The audience client is not required to continuously request the server for the interactive information through the timed service, so that the resources are saved.
Based on the method and the device shown in the embodiment, the embodiment of the invention also provides a server, and the server can be used for processing live broadcast data. Referring to fig. 11, the internal structure of the server at least includes an encoder 301, a processor 302, a communication interface 303 and a computer storage medium 304. The encoder 301, the processor 302, the communication interface 303 and the computer storage medium 304 in the server may be connected by a bus or other means, and in fig. 11 shown in the embodiment of the present invention, the connection by the bus 305 is taken as an example.
Communication interface 303 is the medium that enables interaction and information exchange between the server and either the anchor client or the viewer client. The processor 302 (or CPU) is a computing core and a control core of the server, and is adapted to implement one or more instructions, and specifically, adapted to load and execute one or more instructions so as to implement a corresponding method flow or a corresponding function. The encoder 301 may be configured to perform encoding processing according to the video stream data collected by the server to generate a TS fragment.
In the specific implementation process of the embodiment of the invention, video stream data and at least one piece of interactive information sent by a main broadcast client of a live video can be acquired through a communication interface 303, the video stream data is encoded through an encoder 301 to generate a target TS fragment, a processor 302 acquires an address of the target TS fragment, target interactive information associated with the target TS fragment is selected from the at least one piece of interactive information, an index of the target TS fragment is established in an index file of the live video, and the index of the target video fragment comprises the address of the target video fragment and the target interactive information; when a video request sent by a viewer client of the live video is received, the index file is sent to the viewer client, and so on.
A computer storage medium (Memory)304 is a Memory device in the server for storing programs and data. It is understood that the computer storage medium herein may include both the built-in storage medium of the server and, of course, the extended storage medium supported by the server. The computer storage media provides storage space that stores the operating system of the server. Also, one or more instructions, which may be one or more computer programs (including program code), are stored in the memory space and are adapted to be loaded and executed by the processor. The computer storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer storage medium located remotely from the processor.
In an embodiment of the present invention, the processor 302 loads and executes one or more instructions stored in the computer storage medium to implement the corresponding steps of the method flow shown in fig. 3; in a specific implementation, one or more first instructions in the computer storage medium are loaded by the processor 302 and perform the following steps:
receiving video stream data and at least one interactive message sent by a main broadcast client of a live broadcast video;
processing the video stream data to obtain a target video fragment of the live video, and acquiring an address of the target video fragment;
selecting target interaction information associated with the target video fragment from the at least one interaction information;
establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and the target interaction information;
and when a video request sent by a viewer client of the live video is received, sending the index file to the viewer client, so that the viewer client acquires and plays the target video fragment according to the index of the target video fragment included in the index file, and displaying the target interaction information on a playing interface of the target video fragment.
In an embodiment, when the video stream data is processed to obtain a target video fragment of the live video and obtain an address of the target video fragment, the one or more first instructions are loaded and executed by the processor 302:
encoding the video stream data to generate target video fragments;
storing the target video fragment into a content distribution network system;
and acquiring the address of the target video fragment from the content distribution network system.
In yet another embodiment, in selecting the target interactive information associated with the target video slice from the at least one interactive information, the one or more first instructions are loaded and executed by the processor 302 to:
acquiring the receiving time of video stream data contained in the target video fragment;
acquiring the receiving time of the at least one interactive message;
selecting interactive information matched with the receiving time of video stream data contained in the target video fragment from the at least one piece of interactive information according to the receiving time of the at least one piece of interactive information;
and determining the selected interaction information as target interaction information associated with the target video fragment.
In another embodiment, when the index of the target video segment is established in the index file of the live video, the one or more first instructions are loaded and executed by the processor 302:
distributing an index item for the target video fragment in an index file of the live video, wherein the index item comprises a data field and an extension field;
and storing the address of the target video fragment into the data field, and storing the target interaction information into the extension field.
In another embodiment, the index of the target video segment further includes a playing time of the target video segment, and the playing time is less than a first preset length threshold.
After receiving video stream data and at least one piece of interaction information sent by a main broadcast client of a live broadcast video, the embodiment of the invention can carry out a series of processing on the video stream data and the at least one piece of interaction information to obtain a target video fragment, an address of the target video fragment and target interaction information associated with the target video fragment. Establishing an index of a target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and target interaction information; when a video request sent by a viewer client of the live video is received, sending the index file to the viewer client; because the interactive information is contained in the index file of the live video, the audience client can know which video clips (TS clips) have the interactive information according to the index file and can directly obtain the target interactive information associated with the video clips, so that the purpose of real-time interaction is achieved, and the user experience is improved.
Based on the description of the method embodiment and the device embodiment, the embodiment of the present invention further provides a terminal, where the terminal may be used to perform live data processing. And the terminal runs a spectator client with live video. Referring to fig. 12, the internal structure of the terminal includes at least a decoder 401, a processor 402, an input device 403, an output device 404, and a computer storage medium 405. The decoder 401, the processor 402, the input device 403, the output device 404, and the computer storage medium 405 in the terminal may be connected by a bus or other means, and are exemplified by being connected by a bus 406 in fig. 12 shown in the embodiment of the present invention.
In a specific implementation process of the embodiment of the invention, a video request can be sent to a server through an output device 404, an index file of a live video returned by the server is received through an input device 403, and an address and target interaction information of a target video fragment are read through a processor 402 according to an index of the target video fragment included in the index file; and obtaining the target video fragment according to the target video fragment quota address. And then the decoder 401 decodes the target video fragment, and after the decoding is completed, the processor 402 plays the decoded target video fragment, and displays the target interaction information on a playing interface of the target video fragment.
The computer storage medium 405 may be used to store a computer program comprising program instructions for execution by the processor of the program instructions stored by the computer storage medium. The computer storage medium is a memory device in the terminal for storing programs and data. It is understood that the computer storage medium herein may include a built-in storage medium in the terminal, and may also include an extended storage medium supported by the terminal. The computer storage medium provides a storage space that stores an operating system of the terminal. Also, one or more instructions, which may be one or more computer programs (including program code), are stored in the memory space and are adapted to be loaded and executed by the processor. The computer storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer storage medium located remotely from the processor.
In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by processor 402 to perform the corresponding steps of the method shown in FIG. 4; in a specific implementation, one or more second instructions in the computer storage medium are loaded by the processor 402 and perform the following steps:
a spectator client of the live video sends a video request to a server;
receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; the target interactive information is selected from at least one interactive information sent by the anchor client by the server;
reading the address of the target video fragment and the target interaction information according to the index of the target video fragment included in the index file;
and acquiring and playing the target video fragment according to the address of the target video fragment, and displaying the target interaction information on a playing interface of the target video fragment.
In one embodiment, the index file includes an index entry of the target video slice, where the index entry includes a data field and an extension field;
the address of the target video slice is stored in the data field and the target interaction information is stored in the extension field.
In another embodiment, when the address of the target video segment and the target interaction information are read according to the index of the target video segment included in the index file, the one or more second instructions are loaded and executed by the processor 402:
searching an index item of the target video fragment in the index file;
and acquiring the address of the target video fragment from the data field of the index entry, and acquiring the target interaction information from the extension field of the index entry.
In another embodiment, when the target video segment is obtained and played according to the address of the target video segment, the one or more second instructions are loaded and executed by the processor 402:
acquiring the target video fragment from a content distribution network system according to the address of the target video fragment;
and playing the target video fragment.
In yet another embodiment, when playing the target video segment, the one or more second instructions are loaded and executed by the processor 402:
loading the target video fragment into a buffer area, wherein the length of the buffer area is smaller than a second preset length threshold value;
and playing the target video fragments loaded in the buffer area.
In yet another embodiment, the interaction information includes at least one of: questions and options, answers, guessing questions, guessing results; the one or more second instructions may also be loaded and executed by the processor 402 to:
collecting audience interaction information of the live video in the playing process, and carrying out service processing on the audience interaction information;
the audience interaction information comprises at least one of: the answer information submitted aiming at the questions and the options, the operation information carried out aiming at the answers, the guess information returned aiming at the guess questions and the question information submitted aiming at the guess results.
In the embodiment of the invention, after the audience client sends the video request to the server and receives the index file of the live video returned by the server, the target TS fragments and the target interaction information associated with the target TS fragments can be obtained according to the indexes of the target TS fragments included in the index file. The audience client is not required to continuously request the server for the interactive information through the timed service, so that the resources are saved.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (17)

1. A live data processing method is characterized by comprising the following steps:
receiving video stream data and at least one interactive message sent by a main broadcast client of a live broadcast video;
processing the video stream data to obtain a target video fragment of the live video, and acquiring an address of the target video fragment;
selecting target interaction information associated with the target video segment from the at least one piece of interaction information, wherein the target interaction information is as follows: in the at least one piece of interactive information, the receiving time of the interactive information is matched with the receiving time of video stream data contained in the target video fragment;
establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and the target interaction information;
when a video request sent by a viewer client of the live video is received, the index file is sent to the viewer client, so that the viewer client acquires and plays the target video fragment according to the address of the target video fragment included in the index of the target video fragment in the index file, and the target interaction information is displayed on a playing interface of the target video fragment.
2. The method of claim 1, wherein the processing the video stream data to obtain a target video slice of the live video and obtaining an address of the target video slice comprises:
encoding the video stream data to generate target video fragments;
storing the target video fragment into a content distribution network system;
and acquiring the address of the target video fragment from the content distribution network system.
3. The method of claim 1, wherein said selecting target interaction information associated with the target video slice from the at least one interaction information comprises:
acquiring the receiving time of video stream data contained in the target video fragment;
acquiring the receiving time of the at least one interactive message;
selecting interactive information matched with the receiving time of video stream data contained in the target video fragment from the at least one piece of interactive information according to the receiving time of the at least one piece of interactive information;
and determining the selected interaction information as target interaction information associated with the target video fragment.
4. The method of claim 1, wherein the indexing the target video segment in an index file of the live video comprises:
distributing an index item for the target video fragment in an index file of the live video, wherein the index item comprises a data field and an extension field;
and storing the address of the target video fragment into the data field, and storing the target interaction information into the extension field.
5. The method of any of claims 1-4, wherein the index of the target video slice further comprises a play-out duration of the target video slice; the playing time is less than a first preset length threshold.
6. A live data processing method is characterized by comprising the following steps:
a spectator client of the live video sends a video request to a server;
receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; the target interaction information is selected and obtained from at least one interaction information sent by the anchor client side by the server, and the target interaction information refers to: in the at least one piece of interactive information, the receiving time of the interactive information is matched with the receiving time of video stream data contained in the target video fragment;
reading the address of the target video fragment and the target interaction information from the index of the target video fragment included in the index file;
and acquiring and playing the target video fragment according to the address of the target video fragment, and displaying the target interaction information on a playing interface of the target video fragment.
7. The method of claim 6, wherein the index file comprises an index entry of the target video slice, the index entry comprising a data field and an extension field;
the address of the target video slice is stored in the data field and the target interaction information is stored in the extension field.
8. The method of claim 7, wherein the reading the address of the target video slice and the target interaction information according to the index of the target video slice included in the index file comprises:
searching an index item of the target video fragment in the index file;
and acquiring the address of the target video fragment from the data field of the index entry, and acquiring the target interaction information from the extension field of the index entry.
9. The method according to any of claims 6-8, wherein the obtaining and playing the target video segment according to the address of the target video segment comprises:
acquiring the target video fragment from a content distribution network system according to the address of the target video fragment;
and playing the target video fragment.
10. The method of claim 9, wherein the playing the target video segment comprises:
loading the target video fragment into a buffer area, wherein the length of the buffer area is smaller than a second preset length threshold value;
and playing the target video fragments loaded in the buffer area.
11. The method of claim 6, wherein the method further comprises:
collecting audience interaction information of the live video in the playing process, and carrying out service processing on the audience interaction information;
wherein the interaction information comprises at least one of: questions and options, answers, guessing questions, guessing results; the audience interaction information comprises at least one of: the answer information submitted aiming at the questions and the options, the operation information carried out aiming at the answers, the guess information returned aiming at the guess questions and the question information submitted aiming at the guess results.
12. A live broadcast data processing device applied to a server is characterized by comprising:
the receiving unit is used for receiving video stream data and at least one piece of interactive information sent by a main broadcasting client of live broadcast video;
the processing unit is used for processing the video stream data to obtain a target video fragment of the live video and acquiring an address of the target video fragment;
a selecting unit, configured to select, from the at least one piece of interaction information, target interaction information associated with the target video segment, where the target interaction information is: in the at least one piece of interactive information, the receiving time of the interactive information is matched with the receiving time of video stream data contained in the target video fragment;
the establishing unit is used for establishing an index of the target video fragment in an index file of the live video, wherein the index of the target video fragment comprises an address of the target video fragment and the target interaction information;
and the output unit is used for sending the index file to the audience client when receiving a video request sent by the audience client of the live video, so that the audience client acquires and plays the target video fragment according to the address of the target video fragment included in the index of the target video fragment in the index file, and displays the target interaction information on a playing interface of the target video fragment.
13. A live data processing apparatus for use at a viewer client of a live video, comprising:
a request unit for sending a video request to a server;
the receiving unit is used for receiving an index file of the live video returned by the server, wherein the index file comprises an index established by the server for a target video fragment of the live video, and the index of the target video fragment comprises an address of the target video fragment and target interaction information associated with the target video fragment; the target video fragment is obtained by processing video stream data sent by a main broadcast client of the live broadcast video by the server; the address of the target video fragment is obtained by the server; the target interaction information is selected and obtained from at least one interaction information sent by the anchor client side by the server, and the target interaction information refers to: in the at least one piece of interactive information, the receiving time of the interactive information is matched with the receiving time of video stream data contained in the target video fragment;
a reading unit, configured to read an address of the target video segment and the target interaction information from an index of the target video segment included in the index file;
and the processing unit is used for acquiring and playing the target video fragment according to the address of the target video fragment and displaying the target interaction information on a playing interface of the target video fragment.
14. A server for live data processing, comprising:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium having one or more instructions stored thereon, the one or more instructions adapted to be loaded by the processor and to perform a live data processing method as claimed in any of claims 1-5.
15. A terminal for processing live data, the terminal running a viewer client of live video, the terminal comprising an input device and an output device, the terminal further comprising:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium having one or more instructions stored thereon, the one or more instructions adapted to be loaded by the processor and to perform a live data processing method as claimed in any of claims 6-11.
16. A computer storage medium having one or more first instructions stored thereon, the one or more first instructions adapted to be loaded by a processor and to perform a live data processing method as claimed in any one of claims 1-5.
17. A computer storage medium having one or more second instructions stored thereon, the one or more second instructions adapted to be loaded by a processor and to perform a live data processing method as claimed in any of claims 6-11.
CN201810388944.9A 2018-04-26 2018-04-26 Live broadcast data processing method and device, server, terminal and storage medium Active CN108391179B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810388944.9A CN108391179B (en) 2018-04-26 2018-04-26 Live broadcast data processing method and device, server, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810388944.9A CN108391179B (en) 2018-04-26 2018-04-26 Live broadcast data processing method and device, server, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN108391179A CN108391179A (en) 2018-08-10
CN108391179B true CN108391179B (en) 2021-07-27

Family

ID=63064967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810388944.9A Active CN108391179B (en) 2018-04-26 2018-04-26 Live broadcast data processing method and device, server, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN108391179B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109600678B (en) * 2018-12-19 2021-11-02 北京达佳互联信息技术有限公司 Information display method, device and system, server, terminal and storage medium
CN109960731B (en) * 2019-03-28 2022-11-18 腾讯音乐娱乐科技(深圳)有限公司 Data processing method, device and storage medium
CN110290392B (en) * 2019-06-28 2021-05-14 广州酷狗计算机科技有限公司 Live broadcast information display method, device, equipment and storage medium
CN110636335B (en) * 2019-09-24 2022-04-08 中电鸿信信息科技有限公司 HLS (HTTP live streaming) quick sharing method for real-time video
CN110636340B (en) * 2019-09-30 2021-11-09 普联技术有限公司 Video file uploading method, storage device, terminal device and storage medium
CN112969093B (en) * 2019-12-13 2023-09-08 腾讯科技(北京)有限公司 Interactive service processing method, device, equipment and storage medium
CN111182328B (en) * 2020-02-12 2022-03-25 北京达佳互联信息技术有限公司 Video editing method, device, server, terminal and storage medium
CN111526430A (en) * 2020-03-26 2020-08-11 王东 File matching method and device and electronic equipment
CN111787382A (en) * 2020-07-03 2020-10-16 北京英迈琪科技有限公司 Data interaction method and system
CN114189699B (en) * 2020-09-15 2024-07-19 钉钉(中国)信息技术有限公司 Government service information providing method and device and electronic equipment
CN112261118B (en) * 2020-10-19 2022-03-25 腾讯科技(深圳)有限公司 Multimedia data anomaly detection method, terminal and server
CN112423012B (en) * 2020-11-18 2023-05-09 青岛华升联信智慧科技有限公司 Multi-stage load live broadcast method
CN114697746A (en) * 2020-12-28 2022-07-01 北京金山云网络技术有限公司 Video playing starting method and device, electronic equipment and system
CN113438520B (en) * 2021-06-29 2023-01-03 北京奇艺世纪科技有限公司 Data processing method, device and system
CN113742519A (en) * 2021-08-31 2021-12-03 杭州登虹科技有限公司 Multi-object storage cloud video Timeline storage method and system
CN114025201A (en) * 2021-10-29 2022-02-08 恒安嘉新(北京)科技股份公司 Video playing method, device, equipment and storage medium
CN114071174A (en) * 2021-11-15 2022-02-18 咪咕文化科技有限公司 Processing method of live content, electronic equipment and readable storage medium
CN114302218A (en) * 2021-12-29 2022-04-08 北京力拓飞远科技有限公司 Interactive video generation method, system and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103632332A (en) * 2013-11-29 2014-03-12 腾讯科技(成都)有限公司 Subject question and answer method, device and system
CN104219785B (en) * 2014-08-20 2018-07-24 小米科技有限责任公司 Real-time video providing method, device and server, terminal device
CN104683884B (en) * 2015-02-09 2018-08-07 网宿科技股份有限公司 A kind of stream media live broadcasting method and system
CN106028137A (en) * 2016-06-22 2016-10-12 北京小米移动软件有限公司 Live streaming processing method and apparatus
CN106162230A (en) * 2016-07-28 2016-11-23 北京小米移动软件有限公司 The processing method of live information, device, Zhu Boduan, server and system

Also Published As

Publication number Publication date
CN108391179A (en) 2018-08-10

Similar Documents

Publication Publication Date Title
CN108391179B (en) Live broadcast data processing method and device, server, terminal and storage medium
US11039218B1 (en) Systems, apparatus and methods for rendering digital content relating to a sporting event with online gaming information
US9344517B2 (en) Downloading and adaptive streaming of multimedia content to a device with cache assist
CN109257631B (en) Video carousel playing method and device, computer equipment and storage medium
CN108810052B (en) Live broadcast server selection method and device
US11736749B2 (en) Interactive service processing method and system, device, and storage medium
US7971223B2 (en) Method and system of queued management of multimedia storage
US12047615B2 (en) Methods and systems for dynamic routing of content using a static playlist manifest
EP2493191B1 (en) Method, device and system for realizing hierarchically requesting content in http streaming system
US9986267B2 (en) Methods and systems for dynamically editing, encoding, posting and updating live video content
CN105472401B (en) The method and system of advertisement are played during network direct broadcasting
WO2019128800A1 (en) Content service implementation method and device, and content delivery network node
CN103607634A (en) Method for reducing network video ordering terminal user waiting time
US20230379531A1 (en) Systems, apparatus and methods for rendering digital content
CN113141522B (en) Resource transmission method, device, computer equipment and storage medium
CN109842804A (en) Processing method and server, the computer storage medium of audio, video data
CN107690093B (en) Video playing method and device
CN111510789A (en) Video playing method, system, computer equipment and computer readable storage medium
CN105592369B (en) A kind of video frequency abstract processing method and processing device
CN113079386A (en) Video online playing method and device, electronic equipment and storage medium
US20150026711A1 (en) Method and apparatus for video content distribution
CN113301374A (en) Live broadcast audio and video processing method and device, client and server
CN112235592A (en) Live broadcast method, live broadcast processing method, device and computer equipment
CN110784734A (en) Multifunctional player with freely changeable interface
CN115734033A (en) Video playing method and device and computer readable storage medium

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