Live broadcast stream recording method, apparatus and device, and storage medium

By generating memory data on the user side and sending recording requests to the service side, the method of streaming recording of complete files is solved, and the problem of large memory overhead, fragmented file and easy loss of recorded data during web page recording is solved. It supports long-term recording and improves the flexibility and reliability of recording.

CN119893199APending Publication Date: 2025-04-25CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411804528.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art has problems such as high memory overhead, easy crash, file fragmentation, and easy loss of recorded data during web page recording.

Method used

By generating memory data on the user side and sending a recording request to the service side, the memory data is written to the target audio and video data and forwarded to the service side, the method of streaming recording of the complete file is realized, avoiding waiting for the stream to end and shard recording.

Benefits of technology

It supports long-term recording without causing memory overflow, reduces the generation of fragmented files, and effectively avoids the problem of missing recording data, improving the flexibility and reliability of recording.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893199A_ABST
    Figure CN119893199A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a live broadcast stream recording method and device, equipment and a storage medium. The live broadcast stream recording method comprises the steps of obtaining a live broadcast stream; generating memory data according to the live stream; sending a recording request for the live broadcast stream to a service side; when the recording request is responded, writing the memory data into the target audio and video data; forwarding the target audio and video data to a service side; and receiving a request response of the recording request sent by the service side, wherein the request response comprises a target recording file generated according to the target audio and video data. According to the embodiment of the invention, the memory data corresponding to the live broadcast stream is stored in the target recording file in the form of stream, a mode of recording the complete file in a streaming manner is adopted, the recording action does not need to wait for the end of the stream, a user can watch the live broadcast or participate in a video conference in a webpage, and the audio and video contents are recorded in the local recording file in a streaming manner at the same time. And the recorded file does not need to be downloaded from the server for the second time, so that not only is the bandwidth saved, but also the recording flexibility is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a live streaming recording method and device, an electronic device and a storage medium. Background Art

[0002] With the booming development of rich media and live broadcasting, audiences are becoming more and more fond of and dependent on audio and video content. Especially in scenarios such as online education, sports events, live entertainment, and video conferencing, audiences are not only keen on watching in real time, but also expect to be able to watch the recording at any time after the live broadcast or meeting.

[0003] In related technologies, web page recording has many challenges. For example, the recording process needs to wait for the end of the stream, and before that the data must be temporarily stored in the memory, which causes a sharp increase in browser memory overhead and is very likely to cause crashes. Another solution is to record in segments regularly, but this method will cause file fragmentation, and once an unexpected refresh or tab closing occurs, the recorded data may be lost, affecting the viewing experience. Summary of the invention

[0004] An embodiment of the present application provides a live streaming recording method to solve or at least partially solve the above-mentioned problem.

[0005] Correspondingly, an embodiment of the present application also provides a live stream recording device, an electronic device and a storage medium to ensure the implementation and application of the above method.

[0006] In order to solve the above problems, the embodiment of the present application discloses a live streaming recording method, which is applied to a user side, and the user side is connected to a service side for communication. The method includes:

[0007] Obtaining the live stream;

[0008] Generate memory data according to the live stream;

[0009] Sending a recording request for the live stream to the service side;

[0010] When the recording request is responded to, writing the memory data into the target audio and video data;

[0011] Forwarding the target audio and video data to the service side;

[0012] A request response to the recording request sent by the service side is received, wherein the request response includes a target recording file generated according to the target audio and video data.

[0013] In an optional embodiment of the present application, before acquiring the live stream, the method further includes:

[0014] Initialize a first object and a second object; the first object includes a first endpoint and a second endpoint; the second object includes a readable stream and a writable stream;

[0015] saving the first endpoint and the writable stream;

[0016] The second endpoint and the writable stream are passed to the service side.

[0017] In an optional embodiment of the present application, the sending a recording request for the live stream to the service side includes:

[0018] The first endpoint is used to send the recording request to the second endpoint.

[0019] In an optional embodiment of the present application, when the recording request is responded to, writing the memory data into the target audio and video data includes:

[0020] Using the writable stream, writing the memory data into the target audio and video data;

[0021] The forwarding of the target audio and video data to the service side includes:

[0022] The target audio and video data is forwarded to the readable stream through the writable stream.

[0023] In an optional embodiment of the present application, the writable stream includes a stop recording interface, and the method further includes:

[0024] When stopping recording the live stream, calling the stop recording interface;

[0025] The service side is notified to release the second endpoint and the readable stream.

[0026] The embodiment of the present application also discloses another live streaming recording method, which is applied to a service side, and the service side is connected to a user side for communication. The method includes:

[0027] Receiving a recording request for the live stream sent by the user side; the live stream has memory data saved by the user side;

[0028] In response to the recording request, receiving target audio and video data forwarded by the user side; the target audio and video data is data written by the user side according to the memory data;

[0029] A request response to the recording request is returned to the user side, wherein the request response includes a target recording file generated according to the target audio and video data.

[0030] The embodiment of the present application further discloses a live streaming recording device, which is applied to a user side, and the user side is connected to a service side for communication, and the device includes:

[0031] A live stream acquisition module, used to acquire the live stream;

[0032] A memory generation module, used to generate memory data according to the live stream;

[0033] A request sending module, used for sending a recording request for the live stream to the service side;

[0034] A data writing module, used for writing the memory data into target audio and video data when the recording request is responded to;

[0035] A data forwarding module, used for forwarding the target audio and video data to the service side;

[0036] The target file receiving module is used to receive a request response to the recording request sent by the service side, wherein the request response includes a target recording file generated according to the target audio and video data.

[0037] The embodiment of the present application further discloses another live stream recording device, which is applied to a service side, and the service side is connected to a user side for communication, and the device includes:

[0038] A request receiving module, used for receiving a recording request for the live stream sent by the user side; the live stream contains memory data saved by the user side;

[0039] A data receiving module, configured to receive target audio and video data forwarded by the user side in response to the recording request; the target audio and video data is data written by the user side according to the memory data;

[0040] A response returning module is used to return a request response of the recording request to the user side, wherein the request response includes a target recording file generated according to the target audio and video data.

[0041] An embodiment of the present application also discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the live stream recording method as described in one or more of the embodiments of the present application.

[0042] The embodiments of the present application also disclose one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the live stream recording method as described in one or more of the embodiments of the present application.

[0043] Compared with the prior art, the embodiments of the present application have the following advantages:

[0044] In an embodiment of the present application, a live stream is obtained; memory data is generated according to the live stream; a recording request for the live stream is sent to the service side; when the recording request is responded to, the memory data is written into the target audio and video data; the target audio and video data is forwarded to the service side; and a request response to the recording request sent by the service side is received, and the request response includes a target recording file generated according to the target audio and video data. In an embodiment of the present application, the memory data corresponding to the live stream is saved to the target recording file in the form of a stream, and a streaming recording of the complete file is adopted. The recording action does not need to wait for the end of the stream, supports long-term recording without causing memory overflow, and does not need to be recorded in segments, thereby reducing the generation of fragmented files. In addition, the embodiment of the present application can also effectively avoid the problem of missing recording data caused by accidental refresh, closing tabs, etc. Therefore, users can stream and record audio and video content to local recording files while watching live broadcasts or participating in video conferences on a web page for subsequent playback without downloading the recording file from the server for a second time, which not only saves bandwidth but also significantly increases the flexibility of recording. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a flowchart of a live streaming recording method embodiment of the present application;

[0046] Figure 2 It is a flowchart of another live stream recording method embodiment of the present application;

[0047] Figure 3 It is a flowchart of an embodiment of a live stream recording method of the present application;

[0048] Figure 4 This is a live stream recording schematic diagram of an embodiment of a live stream recording method of the present application;

[0049] Figure 5 This is a schematic diagram of completing live stream recording in an embodiment of a live stream recording method of the present application;

[0050] Figure 6 It is a structural block diagram of an embodiment of a live stream recording device of the present application;

[0051] Figure 7 It is a structural block diagram of another embodiment of a live stream recording device of the present application;

[0052] Figure 8 It is a schematic diagram of the structure of a device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0054] Reference Figure 1 , is a flowchart of a live stream recording method embodiment of the present application, comprising the following steps:

[0055] Step 101: Obtain the live stream.

[0056] In the embodiment of the present application, the browser that obtains the live stream is the client, and the client includes the user side. The client can obtain the live stream from the server and display it to the user, and the user can watch the live stream through the client.

[0057] In one example, the live stream may include live and recorded data loaded through the network, data recorded through a MediaRecorder interface (media recorder interface), real-time recording of a web game, or live stream data generated or processed in other ways.

[0058] In an embodiment of the present application, a local service ServiceWorker (JavaScript file running on the client), i.e., the service side, can be registered in the browser using the ServiceWorkerContainer interface, so that the client includes the user side and the service side. Through the interaction between the user side and the service side, the embodiment of the present application can simulate HTTP (HyperText Transfer Protocol) streaming download action and save the memory data in the form of a stream to the target recording file.

[0059] A live streaming recording method shown in this embodiment is applied to a user side, and the user side is communicatively connected with a service side.

[0060] Specifically, in one embodiment, a first object including a first endpoint (port1) and a second endpoint (port2) and a second object including a readable stream (ReadableStream) and a writable stream (WritableStream) can be initialized on the user side, and the second endpoint and the writable stream are passed to the service side, thereby realizing a communication connection between the user side and the service side through a channel between the first endpoint and the second endpoint and a channel between the readable stream and the writable stream.

[0061] In this embodiment, in step 101, the client obtains the live stream from the server, and the user can watch the live stream through the client.

[0062] Step 102: Generate memory data according to the live stream.

[0063] In step 102, during the process of acquiring and playing the live stream, corresponding memory data will be generated in the local memory.

[0064] Step 103: Send a recording request for the live stream to the service side.

[0065] In step 103, when the user wants to record the live stream, a recording request for the live stream can be sent from the user side to the service side.

[0066] In one embodiment, a loadable element, such as an iframe (Inline Frame, an element in HTML), can be created on the user side, and a recording request can be triggered by specifying its src (an attribute of multiple elements in HTML, used to specify the URL of an external resource) to point to the service address provided by the ServiceWorker on the service side.

[0067] Step 104: When the recording request is responded to, the memory data is written into the target audio and video data.

[0068] In step 104, when the service side responds to the recording request, the local memory data is written into the target audio and video data on the user side.

[0069] In one embodiment, the target audio and video data can be obtained by obtaining the writable property object writable (writable stream property object) of the writable stream of the second object on the user side and continuously writing the audio and video data in the memory data corresponding to the live stream into the object during the process of obtaining the live stream.

[0070] Step 105: forward the target audio and video data to the service side.

[0071] In step 105, after writing the local memory data into the target audio and video data, the user side can forward the target audio and video data to the service side through the channel between the readable stream and the writable stream.

[0072] Step 106: Receive a request response to the recording request sent by the service side, wherein the request response includes a target recording file generated according to the target audio and video data.

[0073] In step 106, after receiving the recording request, the service side can use the readable stream to receive the target audio and video data forwarded by the writable stream, and use the target audio and video data to build a response body (Response Body), that is, a Response (response) instance; at the same time, set "Content-Type: application / octet-stream; charset = utf-8" (indicating a streaming response), "Content-Disposition: attachment; filename* = UTF-8" fragmented.mp4" (instructing the browser to download the response content as an attachment instead of directly displaying it in the browser, and the header field specifically specifies the file name) and other response headers (Response Headers), and use the request response consisting of the response header and the response body to respond to the recording request.

[0074] The user side receives a request response to the recording request sent by the service side. The response body in the request response includes a target recording file generated based on the target audio and video data. The target recording file is saved, and the recorded live stream content can be played back using the target recording file.

[0075] In the process of obtaining the live stream, the user side can continuously write the audio and video data in the memory data corresponding to the live stream into the target audio and video data through the writable stream, and forward the target audio and video data to the readable stream of the server. The readable stream generates a target recording file according to the received target audio and video data, and the service side returns the target recording file as a request response to the user side, thereby achieving the effect of streaming download to a local file. The user can watch the live stream on the web page while streaming the audio and video content to the local target recording file.

[0076] In an embodiment of the present application, a live stream is obtained; memory data is generated according to the live stream; a recording request for the live stream is sent to the service side; when the recording request is responded to, the memory data is written into the target audio and video data; the target audio and video data is forwarded to the service side; and a request response to the recording request sent by the service side is received, and the request response includes a target recording file generated according to the target audio and video data. In an embodiment of the present application, the memory data corresponding to the live stream is saved to the target recording file in the form of a stream, and a streaming recording of the complete file is adopted. The recording action does not need to wait for the end of the stream, supports long-term recording without causing memory overflow, and does not need to be recorded in segments, thereby reducing the generation of fragmented files. In addition, the embodiment of the present application can also effectively avoid the problem of missing recording data caused by accidental refresh, closing tabs, etc. Therefore, users can stream and record audio and video content to local recording files while watching live broadcasts or participating in video conferences on a web page for subsequent playback without downloading the recording file from the server for a second time, which not only saves bandwidth but also significantly increases the flexibility of recording.

[0077] In an optional embodiment of the present application, before step 101, the method further includes:

[0078] Initialize a first object and a second object; the first object includes a first endpoint and a second endpoint; the second object includes a readable stream and a writable stream;

[0079] saving the first endpoint and the writable stream;

[0080] The second endpoint and the writable stream are passed to the service side.

[0081] In this embodiment, a first object including a first endpoint and a second endpoint, and a second object including a readable stream and a writable stream can be initialized on the user side, and the second endpoint and the writable stream are passed to the service side. The user side itself retains the first endpoint and the writable stream, thereby realizing a communication connection between the user side and the service side through the channel between the first endpoint and the second endpoint and the channel between the readable stream and the writable stream.

[0082] In one embodiment, the first object may be a MessageChannel object (message channel object), and the channel between the first endpoint and the second endpoint may be used to transmit signaling messages between the user side and the service side, such as start recording, stop recording, events, etc.

[0083] In one embodiment, the second object may be a TransformStream object (transformation stream object).

[0084] The embodiment of the present application transmits data through the interface of the first object and the second object, thereby achieving the effect of saving the memory data in the form of a stream to the target recording file. The recording action does not need to wait for the stream to end, and there is no need to download the recording file from the server for a second time.

[0085] In an optional embodiment of the present application, step 103 includes:

[0086] The first endpoint is used to send the recording request to the second endpoint.

[0087] In this embodiment, since the first object has been created, the user side can use the first endpoint to send a recording request to the second endpoint of the service side through the channel between the first endpoint and the second endpoint included in the first object.

[0088] The embodiment of the present application transmits a recording request through the interface of the first object and the second object, thereby triggering the subsequent operation of saving the memory data corresponding to the live stream in the form of a stream to the target recording file.

[0089] In an optional embodiment of the present application, step 104 includes:

[0090] Using the writable stream, writing the memory data into the target audio and video data;

[0091] The step 105 includes:

[0092] The target audio and video data is forwarded to the readable stream through the writable stream.

[0093] In this embodiment, when the memory data corresponding to the live stream is saved in the form of a stream to the target recording file, the data can be transmitted through the second object including the readable stream and the writable stream. Specifically, in the process of obtaining the live stream, the writable stream continuously writes the audio and video data in the memory data corresponding to the live stream into the object, thereby obtaining the target audio and video data.

[0094] After the user side writes the local memory data into the target audio and video data through the writable stream, the channel between the readable stream and the writable stream can be used to forward the target audio and video data to the readable stream of the service side through the writable stream, so that the readable stream generates the target recording file, so that the user side can receive the target recording file returned by the service side.

[0095] The embodiment of the present application can continuously write the audio and video data in the memory data corresponding to the live stream into the target audio and video data through the writable stream, and forward the target audio and video data to the readable stream of the server. The readable stream generates a target recording file based on the received target audio and video data, and the service side returns the target recording file as a request response to the user side, thereby achieving the effect of streaming download to a local file.

[0096] In an optional embodiment of the present application, the writable stream includes a stop recording interface, and the method further includes:

[0097] When stopping recording the live stream, calling the stop recording interface;

[0098] The service side is notified to release the second endpoint and the readable stream.

[0099] In this embodiment, if the user wants to stop recording, he can call the stop recording interface (close interface) of the writable stream and notify the service side to release the second endpoint and the readable stream. At this time, the recording will stop, and the service side will generate a complete target recording file as a request response and return it to the user side, and release the second endpoint and the readable stream.

[0100] When it is necessary to stop recording, the embodiment of the present application can call a stop recording interface and notify the service side to release the second endpoint and the readable stream, thereby stopping recording and generating a complete target recording file.

[0101] In an embodiment of the present application, a live stream is obtained; memory data is generated according to the live stream; a recording request for the live stream is sent to the service side; when the recording request is responded to, the memory data is written into the target audio and video data; the target audio and video data is forwarded to the service side; and a request response to the recording request sent by the service side is received, and the request response includes a target recording file generated according to the target audio and video data. In an embodiment of the present application, the memory data corresponding to the live stream is saved to the target recording file in the form of a stream, and a streaming recording of the complete file is adopted. The recording action does not need to wait for the end of the stream, supports long-term recording without causing memory overflow, and does not need to be recorded in segments, thereby reducing the generation of fragmented files. In addition, the embodiment of the present application can also effectively avoid the problem of missing recording data caused by accidental refresh, closing tabs, etc. Therefore, users can stream and record audio and video content to local recording files while watching live broadcasts or participating in video conferences on a web page for subsequent playback without downloading the recording file from the server for a second time, which not only saves bandwidth but also significantly increases the flexibility of recording.

[0102] Based on the above embodiment, this embodiment also provides another live streaming recording method.

[0103] Reference Figure 2, shows a flowchart of another live stream recording method embodiment of the present application, comprising the following steps:

[0104] Step 201: Receive a recording request for the live stream sent by the user side; the live stream exists in memory data saved by the user side.

[0105] Another live stream recording method shown in an embodiment of the present application is applied to a service side, and the service side is communicatively connected with a user side.

[0106] Specifically, in one embodiment, a first object including a first endpoint (port1) and a second endpoint (port2) and a second object including a readable stream (ReadableStream) and a writable stream (WritableStream) can be initialized on the user side, and the second endpoint and the writable stream are passed to the service side, thereby realizing a communication connection between the user side and the service side through a channel between the first endpoint and the second endpoint and a channel between the readable stream and the writable stream.

[0107] In step 201, the service side may receive a recording request for a live stream sent by a user side; the live stream may exist in local memory data saved by the user side.

[0108] Step 202: In response to the recording request, receiving target audio and video data forwarded by the user side; the target audio and video data is data written by the user side according to the memory data.

[0109] In step 202, after writing the local memory data into the target audio and video data, the user side can forward the target audio and video data to the service side through the channel between the readable stream and the writable stream.

[0110] After receiving the recording request, the service side can receive the target audio and video data and construct a response body using the target audio and video data; at the same time, set the response header and respond to the recording request with a request response consisting of the response header and the response body.

[0111] Step 203: Return a request response to the recording request to the user side, wherein the request response includes a target recording file generated according to the target audio and video data.

[0112] In step 203, the service side may return a request response of the recording request to the user side, and the response body of the request response includes a target recording file generated according to the target audio and video data.

[0113] In an embodiment of the present application, a recording request for a live stream sent by a user side is received; the live stream contains memory data saved by the user side; in response to the recording request, the target audio and video data forwarded by the user side is received; the target audio and video data is the data written by the user side according to the memory data; a request response to the recording request is returned to the user side, and the request response includes a target recording file generated according to the target audio and video data. In an embodiment of the present application, the memory data corresponding to the live stream is saved to the target recording file in the form of a stream, and a streaming recording of a complete file is adopted. The recording action does not need to wait for the end of the stream, supports long-term recording without causing memory overflow, and does not need to be recorded in segments, thereby reducing the generation of fragmented files. In addition, the embodiment of the present application can also effectively avoid the problem of missing recording data caused by accidental refresh, closing tabs, etc. Therefore, users can stream and record audio and video content to local recording files while watching live broadcasts or participating in video conferences on a web page for subsequent playback without downloading the recording file from the server for a second time, which not only saves bandwidth but also significantly increases the flexibility of recording.

[0114] In order to enable those skilled in the art to better understand the live streaming recording method of the embodiment of the present application, the following will be described according to Figure 3 to Figure 5 Provide further explanation.

[0115] Reference Figure 3 , is a flowchart of an embodiment of a live stream recording method of the present application.

[0116] Step (1), registering a local service. In the embodiment of the present application, the browser that obtains the live stream is the client, and the client includes the user side. The client can obtain the live stream from the server and display it to the user, and the user can watch the live stream through the client. Use the ServiceWorkerContainer interface to register a local service ServiceWorker in the browser, that is, the service side, so that the client includes the user side and the service side.

[0117] Step (2): Initialize a MessageChannel object including a first endpoint (port1) and a second endpoint (port2) on the user side, and pass port2 to the service side.

[0118] Step (3) Initialize the TransformStream objects including the readable stream (ReadableStream) and the writable stream (WritableStream) on the user side, and pass the writable stream object (readable) to the service side.

[0119] Step (4): The user side initiates a download request (i.e., a recording request) to the ServiceWorker on the service side.

[0120] Step (5): The service side responds to the download request from the user side and starts recording.

[0121] Step (6), during the process of acquiring and playing the live stream, corresponding memory data will be generated in the local memory. By acquiring the writable attribute object (writable stream attribute object) of the second object on the user side, the audio and video data (in bytes) in the memory data corresponding to the live stream is continuously written to the object during the process of acquiring the live stream, thereby obtaining the target audio and video data. After receiving the recording request, the service side can receive the target audio and video data from the user side, and use the target audio and video data to build a response body; at the same time, a response header is set, and a request response consisting of a response header and a response body is used to respond to the recording request, and the request response of the recording request is returned to the user side.

[0122] Reference Figure 4 , is a live stream recording schematic diagram of a live stream recording method embodiment of the present application.

[0123] Figure 4 , a screenshot of the process of streaming audio and video content to a local target recording file is shown in FIG. , and the file name of the target recording file is “fragmented.mp4”.

[0124] Step (7), when it is necessary to stop recording, the stop recording interface can be called and the service side can be notified to release the second endpoint and the readable stream, thereby stopping recording, and the service side generates a complete target recording file. The service side can return a request response to the recording request to the user side, and the response body of the request response includes the target recording file generated according to the target audio and video data.

[0125] Reference Figure 5 , is a schematic diagram of completing live stream recording in an embodiment of a live stream recording method of the present application.

[0126] Figure 5 The screenshot in FIG. 4 shows the target recording file “fragmented.mp4” being downloaded.

[0127] In the embodiment of the present application, after each step, the service side may return a prompt indicating the success or failure of the event to the user side.

[0128] In an embodiment of the present application, a live stream is obtained; memory data is generated according to the live stream; a recording request for the live stream is sent to the service side; when the recording request is responded to, the memory data is written into the target audio and video data; the target audio and video data is forwarded to the service side; and a request response to the recording request sent by the service side is received, and the request response includes a target recording file generated according to the target audio and video data. In an embodiment of the present application, the memory data corresponding to the live stream is saved to the target recording file in the form of a stream, and a streaming recording of the complete file is adopted. The recording action does not need to wait for the end of the stream, supports long-term recording without causing memory overflow, and does not need to be recorded in segments, thereby reducing the generation of fragmented files. In addition, the embodiment of the present application can also effectively avoid the problem of missing recording data caused by accidental refresh, closing tabs, etc. Therefore, users can stream and record audio and video content to local recording files while watching live broadcasts or participating in video conferences on a web page for subsequent playback without downloading the recording file from the server for a second time, which not only saves bandwidth but also significantly increases the flexibility of recording.

[0129] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0130] On the basis of the above embodiments, this embodiment further provides a live stream recording device, which is applied to electronic devices such as terminal devices and servers.

[0131] Reference Figure 6 , shows a structural block diagram of an embodiment of a live stream recording device of the present application, which may specifically include the following modules:

[0132] A live stream acquisition module 601 is used to acquire the live stream;

[0133] A memory generation module 602, used to generate memory data according to the live stream;

[0134] A request sending module 603, configured to send a recording request for the live stream to the service side;

[0135] A data writing module 604 is used to write the memory data into target audio and video data when the recording request is responded to;

[0136] A data forwarding module 605, configured to forward the target audio and video data to the service side;

[0137] The target file receiving module 606 is used to receive a request response to the recording request sent by the service side, wherein the request response includes a target recording file generated according to the target audio and video data.

[0138] In an optional embodiment of the present application, the device further includes:

[0139] An object initialization module, used to initialize a first object and a second object; the first object includes a first endpoint and a second endpoint; the second object includes a readable stream and a writable stream;

[0140] An endpoint saving module, used for saving the first endpoint and the writable stream;

[0141] An endpoint transfer module is used to transfer the second endpoint and the writable stream to the service side.

[0142] In an optional embodiment of the present application, the request sending module 603 includes:

[0143] The endpoint request sending submodule is used to use the first endpoint to send the recording request to the second endpoint.

[0144] In an optional embodiment of the present application, the data writing module 604 includes:

[0145] A writable stream writing submodule, used to write the memory data into the target audio and video data using the writable stream;

[0146] The data forwarding module 605 includes:

[0147] The writable stream forwarding submodule is used to forward the target audio and video data to the readable stream through the writable stream.

[0148] In an optional embodiment of the present application, the writable stream includes a stop recording interface, and the device further includes:

[0149] An interface calling module, used for calling the stop recording interface when stopping recording the live stream;

[0150] An endpoint release module is used to notify the service side to release the second endpoint and the readable stream.

[0151] In an embodiment of the present application, a live stream is obtained; memory data is generated according to the live stream; a recording request for the live stream is sent to the service side; when the recording request is responded to, the memory data is written into the target audio and video data; the target audio and video data is forwarded to the service side; and a request response to the recording request sent by the service side is received, and the request response includes a target recording file generated according to the target audio and video data. In an embodiment of the present application, the memory data corresponding to the live stream is saved to the target recording file in the form of a stream, and a streaming recording of the complete file is adopted. The recording action does not need to wait for the end of the stream, supports long-term recording without causing memory overflow, and does not need to be recorded in segments, thereby reducing the generation of fragmented files. In addition, the embodiment of the present application can also effectively avoid the problem of missing recording data caused by accidental refresh, closing tabs, etc. Therefore, users can stream and record audio and video content to local recording files while watching live broadcasts or participating in video conferences on a web page for subsequent playback without downloading the recording file from the server for a second time, which not only saves bandwidth but also significantly increases the flexibility of recording.

[0152] Based on the above embodiment, this embodiment also provides another live stream recording device.

[0153] Reference Figure 7 , shows a structural block diagram of another embodiment of a live stream recording device of the present application, which may specifically include the following modules:

[0154] The request receiving module 701 is used to receive a recording request for the live stream sent by the user side; the live stream exists in the memory data saved by the user side;

[0155] The data receiving module 702 is used to receive the target audio and video data forwarded by the user side in response to the recording request; the target audio and video data is the data written by the user side according to the memory data;

[0156] The response returning module 703 is used to return a request response of the recording request to the user side, wherein the request response includes a target recording file generated according to the target audio and video data.

[0157] In an embodiment of the present application, a recording request for a live stream sent by a user side is received; the live stream contains memory data saved by the user side; in response to the recording request, the target audio and video data forwarded by the user side is received; the target audio and video data is the data written by the user side according to the memory data; a request response to the recording request is returned to the user side, and the request response includes a target recording file generated according to the target audio and video data. In an embodiment of the present application, the memory data corresponding to the live stream is saved to the target recording file in the form of a stream, and a streaming recording of a complete file is adopted. The recording action does not need to wait for the end of the stream, supports long-term recording without causing memory overflow, and does not need to be recorded in segments, thereby reducing the generation of fragmented files. In addition, the embodiment of the present application can also effectively avoid the problem of missing recording data caused by accidental refresh, closing tabs, etc. Therefore, users can stream and record audio and video content to local recording files while watching live broadcasts or participating in video conferences on a web page for subsequent playback without downloading the recording file from the server for a second time, which not only saves bandwidth but also significantly increases the flexibility of recording.

[0158] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.

[0159] The present application embodiment provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, an electronic device executes one or more of the methods described in the above embodiments. In the present application embodiment, the electronic device includes various types of devices such as terminal devices and servers (clusters).

[0160] The embodiments of the present disclosure may be implemented as a device configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the device may include electronic devices such as terminal devices and servers (clusters). Figure 8 An exemplary apparatus 800 that can be used to implement various embodiments described in this application is schematically illustrated.

[0161] For one embodiment, Figure 8 An exemplary apparatus 800 is shown having one or more processors 802, a control module (chip set) 804 coupled to at least one of the processor(s) 802, a memory 806 coupled to the control module 804, a non-volatile memory (NVM) / storage device 808 coupled to the control module 804, one or more input / output devices 810 coupled to the control module 804, and a network interface 812 coupled to the control module 804.

[0162] The processor 802 may include one or more single-core or multi-core processors, and the processor 802 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 800 can be used as a terminal device, server (cluster), etc. described in the embodiments of the present application.

[0163] In some embodiments, the apparatus 800 may include one or more computer-readable media (e.g., memory 806 or NVM / storage device 808) having instructions 814 and one or more processors 802 combined with the one or more computer-readable media and configured to execute the instructions 814 to implement a module to perform the actions described in the present disclosure.

[0164] For one embodiment, the control module 804 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 802 and / or any suitable device or component in communication with the control module 804 .

[0165] The control module 804 may include a memory controller module to provide an interface to the memory 806. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0166] The memory 806 may be used, for example, to load and store data and / or instructions 814 for the device 800. For one embodiment, the memory 806 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 806 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0167] For one embodiment, control module 804 may include one or more input / output controllers to provide an interface to NVM / storage device 808 and input / output device(s) 810 .

[0168] For example, NVM / storage 808 may be used to store data and / or instructions 814. NVM / storage 808 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0169] NVM / storage device 808 may include storage resources that are physically part of the device on which apparatus 800 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 808 may be accessed via input / output device(s) 810 over a network.

[0170] (One or more) input / output devices 810 may provide an interface for the apparatus 800 to communicate with any other appropriate device, and the input / output device 810 may include a communication component, an audio component, a sensor component, etc. The network interface 812 may provide an interface for the apparatus 800 to communicate through one or more networks, and the apparatus 800 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.

[0171] For one embodiment, at least one of the processor(s) 802 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 804. For one embodiment, at least one of the processor(s) 802 may be packaged together with the logic of one or more controllers of the control module 804 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 802 may be integrated on the same die with the logic of one or more controllers of the control module 804. For one embodiment, at least one of the processor(s) 802 may be integrated on the same die with the logic of one or more controllers of the control module 804 to form a system-on-chip (SoC).

[0172] In various embodiments, the device 800 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 800 may have more or fewer components and / or different architectures. For example, in some embodiments, the device 800 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0173] Among them, the main control chip can be used as a processor or control module in the detection device, sensor data, location information, etc. are stored in a memory or NVM / storage device, the sensor group can be used as an input / output device, and the communication interface may include a network interface.

[0174] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0175] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0176] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable live stream recording terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable live stream recording terminal device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0177] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable live stream recording terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0178] These computer program instructions can also be loaded onto a computer or other programmable live stream recording terminal device, so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0179] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0180] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0181] The live streaming recording method and device, an electronic device and a storage medium provided by the present application are introduced in detail above. The principles and implementation methods of the present application are explained in this article using specific examples. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A live streaming recording method, characterized in that: Applied to a user side, the user side is in communication connection with a service side, the method comprises: Obtaining the live stream; Generate memory data according to the live stream; Sending a recording request for the live stream to the service side; When the recording request is responded to, writing the memory data into the target audio and video data; Forwarding the target audio and video data to the service side; A request response to the recording request sent by the service side is received, wherein the request response includes a target recording file generated according to the target audio and video data.

2. The method according to claim 1, characterized in that Before acquiring the live stream, the method further includes: Initialize a first object and a second object; the first object includes a first endpoint and a second endpoint; the second object includes a readable stream and a writable stream; saving the first endpoint and the writable stream; The second endpoint and the writable stream are passed to the service side.

3. The method according to claim 2, characterized in that The sending a recording request for the live stream to the service side includes: The first endpoint is used to send the recording request to the second endpoint.

4. The method according to claim 2, characterized in that: When the recording request is responded to, writing the memory data into the target audio and video data includes: Using the writable stream, writing the memory data into the target audio and video data; The forwarding of the target audio and video data to the service side includes: The target audio and video data is forwarded to the readable stream through the writable stream.

5. The method according to claim 2, characterized in that: The writable stream includes a stop recording interface, and the method further includes: When stopping recording the live stream, calling the stop recording interface; The service side is notified to release the second endpoint and the readable stream.

6. A live streaming recording method, characterized in that: Applied to a service side, the service side is in communication connection with a user side, the method comprising: Receiving a recording request for the live stream sent by the user side; the live stream has memory data saved by the user side; In response to the recording request, receiving target audio and video data forwarded by the user side; the target audio and video data is data written by the user side according to the memory data; A request response to the recording request is returned to the user side, wherein the request response includes a target recording file generated according to the target audio and video data.

7. A live streaming recording device, characterized in that: Applied to a user side, the user side is connected to a service side for communication, and the device comprises: A live stream acquisition module, used to acquire the live stream; A memory generation module, used to generate memory data according to the live stream; A request sending module, used for sending a recording request for the live stream to the service side; A data writing module, used for writing the memory data into target audio and video data when the recording request is responded to; A data forwarding module, used for forwarding the target audio and video data to the service side; The target file receiving module is used to receive a request response to the recording request sent by the service side, wherein the request response includes a target recording file generated according to the target audio and video data.

8. A live streaming recording device, characterized in that: Applied to a service side, the service side is connected to a user side for communication, and the device comprises: A request receiving module, used for receiving a recording request for the live stream sent by the user side; the live stream contains memory data saved by the user side; A data receiving module, configured to receive target audio and video data forwarded by the user side in response to the recording request; the target audio and video data is data written by the user side according to the memory data; A response returning module is used to return a request response of the recording request to the user side, wherein the request response includes a target recording file generated according to the target audio and video data.

9. An electronic device, characterized in that: include: processor; and A memory having executable codes stored thereon, which, when executed, enables the processor to execute the live streaming recording method as described in one or more of claims 1-6.

10. One or more machine-readable media having executable codes stored thereon, which, when executed, enable a processor to execute the live streaming recording method as described in one or more of claims 1-6.

Citation Information

Patent Citations

  • Client and browser live-broadcasting video recording method and apparatus

    CN107517402A

  • Audio and video real-time recording and broadcasting method and device, equipment and storage medium

    CN114900631A