WO2023179404A1 - 直播启播方法、设备及程序产品 - Google Patents

直播启播方法、设备及程序产品 Download PDF

Info

Publication number
WO2023179404A1
WO2023179404A1 PCT/CN2023/081180 CN2023081180W WO2023179404A1 WO 2023179404 A1 WO2023179404 A1 WO 2023179404A1 CN 2023081180 W CN2023081180 W CN 2023081180W WO 2023179404 A1 WO2023179404 A1 WO 2023179404A1
Authority
WO
WIPO (PCT)
Prior art keywords
media
fragment
fragments
delay threshold
segment
Prior art date
Application number
PCT/CN2023/081180
Other languages
English (en)
French (fr)
Inventor
于涌溢
杨乐
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023179404A1 publication Critical patent/WO2023179404A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47202End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand

Definitions

  • the embodiments of the present disclosure relate to the field of video processing, and in particular, to a live broadcast starting method, device, equipment, storage medium, program product, and program.
  • DASH Dynamic Adaptive Streaming over HTTP
  • a user terminal when a user terminal needs to start a live broadcast of a certain streaming media, it needs to sequentially initiate a Media Presentation Description (MPD) request, an Initialization Segment request and a request based on the DASH protocol. Media Segment request.
  • the user terminal can render and play the first frame of the live broadcast only after receiving the live broadcast server's response to each request.
  • the rendering and playback process of the first frame of a live broadcast requires a long time to start broadcasting, which seriously affects the user's viewing experience.
  • embodiments of the present disclosure provide a live broadcast starting method, device, equipment, storage medium, program product, and program.
  • embodiments of the present disclosure provide a live broadcast starting method, which method is applied to a server.
  • the method includes:
  • start-up fragments include media presentation description MPD files, initialization fragments, and media fragments corresponding to the delay threshold;
  • the start-up fragment is used to render the first frame of the live broadcast when the terminal starts the live broadcast.
  • embodiments of the present disclosure provide a live broadcast starting method, which method is applied to a terminal.
  • the method includes:
  • start-up fragments returned by the server; where the start-up fragments are determined by the server based on the preset delay threshold; the start-up fragments include media presentation description MPD files, initialization fragments, and media fragments corresponding to the delay threshold. piece;
  • embodiments of the present disclosure provide a live broadcast starting device, which is applied to a server and includes:
  • the first transceiver module is used to receive a live broadcast start request for streaming media initiated by the terminal;
  • the start-up fragment determination module is used to determine the start-up fragment according to the preset delay threshold; wherein the start-up fragment includes a media presentation description MPD file, an initialization fragment, and a media fragment corresponding to the delay threshold;
  • the first transceiver module is also used to send start-up fragments to the terminal.
  • the start-up fragments are used to render the first frame of the live broadcast when the terminal starts the live broadcast.
  • embodiments of the present disclosure provide a live broadcast starting device, which is applied to a terminal and includes:
  • the second transceiver module is used to send a live broadcast start request of streaming media to the server;
  • the second transceiver module is also used to receive start-up fragments returned by the server; where the start-up fragments are determined by the server based on the preset delay threshold; the start-up fragments include media presentation description MPD files, initialization fragments, Media fragmentation corresponding to the delay threshold;
  • the playback module is used to render and play the first frame of streaming media using start-up fragmentation.
  • embodiments of the present disclosure provide an electronic device, including: at least one processor; and
  • the memory stores computer execution instructions
  • the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method described in any one of the first aspect or the second aspect.
  • embodiments of the present disclosure provide a computer-readable storage medium, wherein computer-executable instructions are stored in the computer-readable storage medium.
  • the processor executes the computer-executable instructions, the first aspect is implemented. Or the method described in any one of the second aspects.
  • embodiments of the present disclosure provide a computer program product, which includes computer instructions.
  • the computer instructions are executed by a processor, the method described in any one of the first aspect or the second aspect is implemented.
  • an embodiment of the present disclosure provides a computer program, wherein when the computer program is executed by a processor, it implements the method described in any one of the first aspect or the second aspect.
  • Figure 1 is a schematic data flow diagram of a live broadcast starting method in the prior art
  • Figure 2 is a schematic diagram of a network architecture on which the present disclosure is based;
  • Figure 3 is a schematic flowchart of a live broadcast starting method provided by an embodiment of the present disclosure
  • Figure 4 is a schematic data flow diagram of a live broadcast starting method provided by an embodiment of the present disclosure
  • Figure 5 is a schematic data flow diagram of another live broadcast starting method provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart of another live broadcast starting method provided by an embodiment of the present disclosure.
  • Figure 7 is a structural block diagram of a live broadcast starting device provided by an embodiment of the present disclosure.
  • Figure 8 is a structural block diagram of another live broadcast starting device provided by an embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure.
  • DASH Dynamic Adaptive Streaming over HTTP
  • a user terminal when a user terminal needs to on-demand a certain streaming media, it needs to sequentially initiate a Media Presentation Description (MPD) request, an Initialization Segment (Initialization Segment) request, and a Media Segmentation request based on the DASH protocol. Media Segment request.
  • MPD Media Presentation Description
  • Initialization Segment Initialization Segment
  • Media Segmentation request based on the DASH protocol.
  • User terminal After receiving the response from the live broadcast server to each request, the end can render and play the first frame of the current on-demand video.
  • Figure 1 is a schematic data flow diagram of a live broadcast starting method in the prior art.
  • the terminal will first initiate an operation to the server.
  • the first HTTP request is used to request the MPD file; the server will return the MPD file to the terminal based on the first HTTP request.
  • the MPD file will include templates for subsequent fragments and related addresses.
  • the terminal will initiate a second HTTP request to the server to request initial fragmentation; the server will return the initialization fragment to the terminal based on the second HTTP request, and the initialization fragment will be used to fragment subsequent media. Carry out decoding processing.
  • the terminal will initiate a third HTTP request to the server to request media fragments; the server will return the media fragments to the terminal based on the third HTTP request.
  • the media fragments include the relevant images of the first frame. content.
  • the terminal can use the received MPD file, initialization fragment and media fragment to perform a series of rendering processes to obtain the first frame of the picture.
  • the terminal will display the rendered first frame to the user for viewing.
  • the process of starting the streaming media is completed.
  • the terminal will continuously request relevant content of subsequent frames to enable users to watch streaming media on demand.
  • the live broadcast start process is improved based on the DASH protocol, so that the terminal only needs to initiate a start request to render and play the first frame, effectively reducing the start-up time. broadcast time to improve user experience.
  • embodiments of the present disclosure provide a live broadcast starting method, device, equipment, storage medium, program product, and program.
  • the user terminal By improving the live broadcast starting process based on the DASH protocol, the user terminal only needs Initiating a live broadcast start request can render and play the first frame of the live broadcast, effectively reducing the live broadcast start time and improving user experience.
  • Figure 2 is a schematic diagram of a network architecture on which the present disclosure is based.
  • the network architecture shown in Figure 2 may specifically include a first terminal, a second terminal and a server.
  • the first terminal and the second terminal are respectively user terminals.
  • the first terminal may be a terminal used by users who upload streaming media
  • the second terminal may be a terminal used by users who request streaming media. Whether it is the first terminal or the second terminal, they can be specifically hardware devices with computing processing functions, communication functions, and display functions, including but not limited to smart phones, desktop computers, tablet computers, etc.
  • the server may specifically be a server cluster set up in the cloud. Through communication with the first terminal and the second terminal, it provides streaming media storage functions for streaming media providing users and provides on-demand streaming media on-demand users.
  • FIG. 3 is a schematic flowchart of a live broadcast starting method provided by this embodiment of the present disclosure. As shown in Figure 3, the live broadcast starting method may include the following steps:
  • Step 301 Receive a live broadcast start request for streaming media initiated by the terminal.
  • streaming media it should be uploaded to the server by the streaming media provider, and its media forms include but are not limited to: video media and audio media.
  • the terminal mentioned in this embodiment may specifically be the second terminal shown in FIG. 2 , that is, the terminal used by the on-demand user. Users can use the terminal to initiate on-demand operations on streaming media. The terminal will generate a corresponding live broadcast start request based on the on-demand operation and send the live broadcast start request to the server.
  • Step 302 Determine the start-up fragments according to the preset delay threshold; wherein the start-up fragments include media presentation description MPD files, initialization fragments, and media fragments corresponding to the delay threshold.
  • Step 303 Send the start-up fragment to the terminal.
  • the start-up fragment is used to render the first frame of the live broadcast when the terminal starts the live broadcast.
  • the delay threshold refers to a parameter preset in the server.
  • the delay threshold is used to represent the minimum time difference between the timestamp of the latest frame of the streaming media and the start time of the media fragment in the start-up fragment. value.
  • the specific value of the delay threshold can be determined according to the actual situation.
  • the delay threshold can be 8 seconds.
  • the playback fragments include MP4 format files.
  • the server will no longer send MPD files, initialization fragments, and media fragments to the terminal through multiple responses to HTTP requests. Instead, the server will use the method after the server receives the terminal's live broadcast start request. , a method of sending start-up fragments including media presentation description MPD files, initialization fragments, and media fragments corresponding to the delay threshold to the terminal at one time.
  • This processing method greatly reduces the number of communication requests during the broadcast process, reduces the time required to start broadcast, and improves the user experience.
  • starting the broadcast fragmentation also includes: fragment sequence number and the start time of the media fragmentation; where the fragmentation sequence number of the media fragmentation and the start time of the media fragmentation are used to generate the terminal's acquisition request for the next frame.
  • the terminal can use this information to deduce the fragment sequence number of the media fragment of the next frame, so that it can directly request the next frame from the server.
  • Media is fragmented to improve the efficiency of obtaining the next frame.
  • this embodiment also provides two methods to determine the specific process of starting segmentation based on the preset delay threshold.
  • the server after receiving the live broadcast start request, the server triggers the generation process of the start-up fragments to determine the start-up fragments that meet the delay threshold:
  • Figure 4 is a schematic data flow diagram of a live broadcast starting method provided by an embodiment of the present disclosure. As shown in Figure 4, when a user performs a live broadcast starting operation based on a terminal, the terminal will send a live broadcast starting request to server.
  • the server will first fragment the streaming media according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time.
  • 4s can be used as a fragmentation time, and the streaming media can be allocated and processed to obtain multiple media fragments, such as media fragmentation 1 [0s, 4s], media fragmentation 2 [4s, 8s], and media fragmentation 3. [8s,12s], media fragmentation 4[12s,16s], etc.
  • the server will select the target media fragment corresponding to the delay threshold based on the preset delay threshold.
  • a traversal method can be used when selecting target media fragments, such as:
  • the server selects the media fragment with the latest start time from the unselected media fragments as the media fragment to be processed.
  • the server determines whether the time difference between the start time of the media fragment to be processed and the timestamp of the latest frame in the streaming media is greater than the delay threshold
  • the media fragment to be processed is used as the target media fragment
  • the target media fragment from media fragment 1 [0s, 4s], media fragment 2 [4s, 8s], media fragment 3 [8s, 12s], and media fragment 4 [12s, 16s] as mentioned above.
  • the delay threshold is 8s
  • the timestamp of the latest frame in the streaming media is 18s.
  • the server will first treat media fragment 4 as a pending media fragment.
  • the start time of media segment 4, 12s with the timestamp of the latest frame in the streaming media, which is 18s, we can see that the time difference between the two is 6s. This time difference is less than the delay threshold of 8s.
  • the media segmentation Fragment 4 does not meet the criteria for being a target media fragment.
  • the server will regard media fragment 3 as the media fragment to be processed, and then make a difference between its start time of 8s and the timestamp of the latest frame in the streaming media, which is 18s, to obtain a time difference of 10s. Since the time difference between media fragment 3 and the timestamp of the latest frame in the streaming media is greater than the delay threshold of 8s, at this time, media fragment 3 will be used as the target media fragment and combined with the MPD file and initialization fragment The combination generates start-up fragments.
  • the server will The media fragment with the earliest start time is used as the target media fragment.
  • the server has traversed and determined that the time difference between the start time of each media fragment and the timestamp of the latest frame in the streaming media is less than the delay threshold.
  • the server will fragment the media 1[0s ,4s] as the target media fragment to generate the launch fragment.
  • the server can quickly generate target media fragments that meet the delay threshold. Then, the server will generate start-up fragments based on the MPD file, initialization fragments, and target media fragments and send them to the terminal.
  • the server can generate multiple start broadcast fragments in advance. After the server receives the live broadcast start request, it selects from the multiple start broadcast fragments. The start-up fragments that meet the delay threshold are sent to the terminal, thereby improving the delivery efficiency of the start-up fragments.
  • FIG. 5 is a schematic data flow diagram of another live broadcast starting method provided by an embodiment of the present disclosure.
  • the server will fragment the streaming media according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time. Subsequently, the server will generate multiple start-up fragments based on each media fragment; different start-up fragments include media presentation description MPD files, initialization fragments, and different media fragments.
  • the server will fragment the existing streaming media once, and obtain media fragment 1 [0s, 4s], media fragment 2 [4s, 8s] ], multiple media fragments including media fragment 3 [8s, 12s], media fragment 4 [12s, 16s].
  • the server will combine each media fragment with the MPD file and the initialization fragment to obtain start-up fragment 1 [MPD file, initialization fragment, media fragment 1], start-up fragment 2 [MPD file, initialization fragment, media fragment 2], start fragment 3 [MPD file, initial fragment, media fragment 3] and start fragment 4 [MPD file, initial fragment, media fragment 4].
  • the server will select the target start-up fragment from each start-up fragment based on the delay threshold. Specifically, the server will select the target media fragment corresponding to the delay threshold based on the preset delay threshold, and use the start-up fragment corresponding to the target media fragment as the target start-up fragment.
  • the server selects the latest start time from the unselected start-up fragments based on the start time of the media fragments in each start-up fragment.
  • the start-up fragment corresponding to the media fragment is used as the pending start-up fragment.
  • the server determines whether the time difference between the start time of the media fragment to be processed and the timestamp of the latest frame in the streaming media is greater than the delay threshold; if it is greater than the delay threshold, the time difference is The start-up fragment is processed as the target start-up fragment; if it is not greater than the delay threshold, the start-up fragment corresponding to the media fragment with the latest start time among the unselected start-up fragments is returned as the start-up fragment to be processed. Handle the steps for starting a shard.
  • the delay threshold is 8s
  • the timestamp of the latest frame in the streaming media is 18s.
  • the server Since the start time of media fragment 4 in startup fragment 4 is 12 seconds, which is the latest start time, the server will first treat startup fragment 4 as the pending startup fragment. By comparing the start time of media segment 4 in start segment 4 (12s) with the timestamp of the latest frame in streaming media (18s), it can be seen that the time difference between the two is 6s, which is less than the delay
  • the threshold is 8 seconds, and the start-up fragment 4 does not meet the conditions for being a target start-up fragment.
  • the server will regard the start-up segment 3 as the pending start-up segment, and then make a difference between the start time of the corresponding media segment 3, 8s, and the timestamp of the latest frame in the streaming media, which is 18s, to get The time difference is 10s. Since the time difference between media fragment 3 and the timestamp of the latest frame in the streaming media is greater than the delay threshold of 8 seconds, at this time, the start fragment 3 will be used as the target start fragment.
  • the server will start each play-out segment.
  • the start-up fragment with the earliest start time among the fragments is used as the target start-up fragment.
  • the server can quickly determine the target start-up fragment that meets the delay threshold. Subsequently, the server will also update the target start-up fragments in real time as the encoding of each frame of the streaming media is completed to ensure that the target start-up fragments currently selected by the server meet the delay threshold, that is, the server will The timestamp of the latest frame of the media is used to update the target start-up segment.
  • the server since the server has real-time pre-stored target broadcast start fragments that meet the delay threshold, when the server receives the live broadcast start request sent by the terminal, the server can directly start the target broadcast into fragments. Delivered to the terminal for the terminal to use the MPD file, initialization fragment and target media fragment in the target start-up fragment to render and play the first frame of the picture.
  • This method can further improve the server's response efficiency to live broadcast start requests, thereby enabling the terminal to quickly render and play the first frame.
  • the method provided by the embodiment of the present disclosure improves the live broadcast start process based on the DASH protocol, so that the terminal only needs to initiate a start broadcast request to realize the rendering and playback of the first frame, effectively reducing the cost of starting the broadcast. time to improve user experience.
  • FIG. 6 is a schematic flowchart of another live broadcast starting method provided by an embodiment of the present disclosure. As shown in Figure 6, the live broadcast starting method may include the following steps:
  • Step 601 Send a streaming media live broadcast start request to the server.
  • Step 602 Receive the start-up fragments returned by the server; wherein the start-up fragments are determined by the server according to the preset delay threshold; the start-up fragments include media presentation description MPD files, initialization fragments, and corresponding delay thresholds media fragmentation.
  • Step 603 Use the start-up fragment to render and play the first frame of the streaming media.
  • streaming media it should be uploaded to the server by the streaming media provider, and its media forms include but are not limited to: video media and audio media.
  • the terminal mentioned in this embodiment may specifically be the second terminal shown in FIG. 2 , that is, the terminal used by the on-demand user.
  • the terminal will generate a corresponding live broadcast start request based on the on-demand operation and send the live broadcast start request to the server.
  • the server After the user sends the live broadcast start request to the server, the server will respond to the live broadcast start request according to the method provided in the aforementioned implementation mode, and will include the media presentation description MPD file, initialization fragmentation, and the delay threshold.
  • the media fragments are delivered to the terminal for rendering and playback by the terminal.
  • the playback fragments include MP4 format files.
  • the terminal only needs to send a live broadcast start request once to obtain the start-up fragments including the MPD file, initialization fragments, and media fragments corresponding to the delay threshold, thereby reducing the time required to start the broadcast. time to improve user experience.
  • starting the broadcast segment also includes the media The fragment sequence number of the fragment and the start time of the media fragment; and the method further includes: generating the next frame of the streaming media according to the fragment sequence number of the media fragment and the start time of the media fragment.
  • the acquisition request of the next frame is sent to the server.
  • the terminal can use this information to deduce the fragment sequence number of the media fragment of the next frame, so that it can directly request the next frame from the server.
  • Media is fragmented to improve the efficiency of obtaining the next frame.
  • the method provided by the embodiment of the present disclosure improves the live broadcast start process based on the DASH protocol, so that the terminal only needs to initiate a start broadcast request to realize the rendering and playback of the first frame, effectively reducing the cost of starting the broadcast. time to improve user experience.
  • FIG. 7 is a structural block diagram of a live broadcast starting device provided by an embodiment of the present disclosure.
  • the live broadcast starting device is applied to the server and includes:
  • the first transceiver module 701 is used to receive a live broadcast start request for streaming media initiated by the terminal;
  • the start-up fragment determination module 702 is used to determine the start-up fragment according to the preset delay threshold; wherein the start-up fragment includes a media presentation description MPD file, an initialization fragment, and a media fragment corresponding to the delay threshold. ;
  • the first transceiver module 701 is also used to send the broadcast start fragment to the terminal.
  • the start broadcast fragment is used to render the first frame of the live broadcast when the terminal starts the live broadcast.
  • the starting fragment also includes: the fragment sequence number of the media fragment and the start time of the media fragment; wherein the fragment sequence number of the media fragment and the The start time is used to generate the terminal's acquisition request for the next frame.
  • start broadcast fragment determination module 702 specifically used for:
  • the streaming media is fragmented according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time; according to the preset delay threshold, the delay threshold is selected.
  • the corresponding target media fragment is generated according to the MPD file, the initialization fragment and the target media fragment.
  • start broadcast fragment determination module 702 specifically used for:
  • the start time of each media fragment select the media fragment with the latest start time from the unselected media fragments as the media fragment to be processed; determine the start time of the media fragment to be processed and the Whether the time difference between the timestamps of the latest frame in the streaming media is greater than the delay threshold; if so, the media fragment to be processed is used as the target media fragment; if not, the basis is returned Based on the start time of each media fragment, the media fragment with the latest start time from the unselected media fragments is selected as the step of the media fragment to be processed.
  • the determining module 702 is also configured to use the media fragment with the earliest start time among the media fragments as the target media fragment.
  • the broadcast fragment determination module 702 is specifically used to:
  • the streaming media is fragmented according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time; multiple start-up fragments are generated according to each media fragment; wherein, different The start-up fragments include the MPD file, the initialization fragment and different media fragments; according to the preset delay threshold, the target start-up fragment is selected from each start-up fragment; the target start-up fragment is The start-up fragment is used as the start-up fragment sent to the terminal.
  • start broadcast fragment determination module 702 specifically used for:
  • the target media fragment corresponding to the delay threshold is selected; the start-up fragment corresponding to the target media fragment is used as the target start-up fragment.
  • the broadcast fragment determination module 702 is also used to:
  • the target start-up segment is updated according to the timestamp of the latest frame of the streaming media.
  • the playback fragments include MP4 format files.
  • the device provided by the embodiment of the present disclosure improves the live broadcast start process based on the DASH protocol, so that the terminal only needs to initiate a start broadcast request to realize the rendering and playback of the first frame, effectively reducing the start broadcast time. , improve user experience.
  • FIG. 8 is a structural block diagram of another live broadcast starting device provided by an embodiment of the present disclosure.
  • the live broadcast starting device is applied to the terminal and includes:
  • the second transceiver module 801 is used to send a live broadcast start request of streaming media to the server;
  • the second transceiver module 801 is also used to receive start-up fragments returned by the server; wherein the start-up fragments are determined by the server according to the preset delay threshold; the start-up fragments include media presentation description MPD files, initialization fragments , media fragmentation corresponding to the delay threshold;
  • the play module 802 is used to render and play the first frame of the streaming media using the start-up fragment.
  • start-up segments include MP4 format files.
  • starting a segment also includes the segment sequence number of the media segment and the start time of the media segment;
  • the second transceiver module 801 is also used for:
  • an acquisition request for the next frame of the streaming media is generated; the acquisition request for the next frame is sent to the server.
  • the device provided by the embodiment of the present disclosure improves the live broadcast start process based on the DASH protocol, so that the terminal only needs to initiate a start broadcast request to realize the rendering and playback of the first frame, effectively reducing the start broadcast time. , improve user experience.
  • the electronic device provided in this embodiment can be used to execute the technical solutions of the above method embodiments.
  • the implementation principles and technical effects are similar and will not be described again in this embodiment.
  • the electronic device 900 may be a terminal device or a server.
  • terminal devices may include but are not limited to mobile phones, laptops, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA for short), tablet computers (Portable Android Device, PAD for short), portable streaming media players ( Mobile terminals such as Portable Media Player (PMP for short), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TV (television), desktop computers, etc.
  • PDA Personal Digital Assistant
  • PAD Portable Android Device
  • PMP Portable Media Player
  • vehicle-mounted terminals such as vehicle-mounted navigation terminals
  • fixed terminals such as digital TV (television), desktop computers, etc.
  • the electronic device shown in FIG. 9 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 900 may include a processing device (such as a central processing unit, a graphics processor, etc.) 901, which may process data according to a program stored in a read-only memory (Read Only Memory, ROM for short) 902 or from a storage device. 908 loads the program in the random access memory (Random Access Memory, RAM for short) 903 to perform various appropriate actions and processing. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored.
  • the processing device 901, ROM 902 and RAM 903 are connected to each other via a bus 904.
  • An input/output (I/O) interface 905 is also connected to bus 904.
  • the following devices can be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Crystal Display (LCD). ), an output device 907 such as a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909.
  • the communication device 909 may allow the electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 9 illustrates an electronic device 900 having various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via communication device 909, or from storage device 908, or from ROM 902.
  • the processing device 901 the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any A combination of the above. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmd read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the computer-readable medium carries one or more programs.
  • the electronic device When the one or more programs are executed by the electronic device, the electronic device performs the method shown in the above embodiment.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or media library.
  • the remote computer can be connected to the user's computer through any kind of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or it can be connected to an external computer Computer (e.g. connected via the Internet using an Internet service provider).
  • LAN Local Area Network
  • WAN Wide Area Network
  • This embodiment provides a computer program product that includes computer instructions.
  • the computer instructions are executed by a processor as described in the previous item.
  • the implementation principles and technical effects are similar and will not be described again in this embodiment.
  • This embodiment provides a computer program.
  • the computer program is executed by a processor as described in the previous item. Its implementation principles and technical effects are similar and will not be described again in this embodiment.
  • each block in the flowchart or block diagram may represent a module, segment, or portion of code that contains one or more logic functions that implement the specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
  • each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of specialized hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure can be implemented in software or hardware.
  • the name of the unit does not constitute a limitation on the unit itself under certain circumstances.
  • the first acquisition unit can also be described as "the unit that acquires at least two Internet Protocol addresses.”
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • a live broadcast starting method is applied to a server; the method includes:
  • start-up fragments include media presentation description MPD files, initialization fragments, and media fragments corresponding to the delay threshold;
  • the start-up fragment is used to render the first frame of the live broadcast when the terminal starts the live broadcast.
  • starting broadcast fragmentation also includes: the fragmentation sequence number of the media fragmentation and the start time of the media fragmentation; where the fragmentation sequence number and the start time of the media fragmentation are used to generate the terminal's response to the next frame. Get request.
  • determine the start of segmentation based on the preset delay threshold including:
  • the streaming media is fragmented according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time; according to the preset delay threshold, the target media fragment corresponding to the delay threshold is selected. Fragments; generate start-up fragments based on MPD files, initialization fragments and target media fragments.
  • select target media fragments corresponding to the delay threshold based on the preset delay threshold including:
  • the start time of each media fragment select the media fragment with the latest start time from the unselected media fragments as the media fragment to be processed; determine the start time of the media fragment to be processed and the latest in the streaming media Whether the time difference between the timestamps of a frame is greater than the delay threshold; if so, the media fragment to be processed is used as the target media fragment; if not, the start time of each media fragment is returned, never The step of selecting the media fragment with the latest start time among the selected media fragments as the media fragment to be processed.
  • the method also includes: The media fragment with the earliest start time is used as the target media fragment.
  • this method also includes:
  • the streaming media is fragmented according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time; multiple start-up fragments are generated according to each media fragment; among them, different start-up fragments
  • the film includes media presentation description MPD files, initialization fragments and different media fragments; according to the preset delay threshold, the target start-up fragment is selected from each start-up fragment;
  • Determine the start-up fragment according to the preset delay threshold including: using the target start-up fragment as the start-up fragment sent to the terminal.
  • selecting the target start-up segment from each start-up segment according to the preset delay threshold includes: selecting the target media segment corresponding to the delay threshold according to the preset delay threshold; The start-up fragment corresponding to the target media fragment is used as the target start-up fragment.
  • the method also includes: updating the target start-up segment according to the timestamp of the latest frame of the streaming media.
  • start-up segments include MP4 format files.
  • a live broadcast starting method is applied to a terminal; the method includes:
  • start-up segments include MP4 format files.
  • starting the broadcast fragment also includes the fragment sequence number of the media fragment and the start time of the media fragment; the method also includes: generating the streaming media according to the fragment sequence number of the media fragment and the start time of the media fragment. Get request for the next frame; send the get request for the next frame to the server.
  • a live broadcast starting device is applied to a server and includes:
  • the first transceiver module is used to receive a live broadcast start request for streaming media initiated by the terminal;
  • the start-up fragment determination module is used to determine the start-up fragment according to the preset delay threshold; wherein the start-up fragment includes a media presentation description MPD file, an initialization fragment, and a media fragment corresponding to the delay threshold;
  • the first transceiver module is also used to send start-up fragments to the terminal.
  • the start-up fragments are used to render the first frame of the live broadcast when the terminal starts the live broadcast.
  • the starting fragment also includes: the fragment sequence number of the media fragment and the start time of the media fragment; wherein the fragment sequence number of the media fragment and the The start time is used to generate the terminal's acquisition request for the next frame.
  • start broadcast fragmentation determination module specifically used for:
  • the streaming media is fragmented according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time; according to the preset delay threshold, the delay threshold is selected.
  • the corresponding target media fragment is generated according to the MPD file, the initialization fragment and the target media fragment.
  • start broadcast fragmentation determination module specifically used for:
  • the start time of each media fragment select the media fragment with the latest start time from the unselected media fragments as the media fragment to be processed; determine the start time of the media fragment to be processed and the Whether the time difference between the timestamps of the latest frame in the streaming media is greater than the delay threshold; if so, the media fragment to be processed is used as the target media fragment; if not, the basis is returned Based on the start time of each media fragment, the media fragment with the latest start time from the unselected media fragments is selected as the step of the media fragment to be processed.
  • the determining module is also configured to use the media fragment with the earliest start time among the media fragments as the target media fragment.
  • start-up fragmentation determination module is specifically used for:
  • the streaming media is fragmented according to the timestamp of each frame in the streaming media to obtain multiple consecutive media fragments with the same fragmentation time; multiple start-up fragments are generated according to each media fragment; wherein, different The start-up fragments include the MPD file, the initialization fragment and different media fragments; according to the preset delay threshold, the target start-up fragment is selected from each start-up fragment; the target start-up fragment is The start-up fragment is used as the start-up fragment sent to the terminal.
  • start broadcast fragmentation determination module specifically used for:
  • the target media fragment corresponding to the delay threshold is selected; the start-up fragment corresponding to the target media fragment is used as the target start-up fragment.
  • start broadcast fragmentation determination module also used for:
  • the target start-up segment is updated according to the timestamp of the latest frame of the streaming media.
  • the playback fragments include MP4 format files.
  • a live broadcast starting device is applied to a terminal and includes:
  • the second transceiver module is used to send a live broadcast start request of streaming media to the server;
  • the second transceiver module is also used to receive start-up fragments returned by the server; where the start-up fragments are determined by the server based on the preset delay threshold; the start-up fragments include media presentation description MPD files, initialization fragments, Media fragmentation corresponding to the delay threshold;
  • the playback module is used to render and play the first frame of streaming media using start-up fragmentation.
  • start-up segments include MP4 format files.
  • starting a segment also includes the segment sequence number of the media segment and the start time of the media segment;
  • the second transceiver module is also used for:
  • an acquisition request for the next frame of the streaming media is generated; the acquisition request for the next frame is sent to the server.
  • an electronic device including: at least one processor and a memory;
  • the memory stores computer execution instructions
  • the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method described in the preceding item.
  • a computer-readable storage medium stores computer-executable instructions in the computer-readable storage medium.
  • the processor executes the computer-executable instructions, the following is implemented: The method described in the previous item.
  • a computer program product includes computer instructions, and the computer instructions are executed by a processor as described in the previous item.
  • An eighth aspect is a computer program, wherein the computer program is executed by a processor as described in the previous item.
  • Embodiments of the present disclosure provide a live broadcast starting method, device, equipment, storage medium, program product and program, in which the server will receive a live broadcast starting request for streaming media initiated by the terminal, and according to the preset delay threshold, Determine the start-up fragment; where the start-up fragment includes the media presentation description MPD file, initialization fragment, and media fragment corresponding to the delay threshold; the terminal will receive the start-up fragment sent by the server and use the start-up fragment Render the film to get the first frame of the live streaming video.
  • the method provided by the embodiment of the present disclosure improves the live broadcast start process based on the DASH protocol, so that the terminal only needs to initiate a start broadcast request to realize the rendering and playback of the first frame, effectively reducing the cost of starting the broadcast. time to improve user experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本公开实施例提供的直播启播方法、装置、设备、存储介质、程序产品及程序,其中,服务器将接收终端发起的对流媒体的直播启播请求,并根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;终端将接收到服务器发送的启播分片并利用该启播分片渲染得到流媒体直播的首帧画面;本方案通过在DASH协议的基础上,对直播启播流程进行改进,以使得终端仅需发起一次启播请求即可实现对首帧的渲染播放,有效降低了启播时间,提升用户体验。

Description

直播启播方法、设备及程序产品
相关申请的交叉引用
本申请要求于2022年3月21日提交的申请号为202210279320.X、申请名称为“直播启播方法、设备及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开实施例涉及视频处理领域,尤其涉及一种直播启播方法、装置、设备、存储介质、程序产品及程序。
背景技术
随着娱乐生活的多样化,流媒体直播成为人们娱乐生活的重要组成部分。国际标准动态自适应HTTP流(Dynamic Adaptive Streaming over HTTP,简称DASH)是一种常见的流媒体直播的媒体资源分发协议。
在现有技术中,当用户终端需要对某一流媒体进行直播启播时,需要基于DASH协议依次发起媒体演示描述(Media Presentation Description,简称MPD)的请求、初始化分片(Initialization Segment)的请求以及媒体分片(Media Segment)的请求。用户终端在接收到直播服务器对各请求的响应之后,才能够对直播首帧进行渲染和播放。而这样的直播首帧的渲染播放流程所需要的启播时间较长,严重影响了用户的观感体验。
发明内容
针对上述问题,本公开实施例提供了一种直播启播方法、装置、设备、存储介质、程序产品及程序。
第一方面,本公开实施例提供了一种直播启播方法,该方法应用于服务器,该方法包括:
接收终端发起的对流媒体的直播启播请求;
根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
将启播分片发送至终端,启播分片用于在终端进行直播启播时渲染得到直播的首帧画面。
第二方面,本公开实施例提供了一种直播启播方法,该方法应用于终端,该方法包括:
向服务器发送流媒体的直播启播请求;
接收服务器返回的启播分片;其中,启播分片是服务器根据预设的延时阈值确定的;启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
利用启播分片对流媒体的首帧画面进行渲染和播放。
第三方面,本公开实施例提供了一种直播启播装置,该装置应用于服务器,该装置包括:
第一收发模块,用于接收终端发起的对流媒体的直播启播请求;
启播分片确定模块,用于根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
第一收发模块,还用于将启播分片发送至终端,启播分片用于在终端进行直播启播时渲染得到直播的首帧画面。
第四按方面,本公开实施例提供了一种直播启播装置,该装置应用于终端,该装置包括:
第二收发模块,用于向服务器发送流媒体的直播启播请求;
第二收发模块,还用于接收服务器返回的启播分片;其中,启播分片是服务器根据预设的延时阈值确定的;启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
播放模块,用于利用启播分片对流媒体的首帧画面进行渲染和播放。
第五方面,本公开实施例提供了一种电子设备,包括:至少一个处理器;以及
存储器;
所述存储器存储计算机执行指令;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如第一方面或第二方面任一项所述方法。
第六方面,本公开实施例提供了一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如第一方面或第二方面任一项所述方法。
第七方面,本公开实施例提供了一种计算机程序产品,包括计算机指令,所述计算机指令被处理器执行时实现如第一方面或第二方面任一项所述方法。
第八方面,本公开实施例提供了一种计算机程序,其中,所述计算机程序被处理器执行时执行实现如第一方面或第二方面任一项所述的方法。
附图说明
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术中的一种直播启播方法的数据流示意图;
图2为本公开所基于的一种网络架构的示意图;
图3为本公开实施例提供的一种直播启播方法的流程示意图;
图4为本公开实施方式提供的一种直播启播方法的数据流示意图;
图5为本公开实施方式提供的另一种直播启播方法的数据流示意图;
图6为本公开实施例提供的另一种直播启播方法的流程示意图;
图7为本公开实施例提供的直播启播装置的结构框图;
图8为本公开实施例提供的另一直播启播装置的结构框图;
图9为本公开实施例提供的电子设备的硬件结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
随着娱乐生活的多样化,流媒体直播成为人们娱乐生活的重要组成部分。国际标准动态自适应HTTP流(Dynamic Adaptive Streaming over HTTP,简称DASH)是一种常见的流媒体直播的媒体资源分发协议。
在现有技术中,当用户终端需要对某一流媒体进行点播时,需要基于DASH协议依次发起媒体演示描述(Media Presentation Description,简称MPD)的请求、初始化分片(Initialization Segment)的请求以及媒体分片(Media Segment)的请求。用户终 端在接收到直播服务器对各请求的响应之后,才能够对当前点播的首帧进行渲染和播放。
示例性的,图1为现有技术中的一种直播启播方法的数据流示意图,如图1所示的,当用户通过终端触发对流媒体的直播启播操作之后,终端首先会向服务器发起第一次HTTP请求,以用于请求MPD文件;服务器会基于该第一HTTP请求将MPD文件返回给终端,该MPD文件中将包括有后续分片的模板以及相关地址。然后,终端会向服务器发起第二次HTTP请求,以用于请求初始化分片;服务器会基于该第二次HTTP请求将初始化分片返回给终端,该初始化分片则用于对后续媒体分片进行解码处理。最后,终端会向服务器发起第三次HTTP请求,以用于请求媒体分片;服务器会基于该第三次HTTP请求将媒体分片返回给终端,该媒体分片中包括有首帧的相关画面内容。
此时,终端可利用接收到的MPD文件、初始化分片和媒体分片进行一系列渲染处理,得到首帧画面。此时,终端会将渲染得到的首帧画面显示给用户,以供用户观看,此时完成对流媒体的启播流程。当然,在启播流程之后,终端会持续性的请求后续帧的相关内容,以实现用户对流媒体的点播观看。
显然的,如图1所示的现有的基于DASH协议的流媒体的启播流程中,终端需要与服务器进行多次通信,其启播时间较长,严重影响了用户的观感体验。
针对这样的问题,根据本公开的实施例在DASH协议的基础上,对直播启播流程进行改进,以使得终端仅需发起一次启播请求即可实现对首帧的渲染播放,有效降低了启播时间,提升用户体验。
具体地,本公开实施例提供了一种直播启播方法、装置、设备、存储介质、程序产品及程序,通过在DASH协议的基础上,对直播启播流程进行改进,以使得用户终端仅需发起一次直播启播请求即可实现对直播首帧的渲染播放,有效降低了直播启播时间,提升用户体验。
参考图2,图2为本公开所基于的一种网络架构的示意图,该图2所示网络架构具体可包括第一终端、第二终端和服务器。
其中,第一终端和第二终端分别为用户终端,其第一终端可为上传流媒体的用户所使用的终端,而第二终端可为点播流媒体的用户所使用的终端。无论是第一终端还是第二终端,其均具体可为具有运算处理功能、通信功能以及显示功能的硬件设备,包括但不限于智能手机、台式电脑、平板电脑等。
其中,服务器具体可为设置在云端的服务器集群,通过与第一终端和第二终端的通信,为流媒体的提供用户提供流媒体的存储功能,为流媒体的点播用户提供点播功能。
下面通过具体的实施例对本公开提供的直播启播方法及设备进行详细说明。下面的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。
需要说明的是,在本实施例中提供的直播启播方法的执行主体为前述提及的服务器,图3为本公开实施例提供的一种直播启播方法的流程示意图。如图3所示的,该直播启播方法可以包括如下几个步骤:
步骤301、接收终端发起的对流媒体的直播启播请求。
具体的,对于流媒体来说,其应为流媒体的提供用户上传至服务器中的,其媒体形式包括但不限于:视频媒体、音频媒体。
而本实施方式中所提及的终端具体可为图2所示的第二终端,即点播用户所使用的终端。用户可通过使用该终端发起对流媒体的点播操作,终端会根据点播操作生成相应的直播启播请求,并将该直播启播请求发送至服务器。
步骤302、根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片。
步骤303、将启播分片发送至终端,启播分片用于在终端进行直播启播时渲染得到直播的首帧画面。
具体的,延时阈值是指预先设置在服务器中的参数,该延时阈值用于表示流媒体的最新一帧的时间戳与启播分片中媒体分片的开始时间之间的最小时间差值。在可选实施方式中,该延时阈值的具体取值可根据实际情况自行确定,示例性的,延时阈值可为8s。示例性的,启播分片包括MP4格式文件。
本实施方式中,服务器将不再采用通过多次对HTTP请求的响应以将MPD文件、初始化分片和媒体分片分别发送至终端的方式,而是采用服务器接收到终端的直播启播请求之后,一次性的将包括有媒体演示描述MPD文件、初始化分片以及与延时阈值对应的媒体分片的启播分片发送至终端的方式。
而这样的处理方式大大降低了启播过程中的通信请求的次数,降低了启播所需要的时间,提升用户体验。
由于本公开实施方式中的延时阈值是由服务器预设的,为了能够便于终端后续会流媒体的下一帧的数据进行请求,可选的,在启播分片还包括:媒体分片的分片序号 和媒体分片的开始时间;其中,媒体分片的分片序号和媒体分片的开始时间用于生成终端对下一帧的获取请求。
通过在启播分片中携带媒体分片的开始时间和分片序号等相关信息,终端可利用该信息推算出下一帧的媒体分片的分片序号,从而可直接向服务器请求下一帧媒体分片,进而提升下一帧的获取效率。
在上述各实施方式的基础上,本实施方式还提供了两种方式以实现根据预设的延时阈值确定启播分片的具体流程。
在其中一种实现方式中,服务器会在接收直播启播请求之后,触发启播分片的生成流程,以确定出符合延时阈值的启播分片:
具体的,图4为本公开实施方式提供的一种直播启播方法的数据流示意图,如图4所示的,当用户基于终端进行直播启播操作时,终端会将直播启播请求发送至服务器。
此时,服务器首先会根据流媒体中各帧的时间戳对流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片。
示例性的,可将4s作为一个分片时间,对流媒体进行分配处理得到多个媒体分片,如媒体分片1[0s,4s]、媒体分片2[4s,8s]、媒体分片3[8s,12s]、媒体分片4[12s,16s]等。
随后,服务器将根据预设的延时阈值,选出与延时阈值对应的目标媒体分片。具体的,在选取目标媒体分片时可采用遍历的方式进行,如:
首先,服务器根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片。
然后,服务器判断待处理媒体分片的开始时间与流媒体中最新一帧的时间戳之间的时间差值,是否大于延时阈值;
若大于延时阈值,则将该待处理媒体分片作为目标媒体分片;
若不大于延时阈值,则返回根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片。
以前述的从媒体分片1[0s,4s]、媒体分片2[4s,8s]、媒体分片3[8s,12s]、媒体分片4[12s,16s]中选出目标媒体分片为例,延时阈值为8s,流媒体中最新一帧的时间戳为18s。
由于媒体分片4的开始时间为12s,其开始时间最晚,服务器首先会将媒体分片4作为待处理媒体分片。通过将媒体分片4的开始时间12s与流媒体中最新一帧的时间戳为18s进行作差可知,其二者的时间差值为6s,该时间差值小于延时阈值8s,该媒体分片4不满足作为目标媒体分片的条件。
此时,服务器会将媒体分片3作为待处理媒体分片,并重新将其开始时间8s与流媒体中最新一帧的时间戳为18s进行作差,得到时间差值10s。由于媒体分片3与流媒体中最新一帧的时间戳之间的时间差值大于延时阈值8s,此时,该媒体分片3将作为目标媒体分片,并与MPD文件和初始化分片组合生成启播分片。
在其他示例中,若各媒体分片中不存在开始时间与流媒体中最新一帧的时间戳之间的时间差值大于所述延时阈值的媒体分片,则服务器将各媒体分片中开始时间最早的媒体分片作为目标媒体分片。
以从媒体分片1[0s,4s]、媒体分片2[4s,8s]、媒体分片3[8s,12s]、媒体分片4[12s,16s]中选出目标媒体分片为例,延时阈值为20s,流媒体中最新一帧的时间戳为17s。
此时可知的是,服务器经过遍历确定各媒体分片的开始时间与流媒体中最新一帧的时间戳之间的时间差值均小于延时阈值,此时服务器会将媒体分片1[0s,4s]作为目标媒体分片,以生成启播分片。
通过上述按照媒体分片的开始时间进行遍历的方式,服务器能够快速生成满足延时阈值的目标媒体分片。然后,服务器会将根据MPD文件、初始化分片和目标媒体分片,生成启播分片并发送给终端。
在另一种根据预设的延时阈值确定启播分片的具体流程中,服务器可预先生成多个启播分片,当服务器接收直播启播请求之后,从多个启播分片中选择符合延时阈值的启播分片以下发给终端,从而提升启播分片的下发效率。
具体的,图5为本公开实施方式提供的另一种直播启播方法的数据流示意图。
如图5所示的,首先,服务器将根据流媒体中各帧的时间戳对流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片。随后,服务器将根据各媒体分片生成多个启播分片;其中,不同启播分片中包括媒体演示描述MPD文件、初始化分片以及不同的媒体分片。
例如,当服务器完成对流媒体的最新一帧的编码处理后,服务器会将已有的流媒体进行一次分片处理,得到包括媒体分片1[0s,4s]、媒体分片2[4s,8s]、媒体分片3[8s,12s]、媒体分片4[12s,16s]在内的多个媒体分片。
然后,服务器会将各媒体分片分别与MPD文件和初始化分片进行组合,得到启播分片1[MPD文件,初始化分片,媒体分片1]、启播分片2[MPD文件,初始化分片,媒体分片2]、启播分片3[MPD文件,初始化分片,媒体分片3]和启播分片4[MPD文件,初始化分片,媒体分片4]。
然后,服务器会根据延时阈值,从各启播分片中选出目标启播分片。具体的,服务器将根据预设的延时阈值,选出与延时阈值对应的目标媒体分片,并将目标媒体分片对应的启播分片作为目标启播分片。
示例性的,与前述对目标媒体分片的选择类似的是,服务器根据各启播分片中的媒体分片的开始时间,从未被选取的各启播分片中选出开始时间最晚的媒体分片所对应的启播分片作为待处理启播分片。然后,服务器判断待处理启播分片的媒体分片的开始时间与流媒体中最新一帧的时间戳之间的时间差值,是否大于延时阈值;若大于延时阈值,则将该待处理启播分片作为目标启播分片;若不大于延时阈值,则返回未被选取的各启播分片中选出开始时间最晚的媒体分片所对应的启播分片作为待处理启播分片的步骤。
以前述的从启播分片1、启播分片2、启播分片3和启播分片4为例,延时阈值为8s,流媒体中最新一帧的时间戳为18s。
由于启播分片4中媒体分片4的开始时间为12s,其开始时间最晚,服务器首先会将启播分片4作为待处理启播分片。通过将启播分片4中媒体分片4的开始时间12s与流媒体中最新一帧的时间戳为18s进行作差可知,其二者的时间差值为6s,该时间差值小于延时阈值8s,该启播分片4不满足作为目标启播分片的条件。
此时,服务器会将启播分片3作为待处理启播分片,并重新将其对应的媒体分片3的开始时间8s与流媒体中最新一帧的时间戳为18s进行作差,得到时间差值10s。由于媒体分片3与流媒体中最新一帧的时间戳之间的时间差值大于延时阈值8s,此时,该启播分片3将作为目标启播分片。
同样的,若各启播分片中不存在媒体分片的开始时间与流媒体中最新一帧的时间戳之间的时间差值大于延时阈值的启播分片,则服务器将各启播分片中开始时间最早的启播分片作为目标启播分片。
通过上述按照启播分片中各媒体分片的开始时间进行遍历的方式,服务器能够快速确定满足延时阈值的目标启播分片。而后续的,服务器还将随着流媒体各帧的编码完成,对目标启播分片进行实时更新,以保证服务器当前选出的目标启播分片是满足延时阈值的,即服务器根据流媒体最新一帧的时间戳,对所述目标启播分片进行更新。
再后,参见图5所示的,由于服务器中实时预存有满足延时阈值的目标启播分片,当服务器接收到终端发送的直播启播请求之后,服务器可直接将该目标启播分片下发给终端,以供终端利用目标启播分片中的MPD文件、初始化分片和目标媒体分片对首帧画面进行渲染播放。
这样的方式能够进一步提升服务器对于直播启播请求的响应效率,从而实现终端对首帧的快速渲染播放。
本公开实施方式提供的方法,通对在DASH协议的基础上,对直播启播流程进行改进,以使得终端仅需发起一次启播请求即可实现对首帧的渲染播放,有效降低了启播时间,提升用户体验。
在前述实施方式的基础上,图6为本公开实施例提供的另一种直播启播方法的流程示意图。如图6所示的,该直播启播方法可以包括如下几个步骤:
步骤601、向服务器发送流媒体的直播启播请求。
步骤602、接收服务器返回的启播分片;其中,启播分片是服务器根据预设的延时阈值确定的;启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片。
步骤603、利用启播分片对流媒体的首帧画面进行渲染和播放。
具体的,对于流媒体来说,其应为流媒体的提供用户上传至服务器中的,其媒体形式包括但不限于:视频媒体、音频媒体。而本实施方式中所提及的终端具体可为图2所示的第二终端,即点播用户所使用的终端。
用户可通过使用该终端发起对流媒体的点播操作,终端会根据点播操作生成相应的直播启播请求,并将该直播启播请求发送至服务器。
当用户将直播启播请求发送至服务器之后,服务器将会按照前述实施方式提供的方法对该直播启播请求进行响应,并将包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片的下发至终端,以供终端渲染播放。
可选实施例中,启播分片包括MP4格式文件。
其中,服务器对直播启播请求的响应过程可参见前述实施方式,本实施方式对此不进行赘述。
本实施方式中,终端仅需发送一次直播启播请求之后,即可获得包括有MPD文件、初始化分片以及与延时阈值对应的媒体分片的启播分片,从而降低了启播所需要的时间,提升用户体验。
由于本公开实施方式中的延时阈值是由服务器预设的,为了能够便于终端后续会流媒体的下一帧的数据进行请求,在可选实施方式中,启播分片还包括所述媒体分片的分片序号和所述媒体分片的开始时间;而方法还包括:根据所述媒体分片的分片序号和所述媒体分片的开始时间,生成所述流媒体的下一帧的获取请求;将所述下一帧的获取请求发送至所述服务器。
通过在启播分片中携带媒体分片的开始时间和分片序号等相关信息,终端可利用该信息推算出下一帧的媒体分片的分片序号,从而可直接向服务器请求下一帧媒体分片,进而提升下一帧的获取效率。
本公开实施方式提供的方法,通对在DASH协议的基础上,对直播启播流程进行改进,以使得终端仅需发起一次启播请求即可实现对首帧的渲染播放,有效降低了启播时间,提升用户体验。
对应于上文实施例的视频特效处理方法,图7为本公开实施例提供的直播启播装置的结构框图。为了便于说明,仅示出了与本公开实施例相关的部分。参照图7,直播启播装置,应用于服务器,其包括:
第一收发模块701,用于接收终端发起的对流媒体的直播启播请求;
启播分片确定模块702,用于根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
第一收发模块701,还用于将启播分片发送至终端,启播分片用于在终端进行直播启播时渲染得到直播的首帧画面。
可选的,所述启播分片还包括:所述媒体分片的分片序号和所述媒体分片的开始时间;其中,所述媒体分片的分片序号和所述媒体分片的开始时间用于生成所述终端对下一帧的获取请求。
可选的,启播分片确定模块702,具体用于:
根据流媒体中各帧的时间戳对所述流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;根据预设的延时阈值,选出与所述延时阈值对应的目标媒体分片;根据所述MPD文件、所述初始化分片和所述目标媒体分片,生成所述启播分片。
可选的,启播分片确定模块702,具体用于:
根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片;判断所述待处理媒体分片的开始时间与所述流媒体中最新一帧的时间戳之间的时间差值,是否大于所述延时阈值;若是,则将该待处理媒体分片作为所述目标媒体分片;若否,则返回所述根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片的步骤。
可选的,若所述各媒体分片中不存在开始时间与所述流媒体中最新一帧的时间戳之间的时间差值大于所述延时阈值的媒体分片,则启播分片确定模块702还用于将各媒体分片中开始时间最早的媒体分片作为所述目标媒体分片。
可选的,启播分片确定模块702具体用于:
根据流媒体中各帧的时间戳对所述流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;根据各媒体分片生成多个启播分片;其中,不同启播分片中包括所述MPD文件、所述初始化分片以及不同的媒体分片;根据预设的延时阈值,在各启播分片中选出目标启播分片;将所述目标启播分片作为发送至所述终端的所述启播分片。
可选的,启播分片确定模块702,具体用于:
根据预设的延时阈值,选出与所述延时阈值对应的目标媒体分片;所述目标媒体分片对应的启播分片作为所述目标启播分片。
可选的,启播分片确定模块702,还用于:
根据所述流媒体最新一帧的时间戳,对所述目标启播分片进行更新。
可选的,所述启播分片包括MP4格式文件。
本公开实施方式提供的装置,通过在DASH协议的基础上,对直播启播流程进行改进,以使得终端仅需发起一次启播请求即可实现对首帧的渲染播放,有效降低了启播时间,提升用户体验。
对应于上文实施例的视频特效处理方法,图8为本公开实施例提供的另一直播启播装置的结构框图。为了便于说明,仅示出了与本公开实施例相关的部分。参照图8,直播启播装置,应用于终端,其包括:
第二收发模块801,用于向服务器发送流媒体的直播启播请求;
第二收发模块801,还用于接收服务器返回的启播分片;其中,启播分片是服务器根据预设的延时阈值确定的;启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
播放模块802,用于利用启播分片对流媒体的首帧画面进行渲染和播放。
可选的,启播分片包括MP4格式文件。
可选的,启播分片还包括媒体分片的分片序号和媒体分片的开始时间;
第二收发模块801,还用于:
根据媒体分片的分片序号和媒体分片的开始时间,生成流媒体的下一帧的获取请求;将下一帧的获取请求发送至服务器。
本公开实施方式提供的装置,通过在DASH协议的基础上,对直播启播流程进行改进,以使得终端仅需发起一次启播请求即可实现对首帧的渲染播放,有效降低了启播时间,提升用户体验。
本实施例提供的电子设备,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。
参考图9,其示出了适于用来实现本公开实施例的电子设备900的结构示意图,该电子设备900可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式流媒体播放器(Portable Media Player,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV(电视)、台式计算机等等的固定终端。图9示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图9所示,电子设备900可以包括处理装置(例如中央处理器、图形处理器等)901,其可以根据存储在只读存储器(Read Only Memory,简称ROM)902中的程序或者从存储装置908加载到随机访问存储器(Random Access Memory,简称RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有电子设备900操作所需的各种程序和数据。处理装置901、ROM 902以及RAM 903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。
通常,以下装置可以连接至I/O接口905:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置906;包括例如液晶显示器(Liquid Crystal Display,简称LCD)、扬声器、振动器等的输出装置907;包括例如磁带、硬盘等的存储装置908;以及通信装置909。通信装置909可以允许电子设备900与其他设备进行无线或有线通信以交换数据。虽然图9示出了具有各种装置的电子设备900,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置909从网络上被下载和安装,或者从存储装置908被安装,或者从ROM 902被安装。在该计算机程序被处理装置901执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意 以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或媒体库上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,简称LAN)或广域网(Wide Area Network,简称WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
本实施例提供的一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行如前任一项所述的方法,其实现原理和技术效果类似,本实施例此处不再赘述。
本实施例提供的一种计算机程序,该计算机程序被处理器执行如前任一项所述的方法,其实现原理和技术效果类似,本实施例此处不再赘述。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
以下是本公开的一些实施例。
第一方面,根据本公开的一个或多个实施例,一种直播启播方法,该方法应用于服务器;该方法包括:
接收终端发起的对流媒体的直播启播请求;
根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
将启播分片发送至终端,启播分片用于在终端进行直播启播时渲染得到直播的首帧画面。
可选的,启播分片还包括:媒体分片的分片序号和媒体分片的开始时间;其中,媒体分片的分片序号和媒体分片的开始时间用于生成终端对下一帧的获取请求。
可选的,根据预设的延时阈值,确定启播分片,包括:
根据流媒体中各帧的时间戳对流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;根据预设的延时阈值,选出与延时阈值对应的目标媒体分片;根据MPD文件、初始化分片和目标媒体分片,生成启播分片。
可选的,根据预设的延时阈值,选出与延时阈值对应的目标媒体分片,包括:
根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片;判断待处理媒体分片的开始时间与流媒体中最新一帧的时间戳之间的时间差值,是否大于延时阈值;若是,则将该待处理媒体分片作为目标媒体分片;若否,则返回根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片的步骤。
可选的,若各媒体分片中不存在开始时间与流媒体中最新一帧的时间戳之间的时间差值大于延时阈值的媒体分片,则方法还包括:将各媒体分片中开始时间最早的媒体分片作为目标媒体分片。
可选的,该方法还包括:
根据流媒体中各帧的时间戳对流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;根据各媒体分片生成多个启播分片;其中,不同启播分片中包括媒体演示描述MPD文件、初始化分片以及不同的媒体分片;根据预设的延时阈值,在各启播分片中选出目标启播分片;
根据预设的延时阈值,确定启播分片,包括:将目标启播分片作为发送至终端的启播分片。
可选的,根据预设的延时阈值,在各启播分片中选出目标启播分片,包括:根据预设的延时阈值,选出与延时阈值对应的目标媒体分片;目标媒体分片对应的启播分片作为目标启播分片。
可选的,该方法还包括:根据流媒体最新一帧的时间戳,对目标启播分片进行更新。
可选的,启播分片包括MP4格式文件。
第二方面,根据本公开的一个或多个实施例,一种直播启播方法,该方法应用于终端;该方法包括:
向服务器发送流媒体的直播启播请求;接收服务器返回的启播分片;其中,启播分片是服务器根据预设的延时阈值确定的;启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;利用启播分片对流媒体的首帧画面进行渲染和播放。
可选的,启播分片包括MP4格式文件。
可选的,启播分片还包括媒体分片的分片序号和媒体分片的开始时间;该方法还包括:根据媒体分片的分片序号和媒体分片的开始时间,生成流媒体的下一帧的获取请求;将下一帧的获取请求发送至服务器。
第三方面,根据本公开的一个或多个实施例,一种直播启播装置,该装置应用于服务器,包括:
第一收发模块,用于接收终端发起的对流媒体的直播启播请求;
启播分片确定模块,用于根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
第一收发模块,还用于将启播分片发送至终端,启播分片用于在终端进行直播启播时渲染得到直播的首帧画面。
可选的,所述启播分片还包括:所述媒体分片的分片序号和所述媒体分片的开始时间;其中,所述媒体分片的分片序号和所述媒体分片的开始时间用于生成所述终端对下一帧的获取请求。
可选的,启播分片确定模块,具体用于:
根据流媒体中各帧的时间戳对所述流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;根据预设的延时阈值,选出与所述延时阈值对应的目标媒体分片;根据所述MPD文件、所述初始化分片和所述目标媒体分片,生成所述启播分片。
可选的,启播分片确定模块,具体用于:
根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片;判断所述待处理媒体分片的开始时间与所述流媒体中最新一帧的时间戳之间的时间差值,是否大于所述延时阈值;若是,则将该待处理媒体分片作为所述目标媒体分片;若否,则返回所述根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片的步骤。
可选的,若所述各媒体分片中不存在开始时间与所述流媒体中最新一帧的时间戳之间的时间差值大于所述延时阈值的媒体分片,则启播分片确定模块还用于将各媒体分片中开始时间最早的媒体分片作为所述目标媒体分片。
可选的,启播分片确定模块具体用于:
根据流媒体中各帧的时间戳对所述流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;根据各媒体分片生成多个启播分片;其中,不同启播分片中包括所述MPD文件、所述初始化分片以及不同的媒体分片;根据预设的延时阈值,在各启播分片中选出目标启播分片;将所述目标启播分片作为发送至所述终端的所述启播分片。
可选的,启播分片确定模块,具体用于:
根据预设的延时阈值,选出与所述延时阈值对应的目标媒体分片;所述目标媒体分片对应的启播分片作为所述目标启播分片。
可选的,启播分片确定模块,还用于:
根据所述流媒体最新一帧的时间戳,对所述目标启播分片进行更新。
可选的,所述启播分片包括MP4格式文件。
第四方面,根据本公开的一个或多个实施例,一种直播启播装置,该装置应用于终端,包括:
第二收发模块,用于向服务器发送流媒体的直播启播请求;
第二收发模块,还用于接收服务器返回的启播分片;其中,启播分片是服务器根据预设的延时阈值确定的;启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;
播放模块用于利用启播分片对流媒体的首帧画面进行渲染和播放。
可选的,启播分片包括MP4格式文件。
可选的,启播分片还包括媒体分片的分片序号和媒体分片的开始时间;
第二收发模块,还用于:
根据媒体分片的分片序号和媒体分片的开始时间,生成流媒体的下一帧的获取请求;将下一帧的获取请求发送至服务器。
第五方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个处理器和存储器;
所述存储器存储计算机执行指令;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如前任一项所述方法。
第六方面,根据本公开的一个或多个实施例,一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如前任一项所述方法。
第七方面,根据本公开的一个或多个实施例,一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行如前任一项所述方法。
第八方面,根据本公开的一个或多个实施例,一种计算机程序,其中,该计算机程序被处理器执行如前任一项所述方法。
本公开实施例提供了一种直播启播方法、装置、设备、存储介质、程序产品及程序,其中,服务器将接收终端发起的对流媒体的直播启播请求,并根据预设的延时阈值,确定启播分片;其中,启播分片包括媒体演示描述MPD文件、初始化分片、与延时阈值对应的媒体分片;终端将接收到服务器发送的启播分片并利用该启播分片渲染得到流媒体直播的首帧画面。本公开实施方式提供的方法,通对在DASH协议的基础上,对直播启播流程进行改进,以使得终端仅需发起一次启播请求即可实现对首帧的渲染播放,有效降低了启播时间,提升用户体验。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (18)

  1. 一种直播启播方法,所述方法应用于服务器;
    所述方法包括:
    接收终端发起的对流媒体的直播启播请求;
    根据预设的延时阈值,确定启播分片;其中,所述启播分片包括媒体演示描述MPD文件、初始化分片、与所述延时阈值对应的媒体分片;
    将所述启播分片发送至所述终端,所述启播分片用于在所述终端进行直播启播时渲染得到所述直播的首帧画面。
  2. 根据权利要求1所述的方法,其中,所述启播分片还包括:所述媒体分片的分片序号和所述媒体分片的开始时间;
    其中,所述媒体分片的分片序号和所述媒体分片的开始时间用于生成所述终端对下一帧的获取请求。
  3. 根据权利要求1或2所述的方法,其中,所述根据预设的延时阈值,确定启播分片,包括:
    根据流媒体中各帧的时间戳对所述流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;
    根据预设的延时阈值,选出与所述延时阈值对应的目标媒体分片;
    根据所述MPD文件、所述初始化分片和所述目标媒体分片,生成所述启播分片。
  4. 根据权利要求3所述的方法,其中,所述根据预设的延时阈值,选出与所述延时阈值对应的目标媒体分片,包括:
    根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片;
    判断所述待处理媒体分片的开始时间与所述流媒体中最新一帧的时间戳之间的时间差值,是否大于所述延时阈值;
    若大于所述延时阈值,则将该待处理媒体分片作为所述目标媒体分片;
    若不大于所述延时阈值,则返回所述根据各媒体分片的开始时间,从未被选取的各媒体分片中选出开始时间最晚的媒体分片作为待处理媒体分片的步骤。
  5. 根据权利要求4所述的方法,其中,若所述各媒体分片中不存在开始时间与所述流媒体中最新一帧的时间戳之间的时间差值大于所述延时阈值的媒体分片,则所述方法还包括:
    将各媒体分片中开始时间最早的媒体分片作为所述目标媒体分片。
  6. 根据权利要求1或2所述的方法,其中,还包括:
    根据流媒体中各帧的时间戳对所述流媒体进行分片处理,得到具有相同分片时间的连续的多个媒体分片;
    根据各媒体分片生成多个启播分片;其中,不同启播分片中包括所述MPD文件、所述初始化分片以及不同的媒体分片;
    根据预设的延时阈值,在各启播分片中选出目标启播分片;
    所述根据预设的延时阈值,确定启播分片,包括:
    将所述目标启播分片作为发送至所述终端的所述启播分片。
  7. 根据权利要求6所述的方法,其中,所述根据预设的延时阈值,在各启播分片中选出目标启播分片,包括:
    根据预设的延时阈值,选出与所述延时阈值对应的目标媒体分片;
    所述目标媒体分片对应的启播分片作为所述目标启播分片。
  8. 根据权利要求7所述的方法,其中,还包括:
    根据所述流媒体最新一帧的时间戳,对所述目标启播分片进行更新。
  9. 根据权利要求1-8任一项所述的方法,其中,所述启播分片包括MP4格式文件。
  10. 一种直播启播方法,所述方法应用于终端;
    所述方法包括:
    向服务器发送流媒体的直播启播请求;
    接收所述服务器返回的启播分片;其中,所述启播分片是所述服务器根据预设的延时阈值确定的;所述启播分片包括媒体演示描述MPD文件、初始化分片、与所述延时阈值对应的媒体分片;
    利用所述启播分片对所述流媒体的首帧画面进行渲染和播放。
  11. 根据权利要求10所述的方法,其中,所述启播分片包括MP4格式文件。
  12. 根据权利要求10或11所述的方法,其中,所述启播分片还包括所述媒体分片的分片序号和所述媒体分片的开始时间;
    所述方法还包括:
    根据所述媒体分片的分片序号和所述媒体分片的开始时间,生成所述流媒体的下一帧的获取请求;
    将所述下一帧的获取请求发送至所述服务器。
  13. 一种直播启播装置,所述装置应用于服务器;所述装置包括:
    第一收发模块,用于接收终端发起的对流媒体的直播启播请求;
    启播分片确定模块,用于根据预设的延时阈值,确定启播分片;其中,所述启播分片包括媒体演示描述MPD文件、初始化分片、与所述延时阈值对应的媒体分片;
    所述第一收发模块,还用于将所述启播分片发送至所述终端,所述启播分片用于在所述终端进行直播启播时渲染得到所述直播的首帧画面。
  14. 一种直播启播装置,所述装置应用于终端;所述装置包括:
    第二收发模块,用于向服务器发送流媒体的直播启播请求;
    所述第二收发模块,还用于接收所述服务器返回的启播分片;其中,所述启播分片是所述服务器根据预设的延时阈值确定的;所述启播分片包括媒体演示描述MPD文件、初始化分片、与所述延时阈值对应的媒体分片;
    播放模块,用于利用所述启播分片对所述流媒体的首帧画面进行渲染和播放。
  15. 一种电子设备,其中,包括:
    至少一个处理器;以及
    存储器;
    所述存储器存储计算机执行指令;
    所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如权利要求1-12任一项所述方法。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1-12任一项所述方法。
  17. 一种计算机程序产品,包括计算机指令,其中,所述计算机指令被处理器执行时实现如权利要求1-12任一项所述方法。
  18. 一种计算机程序,其中,所述计算机程序在被处理器执行时实现如权利要求1-12任一项所述方法。
PCT/CN2023/081180 2022-03-21 2023-03-13 直播启播方法、设备及程序产品 WO2023179404A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210279320.XA CN114630157A (zh) 2022-03-21 2022-03-21 直播启播方法、设备及程序产品
CN202210279320.X 2022-03-21

Publications (1)

Publication Number Publication Date
WO2023179404A1 true WO2023179404A1 (zh) 2023-09-28

Family

ID=81904473

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/081180 WO2023179404A1 (zh) 2022-03-21 2023-03-13 直播启播方法、设备及程序产品

Country Status (2)

Country Link
CN (1) CN114630157A (zh)
WO (1) WO2023179404A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114630157A (zh) * 2022-03-21 2022-06-14 北京字节跳动网络技术有限公司 直播启播方法、设备及程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120166667A1 (en) * 2010-12-22 2012-06-28 Edward Hall Streaming media
CN107147919A (zh) * 2017-06-19 2017-09-08 网宿科技股份有限公司 直播快速启播方法及系统
CN109756755A (zh) * 2017-11-02 2019-05-14 华为技术有限公司 一种媒体播放方法,装置和系统
CN112671694A (zh) * 2019-10-16 2021-04-16 中兴通讯股份有限公司 一种hls播放方法、客户端、服务器及存储介质
CN114630157A (zh) * 2022-03-21 2022-06-14 北京字节跳动网络技术有限公司 直播启播方法、设备及程序产品

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101500142A (zh) * 2008-01-31 2009-08-05 华为技术有限公司 媒体内容分片方法、提供媒体内容的方法、设备及系统
US20170150206A1 (en) * 2015-11-24 2017-05-25 Le Holdings (Beijing) Co., Ltd. Online video player and its method
US20170289599A1 (en) * 2016-03-30 2017-10-05 Le Holdings(Beijing)Co., Ltd. Live broadcast delaying method and apparatus
CN105828107A (zh) * 2016-03-30 2016-08-03 乐视控股(北京)有限公司 一种直播延时方法及装置
CN113794898B (zh) * 2021-08-13 2023-03-07 网宿科技股份有限公司 Dash媒体流传输方法、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120166667A1 (en) * 2010-12-22 2012-06-28 Edward Hall Streaming media
CN107147919A (zh) * 2017-06-19 2017-09-08 网宿科技股份有限公司 直播快速启播方法及系统
CN109756755A (zh) * 2017-11-02 2019-05-14 华为技术有限公司 一种媒体播放方法,装置和系统
CN112671694A (zh) * 2019-10-16 2021-04-16 中兴通讯股份有限公司 一种hls播放方法、客户端、服务器及存储介质
CN114630157A (zh) * 2022-03-21 2022-06-14 北京字节跳动网络技术有限公司 直播启播方法、设备及程序产品

Also Published As

Publication number Publication date
CN114630157A (zh) 2022-06-14

Similar Documents

Publication Publication Date Title
WO2020253806A1 (zh) 展示视频的生成方法、装置、设备及存储介质
CN110708602A (zh) 视频启动方法、装置、电子设备及存储介质
WO2023284437A1 (zh) 媒体文件处理方法、装置、设备、可读存储介质及产品
WO2024104307A1 (zh) 直播视频流渲染方法、装置、设备、存储介质及产品
CN110519645B (zh) 视频内容的播放方法、装置、电子设备及计算机可读介质
GB2589731A (en) Video processing method and apparatus, terminal and medium
CN110290398B (zh) 视频下发方法、装置、存储介质及电子设备
WO2023165371A1 (zh) 音频播放方法、装置、电子设备及存储介质
WO2023179404A1 (zh) 直播启播方法、设备及程序产品
WO2023045973A1 (zh) 直播礼物云渲染方法、装置、电子设备及存储介质
WO2023103889A1 (zh) 视频处理方法、装置、电子设备及存储介质
US20220269714A1 (en) Multimedia information processing method, apparatus, electronic device, and medium
CN109582274B (zh) 音量调节方法、装置、电子设备及计算机可读存储介质
WO2024046284A1 (zh) 绘制动画生成方法、装置、设备、可读存储介质及产品
WO2024094130A1 (zh) 内容分享方法、装置、设备、计算机可读存储介质及产品
WO2023116480A1 (zh) 多媒体内容的发布方法、装置、设备、介质和程序产品
WO2023035879A1 (zh) 自由视角视频的视角切换方法、装置、系统、设备和介质
WO2023273615A1 (zh) 媒体文件处理方法、装置、设备、可读存储介质及产品
WO2022242482A1 (zh) 播放控制方法、设备、存储介质及程序产品
WO2022183922A1 (zh) 视频的自适应播放方法及设备
WO2022134997A1 (zh) 视频跳转播放方法、装置、终端设备及存储介质
US20240195937A1 (en) Method, device, storage medium and program product for video recording
US20240007591A1 (en) Method and apparatus of interaction video connection, electronic device, and storage medium
WO2023226757A1 (zh) 视频缓存方法、装置、设备及存储介质
WO2023197811A1 (zh) 视频下载、传输方法、装置、终端设备、服务器及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23773652

Country of ref document: EP

Kind code of ref document: A1