TECHNICAL FIELD
[0001] This application relates to the field of video playing, and in particular, to a media
stream sending method and apparatus, and a device.
BACKGROUND
[0002] A user may watch a video in a live broadcast mode or a video on demand mode. In the
video on demand mode, when watching the video, the user can fast forward or rewind
video content at any time, but cannot fast forward or rewind video content in the
live broadcast mode. Live broadcast may be generally understood as a process in which
all frames of data are labeled with time sequence tags and then are streamed. Specifically,
a collection apparatus such as a camera or a microphone continuously collects audio
or video information, then performs processing on the information such as encoding,
encapsulation, and stream pushing, and then transmits the information through a delivery
network. A playing end continuously downloads data, and decodes the data based on
a time sequence for playing. An overall procedure of video live broadcast includes
a series of processes: collection, encoding, stream pushing, transcoding, delivery,
decoding/rendering, and the like.
[0003] Mainstream vendors for Internet video live broadcast usually use a unicast transmission
protocol for video transmission. Therefore, if N users are watching a video, there
are N channels of video streams. In addition, for enterprise live video broadcast,
functions such as sharing a presented document and making text comments need to be
supported during video live broadcast. That is, the shared document and the text comments
are displayed while video content is displayed on a web page of the enterprise live
broadcast, to satisfy user requirements and improve user experience.
[0004] To improve user experience and save backbone network bandwidth, a live content delivery
network (content delivery network, CDN) is typically deployed on a live broadcast
platform. The live CDN is a distributed content delivery platform and supports a multi-layer
architecture. On the live CDN platform, servers for caching can be deployed at different
layers, to provide a nearby service for users in different regions.
[0005] In a process of delivering audio and video streams by using the live CDN, a real
time message protocol (real time messaging protocol, RTMP), also referred to as a
real time message transport protocol, is typically used in video stream pushing and
stream distribution processes; and three protocols are typically used in a delivery
process: the RTMP, an HLS (HTTP live streaming) protocol, and a hypertext transfer
protocol (hyper text transfer protocol, HTTP)-flash video (FLV), where the hypertext
transfer protocol-flash video is referred to as "HTTP-FLV" for short. The HLS is an
HTTP-based streaming media transmission protocol developed by Apple Inc. The HLS is
mainly applied to iOS devices, including iPhones, iPads, iPod touches, and Mac OS
X, to provide audio and video live services and recorded content (VOD) services. The
HLS has the following advantage: By using the HLS, a client does not request a complete
data stream at a time; instead, streaming media data is segmented into smaller files
with shorter duration at a server end and the smaller files are accessed in sequence
based on index files. Audio and video can be played provided that the client continuously
and sequentially plays the smaller files obtained from the server.
[0006] As shown in FIG. 1, in the live CDN, a content source (content source) sends audio
and video media streams to an enterprise data center (enterprise data center, EDC)
using the RTMP, where the EDC includes a web server (Web server) and a plurality of
media servers (media server). The web server in the EDC responds to a request, from
a client, for watching a live program, authenticates a user, and allocates a closest
media server to provide a service for the user based on a location of the user. The
selected media server sends the audio and video media streams to a lower-level region
data center (region data center, RDC) according to a preset policy. After receiving
the media stream (live content), a media server in the RDC delivers, according to
a preset policy, the media stream to a lower-level media server in a server room (server
room, SR). Finally, the media server in the server room caches the media stream (the
live content) delivered by the upper-level media server, and directly provides a live
broadcast service for the user.
[0007] In this process, the media server in the upper-level RDC needs to send the live media
stream to each client that requests the media stream in a live broadcast room, so
that the media server in the upper-level RDC needs to send the live media stream to
each user in the live broadcast room. When there are a large quantity of users that
enter the live broadcast room, a large quantity of wide area network (wide area network,
WAN) resources are required for live media stream transmission, resulting in heavy
network overheads.
CN 109 104 614 A discloses a live broadcast buffering system and a method. The system runs on a live
broadcast buffering server. When a plurality of clients request FLV live broadcast
video stream from the live broadcast buffering system, the system obtains the live
broadcast video stream from a video program source station and provides the live broadcast
buffering service for the plurality of clients.
CN 108 235 042 A discloses a multiplayer network live broadcasting method and device, an adding device
and system. The multiplayer network live broadcasting method comprises the following
steps: setting a first user identifier as a deputy broadcaster identifier of a communication
room according to a live broadcasting adding request when receiving the live broadcasting
adding request sent by a deputy broadcaster terminal, wherein the live broadcasting
adding request carries the first user identifier and a room identifier of the communication
room in which the deputy broadcaster terminal needs to add; and then acquiring a first
access address corresponding to the first user identifier, sending the first access
address to the deputy broadcaster terminal corresponding to the first user identifier,
thereby enabling the deputy broadcaster terminal to send video data to an anchor terminal
corresponding to an anchor member identifier in the communication room and an audience
terminal corresponding to the audience member identifier according to the first access
address.
SUMMARY
[0008] The claimed subject matter is defined in claims 1, 11 and 21. Preferred embodiments
are defined in the dependent claims. Embodiments of this application provide a media
stream sending method and apparatus, and a device, to reduce resource overheads for
sending a media stream by a media server to clients in a same live broadcast room.
Specifically, the embodiments of this application disclose the following technical
solutions.
[0009] The invention is defined according to the appended claims.
BRIEF DESCRIPTION OF DRAWINGS
[0010]
FIG. 1 is a schematic diagram of an architecture of a live broadcast system according
to this application;
FIG. 2 is a schematic diagram of an architecture of a unilateral proxy system for
video live broadcast according to an embodiment of this application;
FIG. 3 is a flowchart of a media stream sending method according to an embodiment
of this application;
FIG. 4A to FIG. 4D are a signaling flowchart of a media stream sending method according
to an embodiment of this application;
FIG. 5A and FIG. 5B are a signaling flowchart of another media stream sending method
according to an embodiment of this application;
FIG. 6A and FIG. 6B are a signaling flowchart of still another media stream sending
method according to an embodiment of this application;
FIG. 7A and FIG. 7B are a signaling flowchart of still another media stream sending
method according to an embodiment of this application;
FIG. 8A and FIG. 8B are a signaling flowchart of still another media stream sending
method according to an embodiment of this application;
FIG. 9 is a schematic structural diagram of a media stream sending apparatus according
to an embodiment of this application; and
FIG. 10 is a schematic structural diagram of a network device according to an embodiment
of this application.
DESCRIPTION OF EMBODIMENTS
[0011] To make a person skilled in the art better understand the technical solutions in
the embodiments of this application, and make the objectives, features, and advantages
of the embodiments of this application clearer, the following further describes the
technical solutions in the embodiments of this application in detail with reference
to the accompanying drawings.
[0012] Before the technical solutions in the embodiments of this application are described,
an application scenario of the embodiments of this application is first described
with reference to the accompanying drawings.
[0013] The technical solutions of this application may be applied to a content delivery
network (content delivery network, CDN) system. The system includes a proxy server
(proxy server). The proxy server is configured to: act as a proxy for a video bearer
protocol of a user, identify roles of all clients that enter a live broadcast room
through the proxy server, obtain a live media stream from a media server based on
a media request message of a client whose role is a master user, and deliver the live
media stream to all the clients that enter the live broadcast room through the proxy
server.
[0014] The system to which the technical solutions of this application are applied may include
a plurality of proxy servers, and each of the proxy servers can perform an operation
performed by the proxy server in the embodiments of this application. In other words,
the proxy server in the embodiments of this application may be any proxy server in
the system to which the embodiments of this application are applied. In the embodiments
of this application, the following described client is a client that enters the live
broadcast room through the proxy server, and the proxy server identifies the roles
(for example, a master user and a slave user) of all the clients that enter the live
broadcast room through the proxy server. Correspondingly, the following described
client whose role is a master user in the live broadcast room is a client, among the
clients that enter the live broadcast room through the proxy server, that is identified
as the master user by the proxy server. Similarly, the following described client
whose role is a slave user is a client, among the clients that enter the live broadcast
room through the proxy server, that is identified as the slave user by the proxy server.
[0015] The proxy server may be a device at an edge of a local area network, and a client
in the local area network enters the live broadcast room through the proxy server
and obtains a live media stream of the live broadcast room through the proxy server.
[0016] Optionally, the proxy server may be deployed on a server, or deployed on universal
customer premise equipment (Universal Customer Premise Equipment, uCPE) through network
functions virtualization (Network Functions Virtualization, NFV).
[0017] Further, as shown in FIG. 2, in a video CDN system provided in this embodiment, the
system includes: a content source (content source) 101, an enterprise data center
(enterprise data center, EDC) 102, an RDC 103, a proxy server 104, and at least one
client (client, C). For example, the at least one client includes a first client C1
105, a second client C2 106, and a third client C3 107. The EDC 102 includes a plurality
of media servers (media server) and a web server (Web server), and the RDC 103 includes
a plurality of media servers and a web server.
[0018] The live CDN is a distributed content delivery platform and supports a multi-layer
architecture. On the live CDN platform, the plurality of servers for caching can be
deployed at different layers, to provide a nearby service for users in different regions.
When a user in the EDC watches live broadcast in a live broadcast room, an allocated
media server is deployed in the RDC, and a transmitted live media stream reaches the
RDC through a multi-protocol label switching (Multi-Protocol Label Switching, MPLS)
private line.
[0019] Further, general descriptions of functions of the foregoing devices or network elements
are provided in the following Table 1.
Table 1
Network element name |
Function |
Content source |
Is a production end of live media streams (live broadcast content). |
EDC |
Web server |
Responds to requests, from clients, for watching live broadcast, authenticates users,
and allocates closest media servers to the users based on locations of the users. |
Media server |
Caches media streams sent by the content source and sends the media streams to a lower-level
media server, or directly provides services for users. |
RDC |
Web server |
Responds to the requests, from the clients, for watching live broadcast, authenticates
users, and allocates closest media servers to the users based on locations of the
users. |
Media server |
Caches the media streams (live broadcast content) sent by the upper-level media server
and sends the media streams to a lower-level media server, or directly provides services
for users. |
Proxy server |
Acts as a proxy for a video bearer protocol of users, identifies roles of clients,
initiates media stream requests to the media server by using roles of users, duplicates
media streams sent by the media servers, and delivers the media streams to all clients
in a live broadcast room. |
Client |
Is a user that watches live broadcast. |
[0020] An embodiment provides a media stream sending method, to resolve a problem that a
large quantity of network resources are occupied when a live media stream is transmitted
from an RDC to an SR and then to a client. The method is applied to a proxy server,
and the proxy server is configured to provide a live media stream for at least two
clients that enter a live broadcast room. Specifically, as shown in FIG. 3, the method
includes the following steps.
[0021] Step 101: The proxy server receives, from a first client, a first live broadcast
room request message for requesting to enter the live broadcast room, where the first
live broadcast room request message includes a first identifier of the first client,
for example, an IP address of a client C1.
[0022] Step 102: The proxy server determines a role of the first client based on the first
live broadcast room request message, where the role of the first client may be a master
user (master user) or a slave user (slave user).
[0023] Specifically, step 102 includes: The proxy server determines whether there is a client
whose role is a master user in the live broadcast room when receiving the first live
broadcast room request message; and if there is a client whose role is a master user
in the live broadcast room, the proxy server determines that the role of the first
client is the slave user, or if there is no client whose role is a master user in
the live broadcast room, the proxy server determines that the role of the first client
is the master user. Whether there is a client whose role is a master user in the live
broadcast room may be specifically determined based on a quantity of clients whose
roles are master users when the first live broadcast room request message is received.
If the quantity reaches a preset upper limit, the proxy server determines that the
current client is the slave user; otherwise, the proxy server determines that the
first client is the master user.
[0024] The preset upper limit is an upper limit of a quantity of clients that enter the
live broadcast room through the proxy server and that are determined as master users.
[0025] In addition, in this embodiment, a client whose role is a master user is briefly
referred to as a master-user client, and a client whose role is a slave user is briefly
referred to as a slave-user client. In this embodiment, there may be two cases for
the preset upper limit based on different values of the preset upper limit: a preset
upper limit being 1 and a preset upper limit greater than 1.
[0026] Specifically, when the preset upper limit is 1, among all clients that are set to
access the live broadcast room through the proxy server, a quantity of master-user
clients is 1, that is, there is only one master user. Such a scenario may be referred
to as a scenario in which there is a single master user. When the preset upper limit
is greater than 1, that is, when the quantity of master-user clients is greater than
or equal to 2, there may be specifically one main-master user (main-master user) and
a plurality of secondary-master users. Such a scenario may be referred to as a scenario
in which there are a plurality of master users.
[0027] Further, for the scenario in which there are a plurality of master users, the determining
a role of the first client includes: when the first live broadcast room request message
is received, and if the quantity of clients whose roles are master users in the live
broadcast room is not 0, determining that the role of the first client is a main-master
user; or if the quantity is not 0 but does not reach the preset upper limit, determining
that the role of first client is a secondary-master user.
[0028] Step 103: When determining that the role of the first client is the slave user, the
proxy server sends a locally cached first live media stream to the first client.
[0029] The first live media stream is a media stream that is sent through the proxy server
by a media server to the client whose role is the master user. In this embodiment,
in the technical scenario in which there is a single master user, a role of a second
client is a master user. In the technical scenario in which there are a plurality
of master users, the role of the second client is specifically a main-master user.
[0030] Before step 103, the method further includes: The proxy server receives, from the
second client, a second live broadcast room request message for entering the live
broadcast room; obtains the first live media stream from the media server; caches
the first live media stream; and sends the first live media stream to the second client
through the proxy server. When the first live media stream is obtained, if there is
another client in the live broadcast room that enters the live broadcast room through
the proxy server, the proxy server further sends the first live media stream to the
another client. In specific implementation, the second client may request to enter
the live broadcast room by sending the second live broadcast room request message
and request a live media stream by sending a media request message. In this case,
after receiving the media request message that is sent by the second client, the proxy
server forwards the media request message to the media server to obtain the first
live media stream. Alternatively, by sending the second live broadcast room request
message, the client may request to enter the live broadcast room and request a live
media stream. In this case, after receiving the second live broadcast room request
message, the proxy server forwards the second live broadcast room request message
to the media server to obtain the first live media stream.
[0031] Optionally, after receiving the first live media stream, the proxy server locally
caches the first live media stream by groups of pictures (group of pictures, GOP).
The GOP may refer to a picture sequence between two I frames. The I frame (frame),
also referred to as an intra picture (intra picture), typically refers to the first
frame of each GOP obtained through moving picture experts group (moving picture experts
group, MPEG) technology processing. Further, the MPEG technology processing includes
appropriately compressing a video picture, so that the I frame can be used as a reference
for random access and other pictures do not need to be referred to.
[0032] In this embodiment, for example, three GOPs are cached locally. For example, time
segments of the three GOPs of a cached live media stream are t1-t2, t2-t3, and t3-t4.
[0033] When the first client requests to obtain a live media stream, the proxy server determines
and verifies that the role of the first client is the slave user, and directly sends
the locally cached first live media stream to the first client, so as to prevent the
proxy server from requesting and obtaining the live media stream from the media server
again. In other words, the media server needs to send only one live media stream to
the proxy server, and the proxy server can duplicate and deliver the live media stream
to all clients serving as slave users in the live broadcast room. Therefore, wide
area network bandwidth for only one live media stream is consumed for users that enter
the same live broadcast room. Using the method reduces traffic for sending media streams
between the media server in an RDC and an SR in an existing system, effectively saves
egress bandwidth, and reduces resource overheads.
[0034] In addition, using the method further reduces load of a wide area network link, avoids
video freezing during playing of a live video that is sent to the client, and avoids
affecting another service. Therefore, using the method further improves user experience.
[0035] In the scenario in which there is a single master user, the first client is the slave
user, and the second client is the master user. Before step 103, the method further
includes: The proxy server receives the first media request message that is sent by
the first client. Because the first client is the slave user, the proxy server does
not forward the first media request message to the media server. The proxy server
sends a first media response message to the first client, where the first media response
message is used to notify the first client that the first client is allowed to obtain
a media stream. Further, the media stream that is allowed to be obtained is the first
live media stream, and the first live media stream is a media stream that is sent
by the media server to the client whose role is the master user.
[0036] In addition, this embodiment further includes: The master-user client in the live
broadcast room exits the live broadcast room, another client in the live broadcast
room is selected as a new master user, and a media stream from the new master user
is sent to a client in the live broadcast room. Specifically, the method includes:
The proxy server receives, from the second client, a request message for exiting the
live broadcast room; when determining the first client as the new master user, the
proxy server changes the role of the first client from the slave user to the master
user; the proxy server sends a second media request message to the media server, where
the second media request message includes the identifier of the first client; the
proxy server receives a second live media stream that is sent by the media server
based on the second media request message; and the proxy server switches, to the second
live media stream, the first live media stream that is sent to a client (including
the first client) in the live broadcast room.
[0037] In this implementation, when the second client serving as the master user exits the
live broadcast room, the proxy server selects, as the new master user, the first client
serving as the slave user, and requests and obtains the live media stream by using
an identity of the first client, and then the proxy server duplicates and delivers
the live media stream to another client in the live broadcast room, so as to ensure
that a user in the live broadcast room watches a video smoothly.
[0038] Both the roles of the first client and the second client in the live broadcast room
and the quantity of master-user clients can be determined based on a live-broadcast-room
user relationship table. The live-broadcast-room user relationship table records information
about each client, and the information about each client includes information such
as a live broadcast room request message; an IP address, a port number, a user role,
and a user name that are of a client; an IP address and a port number that are of
the media server; and a name of the live broadcast room. The proxy server determines
a quantity of master users by calculating live broadcast room request messages of
all users in the live broadcast room currently, and then determines the role of the
first client based on the quantity of master users and the preset upper limit.
[0039] In addition, before the proxy server sends a live media stream (for example, the
first live media stream or the second live media stream) to a client (for example,
the first client) in the live broadcast room, the method further includes: adjusting
a timestamp of the live media stream. Specifically, the method further includes: adjusting
the timestamp of the media stream according to Formula
y =
x + Δ
t, where y represents a timestamp after adjustment, x represents a timestamp before
adjustment, and Δ
t represents a time difference.
[0040] If the media stream is a 1
st channel of live media stream that is received by the client after the client enters
the live broadcast room, for example, in step 103, if the first live media stream
is the 1
st channel of live media stream that is received by the first client after the first
client enters the live broadcast room, the proxy server adjusts the timestamp of the
media stream according to the formula, so that an adjusted timestamp satisfies the
following constraints:
- 1. a timestamp of the first frame of the live media stream that is sent by the proxy
server to the client is 0; and
- 2. timestamps of adjacent frames of the live media stream that is sent by the proxy
server to the client are consecutive, that is, time lengths of adjacent frames of
the sent live video stream are the same, and the time length is a reciprocal of a
frame rate f of the live video stream.
[0041] Because the live media stream is the 1
st channel of live media stream that is received by the client after the client enters
the live broadcast room, Δ
t represents an opposite number of the timestamp, before adjustment, of the first frame
of the live media stream that is sent by the proxy server to the client.
[0042] If the client has received a media stream, that is, if the media stream sent by the
proxy server to the client switches from a media stream of a previous master user
to a media stream of a current master user, for example, if the proxy server switches,
to the second live media stream, the first live media stream that is sent to the first
client, the proxy server adjusts a timestamp of the media stream of the current master
user according to the formula, so that an adjusted timestamp satisfies the following
constraints:
- 1. a timestamp of the last frame of the media stream that is of the previous master
user and that is sent by the proxy server to the client and a timestamp of the first
frame of the media stream that is of the current master user and that is sent to the
client are consecutive; and
- 2. timestamps of adjacent frames of the media stream that is of the current master
user and that is sent by the proxy server to the client are consecutive.
[0043] For example, in a scenario in which there are one master user and a plurality of
slave users, it is assumed that a time length of a GOP of the first live media stream
cached by the proxy server is 5 seconds (s), three GOPs are cached locally, and content
of the three GOPs is updated in real time. If the second client C2 is a client that
first enters the live broadcast room, the role of the client C2 at the 0
th second is the master user, and the client C2 continuously watches the first live
media stream in the live broadcast room until the 60
th second arrives. In this case, three GOPs of the video media stream locally cached
by the proxy server are as follows: media content from the 45
th second to the 50
th second, media content from the 50
th second to the 55
th second, and media content from the 55
th second to the 60
th second. The three GOPs are segments of the media stream that are sent by the media
server to the client C2, and a timestamp of each correspondingly sent frame is relative
time of the client C2.
[0044] The first client C1 enters the live broadcast room at the 60
th second, and the role of the first client C1 is the slave user. The proxy server needs
to send, to the client C1, a latest first live media stream that is sent to the client
C2 and that is locally cached. In this case, a live media stream closest to the 60
th second is the media content of the third GOP segment, and the media content from
the 55
th second to the 60
th second is cached. The 55
th second is a timestamp of a frame sent by the media server, and therefore a time difference
that needs to be adjusted is Δ
t =
y -
x = 0 - 55 = -55
s, that is, the proxy server needs to reduce a timestamp by 55 seconds when sending
the first live media stream to the client C1, so as to satisfy the foregoing constraints.
In this way, each user that enters the live broadcast room can watch the live broadcast
video at the 0
th second with no need to wait, and all the users in the live broadcast room can watch
the video "synchronously".
[0045] In addition, when the second client C2 exits the live broadcast room, the timestamp
of the video media stream further needs to be adjusted. Specifically, if the client
C2 exits the live broadcast room at the 120
th second of video playing, the proxy server needs to select a client as the new master
user. It is assumed that in this embodiment, the first client C1 is selected as the
master user. Then, the proxy server changes the first live media stream that is originally
sent to the client C2 to a live media stream that is sent to the client C1. A corresponding
timestamp adjustment process is as follows:
[0046] It is assumed that at the 120
th second, media content of three GOPs locally cached by the proxy server is as follows:
media content from the 105
th second to the 110
th second, media content from the 110
th second to the 115
th second, and media content from the 115
th second to the 120
th second. After 10 seconds elapse, a latest GOP 1 cached by the proxy server is the
video content from the 115
th second to the 120
th second, and a timestamp of a frame in the GOP 1 is relative time of the client C2.
After the client C2 exits the live broadcast room, the proxy server locally caches
a GOP 2 and a GOP 3: media content from the 0
th second to the 5
th second and media content from the 5
th second to the 10
th second. Timestamps of the two GOPs are relative time of the client C1. Therefore,
an adjusted time difference is calculated as Δ
t = 120 - 55 - 0 = 65
s, that is, a timestamp of a frame of the live media stream that is sent by the proxy
server to the client C1 serving as the new master user needs to increase by 65 seconds.
[0047] Based on the foregoing descriptions, there may be two cases for calculating the adjusted
time difference. Details are as follows.
[0048] Case 1: If a client has not received a media stream, that is, if a current media
stream is a first channel of media stream that is received by the client after the
client enters the live broadcast room, the time difference is Δ
t = 0
- t2 =
-t2, where t2 represents a timestamp of the first frame of a media stream that is received
by the proxy server from the media server and that needs to be forwarded to the client.
[0049] Case 2: If a client has received a media stream, that is, if a media stream that
is sent by the proxy server to the client is switched from a media stream of the previous
master user to a media stream of the current master user, a time difference is Δ
t = (
t1 +
m)
-t2, where t2 represents a timestamp, before adjustment, of the first frame of a media
stream (the media stream of the current master user) that is sent by the proxy server
to the client after media stream switching, and t1 represents a timestamp, after adjustment,
of the last frame of a media stream (the media stream of the previous master user)
that is sent by the proxy server to the client before media stream switching. A timestamp
of a corresponding next video frame is
t1 +
m , and
m = 1 /
f . For example, f = 20 fps, and a time length of a sent video frame is m = 1s/20 =
0.05s, that is 50 ms.
[0050] According to the foregoing method, before the proxy server switches, to the second
live media stream, the first live media stream that is sent to the first client, the
method further includes: The proxy server adjusts a timestamp of the second live media
stream, so that an adjusted timestamp satisfies that a timestamp of the first frame
of the second live media stream that is sent by the proxy server to the first client
and a timestamp of the last frame of the first live media stream that is sent by the
proxy server to the first client are consecutive.
[0051] Further, the last frame of the first live media stream that is sent by the proxy
server to the first client and the first frame of the second live media stream that
is sent by the proxy server to the first client are adjacent frames. Before the proxy
server switches, to the second live media stream, the first live media stream that
is sent to the first client, the method further includes: The proxy server identifies,
based on the first live media stream and the second live media stream, a first I frame
and a second I frame that belong to the first live media stream and the second live
media stream respectively, where the first I frame and the second I frame are a same
video frame; and determines, based on the first I frame and the second I frame, a
first switching frame and a second switching frame that are adjacent to each other
and that belong to the first live media stream and the second live media stream respectively,
and uses the first switching frame and the second switching frame as the last frame
of the first live media stream that is sent to the first client and the first frame
of the second live media stream that is sent to the first client respectively. After
determining the first switching frame and the second switching frame, the proxy server
forwards the request message, from the second client, for exiting the live broadcast
room to the media server.
[0052] In this embodiment, the proxy server sends the live media stream of the master user
to each client that enters the live broadcast room through the proxy server. Each
time a master user is switched, the proxy server switches, to the live media stream
of the current master user, the live media stream that is of the previous master user
and that is sent to each client, that is, the proxy server stops sending the media
stream of the previous master user to each client, and starts to send the live media
stream of the current master user to the client. For example, when the client C1 exits
the live broadcast room, the proxy server stops sending the first live media stream
to the client C1, and sends the second live media stream of the newly selected client
C2 to another client in the live broadcast room that is watching the live broadcast
stream. In this case, the role of the client C2 changes to the master user. In addition,
when sending a new media stream, the first frame of the live media stream that is
of the current master user and that is sent to any client by the proxy server is adjacent
to the last frame of the live media stream that is of the previous master user and
that is sent to the client. That is, the first frame of the second live media stream
that is sent to the client C2 is adjacent to the last frame of the originally sent
first live media stream.
[0053] In the scenario in which there are a plurality of master users, the second client
is a main-master user, the first client is a slave user, and the process in which
the client exits the live broadcast room includes: The proxy server receives a request
message, from the second client, for exiting the live broadcast room; the proxy server
changes the role of the first client from the slave user to a secondary-master user
when determining the first client as the new secondary-master user; and the proxy
server sends a third media request message to the media server, receives a third live
media stream that is sent by the media server based on the third media request message,
and locally caches the third live media stream in the proxy server by GOPs, where
the third media request message includes the identifier of the first client.
[0054] In this embodiment, after obtaining a live media stream, the proxy server does not
forward the live media stream to the client serving as the secondary-master user,
but the proxy server locally caches segments of the live media stream, so as to deliver
the cached segments of the live media stream to a user in the live broadcast room
when a role of the secondary-master user is switched to a main-master user.
[0055] Optionally, in the scenario in which there are a plurality of master users, if the
first client is the secondary-master user, and the proxy server obtains a fourth live
media stream from the media server based on a fourth media request message that is
sent by the first client, when the second client serving as a main-master user exits
the live broadcast room, the method further includes: When determining the first client
as the new main-master user, the proxy server changes the role of the first client
from the secondary-master user to the main-master user, and the proxy server switches,
to the fourth live media stream, the first live media stream sent to the client (including
the first client) in the live broadcast room.
[0056] The proxy server adjusts a timestamp of the fourth live media stream, so that an
adjusted timestamp satisfies that a timestamp of the first frame of the fourth live
media stream that is sent to the first client and a timestamp of the last frame of
the first live media stream that is sent to the first client are consecutive.
[0057] Further, the last frame of the first live media stream that is sent by the proxy
server to the first client and the first frame of the fourth live media stream that
is sent by the proxy server to the first client are adjacent frames. Before the proxy
server switches, to the fourth live media stream, the first live media stream sent
to the first client, the method further includes: The proxy server identifies, based
on the cached first live media stream and the fourth live media stream, a first I
frame and a second I frame that belong to the first live media stream and the fourth
live media stream respectively, where the first I frame and the second I frame are
a same video frame.
[0058] The proxy server determines, based on the first I frame and the second I frame, a
first switching frame and a second switching frame that are adjacent to each other
and that belong to the first live media stream and the fourth live media stream respectively,
and uses the first switching frame and the second switching frame as the last frame
of the first live media stream that is sent to the first client and the first frame
of the fourth live media stream that is sent to the first client respectively. For
a more specific timestamp adjustment process, refer to the descriptions in the foregoing
embodiment. Details are not described herein again.
[0059] In this embodiment, in the technical scenario in which there are a plurality of master
users, the proxy server obtains, from the media server, the live media stream requested
by the client whose role is the main-master user, and delivers the live media stream
to all users in the live broadcast room; and the media server does not need to send
the live media stream to the proxy server for each user that enters the live broadcast
room through the proxy server. This saves WAN transmission resources between the media
server and the proxy server, and reduces overheads for media stream transmission.
[0060] In addition, the proxy server further obtains the media stream of the client whose
role is the secondary-master user, and locally caches the media stream, so that the
media stream is prepared to be used when the client serving as the main-master user
exits the live broadcast room. In addition, when a live media stream is switched,
media stream alignment and timestamp adjustment are performed, to ensure that a client
in the live broadcast room that is still watching media content does not perceive
the switching. This ensures user experience.
[0061] It should be noted that, the first live media stream, the second live media stream,
the third live media stream, and the like described in this embodiment of this application
are a same live media stream that is sent by the content source. The media streams
are used to distinguish between live media streams that are obtained by the proxy
server based on media request messages of different clients. Because users enter the
live broadcast room at different time points, timestamps of live media streams that
are sent by the proxy server to the clients are different. Therefore, when sending
a live media stream to a client, the proxy server may adjust a timestamp, so that
each client that enters the live broadcast room can view current live media content
immediately.
[0062] The following specifically describes the method provided in the embodiments of this
application.
Embodiment 1
[0063] This embodiment provides a video live media stream sending method. The method may
be applied to the video live broadcast system shown in FIG. 2. The method includes:
A media server provides a live media stream for a first client and a second client
that enter a live broadcast room, where both the first client and the second client
enter the live broadcast room through a same proxy server. Further, as shown in FIG.
4A to FIG. 4D, the method includes 26 steps (step, S) in total: S1 to S26.
[0064] S1 to S12 are a process in which the first client (referred to as a "client C1" hereinafter)
enters the live broadcast room and obtains a live media stream. S13 to S26 are a process
in which the second client (referred to as a "client C2" hereinafter) enters the live
broadcast room and obtains a live media stream.
[0065] Specifically, the process in which the client C1 enters the live broadcast room and
obtains the live media stream includes the following steps.
[0066] S1: A content source sends a first live media stream to a media server in an EDC.
[0067] S2: The media server in the EDC receives the first live media stream, and sends the
first live media stream to a media server in a lower-level RDC. Before the first live
media stream is sent, the method further includes a step in which a web server in
the EDC authenticates the media server in the lower-level RDC, and the media server
in the EDC sends the first live media stream to the media server in the lower-level
RDC only when authentication succeeds.
[0068] Optionally, S2 further includes: The proxy server (proxy server) identifies, based
on a service feature of the first live media stream, a transmission protocol corresponding
to a client served by the proxy server. The service feature includes: an IP address
and a port number that are of the web server. For example, for a hypertext transfer
protocol (Hyper Text Transfer Protocol, HTTP), a service feature that can be configured
includes: the IP address and the port number that are of the web server. Further,
the proxy server may further determine that a transmission protocol corresponding
to the HTTP protocol is a transmission control protocol (Transmission Control Protocol,
TCP), for media stream transmission.
[0069] S3: The client C1 sends, to a web server in the RDC, a request message for a media
server that can be accessed. Further, the request message includes information such
as a user name and an IP address that are of the client C1, a name of the live broadcast
room, and a key token obtained by the client C1 after authentication succeeds, where
the IP address is used to determine a location of the client C1. Specifically, the
client C1 sends the request message to the proxy server, and then the proxy server
forwards the request message to the web server in the RDC.
[0070] S4: The web server in the RDC receives the request message, and sends, to the client
C1, a response message for the media server that can be accessed, where the response
message is used to notify the client C1 of the media server that can be accessed by
the client C1. Specifically, the web server determines, based on the request message,
a target media server capable of providing a media stream service for the client C1,
where the target media server is one of a plurality of media servers in the RDC; and
then sends the response message to the client C1, where the response message includes
related information of the target media server, for example, uniform resource locator
(Uniform Resource Locator, URL) information, an IP address, and a port number that
are of the target media server.
[0071] Optionally, the web server determines the location of the client C1 based on the
IP address carried in the request message, sent by the client C1, that is for the
media server that can be accessed, and selects a media server closest to the client
C1 as the target media server based on the location information.
[0072] Optionally, the web server in the RDC sends the response message to the client C1
through the proxy server. The response message carries related information of the
target media server, for example, the URL information, the IP address, and the port
number that are of the target media server.
[0073] S5: The client C1 enters the live broadcast room, and sends, to the proxy server,
a first live broadcast room request message for requesting to enter the live broadcast
room, where the first live broadcast room request message indicates that the client
C1 requests to enter the live broadcast room. The first live broadcast room request
message includes the user name, the IP address, and a port number that are of the
client C1, the name of the live broadcast room, the token obtained after authentication
succeeds, and the like.
[0074] S6: The proxy server receives the first live broadcast room request message that
is sent by the client C1, and sets a role of the client C1. In a possible implementation,
after receiving the first live broadcast room request message, the proxy server determines
the role of the client C1 based on a total quantity of clients whose roles are master
users; and if the total quantity is less than or equal to a first threshold, the role
of the client C1 is a master user, or if the total quantity is greater than the first
threshold, the role of the client C1 is a slave user. In this embodiment, assuming
that the first threshold is 1, and the client C1 is a user that first enters the live
broadcast room, if the quantity of clients whose roles are master users is equal to
the first threshold at a current time point, the proxy server determines that the
role of the client C1 is the master user.
[0075] Alternatively, in another possible implementation, after receiving the first live
broadcast room request message, the proxy server determines whether there is a client
serving as a master user in the live broadcast room. If there is a client serving
as a master user in the live broadcast room, the proxy server determines that the
role of the client C1 is a slave user; otherwise, the proxy server determines that
the client C1 is the master user.
[0076] Optionally, the method further includes: After the client C1 enters the live broadcast
room, the proxy server constructs a "live-broadcast-room user relationship table",
where the "live-broadcast-room user relationship table" includes an entry about the
client C1. Specifically, content of the entry includes: the IP address, the port number,
the user role, and the user name that are of the client C1, the IP address and the
port number that are of the selected target media server in the RDC, and the name
of the live broadcast room. The IP address of the client C1 may be a primary key (primary
key) cached in a database. Understandably, when receiving a request message that is
for first entering the live broadcast room and that is sent by the client, the proxy
server constructs the live-broadcast-room user relationship table based on the live
broadcast room request message, to record a status of each client in the live broadcast
room.
[0077] In this embodiment, the quantity of clients whose roles are master users is 1. To
be specific, among clients that enter the live broadcast room through the proxy server,
only one master user is set, and the other clients are slave users. Such a scenario
may be referred to as a scenario in which there is a single master user.
[0078] S7: The proxy server forwards the first live broadcast room request message to the
media server in the RDC.
[0079] Step S6 may be performed before step S7 or step S6 may be performed after step S7.
This is not strictly limited in this embodiment.
[0080] S8: The media server in the RDC receives the first live broadcast room request message,
and sends a first live broadcast room response message to the client C1, where the
first live broadcast room response message is used to notify the client C1 that the
client C1 successfully enters the live broadcast room. Specifically, in S8, the media
server forwards the first live broadcast room response message to the client C1 through
the proxy server.
[0081] S9: The client C1 sends a first media request message to the proxy server, where
the first media request message is used to request to obtain the first live media
stream from the media server. Optionally, the first media request message carries
a first identifier of the client C1, where the first identifier is used to uniquely
identify the client C1. In this embodiment, the first identifier includes the IP address
and the user name of the client C1 and the like.
[0082] S10: The proxy server receives and forwards the first media request message to the
media server in the RDC, where the media server is the target media server. The first
media request message is requested by the client C1 serving as the master user, and
therefore the proxy server forwards the first media request message to the media server.
[0083] 511: After receiving the first media request message, the media server sends a first
media response message to the client C1, where the first media response message is
used to notify the client C1 that the client C1 is allowed to obtain the first live
media stream. In a specific implementation, the proxy server receives and forwards
the first media response message to the client C1.
[0084] S12: The media server sends the first live media stream to the client C1. Specifically,
the proxy server obtains, in real time, the first live media stream sent by the media
server in the upper-level EDC, and then sends the first live media stream to the proxy
server. After receiving the first live media stream, the proxy server locally caches
segments of the first live media stream by GOPs. For example, the proxy server caches
media stream segments of three latest GOPs: t1-t2, t2-t3, and t3-t4, and all the segments
of the cached media stream have a same time length. For example, a time length of
each cached GOP is 5 seconds. The proxy server sends the segments of the cached first
live media stream to the client C1.
[0085] Optionally, in S12, in a process of sending the first live media stream to the client
C1, a timestamp of the first live media stream further needs to be adjusted, so that
an adjusted timestamp satisfies that a timestamp of the first frame of the first live
media stream that is sent to the client C1 is 0, and timestamps of adjacent frames
of the first live media stream that is sent to the client C1 are consecutive. "Consecutive"
means that time lengths of adjacent video frames of the first live media stream received
by the client C1 are the same, and the time length is a reciprocal of a frame rate
parameter f.
[0086] The following describes the method for which the client C2 enters the live broadcast
room and obtains a live media stream. Specifically, the following steps are included.
[0087] S13: The client C2 sends, to the web server in the RDC, a request message for a media
server that can be accessed, where the request message includes information such as
a user name and an IP address that are of the client C2, a name of the live broadcast
room, and a key token obtained after the client C2 is authenticated. Specifically,
the client C2 forwards the request message to the web server in the RDC through the
proxy server; and during forwarding of the request message, the proxy server obtains
the information carried in the request message.
[0088] S14: The web server in the RDC receives the request message, and sends a response
message to the client C2, where the response message is used to notify the client
C2 of the media server that can be accessed by the client C2. This is the same as
the foregoing step S4, the web server selects one of the plurality of media servers
to provide a media stream service for the client C2, and sends related information
of the selected media server to the proxy server through the response message. For
example, the related information of the selected media server includes URL information,
an IP address, and a port number that are of the media server.
[0089] S15: The client C2 sends, to the proxy server, a second live broadcast room request
message for requesting to enter the live broadcast room, where the second live broadcast
room request message indicates that the client C2 requests to enter the live broadcast
room. The second live broadcast room request message includes the user name, the IP
address, and a port number that are of the client C2, the name of the live broadcast
room, the token obtained after authentication succeeds, and the like.
[0090] S16: The proxy server receives the second live broadcast room request message that
is sent by the client C2, and sets a role of the client C2. A specific implementation
is that, after receiving the second live broadcast room request message, the proxy
server determines whether there is a client whose role is a master user in the live
broadcast room; and if there is a client whose role is a master user in the live broadcast
room, the proxy server determines that the role of the client C2 is a slave user.
In this embodiment, there is the client C1 serving as the master user in the current
live broadcast room, and therefore the client C2 is determined as the slave user.
[0091] In addition, S16 further includes: The proxy server adds an entry about the client
C2 to the "live-broadcast-room user relationship table". This is similar to adding
the entry of the client C1 described above. For the client C2, content of the entry
includes information such as the IP address, the port number, the user role, and the
user name that are of the client C2, the IP address and the port number that are of
the target media server, and the name of the live broadcast room.
[0092] Optionally, in S16, a quantity of clients serving as master users currently in the
live broadcast room is calculated, and the quantity of clients serving as master users
may be determined based on a quantity of live broadcast room request messages that
are obtained at a current time point, where the quantity of live broadcast room request
messages is recoded in the "live-broadcast-room user relationship table". In this
embodiment, the proxy server receives two live broadcast room request messages: the
first live broadcast room request message from the client C1 and the second live broadcast
room request message from the client C2, and the quantity of live broadcast room request
messages is greater than 1. Therefore, it is determined that the client C2 is the
slave user. In addition, the quantity of clients serving as master users may be determined
in another manner. This is not limited in this embodiment.
[0093] S17: The proxy server receives and forwards the second live broadcast room request
message to the media server in the RDC.
[0094] S18: The media server in the RDC receives the second live broadcast room request
message, and sends a second live broadcast room response message to the client C2,
where the second live broadcast room response message is used to notify the client
C2 that the client C2 successfully enters the live broadcast room. Specifically, the
media server forwards the second live broadcast room response message to the client
C2 through the proxy server.
[0095] S19: The client C2 sends a second media request message to the proxy server, where
the second media request message is used to request to obtain a live media stream
from the media server. The second media request message carries a second identifier
of the client C2, where the second identifier includes the IP address and the user
name of the client C2.
[0096] The proxy server does not forward the second media request message to the media server
because the second media request message is sent by the client C2 whose role is the
slave user.
[0097] S20: The proxy server receives the second media request message, and sends a second
media response message to the client C2, where the second media response message is
used to notify the client C2 that the client C2 is allowed to obtain the first live
media stream.
[0098] S21: The proxy server sends the locally cached first live media stream to the client
C2, where the first live media stream is cached and delivered by GOPs. Further, for
segments of a media stream that is cached by GOPs, refer to the descriptions in S
12. Details are not described herein again.
[0099] Optionally, when the proxy server sends the first live media stream to the client
C2, the method further includes: adjusting a timestamp of the media stream, so that
an adjusted timestamp satisfies two constraints: 1. a timestamp of the first frame
of the first live media stream received by the client C2 is 0; and 2. timestamps of
adjacent frames of the first live media stream video sent to the client C2 are consecutive,
that is, a time length for sending is the reciprocal of the frame rate parameter f.
For a specific adjustment process, refer to the descriptions in the foregoing embodiment.
[0100] S22: The media server in the RDC sends the first live media stream to the client
C1 in real time. Specifically, the first live media stream may be forwarded to the
client C1 through the proxy server. The first live media stream is initiated and obtained
by the client C1 whose role is the master user in the live broadcast room.
[0101] S23: After receiving the first live media stream from the media server, the proxy
server locally caches the segments of the live media stream by GOPs. In this embodiment,
the proxy server locally caches three GOPs, and may further cache more or fewer GOPs.
[0102] S24: The proxy server determines, based on content of entries in the "live-broadcast-room
user relationship table", the quantity of clients serving as master users and a quantity
of clients serving as slave users, and duplicate the cached segments of the first
live media stream, to prepare to send the segments to a client in the live broadcast
room. In this embodiment, there are only two clients in the current live broadcast
room: the client C1 and the client C2, where the client C1 is the master user, and
the client C2 is the slave user.
[0103] S25: The proxy server sends the first live media stream to the client C1. In addition,
the method further includes: The proxy server adjusts a timestamp in the first live
media stream based on a time point at which the client C1 receives a video frame of
the media stream.
[0104] S26: The proxy server sends the first live media stream to the client C2. In addition,
the method further includes: The proxy server adjusts the timestamp in the first live
media stream based on a time point at which the client C2 receives a video frame of
the media stream.
[0105] In addition, a timestamp of a video frame watched by a user that enters the live
broadcast room is adjusted, so that the client C1 and the client C2 in the live broadcast
room can "synchronously" watch media content of the first live broadcast, thereby
improving user experience.
[0106] According to the method, when the proxy server is used to obtain the live media stream
requested by the client serving as the master user, a part of segments of the media
stream are locally cached in the proxy server. When the client whose role is the slave
user enters the live broadcast room and requests a live media stream, the locally
cached media stream is directly sent to the client serving as the slave user, so that
the media server does not need to send the live media stream to the proxy server again,
that is, the media server needs to send only one live media stream to the proxy server,
and the proxy server can duplicate and deliver the live media stream to all clients
serving as slave users in the live broadcast room. This reduces traffic for sending
media streams, effectively saves egress bandwidth, and reduces resource overheads.
[0107] In addition, according to this method, for all the clients in the same live broadcast
room, the media server needs to send only one live media stream to the proxy server,
that is, wide area network bandwidth for transmitting the one live media stream is
required. In comparison with transmission resources occupied for sending the live
media stream to all the clients by the media server, this reduces load of a wide area
network link, avoids, after all the clients receives the live broadcast media, video
freezing during playing of the live media stream, and therefore further improves user
experience by using this method.
[0108] In addition, according to the method of this embodiment, the first live broadcast
room request message and the first media request message of the client C1 may be combined
into one message, and the combined message has functions of the first live broadcast
room request message and the first media request message. Therefore, when the role
of the client C1 is determined in S6, the quantity of clients serving as master users
that enter the live broadcast room currently may be calculated based on a quantity
of first media request messages. Similarly, the second live broadcast room request
message and the second media request message of the client C2 may also be combined
into one message.
[0109] In addition, the method provided in this embodiment further includes a process in
which the media server sends a live media stream to the client C2 when the role of
the client C2 changes, for example, from the slave user to the master user. Further,
as shown in FIG. 5A and FIG. 5B, S27 to S39 are a specific method procedure, which
are as follows:
S27: The client C1 sends, to the proxy server, a request message for exiting the live
broadcast room, where the request message for exiting the live broadcast room is used
to notify the media server that the client C1 is going to exit the live broadcast
room. The request message for exiting the live broadcast room includes information
such as the user name, the IP address, the port number, and the user role of the client
C1, and the live broadcast room name.
[0110] S28: After receiving, from the client C1, the request message for exiting the live
broadcast room, the proxy server temporarily does not forward, to the media server,
the request message for exiting the live broadcast room, because the first live media
stream requested by the client C1 whose role is the master user is being watched by
the client C2 at this time. In addition, the role of the client C1 is marked as an
exiting (Exiting) user, and is recorded in the "live-broadcast-room user relationship
table".
[0111] S29: The proxy server selects one client in the live broadcast room as a new master
user. In this embodiment, there are only the client C1 and the client C2 in the live
broadcast room. When the client C1 requests to exit the live broadcast room, the remaining
unique client C2 is selected as the client serving as the new master user, and the
role of the client C2 is changed from the slave user to the master user, for example,
the client C2 is marked as a slave-to-master user.
[0112] S30: The proxy server sends, to the media server in the RDC, a third media request
message for obtaining a media stream, where the third media request message includes
the second identifier of the client C2. The second identifier is used to uniquely
identify the client C2. In other words, the second identifier in the third media request
message indicates that the role of the client C2 is used to request a live media stream
from the media server.
[0113] S31: The media server in the RDC receives the third media request message, and sends
a third media response message to the client C2, where the third media response message
is used to notify the client C2 that the client C2 is allowed to obtain the live media
stream.
[0114] In addition, the media server receives the second identifier carried in the third
media request message, determines that the client C2 initiates the request for obtaining
the live media stream to the media server, and further determines that the second
identifier carried in the current request message is different from the first identifier
carried in the first media request message. The first identifier is used to indicate
the client C1, the current second identifier is used to indicate the client C2, and
it indicates that a client initiating the live media stream request changes from the
client C1 to the client C2.
[0115] S32: The proxy server does not forward the third media response message because the
role of the client that initiates the third media request message is the slave-to-master
user. In this case, the role of the client C2 is changed to the master user, and is
recorded in the entry corresponding to the client C2 in the "live-broadcast-room user
relationship table".
[0116] S33: The media server sends a second live media stream to the client C2 through the
proxy server. Content of the second live media stream is the same as content of the
first live media stream, and both the second live media stream and the first live
media stream are from the content source.
[0117] S34: The proxy server receives the second live media stream, and locally caches the
second live media stream by GOPs.
[0118] In addition, the method further includes: The proxy server aligns, according to an
alignment algorithm, live media streams to be sent to the client C1 and the client
C2. Specifically, the process includes: Each time the proxy server receives an I frame
of the first live media stream, the proxy server compares the I frame with an I frame
of the locally cached second live media stream; and each time the proxy server receives
an I frame of the second live media stream, the proxy server compares the I frame
with an I frame of the locally cached first live media stream. If the proxy server
finds, through the foregoing comparison, an I frame belonging to the first live media
stream and an I frame belonging to the second live media stream (which are respectively
referred to as an I frame a and an I frame b hereinafter), where the two I frames
have same media content, the proxy server determines that the two live media streams
are aligned. It can be understood that the I frame a and the I frame b are a same
video frame, and switching points are determined based on the I frame a and the I
frame b, that is, the last frame (which is referred to as a switching frame x hereinafter)
of the first live media stream that is sent to each client and the first frame (which
is referred to as a switching frame y hereinafter) of the second live media stream
that is sent to each client are determined. The switching frame x and the switching
frame y are adjacent frames. Specifically, the n
th frame after the I frame a in the first live media stream may be determined as the
switching frame x, and the (n+1)
th frame after the I frame b in the second live media stream may be determined as the
switching frame y, where n is an integer greater than or equal to 0. Because the I
frame a and the I frame b are a same video frame, the n
th frame after the I frame a and the (n+1)
th frame after the I frame b are naturally adjacent frames.
[0119] S35: The proxy server adjusts a timestamp of the second live media stream based on
a relative location of a video frame that is currently watched by the client C2, so
that a video frame sent to the client C2 satisfies that a timestamp of the first frame
y of the second live media stream received by the client C2 and a timestamp of the
last frame x of the first live media stream are consecutive, and a corresponding time
length is the reciprocal of the frame rate parameter f. For a specific adjustment
process, refer to the descriptions in the foregoing embodiment. Details are not described
herein again.
[0120] In this embodiment, when the client C1 whose role is the master user exits the live
broadcast room, the client C2 serving as the new master user is used to request and
obtain the second live media stream, and a time difference between the second live
media stream and the originally sent first live media stream is adjusted, so that
the proxy server seamlessly switches, when sending the second live media stream to
the client C2, from media content of the first live media stream media that is originally
being played to the second live media stream. In this way, there are no repeatedly
played parts and played content is integral when the video content is watched by the
client C2, and user experience of the client C2 is not affected.
[0121] S36: The proxy server forwards the request message for exiting the live broadcast
room to the media server in the RDC.
[0122] S37: After receiving the request message for exiting the live broadcast room, the
media server sends, to the client C1, a response message for exiting the live broadcast
room, where the response message for exiting the live broadcast room is used to notify
the client C1 that the client C1 successfully exits the live broadcast room. Specifically,
the response message for exiting the live broadcast room is forwarded to the client
C1 through the proxy server.
[0123] S38: The proxy server deletes the entry corresponding to the client C1 from the "live-broadcast-room
user relationship table". S37 may be performed before S38, or S37 may be performed
after S38, and this is not limited.
[0124] S39: The proxy server forwards the response message for exiting the live broadcast
room to the client C1.
[0125] In addition, the method further includes: The proxy server sends the second live
media stream to the client C2 that is watching a video in the live broadcast room.
[0126] According to the method provided in this embodiment, when the client serving as the
master user exits the live broadcast room, the proxy server selects a new client in
the live broadcast room as the new master user, and the role of the new master user
is used to continue to request a live media stream. After the live media stream is
obtained by the new master user, and a timestamp of a video frame is adjusted, the
newly obtained live media stream is sent to a client that is still watching a video
in the live broadcast room, so that the other client is not affected when the client
serving as the master user exits. According to this method, during switching of a
live media stream, there are no repeatedly played parts and the played content is
integral, and user experience is improved because the other user in the live broadcast
room is unaware of the switching of the live media stream.
Embodiment 2
[0127] This embodiment provides another live media stream sending method. The method is
applied to a technical scenario in which there are a plurality of master users. The
plurality of master users mean that a specified quantity (namely, a preset upper limit)
of clients, in a live broadcast room, whose roles are master users is greater than
or equal to 2. Further, the plurality of master users include one main-master user,
which may be identified as a main-master user; include a plurality of secondary-master
users, which may be identified as secondary-master users; and further include at least
one client whose role is a slave user. A process of requesting to enter a live broadcast
room and obtaining a live media stream in this method is the same as the process described
in Embodiment 1. A difference lies in identifying and changing of a role of a client
and delivery of a live media stream.
[0128] Based on Embodiment 1, in this embodiment, a third client C3 is further included,
and a quantity of clients whose roles are master users in the live broadcast room
is set to 2, that is, a preset upper limit is 2. In this case, the process in which
each client enters the live broadcast room and requests to obtain the live media stream
includes the following steps, as shown in FIG. 6A and FIG. 6B.
[0129] S1 to S 12 are a process in which a client C1 enters the live broadcast room, and
requests to obtain a live media stream. This process is the same as S1 to S12 in Embodiment
1, and an only difference lies in: In S6, a role of the client C1 is set as a main-master
user (main-master user) when a "live-broadcast-room user relationship table" is established.
For the other steps, refer to the descriptions in Embodiment 1. Details are not described
herein again.
[0130] When a proxy server obtains a first live media stream that is sent by a media server,
the proxy server locally caches several segments of the first live media stream by
GOPs, updates the segments of the first live media stream in real time, and sends
the segments of the first live media stream to the client C1.
[0131] S13 to S29 are a process in which a client C2 enters the live broadcast room, and
requests to obtain a live media stream. Specifically, details are as follows.
[0132] S13 and S14 are a process in which the client C2 enters the live broadcast room,
initiates a request message for obtaining a media server that can be accessed, and
obtains a response message. This is the same as S13 and S14 in Embodiment 1, and details
are not described again.
[0133] S15: The client C2 sends a second live broadcast room request message to the proxy
server.
[0134] S16: After receiving the second live broadcast room request message that is sent
by the client C2, the proxy server calculates a quantity of live broadcast room request
messages in the current live broadcast room, and determines a role of the client C2
based on the calculated quantity. In this embodiment, the proxy server obtains two
live broadcast room request messages from the client C1 and the client C2. In addition,
if the quantity is equal to the preset upper limit 2, the proxy server determines
that the role of the client C2 is a secondary-master user (secondary-master user).
Alternatively, when the proxy server receives the second live broadcast room request
message, and a quantity of clients whose roles are master users in the live broadcast
room reaches the preset upper limit, the proxy server determines that the role of
the client C2 is the slave user.
[0135] Optionally, if the quantity of clients whose roles are master users in the live broadcast
room is not 0 but does not reach the preset upper limit, the proxy server determines
that the role of the client C2 is the secondary-master user. If the quantity of clients
whose roles are master users in the live broadcast room is 0, the proxy server determines
that the role of the client C2 is a main-master user.
[0136] In addition, the method further includes: adding an entry about the client C2 to
the "live-broadcast-room user relationship table".
[0137] S17: The proxy server forwards the second live broadcast room request message to
the media server.
[0138] S18: The media server in an RDC receives the second live broadcast room request message,
and sends a second live broadcast room response message to the client C2, where the
second live broadcast room response message is used to notify the client C2 that the
client C2 successfully enters the live broadcast room.
[0139] S19: The client C2 sends a second media request message to the proxy server.
[0140] S20: After receiving the second media request message, the proxy server forwards
the second media request message to the media server. The second media request message
includes a second identifier of the client C2, so that the client C2 requests, by
using the role of the secondary-master user of the client C2, a live media stream
from the media server.
[0141] S21: The media server sends a second media response message to the client C2, to
notify the client C2 that the client C2 is allowed to obtain the first live media
stream.
[0142] S22: The proxy server sends the locally cached first live media stream to the client
C2, where the first live media stream is media stream segments that are cached by
GOPs. For example, the proxy server caches three GOP segments. Optionally, the method
further includes: The proxy server adjusts a timestamp of the first live media stream
based on play time of a video frame obtained by the client C2, so that an adjusted
timestamp satisfies that a timestamp of the first frame of the first live media stream
sent to the client C2 is 0 and timestamps of adjacent frames of the first live media
stream sent to the client C2 are consecutive.
[0143] S23: The media server sends a second live media stream to the client C2 in real time.
[0144] S24: The proxy server receives segments of the second live media stream and caches
the segments by GOPs. Because the second live media stream is obtained by a client
by using the role of the secondary-master user, only the second live media stream
is cached locally in the proxy server, and is not duplicated and delivered to other
clients based on the "live-broadcast-room user relationship table".
[0145] In addition, the method further includes: aligning the first live media stream and
the second live media stream. Specifically, a process of aligning the two live media
streams is the same as S34 in the foregoing Embodiment 1. Details are not described
herein again.
[0146] S25: The media server sends the first live media stream to the client C1 in real
time.
[0147] S26: After receiving the first live media stream, the proxy server caches several
segments of the first live media stream by GOPs.
[0148] S27: The proxy server makes one copy of the first live media stream based on the
"live-broadcast-room user relationship table" because there is the only one client
C2, in addition to the client C1 whose role is a master user in the current live broadcast
room. It should be understood that, if there are more clients, a quantity of copies
is the same as a quantity of clients whose user roles are not exiting users in the
current live broadcast room.
[0149] In this embodiment, the proxy server locally caches a live media stream of the client
whose role is the main-master user and a live media stream of the client whose role
is the secondary-master user. The proxy server may directly deliver, to all clients
in the live broadcast room, the live media stream of the client whose role is the
main-master user. The proxy server locally caches the corresponding live media stream
of the client whose role is the secondary-master user, to make preparations for subsequent
switching and delivery. A specific trigger condition is: When the role of the client
serving as the secondary-master user is changed to the main-master user, the media
stream (locally cached in the proxy server) of the new main-master user is delivered
to other clients in the live broadcast room. The proxy server can quickly deliver
a new live media stream. This helps increase a delivery speed and improve efficiency
of the media stream, and reduces a waiting time.
[0150] S28: The proxy server sends the first live media stream to the client C1.
[0151] S29: The proxy server sends the first live media stream to the client C2.
[0152] Optionally, in steps S28 and S29, the method further includes: The proxy server adjusts
a timestamp of the first live media stream based on play time of the client C1 and
play time of the client C2, to ensure synchronization of live content watched by the
clients in the live broadcast room.
[0153] S30 to S44 are a process in which the client C3 enters the live broadcast room, and
requests and obtains a live media stream. As shown in FIG. 7A and FIG. 7B, details
are as follows.
[0154] S30 and S31 are a process in which the client C3 enters the live broadcast room,
initiates a request message for obtaining a media server that can be accessed, and
obtains a response message. The process is the same as S13 and S14 in Embodiment 1.
Details are not described again.
[0155] S32: The client C3 sends, to the proxy server, a third live broadcast room request
message for requesting to enter the live broadcast room, where the third live broadcast
room request message includes a third identifier of the client C3.
[0156] S33: The proxy server receives the third live broadcast room request message, and
determines a user role of the client C3. Specifically, when the third live broadcast
room request message is obtained, if the quantity of clients whose roles are master
users in the current live broadcast room reaches the preset upper limit (the preset
upper limit is 2), the proxy server determines that the role of the client C3 is a
slave user.
[0157] In addition, the method further includes: adding an entry about the client C3 to
the "live-broadcast-room user relationship table", where content of the entry includes
information such as a name, an IP address, a port number, and a user role that are
of the client C3, a name of the live broadcast room, and a name, an IP address, and
a port number that are of the media server.
[0158] S34: The proxy server forwards the third live broadcast room request message to the
media server.
[0159] S35: The media server sends a third live broadcast room response message to the client
C3, where the third live broadcast room response message is used to notify the client
C3 that the client C3 successfully enters the live broadcast room.
[0160] S36: The client C3 sends a third media request message to the proxy server, where
the third media request message is used to request to obtain a live media stream from
the media server, and the third media request message includes the identifier of the
client C3.
[0161] S37: The client C3 receives a third media response message that is fed back based
on the third media request message by the proxy server. In this case, the role of
the client C3 is the slave user.
[0162] S38: The proxy server sends the locally cached first live media stream to the client
C3.
[0163] S39: The media server sends the first live media stream to the client C1 in real
time.
[0164] S40: After receiving the first live media stream, the proxy server caches segments
of the first live media stream by GOPs.
[0165] S41: The proxy server duplicates the first live media stream based on the "live-broadcast-room
user relationship table", and specifically makes two copies of the first live media
stream, where one copy is for the client C2 whose role is the secondary-master user
and the other copy is for the client C3 whose role is the slave user.
[0166] S42: The proxy server sends the first live media stream to the client C1. In addition,
the method further includes: The proxy server adjusts a timestamp of the first live
media stream.
[0167] S43: The proxy server sends the first live media stream to the client C2. In addition,
the method further includes: The proxy server adjusts a timestamp of the first live
media stream.
[0168] S44: The proxy server sends the first live media stream to the client C3. In addition,
the method further includes: The proxy server adjusts a timestamp of the first live
media stream.
[0169] According to the method of this embodiment, when obtaining media requests of different
clients, the proxy server identifies a user role of each client, so that the proxy
server obtains, from the media server, only the live media stream of the master user.
There are the main-master user and the secondary-master user. The live media stream
is not obtained for the slave user, but the segments of the first live media stream
locally cached by the proxy server is sent to the corresponding client. This prevents
the media server from sending the live media stream to the client serving as the slave
user, and further reduces a quantity of live media streams requested by clients whose
roles are slave users in the live broadcast room. Using this method reduces resource
overheads for live media stream transmission between the media server and the proxy
server.
[0170] In addition, the method provided in this embodiment further includes the following
process: After the client C1 exits the live broadcast room, the media server continues
to send a live media stream to the client C2 and the client C3 in the live broadcast
room. Specifically, as shown in FIG. 8A and FIG. 8B, the process includes S45 to S59.
The method procedure is similar to the exiting process of the client C1 in Embodiment
1, but differs in that identity roles configured for the client C2 and the client
C3 in the live broadcast room are different and live media streams that are sent to
the client C2 and the client C3 are different. Specifically, as shown in FIG. 8A and
FIG. 8B, the method includes the following steps.
[0171] S45: The client C1 sends, to the proxy server, a request message for exiting the
live broadcast room.
[0172] S46: The proxy server receives, from the client C1, the request message for exiting
the live broadcast room, marks the user role of the client C1 as an exiting (Exiting)
user in the "live-broadcast-room user relationship table", and changes the user role
of the client C2 to the main-master user.
[0173] S47: The proxy server forwards the request message for exiting the live broadcast
room to the media server.
[0174] S48: The proxy server selects one slave user from all slave users identified in the
live-broadcast-room user relationship table, and changes the slave user to a slave
to secondary master user. In this embodiment, the selected and changed client is the
client C3.
[0175] S49: The proxy server sends the third media request message to the media server,
where the third media request message carries the third identifier of the client C3.
In other words, the proxy server sends the third media request message to the media
server by using the role of the client C3.
[0176] S50: The media server sends the response message for exiting the live broadcast room
to the client C1 through the proxy server, where the response message for exiting
the live broadcast room is used to notify the client C1 that the client C1 successfully
exits the live broadcast room. In addition, the method further includes: The proxy
server deletes the related entry of the client C1 from the "live-broadcast-room user
relationship table".
[0177] S51: The proxy server receives the third media response message that is fed back
by the media server based on the third media request message.
[0178] S52: The current role of the client C3 is the slave to secondary master user, and
the proxy server temporarily does not forward the third media response message, but
changes the user role of the client C3 to the secondary-master user in the "live-broadcast-room
user relationship table".
[0179] S53: The media server sends a third live media stream to the client C3 through the
proxy server, and accordingly the proxy server receives the third live media stream.
[0180] S54: The proxy server caches the third live media stream by GOPs, and aligns the
third live media stream and the second live media stream according to an alignment
algorithm. A specific process of aligning the live media streams is similar to S34
in the foregoing Embodiment 1. For details, refer to the related descriptions in S34.
Details are not described herein again.
[0181] In this embodiment, when the client serving as the main-master user in the live broadcast
room exits, a live media stream is requested by using an identity of the secondary-master
user that does not exit the live broadcast room, a role of the client that obtains
the live media stream is changed, and alignment is performed on a received new live
media stream. In this way, there are no repeatedly played pictures and played video
content is integral when other users watch the live video, so that the other users
are not affected when the master user exits the live broadcast room.
[0182] Between step S46 and step S47, the proxy server switches the first live media stream
that is sent to the client (for example, the client C2) in the live broadcast room
to the second live media stream. The media server continuously sends the second live
media stream to the client C2 through the proxy server. After the switching, the proxy
server delivers the continuously received second live media stream to the client in
the live broadcast room. For details, refer to subsequent steps.
[0183] S55: The media server sends the second live media stream to the client C2.
[0184] S56: The proxy server caches the second live media stream by GOPs. In addition, the
method further includes: The proxy server adjusts a timestamp of the second live media
stream.
[0185] S57: The proxy server duplicates the second live media stream based on the "live-broadcast-room
user relationship table", where a quantity of copies is a quantity of all clients
whose roles are not exiting users in the live broadcast room.
[0186] S58: The proxy server sends the second live media stream to the client C2. In addition,
the method further includes: The proxy server adjusts a timestamp of the second live
media stream.
[0187] S59: The proxy server sends the second live media stream to the client C3. In addition,
the method further includes: The proxy server adjusts a timestamp of the second live
media stream.
[0188] Specifically, for a timestamp adjustment process, refer to the descriptions in the
foregoing embodiment. Details are not described in this embodiment.
[0189] According to the method provided in this embodiment, when the client C1 whose role
is the main-master user requests to exit the live broadcast room, after the proxy
server receives, from the client C1 serving as the main-master user, the request message
for exiting the live broadcast room, the client C1 temporarily does not forward the
request message from the user, for exiting the live broadcast room. Instead, the proxy
server selects a client as the new main-master user, and the role of the new main-master
user is used to request a live media stream. The proxy server duplicates and delivers
the live media stream to other clients, and makes alignment during delivery of the
media streams. This ensures that other clients that are watching a media stream are
not affected when the master user corresponding to the watched media stream exits.
[0190] Optionally, the method provided in this embodiment further includes a process in
which the client C2 whose role is the secondary-master user also requests to exit
the live broadcast room. This process is similar to the foregoing process in which
the client C1 exits the live broadcast room.
[0191] Specifically, as shown in FIG. 8A and FIG. 8B, between step S52 and step S53, the
following step is further included: The client C2 sends, to the proxy server, a request
message for exiting the live broadcast room, where the request message includes related
information of the client C2. When the proxy server receives, from the client C2,
the request message for exiting the live broadcast room, because the live media stream
that is sent to the client C2 is being watched, the user role of the client C2 is
refreshed to an exiting (exiting) user. In this case, the request message, from the
client C2, for exiting the live broadcast room is not forwarded temporarily.
[0192] Then, after S54, the method further includes: The proxy server determines that the
client C2 corresponding to the media stream that is being watched exits, and the proxy
server smoothly switches, based on a relative location of a frame that each user watches,
the live media stream to the media stream that is sent to the client C3, and refreshes
the role of the client C3 to the main-master user. In addition, the method further
includes: The proxy server forwards the request message, from the client C2, for exiting
the live broadcast room to the media server; receives the response message that is
for exiting the live broadcast room and that is sent by the media server to the client
C2; and forwards the response message for exiting the live broadcast room to the client
C2. In addition, the method further includes: The proxy server deletes the entry corresponding
to the client C2 from the "live-broadcast-room user relationship table".
[0193] Finally, after receiving the third live media stream from the media server, the proxy
server locally caches the third live media stream by GOPs, duplicates and delivers
the third live media stream to all clients that are not exiting users in the live
broadcast room. In this case, there is only the client C3 in the live broadcast room,
and the proxy server sends, to the client C3, a live media stream sent by the media
server. Optionally, when sending the live media stream to the client C3, the proxy
server further adjusts a timestamp in the media stream based on play time of a video
frame of a user, to avoid affecting user experience of the client C3. In this way,
there are no repeatedly played parts of a media stream video and played video content
is integral when the client C1 and the client C2 exit the live broadcast room.
[0194] According to the unilateral video live broadcast technology provided in this embodiment
of this application, the proxy server requests and obtains, from the media server
by identifying and by using a user role, the media stream of the client whose role
is the master user; duplicates and delivers the media stream requested by the main-master
user to other users in the same live broadcast room. In this way, when the users in
the same live broadcast room watch the media video, for media streams that are transmitted
from the media server to the proxy server, only the media stream that is requested
by the master user consumes bandwidth. This effectively reduces egress bandwidth costs
and wide area network link load. In addition, according to the method, the media server
does not need to configure independent authentication for the client, thereby further
reducing operation and maintenance costs.
[0195] The following describes apparatus and hardware device embodiments corresponding to
the foregoing method embodiments of this application.
[0196] FIG. 9 is a schematic structural diagram of a media stream sending apparatus according
to an embodiment of this application. The apparatus may be the proxy server described
in the foregoing embodiments.
[0197] Further, the apparatus includes a receiving unit 901, a processing unit 902, and
a sending unit 903. In addition, the apparatus may further include another functional
module or unit, for example, a storage unit. The apparatus may be a server, and is
configured to perform the media stream sending method in the foregoing embodiments.
For example, the apparatus provides a live media stream for at least two users that
enter a live broadcast room.
[0198] Specifically, the receiving unit 901 is configured to receive, from a first client,
a first live broadcast room request message for requesting to enter the live broadcast
room. The processing unit 902 is configured to: determine a role of the first client
based on the first live broadcast room request message, and determine the role of
the first client. The sending unit 903 is configured to: when it is determined that
the role of the first client is a slave user, send a locally cached first live media
stream to the first client, where the first live media stream is a media stream that
is forwarded by a media server to a second client through the proxy server, and a
role of the second client is a master user.
[0199] Optionally, in a specific implementation of this embodiment, the processing unit
902 is specifically configured to: determine whether there is a client whose role
is a master user in the live broadcast room when the first live broadcast room request
message is received; and if there is a client whose role is a master user in the live
broadcast room, determine that the role of the first client is the slave user, or
if there no client whose role is a master user in the live broadcast room, determine
that the role of the first client is the master user.
[0200] Optionally, in another specific implementation of this embodiment, the receiving
unit 901 is further configured to: before the first live media stream is sent to the
first client, receive a first media request message from the first client, and skip
forwarding the first media request message to the media server; and the sending unit
903 is further configured to send a first media response message to the first client,
where the first media response message is used to notify the first client that the
first client is allowed to obtain a media stream.
[0201] Optionally, in still another specific implementation of this embodiment, the first
media request message includes an identifier of the first client. The receiving unit
901 is further configured to: after the first live media stream is sent to the first
client, receive, from the second client, a request message for exiting the live broadcast
room. The processing unit 902 is further configured to: when determining the first
client as a new master user, change the role of the first client from the slave user
to the master user. The sending unit 903 is further configured to send a second media
request message to the media server, where the second media request message includes
the identifier of the first client. The receiving unit 901 is further configured to
receive a second live media stream that is sent by the media server based on the second
media request message. The sending unit 903 is further configured to switch, to the
second live media stream, the first live media stream that is sent to the first client.
[0202] Optionally, in still another specific implementation of this embodiment, the processing
unit 902 is specifically configured to: determine whether a quantity of clients whose
roles are master users in the live broadcast room reaches a preset upper limit when
the first live broadcast room request message is received, where the preset upper
limit is greater than 1; and if the quantity of clients whose roles are master users
in the live broadcast room reaches the preset upper limit, determine that the role
of the first client is the slave user.
[0203] Optionally, in still another specific implementation of this embodiment, the processing
unit 902 is further configured to: if the quantity of clients whose roles are master
users in the live broadcast room is not 0 but does not reach the preset upper limit,
determine that the role of the first client is a secondary-master user.
[0204] Optionally, in still another specific implementation of this embodiment, when the
first client is the slave user, the receiving unit 901 is further configured to receive,
from the second client, a request message for exiting the live broadcast room. The
processing unit 902 is further configured to: when determining the first client as
a new secondary-master user, change the role of the first client from the slave user
to the secondary-master user. The sending unit 903 is further configured to send a
third media request message to the media server, where the third media request message
includes an identifier of the first client. The receiving unit 901 is further configured
to receive a third live media stream that is sent by the media server based on the
third media request message.
[0205] Optionally, in still another specific implementation of this embodiment, when the
second client is a main-master user, and the first client is the secondary-master
user, the sending unit 903 is further configured to send the first live media stream
to the first client.
[0206] Optionally, in still another specific implementation of this embodiment, when the
first client is the secondary-master user, the receiving unit 901 is further configured
to receive a fourth media request message from the first client. The sending unit
903 is further configured to send the fourth media request message to the media server.
The receiving unit 901 is further configured to receive a fourth live media stream
that is sent by the media server based on the fourth media request message.
[0207] Optionally, in still another specific implementation of this embodiment, when the
first client is the secondary-master user, the receiving unit 901 is further configured
to receive, from the second client, a request message for exiting the live broadcast
room. The processing unit 902 is further configured to: when determining the first
client as a new main-master user, change the role of the first client from the secondary-master
user to the main-master user. The sending unit 903 is further configured to switch,
to the fourth live media stream, the first live media stream that is sent to the first
client.
[0208] Optionally, in still another specific implementation of this embodiment, the processing
unit 902 is further configured to adjust a timestamp of the fourth live media stream,
so that an adjusted timestamp satisfies that a timestamp of the first frame of the
fourth live media stream that is sent to the first client and a timestamp of the last
frame of the first live media stream that is sent to the first client are consecutive.
[0209] The last frame of the first live media stream that is sent to the first client and
the first frame of the fourth live media stream that is sent to the first client are
adjacent frames.
[0210] The processing unit 902 is further configured to: before switching, to the fourth
live media stream, the first live media stream that is sent to the first client, identify,
based on the cached first live media stream and the fourth live media stream, a first
I frame and a second I frame that belong to the first live media stream and the fourth
live media stream respectively, where the first I frame and the second I frame are
a same video frame; and determine, based on the first I frame and the second I frame,
a first switching frame and a second switching frame that are adjacent to each other
and that belong to the first live media stream and the fourth live media stream respectively,
and use the first switching frame and the second switching frame as the last frame
of the first live media stream that is sent to the first client and the first frame
of the fourth live media stream that is sent to the first client respectively.
[0211] Optionally, in still another specific implementation of this embodiment, the apparatus
further includes the storage unit, configured to cache the first live media stream
by groups of pictures GOPs. In addition, the storage unit further locally stores the
second live media stream and the third live media stream by GOPs.
[0212] Optionally, in still another specific implementation of this embodiment, the processing
unit 902 is further configured to: before switching, to the second live media stream,
the first live media stream that is sent to the first client, adjust a timestamp of
the second live media stream, so that an adjusted timestamp satisfies that a timestamp
of the first frame of the second live media stream that is sent to the first client
and a timestamp of the last frame of the first live media stream that is sent to the
first client are consecutive. "Consecutive" may be understood as that time lengths
of adjacent video frames of the second live media stream received by the first client
are the same, and the time length is a reciprocal of a frame rate parameter f.
[0213] Optionally, in still another specific implementation of this embodiment, the last
frame of the first live media stream that is sent to the first client and the first
frame of the second live media stream that is sent to the first client are adjacent
frames.
[0214] The processing unit 902 is further configured to: before switching, to the second
live media stream, the first live media stream that is sent to the first client, identify,
based on the first live media stream and the second live media stream, a first I frame
and a second I frame that belong to the first live media stream and the second live
media stream respectively, where the first I frame and the second I frame are a same
video frame; and determine, based on the first I frame and the second I frame, a first
switching frame and a second switching frame that are adjacent to each other and that
belong to the first live media stream and the second live media stream respectively,
and use the first switching frame and the second switching frame as the last frame
of the first live media stream that is sent to the first client and the first frame
of the second live media stream that is sent to the first client respectively.
[0215] The sending unit 903 is further configured to: after the first switching frame and
the second switching frame are determined, forward, to the media server, the request
message, from the second client, for exiting the live broadcast room.
[0216] Optionally, in still another specific implementation of this embodiment, the processing
unit 902 is further configured to: before the first live media stream is sent to the
first client, adjust a timestamp of the first live media stream, so that an adjusted
timestamp satisfies that a timestamp of the first frame of the first live media stream
that is sent to the first client is 0, and timestamps of adjacent frames of the first
live media stream that is sent to the first client are consecutive.
[0217] In specific hardware implementation, as shown in FIG. 10, this application further
provides a network device. The network device 200 may be the proxy server in the foregoing
method embodiments.
[0218] Specifically, the network device 200 includes a transceiver 201, a processor 202,
and a memory 203. The network device may further include more or fewer components,
or combine some components, or have different component arrangements. This is not
limited in this application.
[0219] The transceiver 201 is configured to receive and send a live media stream, and perform
data transmission with another device (such as a client or an RDC) in a network, for
example, send and receive a request message and a response message. Further, the transceiver
201 may include components such as a receiver 2011, a transmitter 2012, and an antenna
2013, or may include a transceiver module. Further, the transceiver module may include
a communications module such as a wireless local area network (wireless local area
network, WLAN) module, a Bluetooth module, or a baseband (base band) module, and may
include a radio frequency (radio frequency, RF) circuit corresponding to the communications
module, where the radio frequency circuit is configured to perform wireless local
area network communication, Bluetooth communication, infrared communication, and/or
cellular communications system communication, for example, wideband code division
multiple access (wideband code division multiple access, WCDMA) and/or high-speed
downlink packet access (high speed downlink packet access, HSDPA). The transceiver
module is configured to control communication between components in the network device,
and may support direct memory access (direct memory access).
[0220] The processor 202 is a control center of the network device, and is connected to
various parts of the entire network device through various interfaces and lines. The
processor 202 runs or executes a software program and/or a unit stored in the memory
203, and invokes data stored in the memory 203, to perform various functions of the
network device and/or process data.
[0221] Further, the processor 202 may include an integrated circuit (integrated circuit,
IC), for example, may include a single packaged IC, or may include a plurality of
connected packaged ICs that have a same function or different functions. For example,
the processor may include only a central processing unit (Central Processing Unit,
CPU), or may be a combination of a GPU, a digital signal processor (Digital Signal
Processor, DSP), and a control chip (such as a baseband chip) in the transceiver.
[0222] The memory 203 may include a volatile memory (volatile memory), for example, a random
access memory (Random Access Memory, RAM); or may include a non-volatile memory (non-volatile
memory), for example, a flash memory (flash memory), a hard disk drive (Hard Disk
Drive, HDD), or a solid-state drive (Solid-State Drive, SSD). The memory may further
include a combination of the foregoing types of memories. The memory may store a program
or code. The processor 202 executes the program or the code to implement functions
of the communications device.
[0223] In this embodiment, when the network device is used as the proxy server, functions
of the receiving unit 901 and the sending unit 903 in the apparatus embodiment shown
in FIG. 9 may be implemented by the transceiver 201, or implemented by the transceiver
201 controlled by the processor 202; a function to be implemented by the processing
unit 902 may be implemented by the processor 202; and a function of the storage unit
may be implemented by the memory 203.
[0224] In addition, an embodiment of this application further provides a media stream sending
system. The system includes the media stream sending apparatus shown in FIG. 9 or
the network device shown in FIG. 10, and further includes devices such as a plurality
of clients, an RDC, an EDC, and a content source, to implement the media stream sending
method in the foregoing method embodiments.
[0225] Optionally, the media stream sending system is a video live broadcast system, for
example, a CDN system.
[0226] In addition, this application further provides a computer storage medium. The computer
storage medium may store a program, and when the program is executed, a part of or
all of the steps of the embodiments of the media stream sending method provided in
this application may be performed. The storage medium may be a magnetic disk, an optical
disc, a read-only memory ROM, a random access memory RAM, or the like.
[0227] All or some of the foregoing embodiments may be implemented by using software, hardware,
firmware, or any combination thereof. When software is used to implement the embodiments,
all or some of the embodiments may be implemented in a form of a computer program
product.
[0228] The computer program product includes one or more computer instructions. When the
computer program is loaded and executed on a computer, all or some of the procedures
or functions according to the foregoing embodiments of this application are generated.
The computer may be a general-purpose computer, a dedicated computer, a computer network,
or another programmable apparatus.
[0229] The computer instructions may be stored in a computer-readable storage medium, or
may be transmitted from a computer-readable storage medium to another computer-readable
storage medium. For example, the computer instructions may be transmitted from a website,
a computer, a server, or a data center to another website, computer, server, or data
center in a wired or wireless manner.
[0230] For same or similar parts in the embodiments in this specification, refer to each
other. Especially, an embodiment of the media stream sending apparatus is basically
similar to a method embodiments, and therefore is described briefly. For related parts,
refer to descriptions in the method embodiments.
[0231] A person skilled in the art may clearly understand that, the technologies in the
embodiments of the present invention may be implemented by software in addition to
a necessary general hardware platform. Based on such an understanding, the technical
solutions in the embodiments of the present invention essentially, or the part contributing
to the conventional technology may be implemented in the form of a software product.
The computer software product may be stored in a storage medium, such as a ROM/RAM,
a magnetic disk, or an optical disc, and includes several instructions for indicating
a computer device (which may be a personal computer, a server, a network device, or
the like) to perform the methods described in the embodiments or some parts of the
embodiments of the present invention.
[0232] For same or similar parts in the embodiments in this specification, refer to each
other. In particular, the embodiments of the media stream sending apparatus are basically
similar to the method embodiments, and therefore are described briefly. For related
parts, refer to descriptions in the method embodiments.
[0233] In addition, in the descriptions of this application, "a plurality of" means two
or more than two, unless otherwise specified. In addition, for convenience of clear
description of the technical solutions in the embodiments of this application, terms
such as "first", "second", and the like are used to distinguish between same objects
or similar objects whose functions and purposes are basically the same. A person skilled
in the art may understand that the terms such as "first" and "second" do not limit
a quantity or an execution sequence, and the terms such as "first" and "second" do
not indicate a definite difference.
[0234] The foregoing implementations of this application are not intended to limit the protection
scope of this application.
1. A media stream sending method, wherein the method provides a live media stream for
a client that enters a live broadcast room, and the method comprises:
receiving, by a proxy server (104) from a first client (105), a first live broadcast
room request message for requesting to enter the live broadcast room;
determining, by the proxy server, a role of the first client based on the first live
broadcast room request message; and
if the role of the first client is a slave user, sending a first live media stream
cached in the proxy server to the first client, wherein the first live media stream
is a media stream that is sent by a media server to a second client (106) through
the proxy server, and a role of the second client is a master user;
after the sending, by the proxy server, the first live media stream to the first client,
the method further comprises:
receiving, by the proxy server from the second client, a request message for exiting
the live broadcast room, whereby the proxy server temporarily does not forward the
request message for exiting the live broadcast room to the media server, when the
first live media stream is being watched by the second client at this time,
when determining the first client as a new master user, changing, by the proxy server,
the role of the first client from the slave user to the master user;
sending, by the proxy server, a second media request message to the media server,
wherein the second media request message comprises an identifier of the first client;
receiving, by the proxy server, a second live media stream that is sent by the media
server based on the second media request message;
switching, by the proxy server to the second live media stream, the first live media
stream that is sent to the first client; and
forwarding, by the proxy server the request message for exiting the live broadcast
room to the media server.
2. The method according to claim 1, wherein the determining a role of the first client
based on the first live broadcast room request message comprises:
determining whether there is a client whose role is a master user in the live broadcast
room when the first live broadcast room request message is received; and
if there is a client whose role is a master user in the live broadcast room, determining
that the role of the first client is the slave user.
3. The method according to claim 2, wherein before the sending a first live media stream
cached in the proxy server to the first client, the method further comprises:
receiving, by the proxy server, a first media request message from the first client,
and skipping forwarding the first media request message to the media server; and
sending, by the proxy server, a first media response message to the first client,
wherein the first media response message is used to notify the first client that the
first client is allowed to obtain a media stream.
4. The method according to claim 3, wherein the first media request message comprises
the identifier of the first client.
5. The method according to claim 1, wherein the determining a role of the first client
based on the first live broadcast room request message comprises:
determining, by the proxy server, whether a quantity of clients whose roles are master
users in the live broadcast room reaches a preset upper limit when receiving the first
live broadcast room request message, wherein the preset upper limit is greater than
1; and
if the quantity of clients whose roles are master users in the live broadcast room
reaches the preset upper limit, determining that the role of the first client is the
slave user.
6. The method according to claim 5, further comprising:
if the quantity of clients whose roles are master users in the live broadcast room
is not 0 but does not reach the preset upper limit, determining that the role of the
first client is a secondary-master user.
7. The method according to claim 5, wherein when the first client is the slave user,
the method further comprises:
receiving, by the proxy server from the second client, a request message for exiting
the live broadcast room;
when determining the first client as a new secondary-master user, changing, by the
proxy server, the role of the first client from the slave user to the secondary-master
user;
sending, by the proxy server, a third media request message to the media server, wherein
the third media request message comprises an identifier of the first client; and
receiving, by the proxy server, a third live media stream that is sent by the media
server based on the third media request message.
8. The method according to any one of claims 1 to 7, further comprising:
caching, by the proxy server, the first live media stream by groups of pictures, GOPs.
9. The method according to claim 4, before the switching, by the proxy server, to the
second live media stream, the first live media stream that is sent to the first client,
the method further comprises:
adjusting, by the proxy server, a timestamp of the second live media stream, to enable
an adjusted timestamp to so that an adjusted timestamp satisfies that a timestamp
of the first frame of the second live media stream that is sent by the proxy server
to the first client and a timestamp of the last frame of the first live media stream
that is sent by the proxy server to the first client are consecutive.
10. The method according to claim 4 or 9, wherein the last frame of the first live media
stream that is sent by the proxy server to the first client and the first frame of
the second live media stream that is sent by the proxy server to the first client
are adjacent frames, wherein
before the switching, by the proxy server, to the second live media stream, the first
live media stream that is sent to the first client, the method further comprises:
identifying, by the proxy server based on the first live media stream and the second
live media stream, a first I frame and a second I frame that belong to the first live
media stream and the second live media stream respectively, wherein the first I frame
and the second I frame are a same video frame; and
determining, by the proxy server based on the first I frame and the second I frame,
a first switching frame and a second switching frame that are adjacent to each other
and that belong to the first live media stream and the second live media stream respectively,
and using the first switching frame and the second switching frame as the last frame
of the first live media stream that is sent to the first client and the first frame
of the second live media stream that is sent to the first client respectively; and
after the proxy server determines the first switching frame and the second switching
frame, the method further comprises: forwarding, by the proxy server to the media
server, the request message, from the second client, for exiting the live broadcast
room.
11. A media stream sending apparatus, wherein the apparatus provides a live media stream
for a client that enters a live broadcast room, and the apparatus comprises:
a receiving unit (901), configured to receive, from a first client (105), a first
live broadcast room request message for requesting to enter the live broadcast room;
a processing unit (902), configured to determine a role of the first client based
on the first live broadcast room request message; and
a sending unit (903), configured to: when it is determined that the role of the first
client is a slave user, send a first live media stream cached in the apparatus to
the first client, wherein the first live media stream is a media stream that is sent
by a media server to a second client (106) through the apparatus, and a role of the
second client is a master user
the receiving unit is further configured to: after the first live media stream is
sent to the first client, receive, from the second client, a request message for exiting
the live broadcast room, whereby the request message for exiting the live broadcast
room to the media server is temporarily not forwarded, when the first live media stream
is being watched by the second client at this time;
the processing unit is further configured to: when determining the first client as
a new master user, change the role of the first client from the slave user to the
master user;
the sending unit is further configured to send a second media request message to the
media server, wherein the second media request message comprises an identifier of
the first client;
the receiving unit is further configured to receive a second live media stream that
is sent by the media server based on the second media request message;
the processing unit is further configured to switch, to the second live media stream,
the first live media stream that is sent to the first client; and
the sending unit is further configured to forward the request message for exiting
the live broadcast room to the media server.
12. The apparatus according to claim 11, wherein
the processing unit is specifically configured to: determine whether there is a client
whose role is a master user in the live broadcast room when the first live broadcast
room request message is received; and if there is a client whose role is a master
user in the live broadcast room, determine that the role of the first client is the
slave user.
13. The apparatus according to claim 12, wherein
the receiving unit is further configured to: before the cached first live media stream
is sent to the first client, receive a first media request message from the first
client, and skip forwarding the first media request message to the media server; and
the sending unit is further configured to send a first media response message to the
first client, wherein the first media response message is used to notify the first
client that the first client is allowed to obtain a media stream.
14. The apparatus according to claim 13, wherein the first media request message comprises
the identifier of the first client.
15. The apparatus according to claim 11, wherein
the processing unit is specifically configured to: determine whether a quantity of
clients whose roles are master users in the live broadcast room reaches a preset upper
limit when the first live broadcast room request message is received, where the preset
upper limit is greater than 1; and if the quantity of clients whose roles are master
users in the live broadcast room reaches the preset upper limit, determine that the
role of the first client is the slave user.
16. The apparatus according to claim 15, wherein
the processing unit is further configured to: if the quantity of clients whose roles
are master users in the live broadcast room is not 0 but does not reach the preset
upper limit, determine that the role of the first client is a secondary-master user.
17. The apparatus according to claim 15, wherein when the first client is the slave user,
the receiving unit is further configured to receive, from the second client, a request
message for exiting the live broadcast room;
the processing unit is further configured to: when determining the first client as
a new secondary-master user, change the role of the first client from the slave user
to the secondary-master user;
the sending unit is further configured to send a third media request message to the
media server, wherein the third media request message comprises an identifier of the
first client; and
the receiving unit is further configured to receive a third live media stream that
is sent by the media server based on the third media request message.
18. The apparatus according to any one of claims 11 to 17, further comprising:
a storage unit, configured to cache the first live media stream by groups of pictures,
GOPs.
19. The apparatus according to claim 14, wherein
the processing unit is further configured to: before switching, to the second live
media stream, the first live media stream that is sent to the first client, adjust
a timestamp of the second live media stream, so that an adjusted timestamp satisfies
that a timestamp of the first frame of the second live media stream that is sent to
the first client and a timestamp of the last frame of the first live media stream
that is sent to the first client are consecutive.
20. The apparatus according to claim 14 or 19, wherein the last frame of the first live
media stream that is sent to the first client and the first frame of the second live
media stream that is sent to the first client are adjacent frames, wherein
the processing unit is further configured to: before switching, to the second live
media stream, the first live media stream that is sent to the first client, identify,
based on the first live media stream and the second live media stream, a first I frame
and a second I frame that belong to the first live media stream and the second live
media stream respectively, wherein the first I frame and the second I frame are a
same video frame; and determine, based on the first I frame and the second I frame,
a first switching frame and a second switching frame that are adjacent to each other
and that belong to the first live media stream and the second live media stream respectively,
and use the first switching frame and the second switching frame as the last frame
of the first live media stream that is sent to the first client and the first frame
of the second live media stream that is sent to the first client respectively; and
the sending unit is further configured to: after the first switching frame and the
second switching frame are determined, forward, to the media server, the request message,
from the second client, for exiting the live broadcast room.
21. A network device (200), comprising a processor (202), wherein the processor is coupled
to a memory (203), wherein
the memory is configured to store instructions; and
the processor is configured to execute the instructions in the memory, so that the
network device performs the method according to any one of claims 1 to 10.
1. Verfahren zum Senden eines Mediendatenstroms, wobei das Verfahren einen Live-Mediendatenstrom
für einen Client, der in einen Live-Rundfunkraum eintritt, bereitstellt, und das Verfahren
umfasst:
Empfangen, durch einen Proxy-Server (104) von einem ersten Client (105), einer ersten
Live-Rundfunkraumanforderungsnachricht zum Anfordern, in den Live-Rundfunkraum einzutreten;
Bestimmen, durch den Proxy-Server, einer Rolle des ersten Clients basierend auf der
ersten Live-Rundfunkraumanforderungsnachricht; und
falls die Rolle des ersten Clients ein Slave-Benutzer ist, Senden eines ersten Live-Mediendatenstroms,
der in dem Proxy-Server zwischengespeichert ist, an den ersten Client, wobei der erste
Live-Mediendatenstrom ein Mediendatenstrom, der durch einen Medienserver an einen
zweiten Client (106) über den Proxy-Server gesendet wird, ist, und eine Rolle des
zweiten Clients ein Master-Benutzer ist;
wobei nach dem Senden, durch den Proxy-Server, des ersten Live-Mediendatenstroms an
den ersten Client, das Verfahren ferner umfasst:
Empfangen, durch den Proxy-Server von dem zweiten Client, einer Anforderungsnachricht
zum Verlassen des Live-Rundfunkraums, wodurch der Proxy-Server die Anforderungsnachricht
zum Verlassen des Live-Rundfunkraums vorübergehend nicht an den Medienserver weiterleitet,
wenn der erste Live-Mediendatenstrom zu diesem Zeitpunkt durch den zweiten Client
geschaut wird,
wenn der erste Client als ein neuer Master-Benutzer bestimmt wird, Ändern, durch den
Proxy-Server, der Rolle des ersten Clients von dem Slave-Benutzer zu dem Master-Benutzer;
Senden, durch den Proxy-Server, einer zweiten Medienanforderungsnachricht an den Medienserver,
wobei die zweite Medienanforderungsnachricht einen Bezeichner des ersten Clients umfasst;
Empfangen, durch den Proxy-Server, eines zweiten Live-Mediendatenstroms, der durch
den Medienserver basierend auf der zweiten Medienanforderungsnachricht gesendet wird;
Umschalten, durch den Proxy-Server, des ersten Live-Mediendatenstroms, der an den
ersten Client gesendet wird, auf den zweiten Live-Mediendatenstrom; und
Weiterleiten, durch den Proxy-Server, der Anforderungsnachricht zum Verlassen des
Live-Rundfunkraums an den Medienserver.
2. Verfahren nach Anspruch 1, wobei das Bestimmen einer Rolle des ersten Clients basierend
auf der ersten Live-Rundfunkraumanforderungsnachricht umfasst:
Bestimmen, ob es einen Client, dessen Rolle ein Master-Benutzer ist, in dem Live-Rundfunkraum
gibt, wenn die erste Live-Rundfunkraumanforderungsnachricht empfangen wird; und
falls es einen Client, dessen Rolle ein Master-Benutzer ist, in dem Live-Rundfunkraum
gibt, Bestimmen, dass die Rolle des ersten Clients der Slave-Benutzer ist.
3. Verfahren nach Anspruch 2, wobei vor dem Senden eines ersten Live-Mediendatenstroms,
der in dem Proxy-Server zwischengespeichert ist, an den ersten Client, das Verfahren
ferner umfasst:
Empfangen, durch den Proxy-Server, einer ersten Medienanforderungsnachricht von dem
ersten Client und Überspringen des Weiterleitens der ersten Medienanforderungsnachricht
an den Medienserver; und
Senden, durch den Proxy-Server, einer ersten Medienantwortnachricht an den ersten
Client, wobei die erste Medienantwortnachricht verwendet wird, um den ersten Client
zu benachrichtigen, dass es dem ersten Client erlaubt ist, einen Mediendatenstrom
zu erhalten.
4. Verfahren nach Anspruch 3, wobei die erste Medienanforderungsnachricht den Bezeichner
des ersten Clients umfasst.
5. Verfahren nach Anspruch 1, wobei das Bestimmen einer Rolle des ersten Clients basierend
auf der ersten Live-Rundfunkraumanforderungsnachricht umfasst:
Bestimmen, durch den Proxy-Server, ob eine Anzahl von Clients, deren Rollen Master-Benutzer
sind, in dem Live-Rundfunkraum eine voreingestellte Obergrenze erreicht, wenn die
erste Live-Rundfunkraumanforderungsnachricht empfangen wird, wobei die voreingestellte
Obergrenze größer als 1 ist; und
falls die Anzahl von Clients, deren Rollen Master-Benutzer sind, in dem Live-Rundfunkraum
die voreingestellte Obergrenze erreicht, Bestimmen, dass die Rolle des ersten Clients
der Slave-Benutzer ist.
6. Verfahren nach Anspruch 5, das ferner umfasst:
falls die Anzahl von Clients, deren Rollen Master-Benutzer sind, in dem Live-Rundfunkraum
nicht 0 ist, aber die voreingestellte Obergrenze nicht erreicht, Bestimmen, dass die
Rolle des ersten Clients ein Sekundärmaster-Benutzer ist.
7. Verfahren nach Anspruch 5, wobei, wenn der erste Client der Slave-Benutzer ist, das
Verfahren ferner umfasst:
Empfangen, durch den Proxy-Server von dem zweiten Client, einer Anforderungsnachricht
zum Verlassen des Live-Rundfunkraums;
wenn der erste Client als ein neuer Sekundärmaster-Benutzer bestimmt wird, Ändern,
durch den Proxy-Server, der Rolle des ersten Clients von dem Slave-Benutzer zu dem
Sekundärmaster-Benutzer;
Senden, durch den Proxy-Server, einer dritten Medienanforderungsnachricht an den Medienserver,
wobei die dritte Medienanforderungsnachricht einen Bezeichner des ersten Clients umfasst;
und
Empfangen, durch den Proxy-Server, eines dritten Live-Mediendatenstroms, der durch
den Medienserver basierend auf der dritten Medienanforderungsnachricht gesendet wird.
8. Verfahren nach einem der Ansprüche 1 bis 7, das ferner umfasst:
Zwischenspeichern, durch den Proxy-Server, des ersten Live-Mediendatenstroms nach
Bildgruppen, GOPs.
9. Verfahren nach Anspruch 4, wobei vor dem Umschalten, durch den Proxy-Server, des ersten
Live-Mediendatenstroms, der an den ersten Client gesendet wird, auf den zweiten Live-Mediendatenstrom,
das Verfahren ferner umfasst:
Anpassen, durch den Proxy-Server, eines Zeitstempels des zweiten Live-Mediendatenstroms,
um einen angepassten Zeitstempel zu aktivieren zum, sodass ein angepasster Zeitstempel
erfüllt, dass ein Zeitstempel des ersten Einzelbilds des zweiten Live-Mediendatenstroms,
der durch den Proxy-Server an den ersten Client gesendet wird, und ein Zeitstempel
des letzten Einzelbilds des ersten Live-Mediendatenstroms, der durch den Proxy-Server
an den ersten Client gesendet wird, aufeinanderfolgend sind.
10. Verfahren nach Anspruch 4 oder 9, wobei das letzte Einzelbild des ersten Live-Mediendatenstroms,
der durch den Proxy-Server an den ersten Client gesendet wird, und das erste Einzelbild
des zweiten Live-Mediendatenstroms, der durch den Proxy-Server an den ersten Client
gesendet wird, angrenzende Einzelbilder sind, wobei vor dem Umschalten, durch den
Proxy-Server, des ersten Live-Mediendatenstroms, der an den ersten Client gesendet
wird, auf den zweiten Live-Mediendatenstrom, das Verfahren ferner umfasst:
Identifizieren, durch den Proxy-Server basierend auf dem ersten Live-Mediendatenstrom
und dem zweiten Live-Mediendatenstrom, eines ersten I-Bilds und eines zweiten I-Bilds,
die zu dem ersten Live-Mediendatenstrom beziehungsweise dem zweiten Live-Mediendatenstrom
gehören, wobei das erste I-Bild und das zweite I-Bild ein gleiches Videoeinzelbild
sind; und
Bestimmen, durch den Proxy-Server basierend auf dem ersten I-Bild und dem zweiten
I-Bild, eines ersten Schalteinzelbilds und eines zweiten Schalteinzelbilds, die aneinander
angrenzen und die zu dem ersten Live-Mediendatenstrom beziehungsweise dem zweiten
Live-Mediendatenstrom gehören, und Verwenden des ersten Schalteinzelbilds und des
zweiten Schalteinzelbilds als das letzte Einzelbild des ersten Live-Mediendatenstroms,
der an den ersten Client gesendet wird, beziehungsweise des ersten Einzelbilds des
zweiten Live-Mediendatenstroms, der an den ersten Client gesendet wird; und
nachdem der Proxy-Server das erste Schalteinzelbild und das zweite Schalteinzelbild
bestimmt hat, das Verfahren ferner umfasst: Weiterleiten, durch den Proxy-Server an
den Medienserver, der Anforderungsnachricht, von dem zweiten Client, zum Verlassen
des Live-Rundfunkraums.
11. Einrichtung zum Senden des Mediendatenstroms, wobei die Einrichtung einen Live-Mediendatenstrom
für einen Client bereitstellt, der in einen Live-Senderaum eintritt, und die Einrichtung
umfasst:
eine Empfangseinheit (901), die konfiguriert ist, um von einem ersten Client (105)
eine erste Live-Rundfunkraumanforderungsnachricht zum Anfordern, in den Live-Rundfunkraum
einzutreten, zu empfangen;
eine Verarbeitungseinheit (902), die konfiguriert ist, um eine Rolle des ersten Clients
basierend auf der ersten Live-Rundfunkraumanforderungsnachricht zu bestimmen; und
eine Sendeeinheit (903), die konfiguriert ist zum: wenn bestimmt wird, dass die Rolle
des ersten Clients ein Slave-Benutzer ist, Senden eines ersten Live-Mediendatenstroms,
der in der Einrichtung zwischengespeichert ist, an den ersten Client, wobei der erste
Live-Mediendatenstrom ein Mediendatenstrom ist, der durch einen Medienserver an einen
zweiten Client (106) über die Einrichtung gesendet wird, und eine Rolle des zweiten
Clients ein Master-Benutzer ist
wobei die Empfangseinheit ferner konfiguriert ist zum: nachdem der erste Live-Mediendatenstrom
an den ersten Client gesendet wurde, Empfangen, von dem zweiten Client, einer Anforderungsnachricht
zum Verlassen des Live-Rundfunkraums, wodurch die Anforderungsnachricht zum Verlassen
des Live-Rundfunkraums an den Medienserver vorübergehend nicht weitergeleitet wird,
wenn der erste Live-Mediendatenstrom zu diesem Zeitpunkt durch den zweiten Client
geschaut wird;
die Verarbeitungseinheit ferner konfiguriert ist zum: wenn der erste Client als ein
neuer Master-Benutzer bestimmt wird, Ändern der Rolle des ersten Clients von dem Slave-Benutzer
zu dem Master-Benutzer;
die Sendeeinheit ferner konfiguriert ist, um eine zweite Medienanforderungsnachricht
an den Medienserver zu senden, wobei die zweite Medienanforderungsnachricht einen
Bezeichner des ersten Clients umfasst;
die Empfangseinheit ferner konfiguriert ist, um einen zweiten Live-Mediendatenstrom
zu empfangen, der durch den Medienserver basierend auf der zweiten Medienanforderungsnachricht
gesendet wird;
die Verarbeitungseinheit ferner konfiguriert ist, um den ersten Live-Mediendatenstrom,
der an den ersten Client gesendet wird, auf den zweiten Live-Mediendatenstrom umzuschalten;
und
die Sendeeinheit ferner konfiguriert ist, um die Anforderungsnachricht zum Verlassen
des Live-Rundfunkraums an den Medienserver weiterzuleiten.
12. Einrichtung nach Anspruch 11, wobei
die Verarbeitungseinheit speziell konfiguriert ist zum: Bestimmen, ob es einen Client,
dessen Rolle ein Master-Benutzer ist, in dem Live-Rundfunkraum gibt, wenn die erste
Live-Rundfunkraumanforderungsnachricht empfangen wird; und falls es einen Client,
dessen Rolle ein Master-Benutzer ist, in dem Live-Rundfunkraum gibt, Bestimmen, dass
die Rolle des ersten Clients der Slave-Benutzer ist.
13. Einrichtung nach Anspruch 12, wobei
die Empfangseinheit ferner konfiguriert ist zum: bevor der zwischengespeicherte erste
Live-Mediendatenstrom an den ersten Client gesendet wird, Empfangen einer ersten Medienanforderungsnachricht
von dem ersten Client und Überspringen des Weiterleitens der ersten Medienanforderungsnachricht
an den Medienserver; und
die Sendeeinheit ferner konfiguriert ist, um eine erste Medienantwortnachricht an
den ersten Client zu senden, wobei die erste Medienantwortnachricht verwendet wird,
um den ersten Client zu benachrichtigen, dass es dem ersten Client erlaubt ist, einen
Mediendatenstrom zu erhalten.
14. Einrichtung nach Anspruch 13, wobei die erste Medienanforderungsnachricht den Bezeichner
des ersten Clients umfasst.
15. Einrichtung nach Anspruch 11, wobei
die Verarbeitungseinheit speziell konfiguriert ist zum: Bestimmen, ob eine Anzahl
von Clients, deren Rollen Master-Benutzer sind, in dem Live-Rundfunkraum eine voreingestellte
Obergrenze erreicht, wenn die erste Live-Rundfunkraumanforderungsnachricht empfangen
wird, wobei die voreingestellte Obergrenze größer als 1 ist; und falls die Anzahl
von Clients, deren Rollen Master-Benutzer sind, in dem Live-Rundfunkraum die voreingestellte
Obergrenze erreicht, Bestimmen, dass die Rolle des ersten Clients der Slave-Benutzer
ist.
16. Einrichtung nach Anspruch 15, wobei
die Verarbeitungseinheit ferner konfiguriert ist zum: falls die Anzahl von Clients,
deren Rollen Master-Benutzer sind, in dem Live-Rundfunkraum nicht 0 ist, aber die
voreingestellte Obergrenze nicht erreicht, Bestimmen, dass die Rolle des ersten Clients
ein Sekundärmaster-Benutzer ist.
17. Einrichtung nach Anspruch 15, wobei, wenn der erste Client der Slave-Benutzer ist,
die Empfangseinheit ferner konfiguriert ist, um von dem zweiten Client eine Anforderungsnachricht
zum Verlassen des Live-Rundfunkraums zu empfangen; die Verarbeitungseinheit ferner
konfiguriert ist zum: wenn der erste Client als ein neuer Sekundärmaster-Benutzer
bestimmt wird, Ändern der Rolle des ersten Clients von dem Slave-Benutzer zu dem Sekundärmaster-Benutzer;
die Sendeeinheit ferner konfiguriert ist, um eine dritte Medienanforderungsnachricht
an den Medienserver zu senden, wobei die dritte Medienanforderungsnachricht einen
Bezeichner des ersten Clients umfasst; und
die Empfangseinheit ferner konfiguriert ist, um einen dritten Live-Mediendatenstrom
zu empfangen, der durch den Medienserver basierend auf der dritten Medienanforderungsnachricht
gesendet wird.
18. Einrichtung nach einem der Ansprüche 11 bis 17, die ferner umfasst:
eine Speichereinheit, die konfiguriert ist, um den ersten Live-Mediendatenstrom nach
Bildgruppen, GOPs, zwischenzuspeichern.
19. Einrichtung nach Anspruch 14, wobei
die Verarbeitungseinheit ferner konfiguriert ist zum: vor dem Umschalten, des ersten
Live-Mediendatenstroms, der an den ersten Client gesendet wird, auf den zweiten Live-Mediendatenstrom,
Anpassen eines Zeitstempels des zweiten Live-Mediendatenstroms, sodass ein angepasster
Zeitstempel erfüllt, dass ein Zeitstempel des ersten Einzelbilds des zweiten Live-Mediendatenstroms,
der an den ersten Client gesendet wird, und ein Zeitstempel des letzten Einzelbilds
des ersten Live-Mediendatenstroms, der an den ersten Client gesendet wird, aufeinanderfolgend
sind.
20. Einrichtung nach Anspruch 14 oder 19, wobei das letzte Einzelbild des ersten Live-Mediendatenstroms,
der an den ersten Client gesendet wird, und das erste Einzelbild des zweiten Live-Mediendatenstroms,
der an den ersten Client gesendet wird, angrenzende Einzelbilder sind, wobei
die Verarbeitungseinheit ferner konfiguriert ist zum: vor dem Umschalten, des ersten
Live-Mediendatenstroms, der an den ersten Client gesendet wird, auf den zweiten Live-Mediendatenstrom,
Identifizieren, basierend auf dem ersten Live-Mediendatenstrom und dem zweiten Live-Mediendatenstrom,
eines ersten I-Bilds und eines zweiten I-Bilds, die zu dem ersten Live-Mediendatenstrom
beziehungsweise dem zweiten Live-Mediendatenstrom gehören, wobei das erste I-Bild
und das zweite I-Bild ein gleiches Videoeinzelbild sind; und Bestimmen, basierend
auf dem ersten I-Bild und dem zweiten I-Bild, eines ersten Schalteinzelbilds und eines
zweiten Schalteinzelbilds, die aneinander angrenzen und die zu dem ersten Live-Mediendatenstrom
beziehungsweise dem zweiten Live-Mediendatenstrom gehören, und Verwenden des ersten
Schalteinzelbilds und des zweiten Schalteinzelbilds als den letzten Rahmen des ersten
Live-Mediendatenstroms, der an den ersten Client gesendet wird, beziehungsweise des
ersten Einzelbilds des zweiten Live-Mediendatenstroms, der an den ersten Client gesendet
wird; und
die Sendeeinheit ferner konfiguriert ist zum: nachdem das erste Schalteinzelbild und
das zweite Schalteinzelbild bestimmt wurden, Weiterleiten, an den Medienserver, der
Anforderungsnachricht, von dem zweiten Client, zum Verlassen des Live-Rundfunkraums.
21. Netzwerkvorrichtung (200), die einen Prozessor (202) umfasst, wobei der Prozessor
mit einem Speicher (203) gekoppelt ist, wobei
der Speicher konfiguriert ist, um Anweisungen zu speichern; und
der Prozessor konfiguriert ist, um die Anweisungen in dem Speicher auszuführen, sodass
die Netzwerkvorrichtung das Verfahren nach einem der Ansprüche 1 bis 10 durchführt.
1. Procédé d'envoi de flux multimédia, dans lequel le procédé fournit un flux multimédia
en direct pour un client qui entre dans une salle de diffusion en direct, et le procédé
comprend :
la réception, par un serveur mandataire (104) en provenance d'un premier client (105),
d'un premier message de demande de salle de diffusion en direct pour demander d'entrer
dans la salle de diffusion en direct ;
la détermination, par le serveur mandataire, d'un rôle du premier client sur la base
du premier message de demande de salle de diffusion en direct ; et
si le rôle du premier client est celui d'un utilisateur esclave, l'envoi d'un premier
flux multimédia en direct mis en cache dans le serveur mandataire au premier client,
dans lequel le premier flux multimédia en direct est un flux multimédia qui est envoyé
par un serveur multimédia à un second client (106) par l'intermédiaire du serveur
mandataire, et un rôle du second client est celui d'un utilisateur maître ;
après l'envoi, par le serveur mandataire, du premier flux multimédia en direct au
premier client, le procédé comprend en outre :
la réception, par le serveur mandataire en provenance du second client, d'un message
de demande pour sortir de la salle de diffusion en direct, moyennant quoi le serveur
mandataire ne transmet temporairement pas le message de demande pour sortir de la
salle de diffusion en direct au serveur multimédia, lorsque le premier flux multimédia
en direct est regardé par le second client à ce moment,
lors de la détermination du premier client en tant que nouvel utilisateur maître,
la modification, par le serveur mandataire, du rôle du premier client de l'utilisateur
esclave à l'utilisateur maître ;
l'envoi, par le serveur mandataire, d'un deuxième message de demande multimédia au
serveur multimédia, dans lequel le deuxième message de demande multimédia comprend
un identifiant du premier client ;
la réception, par le serveur mandataire, d'un deuxième flux multimédia en direct qui
est envoyé par le serveur multimédia sur la base du deuxième message de demande multimédia
;
la commutation, par le serveur mandataire, au deuxième flux multimédia en direct,
du premier flux multimédia en direct qui est envoyé au premier client ; et
le transfert, par le serveur mandataire, du message de demande pour sortir de la salle
de diffusion en direct au serveur multimédia.
2. Procédé selon la revendication 1, dans lequel la détermination d'un rôle du premier
client sur la base du premier message de demande de salle de diffusion en direct comprend
:
le fait de déterminer s'il existe un client dont le rôle est celui d'un utilisateur
maître dans la salle de diffusion en direct lorsque le premier message de demande
de salle de diffusion en direct est reçu ; et
s'il y a un client dont le rôle est celui d'un utilisateur maître dans la salle de
diffusion en direct, le fait de déterminer que le rôle du premier client est celui
de l'utilisateur esclave.
3. Procédé selon la revendication 2, dans lequel avant l'envoi d'un premier flux multimédia
en direct mis en cache dans le serveur mandataire au premier client, le procédé comprend
en outre :
la réception, par le serveur mandataire, d'un premier message de demande multimédia
en provenance du premier client, et le fait de sauter le transfert du premier message
de demande multimédia au serveur multimédia ; et
l'envoi, par le serveur mandataire, d'un premier message de réponse multimédia au
premier client, dans lequel le premier message de réponse multimédia est utilisé pour
notifier au premier client que le premier client est autorisé à obtenir un flux multimédia.
4. Procédé selon la revendication 3, dans lequel le premier message de demande multimédia
comprend l'identifiant du premier client.
5. Procédé selon la revendication 1, dans lequel la détermination d'un rôle du premier
client sur la base du premier message de demande de salle de diffusion en direct comprend
:
le fait de déterminer, par le serveur mandataire, si une quantité de clients dont
les rôles sont ceux d'utilisateurs maîtres dans la salle de diffusion en direct atteint
une limite supérieure prédéfinie lors de la réception du premier message de demande
de salle de diffusion en direct, dans lequel la limite supérieure prédéfinie est supérieure
à 1 ; et
si la quantité de clients dont les rôles sont ceux d'utilisateurs maîtres dans la
salle de diffusion en direct atteint la limite supérieure prédéfinie, le fait de déterminer
que le rôle du premier client est celui de l'utilisateur esclave.
6. Procédé selon la revendication 5, comprenant en outre :
si la quantité de clients dont les rôles sont ceux d'utilisateurs maîtres dans la
salle de diffusion en direct n'est pas 0 mais n'atteint pas la limite supérieure prédéfinie,
la détermination que le rôle du premier client est celui d'un utilisateur maître secondaire.
7. Procédé selon la revendication 5, dans lequel lorsque le premier client est le client
esclave, le procédé comprend en outre :
la réception, par le serveur mandataire en provenance du second client, d'un message
de demande pour sortir de la salle de diffusion en direct ;
lors de la détermination du premier client en tant que nouvel utilisateur maître secondaire,
la modification, par le serveur mandataire, du rôle du premier client de l'utilisateur
esclave à l'utilisateur maître secondaire ;
l'envoi, par le serveur mandataire, d'un troisième message de demande multimédia au
serveur multimédia, dans lequel le troisième message de demande multimédia comprend
un identifiant du premier client ; et
la réception, par le serveur mandataire, d'un troisième flux multimédia en direct
qui est envoyé par le serveur multimédia sur la base du troisième message de demande
multimédia.
8. Procédé selon l'une quelconque des revendications 1 à 7, comprenant en outre :
la mise en cache, par le serveur mandataire, du premier flux multimédia en direct
par des groupes d'images, GOP.
9. Procédé selon la revendication 4, avant la commutation, par le serveur mandataire,
au deuxième flux multimédia en direct, du premier flux multimédia en direct qui est
envoyé au premier client, le procédé comprend en outre :
l'ajustement, par le serveur mandataire, d'une estampille temporelle du deuxième flux
multimédia en direct, pour permettre à une estampille temporelle ajustée de, de sorte
qu'une estampille temporelle ajustée satisfait au fait qu'une estampille temporelle
de la première image du deuxième flux multimédia en direct qui est envoyé par le serveur
mandataire au premier client et qu'une estampille temporelle de la dernière image
du premier flux multimédia en direct qui est envoyé par le serveur mandataire au premier
client sont consécutifs.
10. Procédé selon la revendication 4 ou 9, dans lequel la dernière image du premier flux
multimédia en direct qui est envoyé par le serveur mandataire au premier client et
la première image du deuxième flux multimédia en direct qui est envoyé par le serveur
mandataire au premier client sont des images adjacentes, dans lequel avant la commutation,
par le serveur mandataire, au deuxième flux multimédia en direct, du premier flux
multimédia en direct qui est envoyé au premier client, le procédé comprend en outre
:
l'identification, par le serveur mandataire sur la base du premier flux multimédia
en direct et du deuxième flux multimédia en direct, d'une première image I et d'une
seconde image I qui appartiennent au premier flux multimédia en direct et au deuxième
flux multimédia en direct respectivement, dans lequel la première image I et la seconde
image I sont une même image vidéo ; et
la détermination, par le serveur mandataire sur la base de la première image I et
de la seconde image I, d'une première image de commutation et d'une seconde image
de commutation qui sont adjacentes l'une à l'autre et qui appartiennent au premier
flux multimédia en direct et au deuxième flux multimédia en direct respectivement,
et
l'utilisation de la première image de commutation et de la seconde image de commutation
en tant que dernière image du premier flux multimédia en direct qui est envoyé au
premier client et en tant que première image du deuxième flux multimédia en direct
qui est envoyé au premier client; respectivement ; et
après que le serveur mandataire détermine la première image de commutation et la seconde
image de commutation, le procédé comprend en outre : la transmission, par le serveur
mandataire au serveur multimédia, du message de demande, en provenance du second client,
pour sortir de la salle de diffusion en direct.
11. Appareil d'envoi de flux multimédia, dans lequel l'appareil fournit un flux multimédia
en direct pour un client qui entre dans une salle de diffusion en direct, et l'appareil
comprend :
une unité de réception (901), configurée pour recevoir, en provenance d'un premier
client (105), un premier message de demande de salle de diffusion en direct pour demander
d'entrer dans la salle de diffusion en direct ;
une unité de traitement (902), configurée pour déterminer un rôle du premier client
sur la base du premier message de demande de salle de diffusion en direct ; et
une unité d'envoi (903), configurée pour : lorsqu'il est déterminé que le rôle du
premier client est celui d'un utilisateur esclave, envoyer un premier flux multimédia
en direct mis en cache dans l'appareil au premier client, dans lequel le premier flux
multimédia en direct est un flux multimédia qui est envoyé par un serveur multimédia
à un second client (106) par l'intermédiaire de l'appareil, et un rôle du second client
est celui d'un utilisateur maître
l'unité de réception est en outre configurée pour : après que le premier flux multimédia
en direct est envoyé au premier client, recevoir, en provenance du second client,
un message de demande pour sortir de la salle de diffusion en direct, moyennant quoi
le message de demande pour sortir de la salle de diffusion en direct au serveur multimédia
est temporairement non transmis, lorsque le premier flux multimédia en direct est
regardé par le second client à ce moment ;
l'unité de traitement est en outre configurée pour : lors de la détermination du premier
client en tant que nouvel utilisateur maître, modifier le rôle du premier client de
l'utilisateur esclave à l'utilisateur maître ;
l'unité d'envoi est en outre configurée pour envoyer un deuxième message de demande
multimédia au serveur multimédia, dans lequel le deuxième message de demande multimédia
comprend un identifiant du premier client ;
l'unité de réception est en outre configurée pour recevoir un deuxième flux multimédia
en direct qui est envoyé par le serveur multimédia sur la base du deuxième message
de demande multimédia ;
l'unité de traitement est en outre configurée pour commuter, au deuxième flux multimédia
en direct, le premier flux multimédia en direct qui est envoyé au premier client ;
et
l'unité d'envoi est en outre configurée pour transmettre le message de demande pour
sortir de la salle de diffusion en direct au serveur multimédia.
12. Appareil selon la revendication 11, dans lequel
l'unité de traitement est spécifiquement configurée pour : déterminer s'il existe
un client dont le rôle est celui d'un utilisateur maître dans la salle de diffusion
en direct lorsque le premier message de demande de salle de diffusion en direct est
reçu ; et s'il existe un client dont le rôle est celui d'un utilisateur maître dans
la salle de diffusion en direct, déterminer que le rôle du premier client est celui
de l'utilisateur esclave.
13. Appareil selon la revendication 12, dans lequel
l'unité de réception est en outre configurée pour : avant que le premier flux multimédia
en direct mis en cache ne soit envoyé au premier client, recevoir un premier message
de demande multimédia en provenance du premier client, et sauter le transfert du premier
message de demande multimédia au serveur multimédia ; et
l'unité d'envoi est en outre configurée pour envoyer un premier message de réponse
multimédia au premier client, dans lequel le premier message de réponse multimédia
est utilisé pour notifier au premier client que le premier client est autorisé à obtenir
un flux multimédia.
14. Appareil selon la revendication 13, dans lequel le premier message de demande multimédia
comprend l'identifiant du premier client.
15. Appareil selon la revendication 11, dans lequel
l'unité de traitement est spécifiquement configurée pour : déterminer si une quantité
de clients dont les rôles sont ceux d'utilisateurs maîtres dans la salle de diffusion
en direct atteint une limite supérieure prédéfinie lorsque le premier message de demande
de salle de diffusion en direct est reçu, où la limite supérieure prédéfinie est supérieure
à 1 ; et si la quantité de clients dont les rôles sont ceux d'utilisateurs maîtres
dans la salle de diffusion en direct atteint la limite supérieure prédéfinie, déterminer
que le rôle du premier client est celui de l'utilisateur esclave.
16. Appareil selon la revendication 15, dans lequel
l'unité de traitement est en outre configurée pour : si la quantité de clients dont
les rôles sont ceux d'utilisateurs maîtres dans la salle de diffusion en direct n'est
pas 0 mais n'atteint pas la limite supérieure prédéfinie, déterminer que le rôle du
premier client est celui d'un utilisateur maître secondaire.
17. Appareil selon la revendication 15, dans lequel lorsque le premier client est l'utilisateur
esclave,
l'unité de réception est en outre configurée pour recevoir, en provenance du second
client, un message de demande pour sortir de la salle de diffusion en direct ;
l'unité de traitement est en outre configurée pour : lors de la détermination du premier
client en tant que nouvel utilisateur maître secondaire, modifier le rôle du premier
client de l'utilisateur esclave à l'utilisateur maître secondaire ;
l'unité d'envoi est en outre configurée pour envoyer un troisième message de demande
multimédia au serveur multimédia, dans lequel le troisième message de demande multimédia
comprend un identifiant du premier client ; et
l'unité de réception est en outre configurée pour recevoir un troisième flux multimédia
en direct qui est envoyé par le serveur multimédia sur la base du troisième message
de demande multimédia.
18. Appareil selon l'une quelconque des revendications 11 à 17, comprenant en outre :
une unité de stockage, configurée pour mettre en cache le premier flux multimédia
en direct par des groupes d'images, GOP.
19. Appareil selon la revendication 14, dans lequel
l'unité de traitement est en outre configurée pour : avant de commuter, au deuxième
flux multimédia en direct, le premier flux multimédia en direct qui est envoyé au
premier client, ajuster une estampille temporelle du deuxième flux multimédia en direct,
de sorte qu'une estampille temporelle ajustée satisfait au fait qu'une estampille
temporelle de la première image du deuxième flux multimédia en direct qui est envoyé
au premier client et qu'une estampille temporelle de la dernière image du premier
flux multimédia en direct qui est envoyé au premier client sont consécutifs.
20. Appareil selon la revendication 14 ou 19, dans lequel la dernière image du premier
flux multimédia en direct qui est envoyé au premier client et la première image du
deuxième flux multimédia en direct qui est envoyé au premier client sont des images
adjacentes, dans lequel
l'unité de traitement est en outre configurée pour : avant de commuter, au deuxième
flux multimédia en direct, le premier flux multimédia en direct qui est envoyé au
premier client, identifier, sur la base du premier flux multimédia en direct et du
deuxième flux multimédia en direct, une première image I et une seconde image I qui
appartiennent au premier flux multimédia en direct et au deuxième flux multimédia
en direct respectivement, dans lequel la première image I et la seconde image I sont
une même image vidéo ; et déterminer, sur la base de la première image I et de la
seconde image I, une première image de commutation et une seconde image de commutation
qui sont adjacentes l'une à l'autre et qui appartiennent au premier flux multimédia
en direct et au deuxième flux multimédia en direct respectivement, et utiliser la
première image de commutation et la seconde image de commutation en tant que dernière
image du premier flux multimédia en direct qui est envoyé au premier client et en
tant que première image du deuxième flux multimédia en direct qui est envoyé au premier
client respectivement ; et
l'unité d'envoi est en outre configurée pour : après que la première image de commutation
et la seconde image de commutation sont déterminées, transmettre, au serveur multimédia,
le message de demande, en provenance du second client, pour sortir de la salle de
diffusion en direct.
21. Dispositif réseau (200), comprenant un processeur (202), dans lequel le processeur
est couplé à une mémoire (203), dans lequel
la mémoire est configurée pour stocker des instructions ; et
le processeur est configuré pour exécuter les instructions dans la mémoire, de sorte
que le dispositif réseau effectue le procédé selon l'une quelconque des revendications
1 à 10.