Method, device and storage medium for processing events in media stream

By analyzing and processing methods and devices for DASH and CMAF in-band events, the problem that the MSE specification does not support processing of in-band events is solved, local processing and scheduling of events is realized, and the processing capability of streaming media content is improved.

CN115699705BActive Publication Date: 2024-09-20TENCENT AMERICA LLC
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202280003450.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-03-24
Filing Date
2022-03-25
Publication Date
2024-09-20
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

The current Media Source Extension (MSE) specification does not support parsing and processing of in-band events embedded in DASH or CMAF media segments, resulting in the inability to process DASH or CMAF in-band events natively and schedule them to the corresponding applications.

Method used

Provides a method and device to obtain media data, generate event segments and media segments, analyze the start time, end time and scheduling mode of the event, compare the event start time and the current playback position, and attach the event to the event scheduling buffer area, and perform event scheduling based on the relevant position, time and playback position of the event scheduling buffer.

Benefits of technology

This enables the MSE to locally process DASH and CMAF in-band events, realizes effective scheduling and processing of events, and solves the problem of being unable to process in-band events in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115699705B_ABST
    Figure CN115699705B_ABST
Patent Text Reader

Abstract

A method and apparatus for processing events in a media stream are provided. The method includes: acquiring media data; generating one or more event segments and one or more media segments from the media data; parsing the event from the one or more event segments to determine an event start time, an event end time, and a scheduling mode; appending the event to an event scheduling buffer based on a comparison of the event start time and a current playback position and determining that the event from the one or more event segments does not exist in a scheduled buffer; and scheduling the event based on a position associated with the event in the event scheduling buffer, the event start time, the event end time, and the current playback position.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to provisional application US 63 / 177,791 filed on April 21, 2021, the entire contents of which are hereby expressly incorporated by reference into this application. Technical Field

[0003] The embodiments of the present disclosure are directed to streaming media content, and more specifically, to streaming media content based on Dynamic Adaptive Streaming Over Hypertext Transfer Protocol (DASH) of the Moving Picture Experts Group (MPEG). Background Art

[0004] MPEG DASH provides a standard for streaming content over IP networks. In MPEG DASH, Media Representation Description (MPD) and inband events are used to transmit media timeline related events to the client. DASH provides a mechanism for media segments to carry inband events. The ISO / IEC 23009-1DASH standard defines an event message box for carrying events using media segments. The ISO / IEC 23000-19CMAF standard uses inband events with CMAF blocks, fragments, and segments. Similarly, the Common Media Application Format (CMAF) provides a mechanism for CMAF blocks to carry inband events. A common DASH event is the inband MPD validity expiration event. Other events include application events such as SCTE-35 ("Digital Program Insertion Prompt Message for Cable Television") events.

[0005] Streaming players including DASH players use Media Source Extension (MSE), which allows browsers or user agents to process media segments. However, the current MSE specification does not support parsing and processing in-band events embedded in DASH or CMAF media segments. Browsers or user agents using the current MSE specification cannot natively process DASH or CMAF in-band events and dispatch the in-band events to the corresponding applications. Summary of the invention

[0006] Embodiments of the present disclosure provide a solution that enables the MSE to natively process DASH and CMAF in-band event boxes contained in media segments.

[0007] A method for processing events in a media stream is provided. The method includes: acquiring media data; generating one or more event segments and one or more media segments from the media data; parsing respective events from the one or more event segments to determine an event start time, an event end time, and a scheduling mode; appending respective events from the one or more event segments to an event scheduling buffer based on a comparison of the event start time and a current playback position, and determining that the respective event does not exist in a scheduled buffer, wherein the position associated with the respective event in the event scheduling buffer is based on the scheduling mode of the respective event; and scheduling the respective events based on the position associated with the respective event in the event scheduling buffer, the event start time, the event end time, and the current playback position.

[0008] A device for processing events in a media stream may be provided. The device may include at least one memory configured to store program code; and at least one processor may be configured to read the program code and operate according to the instructions of the program code. The program code includes a first acquisition code configured to enable the at least one processor to acquire media data; a first generation code configured to enable the at least one processor to generate one or more event segments and one or more media segments from the media data; a first parsing code configured to enable the at least one processor to parse respective events from the one or more event segments to determine the event start time, event end time, and scheduling mode; a first appending code configured to enable the at least one processor to append respective events from the one or more event segments to an event scheduling buffer based on a comparison of the event start time and the current playback position and determining that the respective event does not exist in the scheduled buffer, wherein the position associated with the respective event in the event scheduling buffer is based on the scheduling mode of the respective event; and a first scheduling code configured to enable the at least one processor to schedule respective events based on the position associated with the respective event in the event scheduling buffer, the event start time, the event end time, and the current playback position.

[0009] A non-transitory computer-readable medium storing instructions for processing events in a media stream may be provided. The instructions, when executed by at least one processor, may cause the at least one processor to obtain media data; generate one or more event segments and one or more media segments from the media data; parse respective events from the one or more event segments to determine an event start time, an event end time, and a scheduling mode; based on a comparison of the event start time and a current playback position, and determining that the respective event does not exist in a scheduled buffer, append respective events from the one or more event segments to an event scheduling buffer, wherein the position associated with the respective event in the event scheduling buffer is based on the scheduling mode of the respective event; and schedule the respective event based on the position associated with the respective event in the event scheduling buffer, the event start time, the event end time, and the current playback position. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Other features, properties and various advantages of the disclosed subject matter will become more apparent from the following detailed description and the accompanying drawings, in which:

[0011] Figure 1 is a simplified illustration of a communication system according to an embodiment.

[0012] Figure 2 is an example illustration of component placement in a streaming environment according to an embodiment.

[0013] Figure 3 is a simplified block diagram of a DASH processing model according to an embodiment.

[0014] Figure 4 is a simplified block diagram of a DASH processing model according to an embodiment.

[0015] Figure 5A and Figure 5B is a simplified diagram of a media buffer and an event buffer according to an embodiment.

[0016] Fig. 6A and Figure 6B is a simplified diagram of a media buffer and an event buffer according to an embodiment.

[0017] Figure 7 is a simplified flow chart illustrating a process for handling DASH and CMAF in-band events according to an embodiment.

[0018] Figure 8 is a simplified diagram of a computer system according to an embodiment. DETAILED DESCRIPTION

[0019] Embodiments of the present disclosure provide a technical solution that enables MSE to locally process DASH and CMAF in-band event frames. Specifically, embodiments of the present disclosure relate to a processing model and algorithm for processing DASH in-band message frames (e.g., message frames v0 and v1). Aspects of the present disclosure are intended to perform DASH in-band message processing for schemes with "on_receive" or "on_start" scheduling modes. The present disclosure enables a browser or user agent that utilizes an MSE based on the present disclosure to locally process DASH and CMAF in-band event frames and send them to their respective applications.

[0020] The proposed features discussed below may be used alone or in any order. In addition, the embodiments may be implemented by processing circuits (e.g., one or more processors or one or more integrated circuits). In one example, one or more processors execute a program stored in a non-transitory computer-readable medium.

[0021] Figure 1 A simplified block diagram of a communication system 100 according to an embodiment of the present disclosure is shown. The communication system 100 may include at least two terminals 102 and 103 interconnected via a network 105. For unidirectional data transmission, a first terminal 103 may encode video data at a local location for transmission to another terminal 102 via the network 105. The second terminal 102 may receive the encoded video data of the other terminal from the network 105, decode the encoded data, and display the recovered video data. Unidirectional data transmission is more common in media service applications and the like.

[0022] Figure 1 A second pair of terminals 101 and 104 are shown that are provided to support bidirectional transmission of encoded video that may occur, for example, during a video conference. For bidirectional data transmission, each terminal 101 and 104 can encode video data captured at a local location for transmission to the other terminal via a network 105. Each terminal 101 and 104 can also receive encoded video data transmitted by the other terminal, can decode the encoded data, and can display the recovered video data on a local display device.

[0023] exist Figure 1In the embodiment of the present invention, terminals 101, 102, 103 and 104 may be shown as servers, personal computers and smart phones, but the principles of the present invention may not be limited thereto. Embodiments of the present invention are applicable to laptop computers, tablet computers, media players and / or dedicated video conferencing equipment. Network 105 represents any number of networks that transmit encoded video data between terminals 101, 102, 103 and 104, including, for example, wired and / or wireless communication networks. Communication network 105 can exchange data in circuit switching and / or packet switching channels. Representative networks include telecommunication networks, local area networks, wide area networks and / or the Internet. For the purpose of this discussion, unless explained below, the architecture and topology of network 105 may be irrelevant to the operation of the present invention.

[0024] As an example, Figure 2 The placement of the video encoder and video decoder in a streaming environment is shown. The embodiments may be applicable to other video-enabled applications including, for example, video conferencing, digital TV, storage of compressed video on digital media including CDs, DVDs, memory sticks, etc., and the like.

[0025] The streaming system may include an acquisition subsystem 203, which may include a video source 201, such as a digital camera, which creates, for example, an uncompressed video sample stream 213. The sample stream 213 may be emphasized as a high data volume compared to an encoded video bitstream and may be processed by an encoder 202 coupled to the video source 201. The encoder 202 may include hardware, software, or a combination of hardware and software to implement or implement various aspects of the embodiments as described in more detail below. The encoded video bitstream 204 may be emphasized as a low data volume compared to the sample stream and may be stored on a streaming server 205 for future use. One or more streaming clients 212 and 207 may access the streaming server 205 to retrieve the encoded video bitstreams 208 and 206, which may be copies of the encoded video bitstream 204. The client 212 may include a video decoder 211, which decodes the incoming copy 208 of the encoded video bitstream and produces an output video sample stream 210 that can be presented on a display 209 or other presentation device. In some streaming systems, the encoded video bitstreams 204, 206, and 208 may be encoded according to certain video encoding / compression standards. Examples of these standards are mentioned above and are further described herein.

[0026] Figure 3An example DASH processing model 300 of an example client architecture for processing DASH and CMAF events is shown. In the DASH processing model 300, a client's request for media segments can be based on addresses described in a manifest 303. The manifest 303 also describes a metadata path from which the client can access the segments of the metadata path, parse them, and send them to the application 301.

[0027] The manifest 303 may include MPD events or in-band events, and the in-band event and "moof" parser 306 may parse the MPD event segments or in-band event segments and append these event segments to the event and metadata buffer 330. The in-band event and "moof" parser 306 may also obtain media segments and append them to the media buffer 340. The event and metadata buffer 330 may send event and metadata information to the event and metadata synchronizer and scheduler 335. The event and metadata synchronizer and scheduler 335 may dispatch specific events to the DASH player control, selection and heuristics logic 302, and dispatch application-related events and metadata paths to the application 301.

[0028] According to some embodiments, the MSE may include a media buffer 340 and a media decoder 345. The MSE 320 is one or more logical buffers of media segments, in which the media segments may be tracked and sorted based on their presentation time. Each media segment may be added or appended to the media buffer 340 based on the start time, end time, or timestamp offset of the media segment, and the timestamp offset may be used to sort the media segments in the media buffer 340.

[0029] As long as the media segments exist in the media buffer 340, the event and metadata buffer 330 retains the corresponding event segments and metadata. Figure 3 , MSE 320 may only include media buffer 340 and media decoder 345. Event and metadata buffer 330 and event and metadata synchronizer and scheduler 335 are not local devices of MSE 320, thereby prohibiting MSE 320 from processing events locally and sending them to the application.

[0030] Figure 4 An example DASH processing model 400 of an example client architecture for processing DASH and CMAF events is shown. In the DASH processing model 400, client requests for media segments can be based on addresses described in a manifest 403. The manifest 403 also describes a metadata path from which the client can access the segments of the metadata path, parse them, and send them to the application 401.

[0031] The manifest 403 may include MPD events or in-band events, and the in-band event and "moof" parser 406 may parse the MPD event segments or in-band event segments and append these event segments to the event clear buffer 430. Based on the media data or media streams and information in the manifest 403, the in-band event and "moof" parser 406 may obtain the media segments and append them to the media buffer 440. The event clear buffer 430 may send the event and metadata information to the event synchronizer and scheduler 435. The event synchronizer and scheduler 435 may dispatch specific events to the DASH player control, selection, and heuristics logic 402, and dispatch application-related events and metadata paths to the application 401.

[0032] According to an exemplary embodiment, Figure 4 In the embodiment, MSE is extended to include a media buffer 440, a media decoder 445, an event clearing buffer 430, an event synchronizer and scheduler 435, and a scheduled event table 450. The scheduled event table 450 can record events that have been scheduled to the application 401. The extension of the event clearing buffer 430 and the event synchronizer and scheduler 435 enables the MSE to process in-band events locally, and the creation of the scheduled event table 450 enables the scheduled event messages to be recorded and tracked.

[0033] In an exemplary embodiment, the MSE 420 or its components may schedule events based on an event start time, an event end time, an event specific offset, an event duration, or a current play time / position of an event segment or event. Examples may include an event start time offset (which may be referred to as an event start time in some embodiments). The MSE 420 or its components may determine an event start time offset for an event segment, wherein the start time offset is determined with reference to the event start time and the current play time / position, and use the event start time offset to sort and schedule events in the event purge buffer 430 or the event synchronizer and scheduler 435.

[0034] In an exemplary embodiment, MSE 420 can handle event segment and media segment clearing and overwriting for associated events and media. If the media segments associated with the event are retained in media buffer 440, MSE 420 can retain the event in event clearing buffer 430 or event synchronizer and scheduler 435. MSE 420 can manage the timing and duration of event segments based on the timing and duration of the associated media segments.

[0035] In an exemplary embodiment, application 401 may set an event time, a timestamp offset, or an event timestamp offset. Application 401 may also set a scheme URI / value and a scheduling mode for the scheme URI / value. Additionally, in some embodiments, application 401 may also set a processing mode for the scheme URI / value. MSE 420 may schedule events based on the scheme URI / value.

[0036] In some embodiments, the processing mode of the scheme URI may be process@append. The processing mode of process@append may cause the MSE to process the event segment associated with the media segment when appending the associated media segment to the media buffer. Thus, based on the processing mode of process@append, the event segment may be parsed, scheduled, or at least scheduled when appending the associated media segment to the media buffer.

[0037] For example, an application can set a scheme URI to reflect process@append. In the case where the scheme URI includes process@append with an on_receive scheduling mode, one or more events associated with the media segment can be processed when the media segment is appended to the media buffer. In some embodiments, if an event in the one or more events has an end time that is not less than the current play position, the event can be scheduled immediately. That is, the event is appended to the event scheduling buffer at the current play position and the event is scheduled to the application. In some embodiments, when the event end time is not less than the current play position and the event has not been scheduled before, the event will be scheduled immediately.

[0038] In some embodiments, the scheme URI may include process@append with an on_start scheduling mode. When the scheduling mode is on_start, when a media segment is appended to a media buffer, an event in one or more events associated with the media segment may be processed, but the event may be scheduled based on an event start time, event timestamp offset, event end time, or event duration associated with the event. In some embodiments, when the scheme URI includes process@append with an on_start scheduling mode, the event may be stored in the event scheduling buffer at a position associated with the event start time if the current playback position is not less than the event start time, the current playback position is not equal to or greater than the event end time, and the event or an equivalent event has not been previously scheduled.

[0039] In some embodiments, the processing mode of the scheme URI may be process@play. The processing mode of process@play may enable the MSE to process event segments associated with a media segment while the associated media segment is being played. In some embodiments, based on the processing mode being process@play, the event segment may be parsed, scheduled, or at least scheduled while the associated media segment is being played or streamed. In some embodiments, when the processing mode is process@play, the event segment may be scheduled if at least one media sample of the media segment containing the event segment has been played. To implement the process@play processing mode, the MSE may utilize an event clearing buffer (which may be referred to as a clearing buffer) to track scheduled event segments.

[0040] When the scheme URI is process@play with on_receive scheduling mode, one or more events associated with the media segment can be processed when the media segment is appended to the media buffer. In some embodiments, the processing of the event segment can include immediate scheduling, i.e., appending to the event scheduling buffer or sending the event to the application at the current playback position. Immediate scheduling can be based on a comparison of the event end time with the current playback time. As an example, if the current playback position is associated with a media segment containing an electronic message (esmg) or event identifier of the event, if the end time of the event is not less than the current playback position, and if the event or equivalent event has not been previously scheduled, the event can be scheduled immediately.

[0041] If the scheme URI includes process@play with an on_start scheduling mode, one or more events associated with the media segment may be processed when the media segment is appended to the media buffer. Processing of the event may include immediate scheduling. As an example, the event may be scheduled immediately if the current play position is not less than the start time of the event, the current play position is not equal to or greater than the end time of the event, the event is associated with a media segment containing an electronic message (esmg) or event identifier of the event, and if the event or equivalent has not been previously scheduled.

[0042]

[0043]

[0044] The following table (Table 1) describes event handling in different operation modes, processing modes, and dispatch modes for scheme URIs.

[0045] Media data can be obtained, and one or more event segments and one or more media segments can be generated from the media data. Specific or individual events can be parsed from the one or more event segments, and event start time, event end time, and scheduling mode can be determined.

[0046] Comparison based on event start time and current play position and determine that each event does not exist in the scheduled buffer zone, each event is attached to the event scheduling buffer zone. The position associated with each event in the event scheduling buffer zone can be based on the scheduling mode of each event. Can be based on the position, event start time, event end time and current play position associated with each event in the event scheduling buffer zone, each event is scheduled. In certain embodiments, can use clear buffer zone. Attaching each event to clear buffer zone can include, each event is attached to the position associated with target range, and target range can be based on the media segment start time and media segment end time of the media segment associated with each event.

[0047] According to an embodiment of the present disclosure, events and / or media segments having a processing mode of "append" or "process@append" may be processed as described below.

[0048] In some embodiments, based on the end time of the event being less than the current playback position or the identifier of the event (eg, the emsg.id of the event) being in the scheduled buffer, processing of the event may be terminated and the next event may be parsed and processed.

[0049] In some embodiments, the event-based scheduling mode is an on_receive mode, and the event can be scheduled immediately, that is, the event can be attached to the scheduling buffer at a position associated with the current playback position. After attachment, the event or an identifier of the event can be attached to the scheduled buffer.

[0050] According to an embodiment of the present disclosure, the event-based scheduling mode is the on_start mode, and event processing may include calculating the event scheduling range of the event based on the event start time and the event end time, and appending the event to the event scheduling buffer at a location associated with the event scheduling range.

[0051] As an example, the event dispatch scope may be determined based on the following formula:

[0052] For emsg v0 (esmg.version=0): dispatch_range_start=

[0053] segment_start+emsg.presentation_time_delta / emsg.time_scale(1)

[0054] For emsg v1 (emsg.version=1): dispatch_range_start=

[0055] emsg.presentation_time / emsg.timescale(2)

[0056] dispatch_range_end=dispatch_range_start+

[0057] emsg.duration / emsg.timescale(3)

[0058] In some embodiments, there may be an existing overlapping event at a location in the event scheduling buffer associated with an event scheduling range of an event. Based on determining that there is an existing overlapping event at a location in the event scheduling buffer associated with an event scheduling range of an event, the event scheduling range may be divided into a plurality of sub-ranges, such that each of the plurality of sub-ranges is empty or occupied by at least one event having the same state as the entire sub-range.

[0059] After the event dispatch buffer is divided into a plurality of sub-ranges, for each of the plurality of sub-ranges occupied by at least one event, the at least one event may be divided based on a corresponding sub-range in the plurality of sub-ranges. The divided events may be appended to the event dispatch buffer at locations associated with the respective sub-ranges. In some embodiments, for each divided event, event features and / or attributes such as Emsg.scheme_id_uri, emsg.value, emsg.id, dispatch_range_start, dispatch_duration=emsg.duration / emsg.timescale, and emsg.message_data() may be added.

[0060] According to an embodiment, an event occurring at the current playback position in the event scheduling buffer may be scheduled based on the event identifier (e.g., emsg.id) not being in the scheduled buffer. After the event is scheduled to the application, the event may be removed from the event scheduling buffer and the identifier of the event may be added to the scheduled buffer. However, in an embodiment, when the event identifier of the event occurring at the current playback position in the event scheduling buffer is present in the scheduled buffer, the event may be removed from the event scheduling buffer.

[0061] In some embodiments, a range from the beginning or end of the media buffer may be cleared. The cleared media buffer range may be referred to as a "media sub-range". The clearing may include clearing the media sub-range from the media buffer, and based on determining that a position associated with the media sub-range in the event scheduling buffer overlaps with an event scheduling range of a corresponding event in the event scheduling buffer, clearing the overlapping sub-range from the event scheduling buffer.

[0062] According to an embodiment of the present disclosure, events and / or media segments having a processing mode of "play" or "process@play" may be processed as described below.

[0063] In some embodiments, based on the end time of the event being less than the current play position or the identifier of the event (eg, the emsg.id of the event) being in the scheduled buffer, processing of the event may be ended and the next event may be parsed and processed.

[0064] In some embodiments, additional purge buffers may be used based on whether the processing mode is "play" or "process@play". Events may be appended to the purge buffer at a location associated with a target range, where the target range may be based on a segment start time and a segment end time of a media segment associated with the event. In some embodiments, the segment start time and the segment end time of a media segment associated with the event may be determined using a parser that may parse the media segment from one or more media segments.

[0065] In some embodiments, the target range may be determined based on the following formula:

[0066] purge_range_start=segment_start (4)

[0067] purge_range_end=segment_start+segment duration (5)

[0068] In some embodiments, there may be overlapping events at a location associated with the target range in the purge buffer. Based on determining that there are overlapping events at a location associated with the target range in the purge buffer, the target range in the purge buffer may be divided into a plurality of purge sub-ranges, wherein each of the plurality of purge sub-ranges is empty or occupied by at least one event having the same state as the entire purge sub-range.

[0069] After the clear buffer is divided into a plurality of clear sub-ranges, for each of the plurality of clear sub-ranges occupied by at least one event, the at least one event can be divided based on the corresponding clear sub-range in the plurality of clear sub-ranges. These divided events can be attached to the clear buffer at positions associated with the respective clear sub-ranges. In some embodiments, the same event association identifier (EAI) can be assigned to each of at least one divided event at a position associated with the target range in the clear buffer. In some embodiments, for each of at least one divided event at a position associated with the corresponding clear sub-range in the clear buffer, a played flag can be set to false, wherein the played flag can indicate whether the media segment associated with each of the at least one divided event has been played. In some embodiments, for each divided event, event features and / or attributes such as EAI, Emsg.scheme_id_uri, emsg.value, emsg.id, dispatch_range_start, dispatch_duration=emsg.duration / emsg.timescale, and emsg.message_data() can be added.

[0070] In some embodiments, the event-based scheduling mode is an on_receive mode, and an event can be scheduled immediately, that is, the event can be attached to the scheduling buffer at a position associated with the current playback position. After attachment, the event or the identifier of the event can be attached to the scheduled buffer.

[0071] In some embodiments, the event-based scheduling mode is an on_start mode, and event processing may include calculating an event scheduling range of the event based on the event start time and the event end time, and appending the event to an event scheduling buffer at a location associated with the event scheduling range.

[0072] As an example, the event dispatch scope may be determined based on the following formula:

[0073] For emsg v0 (esmg.version=0): dispatch_range_start=

[0074] purge_range_start+emsg.presentation_time_delta / emsg.time_scale (6)

[0076] For emsg v1 (emsg.version=1): dispatch_range_start=

[0077] emsg.presentation_time / emsg.timescale(7)

[0078] dispatch_range_end=dispatch_range_start+

[0079] emsg.duration / emsg.timescale(8)

[0080] In some embodiments, there may be an existing overlapping event at a location in the event scheduling buffer associated with the event scheduling range of the event. Based on determining that there is an existing overlapping event at a location in the event scheduling buffer associated with the event scheduling range of the event, the event scheduling range may be divided into a plurality of sub-ranges such that each of the plurality of sub-ranges is empty or occupied by at least one event having the same state as the entire sub-range.

[0081] After the event scheduling buffer is divided into a plurality of sub-ranges, for each of the plurality of sub-ranges occupied by at least one event, the at least one event can be divided based on the corresponding sub-range in the plurality of sub-ranges. These divided events can be attached to the event scheduling buffer at the position associated with the respective sub-ranges. In some embodiments, for each divided event, event features and / or attributes such as EAI, Emsg.scheme_id_uri, emsg.value, emsg.id, dispatch_range_start, dispatch_duration=emsg.duration / emsg.timescale and emsg.message_data() can be added. As an example, the same event association identifier (EAI) can be assigned to each of at least one divided event at the position associated with the event scheduling range in the event scheduling buffer.

[0082] According to an embodiment, an event occurring at the current playback position in the event scheduling buffer can be scheduled based on the event identifier (e.g., emsg.id) not being in the scheduled buffer and at least one event having the same EAI as the event in the clear buffer having a played flag value "true". After the event is scheduled to the application, the event can be removed from the event scheduling buffer and the identifier of the event can be added to the scheduled buffer.

[0083] In some embodiments, a range from the beginning or end of the media buffer may be cleared. The cleared media buffer range may be referred to as a "media sub-range". The clearing may include clearing the media sub-range from the media buffer and determining whether a position associated with the media sub-range in the event scheduling buffer overlaps with an event scheduling range of each event in the event scheduling buffer.

[0084] In some embodiments, based on determining that there is an overlapping clear subrange between a position associated with a media subrange in a clear buffer and a target range of a corresponding event in the clear buffer, the overlapping clear subrange can be cleared from the clear buffer. In addition, for each event in the clear buffer at a position associated with the media subrange in the clear buffer with a played flag set to false, the event is removed from the clear buffer when the following conditions are met: an event in the clear buffer outside the position associated with the media subrange in the clear buffer does not have the same EAI as the removed event, or an event in the clear buffer within the position associated with the media subrange in the clear buffer does not have the same EAI as the removed event and the played flag is set to true.

[0085] Figure 5A An example media and event dispatch buffer set 500A is described for processing media segments and event segments when the processing mode of the scheme URI is process@append and the dispatch mode of the scheme URI is on_start according to an embodiment.

[0086] like Figure 5A As shown, media stream 510 may include media segments (S0, S1, S2) and events (E0, E1, E2).

[0087] Parser can obtain media data and can generate one or more event segments and one or more media segments from media data. Parser can also parse out one or more events from one or more event segments to determine event start time, event end time and scheduling mode. Media segment can be attached to media source buffer or media buffer. As an example, media segment can be attached to media buffer 520 according to the order of parsing media segment or the play time associated with media segment. Each media segment can be associated with one or more events. In certain embodiments, one or more events and event segment can be associated with media segment.

[0088] When media segments are appended to the media buffer, events may be appended to the event scheduling buffer. In on_start mode, events may be appended to the event scheduling buffer at locations based on their event start times, and event durations may be mapped to the event scheduling buffer. As an example, when media segments S0 and S1 are appended to the media buffer 520, events E0 and E1 may be appended to the event scheduling buffer 530 based on their respective start times, and their respective durations may be mapped to the scheduling buffer 530.

[0089] In some embodiments, the event scheduling range of an event can be calculated based on the event start time and the event end time. When it is determined that there is an overlay event at a position (or range) associated with the event scheduling range of the event in the event scheduling buffer, the event scheduling range in the event scheduling buffer can be divided into multiple sub-ranges, wherein each of the multiple sub-ranges is either empty or occupied by at least one event having the same state as the entire sub-range. According to the example, when the media segment S2 is appended to the media buffer 520, the associated event E2 can be appended to the event scheduling buffer 540 at a position based on the start time and duration of the event E2. Figure 5A As shown, if there is an overlapping event, such as event E1, at a location associated with the mapping (or event scheduling range) of event E2 in the event scheduling buffer, the event scheduling range can be divided into three sub-ranges so that each sub-range either does not include an event or has at least one event that has the same state for the entire sub-range. As an example, event E1 can exist in the event scheduling range of the new event E2 in the event scheduling buffer 540, and then the event scheduling range can be divided into three sub-ranges, the first sub-range 542 can be occupied by the non-overlapping sub-range of event E1, the second sub-range 544 can be occupied by the overlapping sub-range between event E1 and event E2, and the third sub-range 546 can be occupied by the non-overlapping sub-range of event E2.

[0090] Figure 5B An exemplary media and event dispatch buffer set 500B is described for processing media segments and event segments when the processing mode of the scheme URI is process@append and the dispatch mode of the scheme URI is on_start according to an embodiment.

[0091] According to an embodiment of the present disclosure, when the scheduling mode is on_start, the media segment may be partially overwritten, that is, when the scheduling mode is on_start, if the existing media segment is partially overwritten by the new media segment, only the media buffer may be modified without modifying the event scheduling buffer. In some embodiments, only the partially overlapping portion of the existing media segment may be overwritten by the new media segment. As an example, if a new media segment S2' is appended to the media buffer 550, and the media segment S2' partially overlaps with the media segment S2, only the overlapping portion of the media segment S2 on the media buffer may be overwritten.

[0092] In the process@play processing mode, since not every media segment appended to the media buffer is played and / or played sequentially, another buffer can be used to track which media segments have been played and which media segments have not been played. As an example, a clear buffer can be used to track or maintain associations between media samples in the media buffer and events in the event dispatch buffer.

[0093] Fig. 6A An exemplary media, event dispatch, and event clearing buffer set 600A for processing media segments and event segments when the processing mode of the scheme URI is process@play and the dispatch mode of the scheme URI is on_start is described according to an embodiment.

[0094] like Fig. 6A As shown, the media stream 610 may include media segments ( S0 , S1 , S2 , S3 ) and events ( E0 , E1 , E2 ), and processing the media stream 610 may include a media buffer 620 , a clear buffer 630 , and an event scheduling buffer 640 .

[0095] The parser can obtain the media data and can generate one or more event segments and one or more media segments from the media data. In some embodiments, the media segments from one or more media segments can be parsed to determine the segment start time and the segment end time, wherein one or more events can be associated with the media segment. The media segments can be attached to the media buffer 620 in the order in which the media segments are parsed or the play time associated with the media segments. Each media segment can be associated with one or more events.

[0096] The parser can also parse out one or more events from one or more event segments to determine event start time, event end time, and scheduling mode. When the media segment is attached to the media buffer, the event can be attached to the event scheduling buffer. Under the on_start mode, the event can be attached to the event scheduling buffer at a position based on its event start time, and the event duration can be mapped to the event scheduling buffer. As an example, when media segments S0 and S1 are attached to the media buffer 620, events E0 and E1 can be attached to the event scheduling buffer 640 based on their respective start times, and their respective durations can be mapped to the event scheduling buffer 640.

[0097] In some embodiments, events can be attached to the clear buffer at a location associated with a target range, wherein the target range is based on the segment start time and segment end time of the media segment associated with each event. In some embodiments, the event attached to the clear buffer can map the duration, start time and end time of the media segment so that the event can be aligned in the clear buffer, similar to the media segments associated with each other in the media buffer. In an exemplary embodiment, by aligning the event start time and event duration of the event segment in the clear buffer 630 with the start time and duration of the associated media segment (S0, S1, S2, S3) in the media buffer 620, the event (E0, E1, E2) can be attached to the clear buffer 630. As an example, the start time and event duration of one or more events in the clear buffer 630 can be aligned with the media segment start time and duration or media segment end time of the associated media segment in the media buffer 620. In some exemplary embodiments, if more than one event segment is associated with the same media segment, the start time of each event in the clear buffer can be adjusted based on the start time and end time of the associated media segment.

[0098] In some embodiments, each event in the clear buffer may be assigned a unique event association ID (EAI) that may indicate the association between the media segments in the media buffer and the events in the event scheduling buffer. In some embodiments, although the start time and end time of the events in the clear buffer may be in the same range as the start time and end time of the associated media segments, the actual start time and end time of the events may be mapped in the event scheduling buffer. In some embodiments, since the clear buffer may be used to track the played media segments and maintain the association between the media samples in the media buffer and the events in the event scheduling buffer, the EAI may also be assigned to the events in the event scheduling buffer.

[0099] In some embodiments, events may be appended to the purge buffer at a location associated with a target range, wherein the target range is based on a segment start time and a segment end time of a media segment associated with each event. However, when appending events to the purge buffer, if there are overlapping events in the purge buffer at a location associated with the target range, the target range of the purge buffer may be divided into a plurality of purge sub-ranges, wherein each of the plurality of purge sub-ranges is either empty or occupied by at least one event having the same state as the entire purge sub-range.

[0100] As an example, when media segment S2 is appended to the media buffer, the associated event E2 may be appended to the event scheduling buffer 640 at a location based on the start time and duration of event E2, and event E2 may be appended to the clear buffer 630 at a location based on the start time and duration of media segment S2. If there are overlapping events at a location associated with the mapping or event scheduling range of the new event in the event scheduling buffer, the event scheduling range of the new event may be divided into sub-ranges so that each sub-range is occupied by events having the same state for the entire sub-range. As an example, event E1 may exist within the event scheduling range of the new event E2 in the event scheduling buffer 640, and then the event scheduling range may be divided into three sub-ranges, a first sub-range 642 may be occupied by a non-overlapping sub-range of event E1, a second sub-range 644 may be occupied by an overlapping sub-range between event E1 and event E2, and a third sub-range 646 may be occupied by a non-overlapping sub-range of event E2.

[0101] Figure 6B An exemplary media, event dispatch, and event clear buffer set 600B for processing media segments and event segments when the processing mode of the scheme URI is process@play and the dispatch mode of the scheme URI is on_start according to an embodiment is described.

[0102] According to an embodiment of the present disclosure, when the scheduling mode is on_start, the media segment can be partially overwritten, that is, when the scheduling mode is on_start, the existing media segment is partially overwritten by the new media segment, and only the media buffer can be modified without modifying the event scheduling buffer. In some embodiments, only the partially overlapping parts of the existing media segments can be overwritten by the new media segments. As an example, if a new media segment S2' is attached to the media buffer 660, and the media segment S2' partially overlaps with the media segment S2, only the overlapping part of the media segment S2 on the media buffer 660 can be overwritten. In some embodiments, only the media buffer can be modified. In some embodiments, the event in the clear buffer can be modified to reflect the media buffer. As an example, the event E2 corresponding to the media segment S2 in the clear buffer 670 can be cleared or overwritten to reflect the overwritten media segment S2 in the media buffer 660.

[0103] In some embodiments, only the partially overlapping portions of the existing media segments may be overwritten by the new media segments. As an example, a new media segment S2' may be appended to the media buffer 660, and the media segment S2' may partially overlap with the media segment S2, then only the overlapping portion of the media segment S2 on the media buffer may be overwritten.

[0104] In some embodiments, the above disclosed embodiments can be implemented using a single scheduling buffer. Each event in the scheduling buffer can maintain a list of media ranges carried by the electronic message of the event. First, the list may have only one media range, covering the media segment. However, through various operations, the media range may be divided into two or more ranges. For each media range, the event can also include a flag indicating whether the range is played. Changing the media range in the media range list, updating the "played" flag, dividing the media range into two or more ranges, and updating their respective "played" flags make it possible to implement the embodiments of the present disclosure using only one buffer.

[0105] Figure 7 is an exemplary flow chart of a process 700 for processing media segments and event segments according to an embodiment.

[0106] like Figure 7 As shown, in operation 710 of process 700, media data may be obtained. As an example, the parser may obtain the media data.

[0107] In operation 715, one or more event segments may be generated from the media data. In some embodiments, each event may be parsed from the one or more event segments to determine an event start time, an event end time, and a scheduling mode.

[0108] In operation 720, one or more media segments may be generated from the media data. In some embodiments, a media segment from the one or more media segments may be parsed to determine a segment start time and a segment end time.

[0109] In some embodiments, in process 700, one or more events may be associated with a media segment, and individual events may be associated with a media segment.

[0110] In operation 725, each event from one or more event segments can be appended to an event scheduling buffer based on a comparison of the event start time and the current playback position and a determination that the respective event does not exist in the scheduled buffer, and the position associated with each event in the event scheduling buffer can be based on the scheduling mode of the respective event.

[0111] In some embodiments, in operation 725, based on the processing mode being append and the scheduling mode of the event being on_start mode, event processing may include: calculating the event scheduling range of the event based on the event start time and the event end time, and appending the event to the event scheduling buffer at a position associated with the event scheduling range. In some embodiments, there may be existing overlapping events at a position associated with the event scheduling range of the event in the event scheduling buffer. Based on determining that there are existing overlapping events at a position associated with the event scheduling range of the event in the event scheduling buffer, the event scheduling range may be divided into a plurality of sub-ranges, so that each of the plurality of sub-ranges is either empty or occupied by at least one event having the same state for the entire sub-range. After the event scheduling buffer is divided into a plurality of sub-ranges, for each of the plurality of sub-ranges occupied by at least one event, the at least one event may be divided based on a corresponding sub-range in the plurality of sub-ranges. These divided events may be appended to the event scheduling buffer at positions associated with the respective sub-ranges.

[0112] In some embodiments, in operation 725, based on the processing mode being play and the scheduling mode of the event being on_start mode, event processing may include: calculating the event scheduling range of the event based on the event start time and the event end time, and attaching the event to the event scheduling buffer at a position associated with the event scheduling range. In some embodiments, there may be existing overlapping events at a position associated with the event scheduling range of the event in the event scheduling buffer. Based on determining that there are existing overlapping events at a position associated with the event scheduling range of the event in the event scheduling buffer, the event scheduling range may be divided into a plurality of sub-ranges, so that each of the plurality of sub-ranges is either empty or occupied by at least one event having the same state for the entire sub-range. After the event scheduling buffer is divided into a plurality of sub-ranges, for each of the plurality of sub-ranges occupied by at least one event, the at least one event may be divided based on a corresponding sub-range in the plurality of sub-ranges. These divided events may be attached to the event scheduling buffer at positions associated with their respective sub-ranges.

[0113] In operation 730, based on the processing mode being play, an additional clearing buffer can be used. An event can be attached to the clearing buffer at a position associated with a target range, wherein the target range is based on the segment start time and segment end time of the media segment associated with the event. In some embodiments, the segment start time and segment end time of the media segment associated with the event can be determined using a parser, which can parse the media segments in one or more media segments. In some embodiments, overlapping events may exist at a position associated with the target range in the clearing buffer. Based on determining that overlapping events exist at a position associated with the target range in the clearing buffer, the target range in the clearing buffer can be divided into a plurality of clearing sub-ranges, wherein each sub-range in the plurality of clearing sub-ranges is either empty or occupied by at least one event having the same state for the entire clearing sub-range. After the clearing buffer is divided into a plurality of clearing sub-ranges, for each sub-range in the plurality of clearing sub-ranges occupied by at least one event, the at least one event can be divided based on the corresponding clearing sub-ranges in the plurality of clearing sub-ranges. These divided events can be attached to the clearing buffer at a position associated with the respective clearing sub-ranges.

[0114] In operation 735, each event may be scheduled based on the position associated with the respective event in the event scheduling buffer, the event start time, the event end time, and the current playback position. In some embodiments, the event-based scheduling mode is an on_receive mode, and the event may be scheduled immediately, i.e., the event may be appended to the scheduling buffer at a position associated with the current playback position. After appending, the event or an identifier of the event may be appended to the scheduled buffer.

[0115] In some embodiments, when the processing mode is append, an event occurring at the current playback position in the event scheduling buffer can be scheduled based on the event identifier (e.g., emsg.id) not being in the scheduled buffer. After the event is scheduled to the application, the event can be removed from the event scheduling buffer and the identifier of the event can be added to the scheduled buffer. However, in an embodiment, when the event identifier of the event occurring at the current playback position in the event scheduling buffer exists in the scheduled buffer, the event can be removed from the event scheduling buffer.

[0116] In some embodiments, when the processing mode is play, an event occurring at the current play position in the event scheduling buffer can be scheduled based on the event identifier (e.g., emsg.id) not being in the scheduled buffer and at least one event with the same EAI as the event in the clear buffer having a played flag value of "true". After the event is scheduled to the application, the event can be removed from the event scheduling buffer and the identifier of the event can be added to the scheduled buffer.

[0117] In operation 740, when the processing mode is append, clearing the event segment may include clearing a range from the beginning or the end of the media buffer. The cleared media buffer range may be referred to as a "media sub-range". The clearing may include clearing the media sub-range from the media buffer, and based on determining that a position associated with the media sub-range in the event scheduling buffer overlaps with an event scheduling range of each event in the event scheduling buffer, clearing the overlapping sub-range from the event scheduling buffer.

[0118] In some embodiments, when the processing mode is play, clearing the event segment may include clearing a range from the beginning or end of the media buffer. The cleared media buffer range may be referred to as a "media sub-range". The clearing may include: clearing the media sub-range from the media buffer, and determining whether a position associated with the media sub-range in the event scheduling buffer overlaps with an event scheduling range of each event in the event scheduling buffer.

[0119] In some embodiments, based on determining that there is an overlapping clear subrange between a position associated with a media subrange in the clear buffer and a target range of a corresponding event in the clear buffer, the overlapping clear subrange can be cleared from the clear buffer. In addition, for each event in the clear buffer with a played flag set to false at a position associated with the media subrange in the clear buffer, the event is removed from the clear buffer when the following conditions are met: an event in the clear buffer that is outside the position associated with the media subrange in the clear buffer does not have the same EAI as the removed event; or an event in the clear buffer that is within the position associated with the media subrange in the clear buffer does not have the same EAI as the removed event and the played flag is set to true.

[0120] The above techniques can be implemented as computer software using computer-readable instructions and physically stored in one or more computer-readable media or in a computer program product, or implemented by one or more hardware processors of a specific configuration. Figure 8 A computer system 1000 suitable for implementing various embodiments is shown.

[0121] Computer software may be encoded using any suitable machine code or computer language, which may be subjected to assembly, compilation, linking or similar mechanisms to create code comprising instructions that may be executed directly by a computer central processing unit (CPU), graphics processing unit (GPU), etc., or through interpretation, microcode execution, etc.

[0122] The instructions may be executed on various types of computers or components thereof, including, for example, personal computers, tablet computers, servers, smart phones, gaming devices, IoT devices, etc.

[0123] Figure 8 The components of computer system 1000 shown are exemplary in nature and are not intended to suggest any limitation on the scope of use or functionality of computer software implementing embodiments of the present disclosure. Nor should the configuration of components be interpreted as having any dependency or requirement related to any one or combination of components shown in the exemplary embodiment of computer system 1000.

[0124] Computer system 1000 may include certain human-machine interface input devices. Such human-machine interface input devices may respond to input from one or more human users through, for example, tactile input (e.g., keystrokes, swipes, data glove movements), audio input (e.g., voice, clapping), visual input (e.g., gestures), and olfactory input. Human-machine interface devices may also be used to capture certain media that are not necessarily directly related to human conscious input, such as audio (e.g., voice, music, ambient sound), images (e.g., scanned images, photographic images obtained from a still image camera), and videos (e.g., two-dimensional video, three-dimensional video including stereoscopic video).

[0125] The input human-machine interface device may include one or more of the following (only one of each is shown): keyboard 1001 , mouse 1002 , touch pad 1003 , touch screen 1010 , joystick 1005 , microphone 1006 , scanner 1008 , camera 1007 .

[0126] The computer system 1000 may also include certain human-machine interface output devices. Such human-machine interface output devices may, for example, stimulate one or more human user senses through tactile output, sound, light, and smell / taste. Such human-machine interface output devices may include tactile output devices (e.g., tactile feedback of touch screen 1010, or joystick 1005, but may also be tactile feedback devices that are not input devices), audio output devices (e.g., speakers 1009, headphones), visual output devices (e.g., screens including CRT screens, LCD screens, plasma screens, OLED screens, each with or without touch screen input capabilities, each with or without tactile feedback capabilities - some of these screens are capable of outputting two-dimensional visual outputs or outputs in more than three dimensions through devices such as stereo image output, virtual reality glasses, holographic displays, and smoke boxes) and printers.

[0127] The computer system 1000 may also include human-machine accessible storage devices and their associated media, for example, optical media including CD / DVD ROM / RW 1020 with CD / DVD etc. media 1011, thumb drive 1022, removable hard disk drive or solid state drive 1023, traditional magnetic media such as tapes and floppy disks, dedicated ROM / ASIC / PLD based devices such as security dongles, etc.

[0128] Those skilled in the art should also understand that the term "computer-readable media" used in connection with the presently disclosed subject matter does not encompass transmission media, carrier waves, or other transitory signals.

[0129] The computer system 1000 may also include an interface 1099 to connect one or more communication networks 1098. The network 1098 may be, for example, wireless, wired, optical. The network 1098 may further be a local network, a wide area network, a metropolitan area network, a vehicle and industrial network, a real-time network, a delay-tolerant network, etc. Examples of the network 1098 include a local area network such as Ethernet, a wireless LAN, a cellular network including GSM, 3G, 4G, 5G, LTE, etc., a television wired or wireless wide area digital network including cable television, satellite television, and terrestrial broadcast television, a vehicle and industrial network including CANBus, and the like. Some networks 1098 typically require an external network interface adapter (e.g., a USB port of the computer system 1000) connected to some general data port or peripheral bus (1050 and 1051); as described below, other network interfaces are typically integrated into the kernel of the computer system 1000 by connecting to the system bus (e.g., an Ethernet interface in a PC computer system or a cellular network interface in a smartphone computer system). The computer system 1000 can communicate with other entities using any of these networks 1098. Such communications can be one-way receive only (e.g., broadcast television), one-way send only (e.g., a CANbus connected to certain CANbus devices), or bidirectional, for example, connecting to other computer systems using a local or wide area digital network. As described above, certain protocols and protocol stacks can be used on each of these networks and network interfaces.

[0130] The above-mentioned human-machine interface device, human-machine accessible storage device, and network interface may be attached to the kernel 1040 of the computer system 1000 .

[0131] The core 1040 may include one or more central processing units (CPUs) 1041, graphics processing units (GPUs) 1042, image adapters 1017, dedicated programmable processing units 1043 in the form of field programmable gate areas (FPGAs), hardware accelerators 1044 for certain tasks, and the like. These devices, as well as read-only memory (ROM) 1045, random access memory 1046, and internal mass storage 1047 such as internal non-user accessible hard disk drives, SSDs, and the like, may be connected via a system bus 1048. In some computer systems, the system bus 1048 may be accessed in the form of one or more physical plugs to enable expansion by additional CPUs, GPUs, and the like. Peripheral devices may be connected directly to the core's system bus 1048 or to the core's system bus 1048 via a peripheral bus 1051. The architecture of the peripheral bus includes PCI, USB, and the like.

[0132] The CPU 1041, GPU 1042, FPGA 1043, and accelerator 1044 may execute certain instructions, which may be combined to form the above-mentioned computer code. The computer code may be stored in ROM 1045 or RAM 1046. Transitional data may also be stored in RAM 1046, while permanent data may be stored, for example, in internal mass storage 1047. Fast storage and retrieval to any storage device may be performed by using a cache, which may be closely associated with one or more CPUs 1041, GPU 1042, internal mass storage 1047, ROM 1045, RAM 1046, etc.

[0133] The computer readable medium may have thereon computer code for performing various computer-implemented operations. The medium and computer code may be those specially designed and constructed for the purposes of the present disclosure, or the medium and computer code may be of a type well known and available to those skilled in the art of computer software.

[0134] As an example and not for limitation, software contained in one or more tangible computer-readable media may be executed by one or more processors (including CPUs, GPUs, FPGAs, accelerators, etc.) to enable a computer system 1000 having an architecture, particularly a kernel 1040, to provide functionality. Such computer-readable media may be media associated with a user-accessible mass storage as described above, as well as certain non-transitory memories of the kernel 1040, such as a kernel internal mass storage 1047 or ROM 1045. Software implementing the various embodiments of the present disclosure may be stored in such devices and executed by the kernel 1040. Depending on specific needs, the computer-readable medium may include one or more storage devices or chips. The software may enable the kernel 1040, particularly the processors therein (including CPUs, GPUs, FPGAs, etc.) to perform specific processes or specific parts of specific processes described herein, including defining data structures stored in RAM 1046 and modifying such data structures according to processes defined by the software. Additionally or alternatively, the computer system may provide functionality by logic hardwired or otherwise embodied in circuits (e.g., accelerator 1044), which may replace software or run in conjunction with software to perform specific processes or specific portions of specific processes described herein. Where appropriate, references to portions of software may include logic and vice versa. Where appropriate, references to portions of computer-readable media may include circuits (e.g., integrated circuits (ICs)) storing software for execution, circuits embodying logic for execution, or both. The present disclosure includes any suitable combination of hardware and software.

[0135] Although the present disclosure has described several exemplary embodiments, there are changes, substitutions, and various alternative equivalent embodiments that fall within the scope of the present disclosure. Therefore, it is to be understood that those skilled in the art will be able to devise many systems and methods that, although not explicitly shown or described herein, embody the principles of the present disclosure and are therefore within its spirit and scope.

Claims

1. A method for processing an event in a media stream, comprising: Get media data; generating one or more event segments and one or more media segments from the media data; parsing the event from the one or more event segments to determine an event start time, an event end time, and a scheduling mode; appending the event not present in the scheduled buffer to an event scheduling buffer based on a comparison of the event start time and the current playback position and a determination that the event from the one or more event segments is not present in the scheduled buffer, wherein the position associated with the event in the event scheduling buffer is based on a scheduling mode for the event; and The event is scheduled based on a position associated with the event in the event scheduling buffer, the event start time, the event end time, and the current playback position.

2. The method according to claim 1, wherein: The method further comprises: In response to determining that the event end time of the event is less than the current play position or the event exists in the scheduled buffer, another event is parsed from the one or more event segments.

3. The method according to claim 1, wherein: The method further comprises: Based on the scheduling mode of the event being an on_receive mode, appending the event to the event scheduling buffer at a position associated with the current playback position; and After appending the event to the event dispatch buffer, the event is added to the scheduled buffer.

4. The method according to claim 1, wherein: Appending the event to the event dispatch buffer comprises: Determine that the scheduling mode of the event is on_start mode; Calculating the event scheduling range of the event based on the event start time and the event end time; and Based on determining that there are overlapping events at a position in the event scheduling buffer associated with the event scheduling range of the event, the event scheduling range in the event scheduling buffer is divided into multiple sub-ranges, wherein each of the multiple sub-ranges is empty or occupied by at least one event having the same state for the entire sub-range.

5. The method according to claim 4, wherein: The method further comprises: For each sub-range of the plurality of sub-ranges occupied by at least one event, partitioning the at least one event based on a corresponding sub-range of the plurality of sub-ranges; and At least one divided event is appended to the event dispatch buffer at a position associated with each sub-range.

6. The method according to claim 1, wherein: The method further comprises: parsing a media segment from the one or more media segments to determine a segment start time and a segment end time, wherein one or more events are associated with the media segment, and the events are associated with the media segment; and The event is appended to a clear buffer at a location associated with a target range, wherein the target range is based on a segment start time and a segment end time of the media segment associated with the event.

7. The method according to claim 6, wherein: Appending the event to the clear buffer comprises: Based on determining that overlapping events exist at locations in the purge buffer associated with the target range, dividing the target range in the purge buffer into a plurality of purge subranges, wherein each of the plurality of purge subranges is empty or occupied by at least one event having the same state for the entire purge subrange; For each sub-range of the plurality of clear sub-ranges occupied by at least one event, partitioning the at least one event based on a corresponding clear sub-range of the plurality of clear sub-ranges; and At least one divided event is appended to the purge buffer at a position associated with each purge sub-range.

8. The method according to claim 7, wherein: Appending at least one divided event to the purge buffer at a location associated with each purge sub-range includes: assigning the same event association identifier EAI to each of the at least one partitioned event at a location in the purge buffer associated with the target range; and For each of the at least one divided event at a position in the purge buffer associated with the respective purge sub-ranges, a played flag is set to false, wherein the played flag indicates whether a media segment associated with each of the at least one divided event has been played.

9. The method according to claim 6, wherein: Appending the event to the event dispatch buffer comprises: Determine that the scheduling mode of the event is on_start mode; Calculate the event scheduling scope of the event based on the event start time and the event end time; Based on determining that there are overlapping events at a location in the event scheduling buffer associated with the event scheduling range of the event, dividing the event scheduling range in the event scheduling buffer into a plurality of sub-ranges, wherein each of the plurality of sub-ranges is empty or occupied by at least one event having the same state for the entire sub-range; For each sub-range of the plurality of sub-ranges occupied by at least one event, partitioning the at least one event based on a corresponding sub-range of the plurality of sub-ranges; and At least one divided event is appended to the event dispatch buffer at a position associated with each sub-range.

10. The method according to claim 9, wherein: Appending at least one divided event to the event dispatch buffer at a location associated with each sub-range includes: The same event association identifier EAI is assigned to each of the at least one divided event at a position in the event scheduling buffer associated with the event scheduling scope.

11. The method according to claim 1, wherein: The method further comprises: Clear the media subrange from the media buffer; and Based on determining that a location in the event dispatch buffer associated with the media sub-range overlaps with an event dispatch range of the event in the event dispatch buffer, clearing the overlapping sub-range from the event dispatch buffer.

12. The method according to claim 6, wherein: The method further comprises: Clears a media subrange from the media buffer; based on determining that there is an overlapping purge subrange between a location in the purge buffer associated with the media subrange and a target range of the event in the purge buffer, purge the overlapping purge subrange from the purge buffer; and For an event in the purge buffer with the played flag set to false at a position associated with the media subrange in the purge buffer: removing the event from the purge buffer; and The event is removed from the event dispatch buffer based on determining at least one of the following: An event in the purge buffer that is outside a position associated with the media subrange in the purge buffer does not have the same EAI as the removed event; or Events in the purge buffer that are within a position associated with the media subrange in the purge buffer do not have the same EAI as the removed event and have a played flag set to true.

13. The method according to any one of claims 1 to 12, wherein: The scheduling mode is a property of an event scenario selected by an event owner, and wherein the processing mode is a property of an event scenario selected by the event owner.

14. An apparatus for processing an event in a media stream, comprising: at least one memory configured to store program code; and At least one processor is configured to read the program code and execute according to instructions of the program code, wherein the program code includes: a first acquisition code configured to enable the at least one processor to acquire media data; a first generating code configured to cause the at least one processor to generate one or more event segments and one or more media segments from the media data; first parsing code configured to cause the at least one processor to parse an event from the one or more event segments to determine an event start time, an event end time, and a scheduling mode; first appending code configured to cause the at least one processor to append the event not present in the scheduled buffer to an event scheduling buffer based on a comparison of the event start time and the current playback position and a determination that an event from the one or more event segments does not exist in the scheduled buffer, wherein a position associated with the event in the event scheduling buffer is based on a scheduling mode for the event; and The first scheduling code is configured to enable the at least one processor to schedule the event based on the position associated with the event in the event scheduling buffer, the event start time, the event end time and the current playback position.

15. The device according to claim 14, wherein: The first additional code also includes: a scheduling mode determination code configured to cause the at least one processor to determine that the scheduling mode of the event is an on_start mode; A first calculation code configured to enable the at least one processor to calculate an event scheduling range of the event based on the event start time and the event end time; and The first partitioning code is configured to cause the at least one processor to partition the event scheduling range in the event scheduling buffer into multiple sub-ranges based on determining that there are overlapping events at a position in the event scheduling buffer associated with the event scheduling range of the event, wherein each of the multiple sub-ranges is empty or occupied by at least one event having the same state as the entire sub-range.

16. The device according to claim 15, wherein: The first additional code also includes: an event partitioning code configured to cause the at least one processor to, for each sub-range of the plurality of sub-ranges occupied by the at least one event, partition the at least one event based on a corresponding sub-range of the plurality of sub-ranges; and The second appending code is configured to cause the at least one processor to append at least one divided event to the event scheduling buffer at a position associated with each sub-range.

17. The device according to claim 14, wherein: The program code also includes: second parsing code configured to cause the at least one processor to parse the media segments from the one or more media segments to determine a segment start time and a segment end time, wherein one or more events are associated with the media segments, and the events are associated with the media segments; and A third appending code is configured to cause the at least one processor to append the event to a clear buffer at a location associated with a target range, wherein the target range is based on a segment start time and a segment end time of the media segment associated with the event.

18. The device according to claim 17, wherein: The third additional code also includes: second partitioning code configured to cause the at least one processor to partition the target range in the clear buffer into a plurality of clear sub-ranges based on determining that overlapping events exist at locations in the clear buffer associated with the target range, wherein each of the plurality of clear sub-ranges is empty or occupied by at least one event having the same state as the entire clear sub-range; a clear event partitioning code configured to cause the at least one processor to, for each of the plurality of clear subranges occupied by the at least one event, partition the at least one event based on a corresponding clear subrange in the plurality of clear subranges; and The fourth appending code is configured to cause the at least one processor to append at least one divided event to the clear buffer at a position associated with each clear sub-range.

19. The device according to claim 18, wherein: The fourth additional code also includes: first assigning code configured to cause the at least one processor to assign the same event association identifier EAI to each of the at least one divided event at a location in the clear buffer associated with the target range; and The first setting code is configured to cause the at least one processor to set a played flag to false for each of the at least one divided event at a position in the clear buffer associated with the respective clear sub-ranges, wherein the played flag indicates whether the media segment associated with each of the at least one divided event has been played.

20. A non-transitory computer-readable medium having instructions stored thereon, which when executed by at least one processor causes the at least one processor to perform the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Streaming media transmission method, electronic equipment and storage medium

    CN112601113A

  • Apparatus, systems and methods for buffering of media content

    US20170111690A1

  • Disparate live media output stream playout and broadcast distribution

    US20200204861A1

  • Events in timed metadata tracks

    US20210006871A1

  • Methods and apparatuses for dynamic adaptive streaming over HTTP

    US20210099506A1