Method, device, storage medium and electronic device for transmitting media stream file
By processing video conferencing media streams and sending cache instructions to CDN devices, the problem of low CDN hit rate was solved, and high concurrency capabilities for live streaming services were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG HUACHUANG VISION TECH CO LTD
- Filing Date
- 2023-06-21
- Publication Date
- 2026-06-05
AI Technical Summary
When traditional HLS services are integrated with CDN, the CDN hit rate is low, resulting in the pressure on the origin server not being shared and the live streaming concurrency capability being limited.
By acquiring the media streams generated by video conferences, processing them into a collection of media stream files, and sending configuration information to the CDN device to instruct it to cache media stream files for a specific duration, the CDN hit rate can be improved.
It improved CDN hit rate, reduced pressure on the origin server, and enhanced the concurrency capabilities of live streaming services.
Smart Images

Figure CN116708392B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and more specifically, to a method, apparatus, storage medium, and electronic device for transmitting media stream files. Background Technology
[0002] A video conferencing system includes an MCU (Multipoint Control Unit, i.e., a video conferencing server) and various participating devices such as software and hardware terminals, recording servers, etc. Terminals capture images and audio, encode them, and send them to the MCU. The MCU then merges or does not merge the images sent from multiple terminals, and mixes or does not mix the audio before sending them to each participating terminal, thus enabling audio and video communication among multiple participants. When large enterprises and organizations hold large-scale conferences, such as those with tens of thousands of participants, interactive participation is often difficult to achieve. In such cases, a combination of video conferencing and live streaming is often used simultaneously. In this scenario, a live streaming solution that supports high concurrency of video conferencing audio and video streams is needed. A typical browser-based plugin-free live streaming solution is HLS (HTTP Live Streaming). To improve the concurrent access capacity and control hardware deployment costs, we often consider implementing our own CDN origin server and then connecting to a mature CDN (Content Delivery Network) for internet distribution of audio and video streams. However, traditional HLS services suffer from low CDN hit rates when connected to CDN, resulting in the CDN not relieving the pressure on the origin server and thus limiting the live streaming concurrency capability.
[0003] There is currently no effective solution to the technical problem of low concurrency in live streaming services in related technologies. Summary of the Invention
[0004] This invention provides a method, apparatus, storage medium, and electronic device for transmitting media stream files, in order to at least solve the technical problem of low concurrency capability of live streaming services in related technologies.
[0005] According to an embodiment of the present invention, a method for transmitting media stream files is provided, comprising: acquiring a first media stream, wherein the first media stream includes a media stream generated by live streaming a video conference currently being conducted in a video conferencing system; processing the first media stream to obtain a first media stream file set to be downloaded, wherein the first media stream file set includes a first media stream file of a first type and a first group of media stream files of a second type, the first media stream file of the first type being used to index the first group of media stream files of the second type, and the first group of media stream files of the second type being used to represent the first media stream; and, when the first media stream file set is requested to be downloaded, sending first configuration information and the first media stream file set to a CDN device, wherein the first configuration information is used to instruct the first group of media stream files of the second type to be cached on the CDN device for a first predetermined duration.
[0006] In an exemplary embodiment, sending the first configuration information and the first media stream file set to the CDN device includes: sending an HTTP protocol message to the CDN device, wherein the header of the HTTP protocol message carries the first configuration information, and the data field of the HTTP protocol message carries the first media stream file set.
[0007] In an exemplary embodiment, the step of sending first configuration information and the first media stream file set to a CDN device when the first media stream file set is requested to be downloaded includes: sending the first configuration information and the first media stream file set to the CDN device when the first media stream file set is requested to be downloaded via the Internet; after processing the first media stream to obtain the first media stream file set to be downloaded, the method further includes: sending the first media stream file set to a terminal device requesting download in the local area network when the first media stream file set is requested to be downloaded via a local area network.
[0008] In one exemplary embodiment, when the first media stream file set is requested to be downloaded, sending first configuration information and the first media stream file set to the CDN device includes: when the first media stream file set is requested to be downloaded by a first terminal device at a first moment, sending the first configuration information and the first media stream file set to the CDN device, and sending the first media stream file set to the first terminal device through the CDN device; the method further includes: when the second media stream file set is requested to be downloaded by a second terminal device at a second moment, the second media stream file set and the first media stream file set contain the same subset of first media stream files, and the second moment is earlier than the sum of the first moment and the first predetermined duration, sending the first configuration information and the first media stream file set to the CDN device. The N device sends a second subset of media stream files and sends the second subset of media stream files and the first subset of media stream files cached on the CDN device to the second terminal device through the CDN device. The second subset of media stream files includes media stream files in the second set of media stream files other than the first subset of media stream files. The second set of media stream files includes second media stream files of the first type and second group media stream files of the second type. The second media stream files of the first type are used to index the second group media stream files of the second type. The second group media stream files of the second type are used to represent the media stream generated after the second moment of the live broadcast of the video conference currently being held in the video conferencing system.
[0009] In one exemplary embodiment, the method further includes: when sending a second subset of media stream files to the CDN device, sending second configuration information to the CDN device, wherein the second configuration information is used to indicate that the second subset of media stream files is cached on the CDN device for the first predetermined duration or a second predetermined duration different from the first predetermined duration; or, the second configuration information is further used to indicate that the second subset of media stream files is cached on the CDN device for the first predetermined duration or a second predetermined duration different from the first predetermined duration.
[0010] In one exemplary embodiment, the method further includes: when the second configuration information is further used to instruct the second media stream file set to be cached on the CDN device for the first predetermined duration, resetting the remaining cache duration of the first media stream file subset on the CDN device to the first predetermined duration; or when the second configuration information is further used to instruct the second media stream file set to be cached on the CDN device for the second predetermined duration, resetting the remaining cache duration of the first media stream file subset on the CDN device to the second predetermined duration.
[0011] In an exemplary embodiment, processing the first media stream to obtain a first media stream file set to be downloaded includes: slicing the first media stream to obtain the first media stream file set to be downloaded.
[0012] In one exemplary embodiment, the method further includes: generating a target live stream address when the video conference currently being conducted in the video conferencing system is being live-streamed, wherein the target live stream address is used to indicate a request to download the first set of media stream files via the Internet or a local area network.
[0013] In an exemplary embodiment, the target live streaming address includes a first live streaming address and a second live streaming address; wherein, the first live streaming address includes a first IP address used by the live streaming service in the video conferencing system, a port number used by the live streaming service, and a conference number of the video conferencing system, wherein the first IP address is an IP address within a local area network, and the live streaming service is used to live stream the currently ongoing video conferencing system; the second live streaming address includes the domain name of the CDN device and the conference number of the video conferencing system, wherein the origin server address set by the CDN device is the second IP address used by the live streaming service, the origin server port set by the CDN device is the port number used by the live streaming service, the second IP address is an IP address on the Internet, and the origin server address and the origin server port are used to obtain the media stream generated by the live streaming service for live streaming the currently ongoing video conferencing system.
[0014] According to another embodiment of the present invention, a media stream file transmission apparatus is also provided, comprising: an acquisition module for acquiring a first media stream, wherein the first media stream includes a media stream generated by live streaming a video conference currently being conducted in a video conferencing system; a processing module for processing the first media stream to obtain a first media stream file set to be downloaded, wherein the first media stream file set includes a first media stream file of a first type and a first group of media stream files of a second type, the first media stream file of the first type being used to index the first group of media stream files of the second type, and the first group of media stream files of the second type being used to represent the first media stream; and a first sending module for sending first configuration information and the first media stream file set to a CDN device when the first media stream file set is requested to be downloaded, wherein the first configuration information is used to instruct the first group of media stream files of the second type to be cached on the CDN device for a first predetermined duration.
[0015] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0016] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0017] This invention obtains a first media stream, including a media stream generated from a live broadcast of a current video conference. The first media stream is processed to obtain a first media stream file set to be downloaded. This first media stream file set includes first-type first media stream files and a second-type first group of media stream files. When the first media stream file set is requested to be downloaded, first configuration information and the first media stream file set are sent to a Content Delivery Network (CDN) device. The first configuration information instructs that the second-type first group of media stream files be cached on the CDN device for a first predetermined duration. In other words, by instructing the first group of media stream files to be cached on the CDN device, the CDN hit rate can be improved, avoiding the problem of low CDN hit rate caused by the lack of caching in the CDN after the live broadcast service is connected to the CDN in related technologies, and further avoiding the problem of low concurrency capacity of the live broadcast service. Therefore, this invention solves the technical problem of low concurrency capacity of live broadcast services in related technologies, achieving the effect of improving the concurrency capacity of live broadcast services. Attached Figure Description
[0018] Figure 1 This is a block diagram of the mobile terminal hardware structure of the media stream file transmission method according to an embodiment of the present invention;
[0019] Figure 2 This is a flowchart of a media stream file transmission method according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the structure of a video conferencing system according to an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of an HLS live streaming service according to an embodiment of the present invention;
[0022] Figure 5 This is a structural block diagram of a media stream file transmission device according to an embodiment of the present invention. Detailed Implementation
[0023] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0025] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a block diagram of the mobile terminal hardware structure of the media stream file transmission method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0026] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the media stream file transmission method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0028] This embodiment provides a method for transmitting media stream files. Figure 2 This is a flowchart of a media stream file transmission method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0029] Step S202: Obtain the first media stream, wherein the first media stream includes the media stream generated by live streaming the video conference currently being held in the video conferencing system;
[0030] Step S204: Process the first media stream to obtain a first media stream file set to be downloaded, wherein the first media stream file set includes a first media stream file of a first type and a first group of media stream files of a second type, the first media stream file of the first type is used to index the first group of media stream files of the second type, and the first group of media stream files of the second type is used to represent the first media stream;
[0031] Step S206: When the first set of media stream files is requested to be downloaded, send first configuration information and the first set of media stream files to the CDN device, wherein the first configuration information is used to instruct the first set of media stream files of the second type to be cached on the CDN device for a first predetermined duration.
[0032] Through the above steps, by acquiring a first media stream, which includes the media stream generated from the live broadcast of the current video conference, and processing the first media stream to obtain a first media stream file set to be downloaded, the first media stream file set includes first media stream files of a first type and a first group of media stream files of a second type. When the first media stream file set is requested to be downloaded, first configuration information and the first media stream file set are sent to the Content Delivery Network (CDN) device. The first configuration information is used to instruct the first group of media stream files of the second type to be cached on the CDN device for a first predetermined duration. That is, by instructing the first group of media stream files to be cached on the CDN device, the CDN hit rate can be improved, avoiding the problem of low CDN hit rate caused by the lack of caching in the CDN after the live broadcast service is connected to the CDN in related technologies, and further avoiding the problem of low concurrency capacity of the live broadcast service. Therefore, the technical problem of low concurrency capacity of live broadcast services in related technologies is solved, achieving the effect of improving the concurrency capacity of live broadcast services.
[0033] The entity performing the above steps may be a video conferencing system, a processor, a device, a controller, an application control program in the device, a processor with human-computer interaction capabilities configured on a storage device, or a processing device or processing unit with similar processing capabilities, but is not limited to these.
[0034] In the technical solution provided in step S202 above, the first media stream can be a media stream generated by live streaming the current video conference in the video conferencing system. For example, there may be multiple participants in the current video conference. Usually, the initiator or host enables the live streaming function for this video conference. Optionally, it can be enabled on the video conferencing terminal where the initiator is located, or it can be enabled on the management interface of the video conferencing system. In addition, when multiple participants in the video conference have their cameras, microphones, etc. turned on, the video conferencing system can simultaneously collect the audio and video stream data of each participant, thereby generating multiple audio and video streams. The multiple audio and video streams are then processed, for example, by mixing the audio from multiple channels and merging the video from multiple channels. The processed audio and video stream data can be sent to the live streaming service. Of course, whether the cameras, microphones, etc. of each participant are turned on or off can be configured.
[0035] In the technical solution provided in step S204 above, the first media stream obtained in step S202 is further processed to obtain a first media stream file set, which can be downloaded. For example, the first media stream data can be sliced or transcoded. This can be understood as sending the first media stream from step S202 to a live streaming service (e.g., an HLS live streaming service, which belongs to a video conferencing system). This live streaming service can convert the first media stream data into an HLS live streaming data source, for example, generating HLS slice ts files (corresponding to the first group of media stream files of the second type mentioned above) and m3u8 files (corresponding to the first media stream files of the first type mentioned above), and storing them in memory. The m3u8 file can be used to index a group of ts files and can serve as a media playlist, recording a series of multimedia resource slices (such as the aforementioned group of ts files). By playing these slices sequentially, multimedia resources can be presented. The HLS live streaming service can provide live streaming services to external parties to realize HLS live streaming sessions.
[0036] In the technical solution provided in step S206 above, when the first set of media stream files is requested to be downloaded, the first configuration information and the first set of media stream files can be sent to the CDN device. For example, it could be a user requesting to watch a live stream online via an internet web browser, i.e., requesting to download the first set of media stream files. In this step, the HLS live streaming service can send the first configuration information to the CDN device to instruct that the first set of media stream files (such as a set of sliced .ts files) be cached on the CDN device for a first predetermined duration (such as 3s, 10s, 30ms, or other durations). For the HTTP download of the two types of files (such as the aforementioned m3u8 files and .ts files), differentiated HTTP header Cache-Control values can be set. For example, the HLS live streaming service can send an HTTP protocol message to the CDN device, wherein the header of the message can carry the aforementioned first configuration information, such as the setting information of the Cache-Control field. Of course, as the video conference or live stream proceeds, the first media stream is constantly changing, and correspondingly, the first set of media stream files is also changing. According to the instructions in the first configuration information, the CDN caches the first set of media stream files of the second type on the CDN device for a first predetermined duration. For example, when a first terminal device initiates a live streaming request (which can be understood as requesting to watch a live stream), the HLS live streaming service sends the first set of media stream files of the second type to the CDN device corresponding to the first terminal device and instructs the CDN device to cache the first set of media stream files of the second type on the CDN device for the first predetermined duration. In this way, when other terminal devices (such as the second terminal device) also initiate a live streaming request, assuming that the second terminal device and the first terminal device are both within the same CDN node service range, the second terminal device can directly obtain the live streaming content (similar to the first set of media stream files mentioned above) from the CDN when requesting to download it. This improves the CDN hit rate and avoids the problem of needing to download live streaming content from the media stream origin server in the prior art, i.e., the problem of low CDN hit rate in related technologies, which does not relieve pressure on the origin server and thus leads to low concurrency of the live streaming service. The first predetermined duration can be set according to actual application needs.
[0037] In the above embodiments, by instructing the first set of media stream files to be cached on the CDN device, the CDN hit rate can be improved, avoiding the problem in related technologies where the CDN hit rate is low due to the lack of caching in the CDN after the live streaming service is connected, and further avoiding the problem of low concurrency of the live streaming service. Therefore, the technical problem of low concurrency of live streaming services in related technologies is solved, and the effect of improving the concurrency of live streaming services is achieved.
[0038] In an optional embodiment, sending the first configuration information and the first media stream file set to the CDN device includes: sending an HTTP protocol message to the CDN device, wherein the header of the HTTP protocol message carries the first configuration information, and the data field of the HTTP protocol message carries the first media stream file set.
[0039] In the above embodiments, the HLS live streaming service is based on the HTTP transport protocol. The live streaming service can send HTTP protocol messages to the CDN device, through which it can notify the CDN device of the first configuration information, instructing the CDN device to determine the caching strategy for the received first group of media stream files, such as no-cache or caching for a predetermined duration, as in this embodiment, caching for a first predetermined duration. This embodiment achieves the purpose of sending the first configuration information to the CDN device via HTTP protocol messages.
[0040] In an optional embodiment, the step of sending the first configuration information and the first media stream file set to the CDN device when the first media stream file set is requested to be downloaded includes: sending the first configuration information and the first media stream file set to the CDN device when the first media stream file set is requested to be downloaded via the Internet; after processing the first media stream to obtain the first media stream file set to be downloaded, the method further includes: sending the first media stream file set to the terminal device requesting the download in the local area network when the first media stream file set is requested to be downloaded via a local area network.
[0041] In the above embodiments, when the first media stream file set is requested to be downloaded via the Internet, the first configuration information and the first media stream file set can be sent to the CDN device. For example, if a user requests to watch a live broadcast through an Internet web browser or terminal device, that is, requests to download the aforementioned first media stream file set, the HLS live streaming service (or live streaming origin server, or simply origin server) can send the first media stream file set to the CDN device, which then sends it to the Internet web browser or terminal device. Optionally, when the first media stream file set is requested to be downloaded via a local area network (LAN), the first media stream file set can be sent to the terminal device requesting the download within the LAN. For example, if a user requests to watch a live broadcast through a private network web browser (or terminal device), that is, requests to download the aforementioned first media stream file set, the HLS live streaming service (or live streaming origin server, or simply origin server) can directly send the first media stream file set to the terminal device. This embodiment can provide live streaming services through both private networks and the Internet.
[0042] In an optional embodiment, when the first media stream file set is requested to be downloaded, sending the first configuration information and the first media stream file set to the CDN device includes: when the first media stream file set is requested to be downloaded by the first terminal device at a first moment, sending the first configuration information and the first media stream file set to the CDN device, and sending the first media stream file set to the first terminal device through the CDN device; the method further includes: when the second media stream file set is requested to be downloaded by the second terminal device at a second moment, the second media stream file set and the first media stream file set contain the same subset of first media stream files, and the second moment is earlier than the sum of the first moment and the first predetermined duration, sending the first configuration information and the first media stream file set to the CDN device. The N device sends a second subset of media stream files and sends the second subset of media stream files and the first subset of media stream files cached on the CDN device to the second terminal device through the CDN device. The second subset of media stream files includes media stream files in the second set of media stream files other than the first subset of media stream files. The second set of media stream files includes second media stream files of the first type and second group media stream files of the second type. The second media stream files of the first type are used to index the second group media stream files of the second type. The second group media stream files of the second type are used to represent the media stream generated after the second moment of the live broadcast of the video conference currently being held in the video conferencing system.
[0043] In the above embodiments, when the first media stream file set is requested to be downloaded by the first terminal device at a first moment, the first configuration information and the first media stream file set can be sent to the CDN device corresponding to the first terminal device. Then, when the second terminal device requests to download the second media stream file set at a second moment, for example, when the second terminal device requests to watch or join a live broadcast, because the second moment is different from the first moment, the corresponding live broadcast content has also changed. That is, what is downloaded at this time is the second media stream file set (different from the first media stream file set). When the second media stream file set and the first media stream file set contain the same subset of the first media stream files, the second media stream file subset can be sent to the CDN device. The CDN device sends a second subset of media stream files and a subset of the first media stream files (cached by the CDN device) to the second terminal device. For example, assuming that the set of slice resources corresponding to the live content at the first moment is 1 to 10.ts, and the set of slice resources corresponding to the live content at the second moment is 6 to 15.ts, and the CDN device corresponding to the second terminal device has already cached some media stream files (such as the first subset of media stream files mentioned above) when it joins the live broadcast at the second moment, the current live media stream file set (or live content) can be downloaded through the CDN device. That is, it is not necessary to download the live content from the origin server, which achieves the purpose of improving the CDN hit rate and also effectively reduces the pressure on the origin server.
[0044] In an optional embodiment, the method further includes: when sending a second subset of media stream files to the CDN device, sending second configuration information to the CDN device, wherein the second configuration information is used to instruct the second subset of media stream files to be cached on the CDN device for the first predetermined duration or a second predetermined duration different from the first predetermined duration; or, the second configuration information is further used to instruct the second subset of media stream files to be cached on the CDN device for the first predetermined duration or a second predetermined duration different from the first predetermined duration.
[0045] In the above embodiments, optionally, when sending the second media stream file subset to the CDN device, second configuration information may also be sent to the CDN device. The second configuration information is similar to the first configuration information in the aforementioned embodiments. The second configuration information is used to instruct the second media stream file subset to be cached on the CDN device for a first predetermined duration, i.e., the same predetermined duration indicated in the first configuration information. Optionally, the caching duration can also be reconfigured. For example, the second configuration information can be used to instruct the second media stream file subset to be cached on the CDN device for a second predetermined duration. Optionally, the second configuration information may also instruct the second media stream file subset to be cached on the CDN device for a first predetermined duration or a second predetermined duration. The first and second predetermined durations can be in the range of seconds (e.g., 1 second, 3 seconds, or other seconds) or in the range of milliseconds (e.g., 30ms, 100ms, or other milliseconds).
[0046] In an optional embodiment, the method further includes: when the second configuration information is further used to instruct the second media stream file set to be cached on the CDN device for the first predetermined duration, resetting the remaining cache duration of the first media stream file subset on the CDN device to the first predetermined duration; or when the second configuration information is further used to instruct the second media stream file set to be cached on the CDN device for the second predetermined duration, resetting the remaining cache duration of the first media stream file subset on the CDN device to the second predetermined duration.
[0047] As an optional implementation, when the second configuration information is used to instruct the second media stream file set to be cached on the CDN device for a first predetermined duration (e.g., 10 seconds), since the files in the first media stream file subset have already been cached on the CDN device for a period of time, the remaining cache duration of the files in the first media stream file subset on the CDN device may be lower than the first predetermined duration. The second configuration information can be used to instruct the remaining cache duration of the first media stream file subset to be reset to the first predetermined duration. Optionally, when the second configuration information instructs the second media stream file set to be cached on the CDN device for a second predetermined duration, it can also instruct the remaining cache duration of the files in the first media stream file subset on the CDN device to be reset to the second predetermined duration.
[0048] In an optional embodiment, processing the first media stream to obtain a first media stream file set to be downloaded includes: slicing the first media stream to obtain the first media stream file set to be downloaded.
[0049] In the above embodiments, the first media stream can be sliced to obtain a set of first media stream files to be downloaded. For example, the first media stream data can be converted into an HLS live data source to generate a set of HLS slice ts files and m3u8 files, thus obtaining the first media stream file set, which can be stored in memory.
[0050] In an optional embodiment, the method further includes: generating a target live stream address when the video conference currently being conducted in the video conferencing system is being live-streamed, wherein the target live stream address is used to indicate a request to download the first set of media stream files via the Internet or a local area network.
[0051] In the above embodiments, when a live broadcast is started for a video conference currently in progress in the video conferencing system, for example, when the conference initiator or host starts the live broadcast function of the video conference, the video conferencing system will generate a target live broadcast address. The target live broadcast address can be used to instruct the request to download the first media stream file set via the Internet or local area network, or it can be understood that the target live broadcast address can be used to instruct the viewing or joining of the live broadcast via the Internet or local area network.
[0052] In an optional embodiment, the target live streaming address includes a first live streaming address and a second live streaming address; wherein, the first live streaming address includes a first IP address used by the live streaming service in the video conferencing system, the port number used by the live streaming service, and the conference ID of the video conference, wherein the first IP address is an IP address within a local area network, and the live streaming service is used to live stream the currently ongoing video conference in the video conferencing system; the second live streaming address includes the domain name of the CDN device and the conference ID of the video conference, wherein the origin server address set by the CDN device is the second IP address used by the live streaming service, the origin server port set by the CDN device is the port number used by the live streaming service, the second IP address is an IP address on the Internet, and the origin server address and the origin server port are used to obtain the media stream generated by the live streaming service for live streaming the currently ongoing video conference in the video conferencing system.
[0053] In the above embodiments, the target live streaming address may include a first live streaming address and a second live streaming address, wherein the first live streaming address is used to indicate watching the live stream or joining the live stream via a local area network, and the second live streaming address is used to indicate watching the live stream (i.e. watching the live content of a video conference) or joining the live stream via the Internet. The first live stream address may include the first IP address used by the live stream service in the video conferencing system (such as a private network IP address: 10.35.148.111, or others), the port number used by the live stream service (such as 8821, or others), and the conference ID of the video conferencing (such as 9136943xxxx). For example, the first live stream address is: http: / / 10.35.148.111:8821 / live / 91369430851 / index.m3u8. The second live stream address may include the acceleration domain name of the CDN device (such as hls.hitry.com, or others) and the conference ID of the video conferencing (such as 9136943xxxx). For example, the second live stream address is: http: / / hls.hitry.com / live / 91369430851 / index.m3u8. Through this embodiment, by generating two live stream m3u8 addresses for private networks and the Internet, the purpose of automatically switching between private network live stream and Internet live stream scenarios can be achieved.
[0054] Obviously, the embodiments described above are only some embodiments of the present invention, and not all embodiments. The present invention will be specifically described below with reference to the embodiments.
[0055] Figure 3 This is a schematic diagram of a video conferencing system according to an embodiment of the present invention. The video conferencing system includes a Selective Forwarding Unit (SFU), media processing tasks, HLS live streaming service, and terminals (such as...). Figure 3 The system includes terminals 1 and 2, where the SFU includes signaling services and media services. The main functions of each component in the system are described below.
[0056] In the aforementioned video conferencing system, the signaling service and media processing task can interact. When the video conference starts live streaming, the signaling service can start the media processing task; when the video conference stops live streaming, the signaling service can stop the media processing task.
[0057] Media processing tasks can obtain conference audio and video streams from the conference media service and process the obtained audio and video streams. For example, they can perform media processing actions such as audio mixing and video multi-screen fusion. Media processing tasks can also initiate push streaming to the HLS live streaming service to send the processed media stream (corresponding to the aforementioned first media stream) to the HLS live streaming service.
[0058] The HLS live streaming service can receive media stream data pushed from media processing tasks and process it, such as slicing the media stream data to obtain sliced .ts files and m3u8 files (corresponding to the aforementioned first set of media stream files). The HLS live streaming service can then provide live streaming services to external users. Figure 3 The media processing tasks and HLS live streaming services in the system are both equivalent to software modules.
[0059] The following describes the HLS live streaming service provided by the video conferencing system. Figure 4 This is a schematic diagram of an HLS live streaming service according to an embodiment of the present invention, showing the structure of the video conferencing system and... Figure 3 The same applies, and will not be elaborated further here. The video conferencing system in this embodiment of the invention can achieve private network live streaming or internet live streaming through its built-in live streaming service, such as... Figure 4 Live audio and video streams can be played via a private web browser or an internet web browser.
[0060] The following section explains the logic implemented in each unit or module of the video conferencing system, as well as the logic on the browser side.
[0061] 1. Signaling service logic:
[0062] (1) When the meeting control triggers the start of live streaming, the signaling service starts the media processing task for the meeting; when the live streaming is stopped, the media processing task is stopped.
[0063] (2) Provides interfaces for persistent setting and querying of live streaming addresses.
[0064] 2. Media processing task logic:
[0065] (1) Start the live streaming simulation terminal to initiate a meeting to the conference system, obtain the conference audio and video streams from the corresponding conference media service, and complete media processing actions such as audio mixing and video multi-screen fusion;
[0066] (2) Obtain available HLS live streaming services, and generate private network live streaming addresses and Internet live streaming addresses based on the private network address, service port, CDN domain name, and meeting number of the live streaming service;
[0067] (3) Report the two live streaming addresses to the signaling service;
[0068] (4) Start the private push streaming protocol client to initiate push streaming to the HLS live streaming service and send the processed audio and video stream (corresponding to the aforementioned first media stream) to the HLS live streaming service.
[0069] 3. HLS live streaming service logic:
[0070] (1) Provide audio and video streaming services with a private streaming protocol, and implement self-description for the streaming URL;
[0071] (2) Receive streaming audio and video data (corresponding to the aforementioned first media stream) from the media processing task, convert it into an HLS live data source, generate HLS slice ts files and m3u8 files, and store them in memory;
[0072] (3) Provide HLS live streaming services to external users and implement HLS live streaming sessions. In particular, for the HTTP download of the two types of files, set differentiated HTTP header Cache-Control values (corresponding to the aforementioned first configuration information or second configuration information), including:
[0073] a) For m3u8 files (corresponding to the first media stream file of the first type mentioned above), set the Cache-Control value to max-age = 0;
[0074] b) For .ts files (corresponding to the first group of media stream files of the second type mentioned above), set the Cache-Control value to max-age = 30 (corresponding to the first predetermined duration mentioned above);
[0075] (4) Automatically generate HLS live stream address entry based on the value of the push stream URL.
[0076] 4. Browser-side JavaScript logic:
[0077] (1) Determine the URL address of the current web page. If it is an Internet domain name, obtain the Internet live broadcast address from the signaling service; otherwise, obtain the private network live broadcast address from the signaling service.
[0078] (2) Use the m3u8 live streaming address to embed the web page for live audio and video streaming playback.
[0079] Here is an example:
[0080] (1) The video conferencing system starts a live broadcast for the meeting with meeting number 91369430851;
[0081] (2) The private IP address of the HLS live streaming service is 10.35.148.111, and the public IP address is 180.184.99.27;
[0082] (3) The HLS live streaming service port is 8821;
[0083] (4) The push service port for HLS live streaming service is 3883;
[0084] (5) The acceleration domain name applied for by the third-party CDN is hls.hitry.com.
[0085] The private HLS live stream address generated by the media processing task (corresponding to the aforementioned first live stream address) is:
[0086] http: / / 10.35.148.111:8821 / live / 91369430851 / index.m3u8;
[0087] The internet HLS live stream address generated by the media processing task (corresponding to the aforementioned second live stream address) is:
[0088] http: / / hls.hitry.com / live / 91369430851 / index.m3u8;
[0089] The private protocol push address generated by the media processing task is:
[0090] http: / / 10.35.148.111:3883 / livepush?stream=91369430851;
[0091] The origin server address set by the third-party CDN is 180.184.99.27, and the port is 8821.
[0092] The following is an example of HLS protocol interaction in the embodiments of this application. It is only an example and does not constitute a limitation on this case.
[0093] GET / live / 91369430851 / index.m3u8 HTTP / 1.1
[0094] Connection: keep-alive
[0095] User-Agent:Mozilla / 5.0(Windows NT 6.1; WOW64)AppleWebKit / 537.36(KHTML, like Gecko)Chrome / 80.0.3987.87Safari / 537.36SE 2.X MetaSr 1.0
[0096] Accept:* / *
[0097] Accept-Encoding: gzip, deflate
[0098] Accept-Language:zh-CN,zh; q=0.9
[0099] HTTP / 1.1 200 OK
[0100] Content-Type:application / vnd.apple.mpegurl
[0101] Content-Length:215
[0102] Connection:keep-alive
[0103] Content-Range:bytes 0-214 / 215
[0104] Cache-Control:max-age=0
[0105] GET / live / 91369430851 / index_seg_82.ts HTTP / 1.1
[0106] Connection:keep-alive
[0107] User-Agent:Mozilla / 5.0(Windows NT 6.1;WOW64)AppleWebKit / 537.36(KHTML,like Gecko)Chrome / 80.0.3987.87Safari / 537.36SE 2.X MetaSr 1.0
[0108] Accept:* / *
[0109] Accept-Encoding:gzip,deflate
[0110] Accept-Language:zh-CN,zh;q=0.9
[0111] HTTP / 1.1 200OK
[0112] Content-Type:video / octet-stream
[0113] Connection:close
[0114] Cache-Control:max-age=30
[0115] Through this invention, by setting differentiated HTTP Cache-Control values for two types of files used in HLS live streaming, efficient CDN access for the HLS live streaming origin server and improved CDN hit rate are achieved. By generating two different live streaming m3u8 addresses for private networks and the internet, automatic switching between private network and internet live streaming scenarios is achieved, saving CDN traffic costs. The HLS live streaming service push URL is self-describing and automatically converted into an HLS live streaming data source, eliminating the need for push URL management logic and greatly simplifying live streaming management complexity.
[0116] Compared with related technologies, the embodiments of the present invention have the following technical effects: 1) The CDN edge node hit rate is greatly improved. During large-scale live streaming, the CDN hit rate can reach over 90%, thereby greatly reducing the pressure on the HLS live streaming origin server and improving the high concurrency capability of HLS live streaming. In contrast, the CDN hit rate is less than 5% when traditional HLS live streaming services are connected to CDN. 2) The dependency of "third-party live streaming center + dedicated video live streaming CDN" is eliminated. By connecting the origin server to a general CDN through the embodiments of the present invention, high-concurrency live streaming services without browser plugins can be achieved; and only the third-party CDN is needed for live content distribution. When connecting with third-party systems, there are no additional push stream interfaces other than the HTTP file download interface, and no live URL management interface is required. This greatly simplifies the complexity of connecting with third-party systems, reduces development complexity, and improves system reliability. 3) The video conferencing system has built-in live streaming capabilities. For small-scale meeting live streaming needs, no third-party live streaming center or third-party CDN is required, and it can be implemented in the system itself. This improves the self-completeness of the video conferencing system, reduces CDN traffic, and saves meeting costs.
[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0118] This embodiment also provides a media stream file transmission device. Figure 5 This is a structural block diagram of a media stream file transmission device according to an embodiment of the present invention, such as... Figure 5 As shown, the device includes:
[0119] The acquisition module 502 is used to acquire a first media stream, wherein the first media stream includes a media stream generated by live streaming the video conference currently being held in the video conferencing system;
[0120] Processing module 504 is used to process the first media stream to obtain a first media stream file set to be downloaded, wherein the first media stream file set includes a first media stream file of a first type and a first group of media stream files of a second type, the first media stream file of the first type is used to index the first group of media stream files of the second type, and the first group of media stream files of the second type is used to represent the first media stream;
[0121] The first sending module 506 is configured to send first configuration information and the first media stream file set to a CDN device when the first media stream file set is requested to be downloaded, wherein the first configuration information is used to instruct the first group of media stream files of the second type to be cached on the CDN device for a first predetermined duration.
[0122] In an optional embodiment, the first sending module 506 includes: a first sending unit, configured to send an HTTP protocol message to the CDN device, wherein the header of the HTTP protocol message carries the first configuration information, and the data field of the HTTP protocol message carries the first media stream file set.
[0123] In an optional embodiment, the first sending module 506 includes: a second sending unit, configured to send first configuration information and the first media stream file set to the CDN device when the first media stream file set is requested to be downloaded via the Internet; the device further includes: a second sending module, configured to, after processing the first media stream to obtain the first media stream file set to be downloaded, send the first media stream file set to the terminal device requesting download in the local area network when the first media stream file set is requested to be downloaded via the local area network.
[0124] In an optional embodiment, the first sending module 506 includes: a third sending unit, configured to send the first configuration information and the first media stream file set to the CDN device, and send the first media stream file set to the first terminal device through the CDN device, when the first media stream file set is requested to be downloaded by the first terminal device at a first moment; the device further includes: a third sending module, configured to send the second media stream file set to the CDN device when the second media stream file set is requested to be downloaded by the second terminal device at a second moment, the second media stream file set and the first media stream file set contain the same subset of first media stream files, and the second moment is earlier than the sum of the first moment and the first predetermined duration. A subset of files is sent to the second terminal device via the CDN device, along with the first subset of media stream files cached on the CDN device. The second subset of media stream files includes all media stream files in the second media stream file set except for the first subset. The second media stream file set includes a second media stream file of the first type and a second group of media stream files of the second type. The second media stream file of the first type is used for file indexing of the second group of media stream files of the second type, and the second group of media stream files of the second type represents the media stream generated after the second moment of the live broadcast of the currently ongoing video conference in the video conferencing system.
[0125] In an optional embodiment, the above apparatus further includes: a fourth sending module, configured to send second configuration information to the CDN device when sending a second media stream file subset to the CDN device, wherein the second configuration information is configured to instruct the second media stream file subset to be cached on the CDN device for the first predetermined duration or a second predetermined duration different from the first predetermined duration, or the second configuration information is further configured to instruct the second media stream file subset to be cached on the CDN device for the first predetermined duration or a second predetermined duration different from the first predetermined duration.
[0126] In an optional embodiment, the above apparatus further includes: a first reset module, configured to reset the remaining cache duration of the first media stream file subset to the first predetermined duration on the CDN device when the second configuration information is further configured to indicate that the second media stream file set is cached on the CDN device for the first predetermined duration; or, a second reset module, configured to reset the remaining cache duration of the first media stream file subset to the second predetermined duration on the CDN device when the second configuration information is further configured to indicate that the second media stream file set is cached on the CDN device for the second predetermined duration.
[0127] In an optional embodiment, the processing module 504 includes a processing unit for slicing the first media stream to obtain a set of the first media stream files to be downloaded.
[0128] In an optional embodiment, the above apparatus further includes: a generation module, configured to generate a target live streaming address when the video conference currently being conducted in the video conferencing system is being live-streamed, wherein the target live streaming address is used to indicate a request to download the first set of media stream files via the Internet or a local area network.
[0129] In an optional embodiment, the target live streaming address includes a first live streaming address and a second live streaming address; wherein, the first live streaming address includes a first IP address used by the live streaming service in the video conferencing system, the port number used by the live streaming service, and the conference ID of the video conference, wherein the first IP address is an IP address within a local area network, and the live streaming service is used to live stream the currently ongoing video conference in the video conferencing system; the second live streaming address includes the domain name of the CDN device and the conference ID of the video conference, wherein the origin server address set by the CDN device is the second IP address used by the live streaming service, the origin server port set by the CDN device is the port number used by the live streaming service, the second IP address is an IP address on the Internet, and the origin server address and the origin server port are used to obtain the media stream generated by the live streaming service for live streaming the currently ongoing video conference in the video conferencing system.
[0130] It should be noted that each of the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: all the above modules are located in the same processor; or, each of the above modules is located in different processors in any combination.
[0131] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0132] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0133] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0134] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0135] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0136] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0137] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for transmitting media stream files, characterized in that, include: Acquire a first media stream, wherein the first media stream includes a media stream generated by live streaming the currently ongoing video conference in the video conferencing system; The first media stream is processed to obtain a first media stream file set to be downloaded, wherein the first media stream file set includes a first media stream file of a first type and a first group of media stream files of a second type. The first media stream file of the first type is used to index the first group of media stream files of the second type, and the first group of media stream files of the second type is used to represent the first media stream. When the first set of media stream files is requested to be downloaded, first configuration information and the first set of media stream files are sent to the CDN device, wherein the first configuration information is used to instruct the first set of media stream files of the second type to be cached on the CDN device for a first predetermined duration; The method further includes: when sending a second subset of media stream files to the CDN device, sending second configuration information to the CDN device, wherein the second subset of media stream files includes media stream files in the second media stream file set other than the first subset of media stream files, the second media stream file set contains the same first subset of media stream files as the first media stream file set, the second media stream file set is requested to be downloaded by the second terminal device at a second time, the first media stream file set is requested to be downloaded by the first terminal device at a first time, and the second time is earlier than the sum of the first time and the first predetermined duration; The second media stream file set includes a second media stream file of the first type and a second group of media stream files of the second type. The second media stream file of the first type is used to index the second group of media stream files of the second type. The second group of media stream files of the second type is used to represent the media stream generated after the second moment when the video conference currently being broadcast in the video conferencing system is being broadcast live. Wherein, the second configuration information is used to instruct that when the second media stream file set is cached on the CDN device for the first predetermined duration, the remaining cache duration of the first media stream file subset on the CDN device is reset to the first predetermined duration; or If the second configuration information is further used to instruct that the second media stream file set be cached on the CDN device for a second predetermined duration that is different from the first predetermined duration, the remaining cache duration of the first media stream file subset on the CDN device is reset to the second predetermined duration.
2. The method according to claim 1, characterized in that, Sending the first configuration information and the first media stream file set to the CDN device includes: Send an HTTP protocol message to the CDN device, wherein the header of the HTTP protocol message carries the first configuration information and the data field of the HTTP protocol message carries the first media stream file set.
3. The method according to claim 1, characterized in that, The step of sending the first configuration information and the first media stream file set to the CDN device when the first media stream file set is requested to be downloaded includes: sending the first configuration information and the first media stream file set to the CDN device when the first media stream file set is requested to be downloaded via the Internet; After processing the first media stream to obtain a first media stream file set to be downloaded, the method further includes: when the first media stream file set is requested to be downloaded via a local area network, sending the first media stream file set to the terminal device requesting the download in the local area network.
4. The method according to claim 1, characterized in that, When the first media stream file set is requested to be downloaded, sending the first configuration information and the first media stream file set to the CDN device includes: when the first media stream file set is requested to be downloaded by the first terminal device at a first moment, sending the first configuration information and the first media stream file set to the CDN device, and sending the first media stream file set to the first terminal device through the CDN device; The method further includes: sending the second media stream file subset to the CDN device, and sending the second media stream file subset and the first media stream file subset cached on the CDN device to the second terminal device through the CDN device.
5. The method according to claim 1, characterized in that, The method further includes: The second configuration information is also used to instruct the second media stream file subset to be cached on the CDN device for the first predetermined duration or the second predetermined duration, or the second configuration information is also used to instruct the second media stream file set to be cached on the CDN device for the first predetermined duration or the second predetermined duration.
6. The method according to any one of claims 1 to 5, characterized in that, The process of processing the first media stream to obtain a set of first media stream files to be downloaded includes: The first media stream is sliced to obtain a set of first media stream files to be downloaded.
7. The method according to claim 1, characterized in that, The method further includes: When a live stream is enabled for the currently ongoing video conference in the video conferencing system, a target live stream address is generated, wherein the target live stream address is used to indicate a request to download the first set of media stream files via the Internet or a local area network.
8. The method according to claim 7, characterized in that, The target live streaming address includes a first live streaming address and a second live streaming address; The first live streaming address includes the first IP address used by the live streaming service in the video conferencing system, the port number used by the live streaming service, and the conference ID of the video conference. The first IP address is an IP address within a local area network, and the live streaming service is used to live stream the currently ongoing video conference in the video conferencing system. The second live streaming address includes the domain name of the CDN device and the conference ID of the video conference. The origin server address set by the CDN device is the second IP address used by the live streaming service, and the origin server port set by the CDN device is the port number used by the live streaming service. The second IP address is an IP address on the Internet. The origin server address and the origin server port are used to obtain the media stream generated by the live streaming service for live streaming the currently ongoing video conference in the video conferencing system.
9. A media stream file transmission device, characterized in that, include: The acquisition module is used to acquire a first media stream, wherein the first media stream includes a media stream generated by live streaming the currently ongoing video conference in the video conferencing system; The processing module is used to process the first media stream to obtain a set of first media stream files to be downloaded, wherein the first media stream file set includes a first media stream file of a first type and a first group of media stream files of a second type, the first media stream file of the first type is used to index the first group of media stream files of the second type, and the first group of media stream files of the second type is used to represent the first media stream; A first sending module is configured to send first configuration information and the first media stream file set to a CDN device when the first media stream file set is requested to be downloaded, wherein the first configuration information is used to instruct the first group of media stream files of the second type to be cached on the CDN device for a first predetermined duration; The device is further configured to send second configuration information to the CDN device when sending a second subset of media stream files to the CDN device, wherein the second subset of media stream files includes media stream files in the second set of media stream files excluding the first subset of media stream files, the second set of media stream files contains the same first subset of media stream files as the first set of media stream files, the second set of media stream files is requested to be downloaded by the second terminal device at a second time, the first set of media stream files is requested to be downloaded by the first terminal device at a first time, and the second time is earlier than the sum of the first time and the first predetermined duration; The second media stream file set includes a second media stream file of the first type and a second group of media stream files of the second type. The second media stream file of the first type is used to index the second group of media stream files of the second type. The second group of media stream files of the second type is used to represent the media stream generated after the second moment when the video conference currently being broadcast in the video conferencing system is being broadcast live. Wherein, the second configuration information is used to instruct that when the second media stream file set is cached on the CDN device for the first predetermined duration, the remaining cache duration of the first media stream file subset on the CDN device is reset to the first predetermined duration; or when the second configuration information is further used to instruct that when the second media stream file set is cached on the CDN device for a second predetermined duration different from the first predetermined duration, the remaining cache duration of the first media stream file subset on the CDN device is reset to the second predetermined duration.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 8.