Method and device for playing live broadcast audio and video, computer and storage medium
Technical Field
The embodiment of the invention relates to an audio and video processing technology, in particular to a method and a device for playing live audio and video, a computer and a storage medium.
Background
With the development of network technology, more and more people acquire required information through networks. Especially, the audio and video live broadcast integrates rich elements such as images, characters and sounds, and the like, and the audio and video live broadcast is luxuriant in sound and is gradually accepted by more and more users.
However, in the current audio and video live broadcast process, when the anchor end updates the code rate of the current audio and video, the audio and video data with the updated code rate is pushed to the streaming media server, and the streaming media server pushes the received audio and video data to the corresponding client, so that the client can only play the live broadcast audio and video with one code rate, the code stream of the currently played live broadcast audio and video cannot be switched, and the client cannot adjust the definition of the currently played live broadcast streaming media according to the network state of the client and other factors, therefore, the problems of blockage of the live broadcast video and the like caused by the network factors easily exist, and the live broadcast flexibility is low.
Disclosure of Invention
The invention provides a method, a device, a computer and a storage medium for playing live audio and video, which are used for determining pushed live audio and video data according to the dynamic receiving code rate of a client.
In a first aspect, an embodiment of the present invention provides a method for playing a live audio/video, where the method includes:
the method comprises the steps that a business server receives at least two code rate identifications sent by a streaming media server, wherein the code rate identifications comprise a master code rate identification of master audio and video data sent by a master terminal and at least one slave code rate identification, and the slave code rate identifications correspond to slave audio and video data generated by code rate conversion of the master audio and video data by the streaming media server;
the service server acquires the maximum receiving code rate of the client and determines a target code rate identifier matched with the maximum receiving code rate from a master code rate identifier and a slave code rate identifier according to a preset matching rule;
and the business server sends the target code rate identification to the streaming media server so that the streaming media server pushes corresponding audio and video data to the client.
Optionally, the obtaining, by the service server, the maximum receiving code rate of the client, and determining, according to a preset matching rule, a target code rate identifier matching the maximum receiving code rate from the master code rate identifier and the slave code rate identifier, includes:
if the maximum receiving code rate is larger than a first code rate of the master audio video data, or the absolute value of the difference between the maximum receiving code rate and the first code rate is smaller than or equal to a first preset value, determining the master code rate identifier as the target code rate identifier;
and if the maximum receiving code rate is smaller than the first code rate of the master audio video data and the absolute value of the difference between the maximum receiving code rate and the first code rate is larger than the first preset value, screening a slave code rate identifier matched with the maximum receiving code rate, and determining the slave code rate identifier obtained by screening as the target code rate identifier.
Optionally, the sending, by the service server, the target code rate identifier to the streaming media server, so that the streaming media server pushes corresponding audio and video data to the client, where the sending includes:
and the business server sends the target code rate identification to the streaming media server so that the streaming media server determines address information corresponding to the audio and video data according to the target code rate identification, reads the audio and video data according to the address information and pushes the audio and video data to the client.
Optionally, after the audio and video data is pushed to the client, the method further includes:
if the target code rate identification is the slave code rate identification, the standard live broadcast time and the current broadcast time of the audio and video data are obtained, a recommended broadcast rate is generated according to the standard live broadcast time and the current broadcast time, and the recommended broadcast rate is sent to the client, so that the client broadcasts the audio and video data according to the recommended broadcast rate.
Optionally, after the service server sends the target code rate identifier to the streaming media server, so that the streaming media server pushes corresponding audio and video data to the client, the method further includes:
the business server receives a code rate change request sent by a client, wherein the code rate change request carries expected code rate information;
and the service server determines a change code rate identifier matched with the expected code rate information, and sends the change code rate identifier to the streaming media server so that the streaming media server pushes corresponding audio and video data to the client.
Optionally, after the service server sends the target bitrate identifier to the streaming media server, the method further includes:
and the service server sends the target code rate identification to the client so that the client updates the code rate display identification of the client according to the target code rate identification.
Optionally, after updating the code rate identifier of the client according to the target code rate identifier, the method further includes:
the business server counts the client number proportion of the target code rate identification as a slave code rate identification and a master code rate identification;
and if the number proportion of the clients is greater than a preset proportion, generating code rate change information and sending the code rate change information to the anchor terminal so that the anchor terminal adjusts the audio and video acquisition code rate according to the code rate change information.
In a second aspect, an embodiment of the present invention further provides a device for playing a live video, where the device includes:
the code rate identification receiving module is used for receiving at least two code rate identifications sent by a streaming media server, wherein the code rate identifications comprise a main code rate identification of main audio and video data sent by a main broadcast end and at least one slave code rate identification, and the slave code rate identification corresponds to slave audio and video data generated by code rate conversion of the main audio and video data by the streaming media server;
the target code rate identification determining module is used for acquiring the maximum receiving code rate of the client and determining a target code rate identification matched with the maximum receiving code rate according to a preset matching rule;
and the first audio and video data pushing module is used for sending the target code rate identifier to the streaming media server so as to enable the streaming media server to push corresponding audio and video data to the client.
Optionally, the target code rate identifier determining module is specifically configured to:
if the maximum receiving code rate is larger than a first code rate of the master audio video data, or the absolute value of the difference between the maximum receiving code rate and the first code rate is smaller than or equal to a first preset value, determining the master code rate identifier as the target code rate identifier;
and if the maximum receiving code rate is smaller than the first code rate of the master audio video data and the absolute value of the difference between the maximum receiving code rate and the first code rate is larger than the first preset value, screening a slave code rate identifier matched with the maximum receiving code rate, and determining the slave code rate identifier obtained by screening as the target code rate identifier.
Optionally, the first audio/video data pushing module is specifically configured to:
and the business server sends the target code rate identification to the streaming media server so that the streaming media server determines address information corresponding to the audio and video data according to the target code rate identification, reads the audio and video data according to the address information and pushes the audio and video data to the client.
Optionally, the device further includes a play rate recommending module, configured to, after the audio and video data is pushed to the client, if the target code rate identifier is a slave code rate identifier, obtain a standard live broadcast time and a current play time of the audio and video data, generate a recommended play rate according to the standard live broadcast time and the current play time, and send the recommended play rate to the client, so that the client plays the audio and video data according to the recommended play rate.
Optionally, the apparatus further includes a code rate change request module, configured to send the target code rate identifier to the streaming media server by the service server, so that after the streaming media server pushes corresponding audio and video data to the client, the service server receives a code rate change request sent by the client, where the code rate change request carries information about an expected code rate;
and the second audio and video data pushing module is used for determining a change code rate identifier matched with the expected code rate information by the service server and sending the change code rate identifier to the streaming media server so that the streaming media server pushes corresponding audio and video data to the client.
Optionally, the apparatus further includes a code rate display identifier updating module, configured to send the target code rate identifier to the client by the service server after the service server sends the target code rate identifier to the streaming media server, so that the client updates the code rate display identifier of the client according to the target code rate identifier.
Optionally, the apparatus further includes an identifier statistics module, configured to, after updating the code rate identifier of the client according to the target code rate identifier, count, by the service server, a client number ratio in which the target code rate identifier is a slave code rate identifier and a master code rate identifier;
and the acquisition code rate feedback module is used for generating code rate change information and sending the code rate change information to the anchor terminal if the number proportion of the clients is greater than a preset proportion, so that the anchor terminal adjusts the audio and video acquisition code rate according to the code rate change information.
In a third aspect, an embodiment of the present invention further provides a service server, which includes a memory, a processor, and a computer program that is stored in the memory and can be run on the processor, where when the processor executes the program, a live audio and video playing method as provided in any embodiment of the present invention is implemented.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for playing live audio and video according to any embodiment of the present invention.
In the embodiment of the invention, the service server obtains the maximum receiving code rate of the client and determines the target code rate identification matched with the maximum receiving code rate from the main code rate identification and the slave code rate identification according to the preset matching rule, so that the sent audio and video data are matched with the receiving capability of the client, and the problem that a user cannot smoothly browse live audio and video due to the fact that the client cannot smoothly receive live broadcast blockage and audio and video jumping formed by the fact that the audio and video code rate is larger than the maximum receiving code rate of the client is avoided.
Drawings
FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present invention;
fig. 2 is a flowchart of a method for playing a live video and audio according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for playing a live video and audio according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a playing apparatus for live broadcasting audio and video according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a service server according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of the embodiment of the present invention, and includes an anchor terminal 101, a streaming media server 102, a service server 103, and a client 104, where the anchor terminal 101 refers to a terminal that acquires and generates audio and video, and may be a mobile terminal such as a smart phone or a tablet computer that is provided with an audio and video acquisition device, or may be a terminal such as a computer that is provided with an audio and video acquisition device. The client 104 refers to a client for receiving and playing the anchor audio and video data, and the client may be a terminal such as a computer, a smart phone or a tablet computer, where multiple clients may receive the audio and video data pushed by the same anchor simultaneously. The streaming media server 102 is mainly used for transmitting a video file to a client by a streaming protocol for online watching by a user, and also used for receiving a real-time video stream from video acquisition and compression software and then broadcasting the video stream to the client by the streaming protocol. The service server 103 is a newly added server and is configured to coordinate a code rate of the audio and video data pushed by the anchor terminal and a receiving code rate of the client.
The anchor terminal 101 may be connected to the streaming media server 102 and the service server 103 through a wireless network, the client terminal 104 may be connected to the streaming media server 102 and the service server 103 through a wireless network, and the streaming media server 102 and the service server 103 may be connected through a wireless network.
Example one
Fig. 2 is a flowchart of a live audio and video playing method according to an embodiment of the present invention, where this embodiment is applicable to a case where live audio and video data is determined according to a dynamic bitrate of a user end, and the method may be executed by the service server 103 provided in the embodiment of the present invention, and specifically may be implemented in a software and/or hardware manner deployed on the service server 103. The method specifically comprises the following steps:
s110, the service server receives at least two code rate identifications sent by the streaming media server, wherein the code rate identifications comprise a main code rate identification of main audio and video data sent by a main broadcast end and at least one slave code rate identification, and the slave code rate identification corresponds to slave audio and video data generated by code rate conversion of the main audio and video data by the streaming media server.
The code rate mark is a symbol for marking code rate, and can be Chinese characters, numbers, symbols or any combination of the above forms. Illustratively, the code rate identification can be in a Chinese character form such as but not limited to "high definition", "super definition", or "standard definition". Alternatively, one code rate identification may correspond to a range of code rates.
In this embodiment, after the anchor end generates the main audio and video data, the anchor end sends the main audio and video data to the streaming media data through stream pushing software, and sends a main code rate identifier of the code rate of the main audio and video data.
After receiving the master audio and video data, the streaming media server performs rate conversion on the received master audio and video data to generate slave audio and video data with different rates, and simultaneously generates a slave rate identifier corresponding to each slave audio and video data, and optionally, the rate of the slave audio and video data is smaller than that of the master audio and video data.
The stream media data sends the main code rate identification and the at least one slave code rate identification to the service server, or simultaneously sends the main code rate identification to the service server when the anchor side sends the main audio and video data, and the stream media data sends the at least one slave code rate identification to the service server after transcoding is completed.
It should be noted that the streaming media server may perform rate conversion on the master audio and video data to generate at least one two or more slave audio and video data. Each slave audio and video data corresponds to one slave code rate identifier, so that one, two or more slave code rate identifiers corresponding to the slave audio and video data can be provided.
S120, the service server obtains the maximum receiving code rate of the client, and determines a target code rate identification matched with the maximum receiving code rate from the main code rate identification and the slave code rate identification according to a preset matching rule.
The maximum receiving code rate of the client refers to a maximum code rate corresponding to a situation that data reception is smooth for a user, optionally, the maximum receiving code rate may be determined according to a real-time network speed of the client, optionally, the service server obtains the maximum receiving code rate of the client according to a preset interval time, illustratively, the preset interval time starts 1 minute, 5 minutes, 10 minutes, or the like. In this embodiment, the service server may be a client that determines to receive the audio and video data of the anchor terminal, and further obtains the maximum receiving code rate of the client.
In this embodiment, the audio and video data pushed to the client is determined according to the maximum receiving code rate of the client, optionally, a target code rate identifier of the audio and video data pushed to the client is determined according to the maximum receiving code rate of the client, and the corresponding audio and video data is determined according to the target code rate identifier.
Optionally, determining, according to a preset matching rule, a target code rate identifier matching the maximum receiving code rate from the master code rate identifier and the slave code rate identifier, includes: if the maximum receiving code rate is larger than the first code rate of the main audio video data, or the absolute value of the difference value between the maximum receiving code rate and the first code rate is smaller than or equal to a first preset value, determining the main code rate identifier as a target code rate identifier; and if the maximum receiving code rate is smaller than the first code rate of the master audio video data and the absolute value of the difference value between the maximum receiving code rate and the first code rate is larger than a first preset value, screening a slave code rate identifier matched with the maximum receiving code rate, and determining the slave code rate identifier obtained by screening as a target code rate identifier.
The first preset value refers to an allowable error range of the maximum receiving code rate and the first code rate. If the maximum receiving code rate is larger than the first code rate of the master audio video data, or the absolute value of the difference between the maximum receiving code rate and the first code rate is smaller than or equal to a first preset value, the maximum receiving code rate of the client side can support smooth receiving of the master audio video data, and the master code rate identification is determined as the target code rate identification.
If the maximum receiving code rate is smaller than the first code rate of the master audio video data and the absolute value of the difference between the maximum receiving code rate and the first code rate is larger than a first preset value, the maximum receiving code rate of the client cannot support smooth receiving of the master audio video data, and a slave code rate identifier matched with the maximum receiving code rate is screened. Each slave code rate identification corresponds to a code rate of the slave audio and video data, and if the code rate of one slave audio and video data is within a preset error range of the maximum receiving code rate, the corresponding slave code rate identification is determined as a target code rate identification; and if the code rate of any slave audio/video data is not within the preset error range of the maximum receiving code rate, determining the slave code rate identifier corresponding to the slave audio/video data with the minimum code rate as the target code rate identifier.
S130, the service server sends the target code rate identification to the streaming media server so that the streaming media server pushes corresponding audio and video data to the client.
And after determining the target code rate identification, the service server sends the target code rate identification to the streaming media server. And the streaming media server determines corresponding audio and video data according to the target code rate identification and pushes the corresponding audio and video data to the client.
Optionally, step S130 includes: and the service server sends the target code rate identification to the streaming media server so that the streaming media server determines address information corresponding to the audio and video data according to the target code rate identification, reads the audio and video data according to the address information and pushes the audio and video data to the client.
The streaming media server is provided with mapping information of code rate identification and address information of the audio and video data, the address information of the audio and video data corresponding to the target code rate identification can be determined according to the mapping information, and the audio and video data can be obtained based on the address information of the audio and video data.
In the embodiment, the target code rate identification matched with the maximum receiving code rate of the client is determined, so that the sent audio and video data is matched with the receiving capability of the client, and the problem that a user cannot smoothly browse live audio and video due to live broadcast jamming and audio and video jumping caused by the fact that the client cannot smoothly receive the audio and video data because the audio and video code rate is larger than the maximum receiving code rate of the client is solved.
Optionally, after the audio and video data is pushed to the client, the method further includes: and if the target code rate identification is the slave code rate identification, acquiring the standard live broadcast time and the current broadcast time of the audio and video data, generating a recommended broadcast rate according to the standard live broadcast time and the current broadcast time, and sending the recommended broadcast rate to the client so that the client broadcasts the audio and video data according to the recommended broadcast rate.
In this embodiment, when the target bitrate identifier is the slave bitrate identifier, the audio and video data pushed to the client is the slave audio and video data, and the slave audio and video data can be formed only by performing bitrate conversion on the master audio and video data by the streaming media server, so that there is a time delay in pushing the slave audio and video data. When the target code rate identification is determined to be the slave code rate identification, the business server simultaneously sends the recommended play rate, so that the client can play the audio and video data according to the recommended play rate, the play rate of the slave audio and video data is improved, and the watching progress of a user of the client receiving the slave audio and video data and the watching progress of a user of the client receiving the master audio and video data are reduced.
The standard live broadcast time of the slave audio and video data refers to the play time of the master audio and video data, the current play time can be the play time of the slave audio and video data at the client, and when a difference value exists between the standard live broadcast time and the current play time, the play of the slave audio and video data is delayed. Optionally, the recommended play rate is related to a difference between the standard live broadcast time and the current play time. Illustratively, the larger the difference between the standard live broadcast time and the current broadcast time is, the larger the broadcast delay of the slave audio/video data is, the larger the recommended broadcast rate is; correspondingly, the smaller the difference between the standard live broadcast time and the current broadcast time is, the smaller the broadcast delay of the slave audio/video data is, and the smaller the recommended broadcast rate is, so as to reduce the broadcast delay of the slave audio/video data. The recommended play rate may be, but is not limited to, a play rate 1.5 times, a play rate 2 times, or a play rate 3 times of the normal play rate.
In the embodiment, after the slave audio and video data matched with the maximum receiving code rate is pushed to the client, the playing speed of the slave audio and video data is increased according to the playing delay, so that the delay of the standard live audio and video is reduced on the basis that a user smoothly plays all live audio and video data, and the watching experience of the live user is improved.
Optionally, after the service server sends the target code rate identifier to the streaming media server, so that the streaming media server pushes the corresponding audio and video data to the client, the method further includes: a business server receives a code rate change request sent by a client, wherein the code rate change request carries expected code rate information; and the service server determines a change code rate identifier matched with the expected code rate information, and sends the change code rate identifier to the streaming media server so that the streaming media server pushes corresponding audio and video data to the client.
The code rate change request refers to a request which is sent by a client and carries expected code rate information, and the expected code rate information can be a code rate value or a code rate identifier.
After receiving a code rate change request, a business server determines an anchor terminal or live broadcast audio and video data corresponding to a client terminal, determines whether a code rate identifier matched with expected code rate information exists, and if so, determines a change code rate identifier and sends the change code rate identifier to a streaming media server so that the streaming media server pushes the corresponding audio and video data to the client terminal; and if the code rate identification matched with the expected code rate information does not exist, the service server sends prompt information to the client.
In the embodiment, the service server can determine the corresponding audio and video data according to the expected code rate information in the received code rate change request, so that the live broadcast audio and video data can be sent according to the requirements of users, the definition of the currently played live broadcast streaming media can be adjusted, and the flexibility of the live broadcast audio and video is improved.
According to the technical scheme of the embodiment, the service server obtains the maximum receiving code rate of the client and determines the target code rate identification matched with the maximum receiving code rate from the master code rate identification and the slave code rate identification according to the preset matching rule, so that the sent audio and video data are matched with the receiving capability of the client, and the problem that a user cannot smoothly browse live audio and video due to the fact that the audio and video code rate is larger than the maximum receiving code rate of the client and live broadcast blockage and audio and video jumping formed by the fact that the client cannot smoothly receive the audio and video data is avoided.
On the basis of the above technical solution, after updating the code rate identifier of the client according to the target code rate identifier, the method further includes: the business server counts the client quantity proportion of the target code rate identification as the slave code rate identification and the master code rate identification; and if the number proportion of the clients is greater than the preset proportion, generating code rate change information and sending the code rate change information to the anchor terminal so that the anchor terminal adjusts the audio and video acquisition code rate according to the code rate change information.
The method comprises the steps that a plurality of clients can simultaneously receive and play audio and video data of the same anchor, and a service server counts client data with target code rate identifications respectively being slave code rate identifications and master code rate identifications and client data proportion after determining the target code rate identification corresponding to each client. When the client data ratio of the slave code rate identifier and the master code rate identifier is greater than a preset ratio, the preset ratio may be 1:1 or 3:2, for example, which indicates that a large number of clients cannot smoothly receive master audio and video data, and the service server generates code rate change information and sends the code rate change information to the anchor terminal. The code rate change information is code rate reduction information, so that the collecting code rate of the live broadcast audio and video is reduced by the anchor terminal, audio and video data meeting the requirements of a large number of users are pushed, the client terminal can receive the main audio and video data, and the live broadcast watching experience of the users is improved.
Example two
Fig. 3 is a flowchart of a method for playing a live video and audio according to a second embodiment of the present invention, and on the basis of the second embodiment, a method for updating a client code rate display identifier is further provided. Specifically, the method comprises the following steps:
s210, the service server receives at least two code rate identifications sent by the streaming media server.
The code rate identification comprises a main code rate identification of the main audio and video data sent by the anchor terminal and at least one slave code rate identification, and the slave code rate identification corresponds to slave audio and video data generated by performing code rate conversion on the main audio and video data by the streaming media server.
S220, the service server obtains the maximum receiving code rate of the client, and determines a target code rate identification matched with the maximum receiving code rate from the main code rate identification and the slave code rate identification according to a preset matching rule.
And S230, the service server sends the target code rate identifier to the streaming media server so that the streaming media server pushes the corresponding audio and video data to the client.
S240, the service server sends the target code rate identification to the client so that the client updates the code rate display identification of the client according to the target code rate identification.
In this embodiment, when the streaming media server pushes the audio and video data to the client, the service server sends the target code rate identifier corresponding to the audio and video data to the client, so that the client updates the code rate display identifier of the client when receiving the target code rate identifier, thereby avoiding a problem that a user cannot know a change condition of the code rate when the code rate of the audio and video data pushed to the client changes, so that the code rate of the currently played audio and video data is not matched with the code rate display identifier of the playing interface.
Optionally, the updating, by the client, the code rate display identifier of the client according to the target code rate identifier includes: the client detects whether the current code rate display identification is the same as the target code rate identification; if not, updating the current code rate display identification according to the target code rate identification, and if the target code rate display identification is the same, keeping the current code rate display identification unchanged.
In the embodiment, when the audio and video data are pushed, the target code rate identification is sent to the client, and the code rate display identification of the client is updated in real time, so that the code rate display identification is matched with the played audio and video data, manual setting or refreshing of a user is not needed, and the intelligence of a live broadcast interface is improved.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a playing apparatus for live video and audio provided by a third embodiment of the present invention, where the apparatus includes:
a code rate identifier receiving module 310, configured to receive at least two code rate identifiers sent by a streaming media server, where the code rate identifiers include a master code rate identifier of master audio and video data sent by a master terminal and at least one slave code rate identifier, and the slave code rate identifier corresponds to slave audio and video data generated by performing code rate conversion on the master audio and video data by the streaming media server;
a target code rate identifier determining module 320, configured to obtain a maximum receiving code rate of the client, and determine a target code rate identifier matching the maximum receiving code rate according to a preset matching rule;
the first audio/video data pushing module 330 is configured to send the target code rate identifier to the streaming media server, so that the streaming media server pushes corresponding audio/video data to the client.
Optionally, the target code rate identifier determining module 320 is specifically configured to:
if the maximum receiving code rate is larger than the first code rate of the main audio video data, or the absolute value of the difference value between the maximum receiving code rate and the first code rate is smaller than or equal to a first preset value, determining the main code rate identifier as a target code rate identifier;
and if the maximum receiving code rate is smaller than the first code rate of the master audio video data and the absolute value of the difference value between the maximum receiving code rate and the first code rate is larger than a first preset value, screening a slave code rate identifier matched with the maximum receiving code rate, and determining the slave code rate identifier obtained by screening as a target code rate identifier.
Optionally, the first audio and video data pushing module 330 is specifically configured to:
and the service server sends the target code rate identification to the streaming media server so that the streaming media server determines address information corresponding to the audio and video data according to the target code rate identification, reads the audio and video data according to the address information and pushes the audio and video data to the client.
Optionally, the device further includes a play rate recommending module, configured to, after the audio and video data is pushed to the client, if the target code rate identifier is the slave code rate identifier, obtain a standard live broadcast time and a current play time of the audio and video data, generate a recommended play rate according to the standard live broadcast time and the current play time, and send the recommended play rate to the client, so that the client plays the audio and video data according to the recommended play rate.
Optionally, the apparatus further includes a code rate change request module, configured to send the target code rate identifier to the streaming media server by the service server, so that after the streaming media server pushes corresponding audio and video data to the client, the service server receives a code rate change request sent by the client, where the code rate change request carries information about an expected code rate;
and the second audio and video data pushing module is used for determining a change code rate identifier matched with the expected code rate information by the service server and sending the change code rate identifier to the streaming media server so that the streaming media server pushes the corresponding audio and video data to the client.
Optionally, the apparatus further includes a code rate display identifier updating module, configured to send the target code rate identifier to the client by the service server after the service server sends the target code rate identifier to the streaming media server, so that the client updates the code rate display identifier of the client according to the target code rate identifier.
Optionally, the apparatus further includes an identifier counting module, configured to count, by the service server, a client quantity ratio in which the target code rate identifier is the slave code rate identifier and the master code rate identifier after updating the code rate identifier of the client according to the target code rate identifier;
and the acquisition code rate feedback module is used for generating code rate change information and sending the code rate change information to the anchor terminal if the number proportion of the clients is greater than a preset proportion, so that the anchor terminal adjusts the audio and video acquisition code rate according to the code rate change information.
The live audio and video playing device provided by the embodiment of the invention can execute the live audio and video playing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the live audio and video playing method.
Example four
Fig. 5 is a schematic structural diagram of a service server according to a fourth embodiment of the present invention. Referring to fig. 5, the service server includes:
one or more processors 410;
a memory 420 for storing one or more programs;
when the one or more programs are executed by the one or more processors 410, the one or more processors 410 implement the method for playing the live audio and video, which is provided by the embodiment of the present invention.
FIG. 5 illustrates an example of a processor; the processor and memory may be connected by a bus or other means, such as by a bus in FIG. 5.
The memory, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules. The processor executes various functional applications and data processing of the service server by running the software program, the instructions and the modules stored in the memory, namely the method for playing the live audio and video is realized.
The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the service server, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory may further include memory remotely located from the processor, and these remote memories may be connected to the service server over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
In addition, according to different forms of the service server, in addition to the processor and the memory, the control service server may further include other modules or structures, for example, the service server may have a voice broadcasting function and may further include a speaker; for another example, the service server may be a device having a display function, and further includes a display screen for displaying map data, and also allows a user to perform touch operation on the navigation software interface.
The service server provided by the embodiment of the present invention and the method for playing live videos and audios provided by the embodiment of the present invention belong to the same inventive concept, and technical details that are not described in detail in the embodiment of the present invention may refer to the above embodiment, and the embodiment of the present invention has the same beneficial effects as the above embodiment of the present invention.
EXAMPLE five
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for playing live audio and video according to an embodiment of the present invention.
The computer-readable storage medium provided by the embodiment and the method for playing live videos and audios provided by the embodiment belong to the same inventive concept, and technical details that are not described in detail in the embodiment can be referred to the above embodiment, and the embodiment and the above embodiment have the same beneficial effects.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.