CN110740342B - Storage medium, streaming media transmission and playing method, and slicing method and device - Google Patents

Storage medium, streaming media transmission and playing method, and slicing method and device Download PDF

Info

Publication number
CN110740342B
CN110740342B CN201910844044.5A CN201910844044A CN110740342B CN 110740342 B CN110740342 B CN 110740342B CN 201910844044 A CN201910844044 A CN 201910844044A CN 110740342 B CN110740342 B CN 110740342B
Authority
CN
China
Prior art keywords
streaming media
last
fragment
information
fragments
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910844044.5A
Other languages
Chinese (zh)
Other versions
CN110740342A (en
Inventor
曾生锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201910844044.5A priority Critical patent/CN110740342B/en
Publication of CN110740342A publication Critical patent/CN110740342A/en
Application granted granted Critical
Publication of CN110740342B publication Critical patent/CN110740342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • 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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • 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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Abstract

The application discloses a transmission method of streaming media, which comprises the following steps: acquiring fragmentation information of the streaming media; carrying out fragmentation processing on the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information; transmitting or receiving the streaming media fragments according to the sequence indicated by the fragment information; the streaming media after the fragmentation processing comprises a last streaming media fragment and a plurality of non-last streaming media fragments, and the time length of the last streaming media fragment is longer than that of the non-last streaming media fragment. The application also discloses a streaming media transmission device and a computer readable storage medium. Through the mode, the streaming media can be prevented from being abnormally played.

Description

Storage medium, streaming media transmission and playing method, and slicing method and device
Technical Field
The present invention relates to the technical field of streaming media playing, and in particular, to a computer-readable storage medium, a streaming media transmission method, a fragmentation information generation method, a streaming media playing method and an apparatus.
Background
The hls (http Live streaming) is a streaming media network transport protocol based on http protocol (Hypertext transfer protocol), and has the advantages of being simple and adaptive, being capable of realizing plug-in-free playing, and the like, and is one of the most widely used network transport protocols in the world at present, and is particularly suitable for the field of mobile internet streaming.
When the HLS Protocol is used in a scenario where an on-demand stream source is an RTSP (Real Time Streaming Protocol) or RTMP (Real Time Messaging Protocol), the current scheme cannot accurately generate an M3U8 list, and the number of actual slices is inconsistent with that described in the M3U8 list that has been returned to the client, which causes that a fragment of a play terminal cannot be requested completely, thereby causing a problem that the play of the play terminal is abnormal.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a computer-readable storage medium, a streaming media transmission method, a fragment information generation method, a streaming media playing method and a streaming media playing device, which can reduce the time delay during live video playing.
In order to solve the above technical problem, one technical solution adopted in the embodiments of the present application is: a transmission method of streaming media is provided, and the transmission method comprises the following steps: acquiring fragmentation information of the streaming media; carrying out fragmentation processing on the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information; transmitting or receiving the streaming media fragments according to the sequence indicated by the fragment information; the streaming media after the fragmentation processing comprises a last streaming media fragment and a plurality of non-last streaming media fragments, and the time length of the last streaming media fragment is longer than that of the non-last streaming media fragment.
Wherein, the time lengths of a plurality of non-last streaming media fragments are equal.
The time lengths of a plurality of non-last streaming media fragments all satisfy the following formula: t = n × tgop(ii) a Wherein t is the duration of the non-last streaming media segment, n is a positive integer, and t isgopIs the key frame time interval of the streaming media.
The time length of the last streaming media fragment satisfies the following formula: t is tlast=N×tgop + T% T; wherein, tlastThe time length of the last streaming media fragment, N is a positive integer and N>n and T are the total duration of the streaming media.
Wherein n is more than or equal to 1 and less than or equal to 3.
Before the step of obtaining the fragmentation information of the streaming media, the method comprises the following steps: receiving a streaming media playing request of a terminal; sending a request for information on the streaming media to the source station; receiving information of streaming media fed back by a source station; analyzing the duration of the streaming media from the streaming media information; the step of acquiring the fragmentation information of the streaming media comprises the following steps: and acquiring the fragment information of the streaming media according to the duration of the streaming media.
Wherein t is less than or equal to 10 secondslastLess than or equal to 60 seconds.
After the step of fragmenting the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information, the method comprises the following steps: and sending the fragment information to the terminal to allow the terminal to download and play the plurality of streaming media fragments according to the sequence indicated by the fragment information.
In order to solve the above technical problem, another technical solution adopted in the embodiment of the present application is: a method for generating fragmentation information is provided, the method comprising: acquiring related information of streaming media; generating fragmentation information of the streaming media according to the related information of the streaming media and a preset fragmentation algorithm, and storing the fragmentation information; the preset fragmentation algorithm is configured to divide the streaming media into a last streaming media fragment and a plurality of non-last streaming media fragments, wherein the time length of the last streaming media fragment is greater than the time length of the non-last streaming media fragment; the fragment information is used for processing the streaming media into a plurality of streaming media fragments, indicating the sequence of transmitting, receiving or playing the streaming media fragments, and indicating the duration of each streaming media fragment.
The preset fragmentation algorithm comprises the following steps: the time lengths of a plurality of non-last streaming media fragments are equal.
Wherein, the related information of the streaming media comprises the key frame time interval of the streaming media;
the preset slicing algorithm comprises the following steps: t = n × tgop
Wherein t is the duration of the non-last streaming media segment, n is a positive integer, and t isgopIs the key frame time interval of the streaming media.
Wherein, the related information of the streaming media comprises the total duration of the streaming media;
the preset slicing algorithm comprises the following steps: t is tlast=N×tgop +T%t;
Wherein, tlastThe time length of the last streaming media fragment, N is a positive integer and N>n and T are the total duration of the streaming media.
In order to solve the above technical problem, another technical solution adopted in the embodiment of the present application is: a method for playing streaming media is provided, and the method for playing the streaming media comprises the following steps: receiving fragmentation information of the streaming media, wherein the fragmentation information is used for fragmenting the streaming media into a plurality of streaming media fragments, indicating the sequence of sending, receiving or playing the plurality of streaming media fragments, and indicating the duration of each streaming media fragment; downloading and playing a plurality of streaming media fragments according to the sequence indicated by the fragment information; the streaming media after the fragmentation processing comprises a last streaming media fragment and a plurality of non-last streaming media fragments, and the time length of the last streaming media fragment is longer than that of the non-last streaming media fragment.
Wherein, the time lengths of a plurality of non-last streaming media fragments are equal.
The time lengths of a plurality of non-last streaming media fragments all satisfy the following formula: t = n × tgop
Wherein t is the duration of the non-last streaming media segment, n is a positive integer, and t isgopIs the key frame time interval of the streaming media.
The time length of the last streaming media fragment satisfies the following formula: t is tlast=N×tgop +T%t;
Wherein, tlastThe time length of the last streaming media fragment, N is a positive integer and N>n and T are the total duration of the streaming media.
In order to solve the above technical problem, another technical solution adopted in the embodiment of the present application is: there is provided a streaming media delivery device comprising a processor and a memory electrically connected to the processor, the memory for storing a computer program, the processor for invoking the computer program to perform the above method.
In order to solve the above technical problem, another technical solution adopted in the embodiments of the present application is: there is provided a computer readable storage medium for storing a computer program that can be invoked to perform the above-described method.
The embodiment of the application acquires the fragment information of the streaming media; carrying out fragmentation processing on the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information; transmitting or receiving the streaming media fragments according to the sequence indicated by the fragment information; the streaming media after the fragmentation processing comprises the last streaming media fragment and a plurality of non-last streaming media fragments, the time length of the last streaming media fragment is longer than that of the non-last streaming media fragment, and the problem that the playing abnormality occurs because some last fragments of the playing terminal cannot be requested due to the fact that the number of fragments actually cut out is inconsistent with the list information which is informed to the playing terminal due to the fact that the key frame interval of an actual code stream is not uniform can be reduced to the maximum probability.
Drawings
Fig. 1 is a schematic flow chart of a streaming media transmission method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for generating fragmentation information according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a playing method of streaming media according to an embodiment of the present application;
fig. 4 is a schematic hardware structure diagram of a streaming media transmission device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second", etc. in this application are used to distinguish between different objects and not to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a streaming media transmission method according to an embodiment of the present application.
In this embodiment, the streaming media transmission method may include the following steps:
step S101: and acquiring the fragment information of the streaming media.
In this embodiment, the execution subject of the streaming media transmission method may be a server. Such as HLS servers. The step of obtaining the fragmentation information of the streaming media may include: the server receives a streaming media playing request of the terminal; the server sends a request for information of the streaming media to the source station; the server receives the information of the streaming media fed back by the source station; and analyzing the time length T of the streaming media from the streaming media information.
In one example, the request for information of the streaming media may be an RTSP request or an RTMP request. The information of the streaming media may be SDP information or metadata information. When a terminal requests to request an HLS server to order a certain streaming media, the HLS server first sends an RTSP request to a source station to obtain SDP (Session Description Protocol) information, or sends an RTMP request to obtain Metadata information (Metadata), then parses the SDP information or the Metadata information to obtain a playing time T of the streaming media, and then generates an M3U8 list (containing fragment information) of the streaming media according to the playing time T and a predetermined slicing rule and returns the M3U8 list to the terminal. By the above mode, when the playing request is received, the playing duration T of the actual streaming media resource is obtained from the source station, and the situation that the list fed back to the terminal is inconsistent with the cut fragment is avoided as much as possible.
The terminal may be an electronic device with a playing function, such as a smart phone, a tablet computer, a desktop computer, a notebook computer, and so on.
The streaming media may be audio or video.
The predetermined slicing rule at least satisfies that the streaming media after the slicing processing comprises the last streaming media slice and a plurality of non-last streaming media slices, and the duration of the last streaming media slice is longer than the duration of the non-last streaming media slices. The time length of the last streaming media fragment is set to be relatively long, so that the deviation problem of the actual code stream caused by uneven key frame intervals during actual slicing can be buffered, the actual fragment number is ensured to be consistent with that described by the M3U8 list fed back to the playing terminal at the maximum probability, and the terminal can normally play the streaming media resource.
Optionally, the predetermined slicing rule further satisfies that the time lengths of a plurality of non-last streaming media slices after the slicing processing are equal, so that the HLS on-demand dragging precision can be ensured.
In one embodiment, the time durations of the plurality of non-last streaming media segments all satisfy the following formula: t = n × tgop(ii) a Wherein t is the duration of the non-last streaming media segment, n is a positive integer, and t isgopIs a key frame (i.e., I-frame) time interval of the streaming media.
In one embodiment, the duration of the last streaming media segment satisfies the following formula: t is tlast=N×tgop + T% T; wherein, tlastThe time length of the last streaming media fragment, N is a positive integer and N>n and T are the total duration of the streaming media.
Alternatively, 1 ≦ n ≦ 3. In this embodiment, the duration of each slice is not suitable for too long, and each slice has 1-3 key frame time intervals (t)gop) The time length is long, so that the HLS on-demand dragging precision can be ensured.
Alternatively, 10 seconds ≦ tlastLess than or equal to 60 seconds, thereby ensuring HLS pointAnd (5) playing and dragging precision.
Wherein, the fragmentation information further includes the total fragmentation number, i.e. the total number of the streaming media fragments. The total number of slices satisfies the following formula: num = (T-T)last)/t+1。
Optionally, N is more than or equal to 1 and less than or equal to N and N is a value slightly larger than N, so that the HLS on-demand dragging precision can be ensured.
Step S102: and carrying out fragmentation processing on the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information.
Step S103: and sending or receiving the streaming media fragments according to the sequence indicated by the fragment information, wherein the streaming media after fragment processing comprises the last streaming media fragment and a plurality of non-last streaming media fragments, and the time length of the last streaming media fragment is longer than that of the non-last streaming media fragment.
After the step of fragmenting the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information, the method may include the following steps:
sending the fragment information to the terminal to allow the terminal to download and play the plurality of streaming media fragments according to the sequence indicated by the fragment information
In an application example, it is assumed that the playing time T of the streaming media resource is 31 seconds, and the key frame interval time T of the streaming media code streamgopFor 2 seconds, N in this embodiment is 1, N is 5, that is, the time duration t of the non-last streaming media segment is one gop time duration t =1 × 2=2 seconds, and the time duration t of the last segment is t =1 × 2 secondslast=5 × 2+31%2=11 seconds, and the total number of slices num = (31-11)/2+1=11 slices. Then, according to the slicing rule, 11 slices can be actually cut, the time length of the last slice is 11 seconds, the deviation problem existing in the actual slicing process caused by the fact that the key frame interval is not uniform in the actual code stream can be buffered, the actual number of the slices is ensured to be consistent with that described by the M3U8 list fed back to the playing terminal at the maximum probability, and the terminal can normally play the section of streaming media resources.
Further, the present application also provides a method for generating fragmentation information, please refer to fig. 2, and fig. 2 is a schematic flow diagram of a method for generating fragmentation information according to an embodiment of the present application.
In this embodiment, the method for generating the fragmentation information may include:
step S201: and acquiring related information of the streaming media.
Step S202: and generating the fragmentation information of the streaming media according to the related information of the streaming media and a preset fragmentation algorithm, and storing the fragmentation information.
The preset fragmentation algorithm is configured to divide the streaming media into a last streaming media fragment and a plurality of non-last streaming media fragments, wherein the time length of the last streaming media fragment is longer than the time length of the non-last streaming media fragment.
The fragment information is used for processing the streaming media into a plurality of streaming media fragments, indicating the sequence of transmitting, receiving or playing the streaming media fragments, and indicating the duration of each streaming media fragment.
The preset slicing algorithm comprises the following steps: the time lengths of a plurality of non-last streaming media fragments are equal.
The related information of the streaming media includes a key frame time interval of the streaming media.
The preset slicing algorithm comprises the following steps: t = n × tgop
Wherein t is the duration of the non-last streaming media segment, n is a positive integer, and t isgopIs the key frame time interval of the streaming media.
The related information of the streaming media includes a total duration of the streaming media.
The preset slicing algorithm comprises the following steps: t is tlast=N×tgop +T%t。
Wherein, tlastThe time length of the last streaming media fragment, N is a positive integer and N>n and T are the total duration of the streaming media.
Further, the present application also provides a method for playing streaming media, please refer to fig. 3, and fig. 3 is a schematic flow chart of the method for playing streaming media according to the embodiment of the present application.
In this embodiment, the method for playing streaming media may include:
step S301: receiving the slicing information of the streaming media.
The fragment information is used for fragmenting the streaming media into a plurality of streaming media fragments, indicating the sequence of transmitting, receiving or playing the streaming media fragments, and indicating the duration of each streaming media fragment.
Step S302: and downloading and playing the plurality of streaming media fragments according to the sequence indicated by the fragment information.
The streaming media after the fragmentation processing comprises a last streaming media fragment and a plurality of non-last streaming media fragments, and the time length of the last streaming media fragment is longer than that of the non-last streaming media fragment.
Wherein, the time lengths of a plurality of non-last streaming media fragments are equal.
The time lengths of a plurality of non-last streaming media fragments all satisfy the following formula: t = n × tgop
Wherein t is the duration of the non-last streaming media segment, n is a positive integer, and t isgopIs the key frame time interval of the streaming media.
The time length of the last streaming media fragment satisfies the following formula: t is tlast=N×tgop +T%t。
Wherein, tlastThe time length of the last streaming media fragment, N is a positive integer and N>n and T are the total duration of the streaming media.
Referring to fig. 4, fig. 4 is a schematic diagram of a hardware structure of a streaming media transmission device according to an embodiment of the present application.
In this embodiment, the streaming media transmission device may at least include a processor 21 and a memory 22 electrically connected to the processor 21, where the memory 22 is used to execute a computer program, and the processor 21 is used to call the computer program to execute the method of any one of the above embodiments.
In the embodiment of the present application, the streaming media transmission device may be a server, and for example, may be an HLS server. In other embodiments, other transmission devices may be used, and a transmission device that slices the transport stream media by using the method of the present application is within the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
Embodiments of the present invention also provide a computer-readable storage medium for storing a computer program, which can be executed by a processor to implement the method provided in the above embodiments. It is understood that the method executed by the computer program stored in the readable storage medium in this embodiment is similar to the method provided in the foregoing embodiments, and the principle and steps thereof are the same, and are not described herein again.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, which can store program codes.
The embodiment of the application acquires the fragment information of the streaming media; carrying out fragmentation processing on the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information; transmitting or receiving the streaming media fragments according to the sequence indicated by the fragment information; the streaming media after the fragmentation processing comprises the last streaming media fragment and a plurality of non-last streaming media fragments, the time length of the last streaming media fragment is longer than that of the non-last streaming media fragment, and the problem that the playing abnormality occurs because some last fragments of the playing terminal cannot be requested due to the fact that the number of fragments actually cut out is inconsistent with the list information which is informed to the playing terminal due to the fact that the key frame interval of an actual code stream is not uniform can be reduced to the maximum probability.
The above embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow charts using the contents of the specification and drawings of the present disclosure or those directly or indirectly applied to other related technical fields are intended to be included in the scope of the present disclosure.

Claims (9)

1. A transmission method of streaming media, the transmission method comprising:
acquiring fragmentation information of the streaming media;
according to the indication of the fragmentation information, the streaming media is fragmented into a plurality of streaming media fragments;
transmitting or receiving the streaming media fragments according to the sequence indicated by the fragment information;
the streaming media after fragmentation processing comprises a last streaming media fragment and a plurality of non-last streaming media fragments, and the time length of the last streaming media fragment is greater than that of the non-last streaming media fragment;
wherein the time lengths of the plurality of non-last streaming media segments are equal; the time lengths of the plurality of non-last streaming media fragments all satisfy the following formula: t = n × tgopN is a positive integer;
the time length of the last streaming media fragment satisfies the following formula: t is tlast=N×tgop+T%t;
Wherein t is the duration of the non-last streaming media segment, tgopIs a key frame time interval, t, of the streaming medialastThe time length of the last streaming media fragment is N is a positive integer>n and T are the total duration of the streaming media.
2. The transmission method according to claim 1, wherein 1. ltoreq. n.ltoreq.3.
3. The transmission method according to claim 1, wherein the step of obtaining the fragmentation information of the streaming media is preceded by:
receiving a playing request of the streaming media from a terminal;
sending a request for information of the streaming media to a source station;
receiving the information of the streaming media fed back by the source station;
analyzing the duration of the streaming media from the streaming media information;
the step of acquiring the fragmentation information of the streaming media comprises the following steps:
and acquiring the fragment information of the streaming media according to the duration of the streaming media.
4. Transmission method according to claim 1, characterised in that 10 seconds ≦ tlastLess than or equal to 60 seconds.
5. The transmission method according to claim 3, wherein the step of fragmenting the streaming media into a plurality of streaming media fragments according to the indication of the fragmentation information is followed by:
and sending the fragment information to the terminal to allow the terminal to download and play the plurality of streaming media fragments according to the sequence indicated by the fragment information.
6. A method for generating fragmentation information, the method comprising:
acquiring related information of streaming media;
generating fragmentation information of the streaming media according to the related information of the streaming media and a preset fragmentation algorithm, and storing the fragmentation information;
the preset fragmentation algorithm is configured to divide the streaming media into a last streaming media fragment and a plurality of non-last streaming media fragments, wherein the time duration of the last streaming media fragment is greater than the time duration of the non-last streaming media fragment;
the fragment information is used for carrying out fragment processing on the streaming media into a plurality of streaming media fragments, indicating the sequence of sending, receiving or playing the streaming media fragments, and indicating the duration of each streaming media fragment;
wherein the time lengths of the plurality of non-last streaming media segments are equal; the time lengths of the plurality of non-last streaming media fragments all satisfy the following formula: t = n × tgopN is a positive integer;
the time length of the last streaming media fragment satisfies the following formula: t is tlast=N×tgop+T%t;
Wherein t is the duration of the non-last streaming media segment, tgopIs a key frame time interval, t, of the streaming medialastThe time length of the last streaming media fragment is N is a positive integer>n and T are the total duration of the streaming media.
7. A method for playing streaming media is characterized in that the method for playing the streaming media comprises the following steps:
receiving fragmentation information of a streaming media, wherein the fragmentation information is used for fragmenting the streaming media into a plurality of streaming media fragments, indicating the sequence of sending, receiving or playing the streaming media fragments, and indicating the duration of each streaming media fragment;
downloading and playing the plurality of streaming media fragments according to the sequence indicated by the fragment information;
the streaming media after fragmentation processing comprises a last streaming media fragment and a plurality of non-last streaming media fragments, and the time length of the last streaming media fragment is greater than that of the non-last streaming media fragment;
wherein the time lengths of the plurality of non-last streaming media segments are equal; the time lengths of the plurality of non-last streaming media fragments all satisfy the following formula: t = n × tgopN is a positive integer;
the time length of the last streaming media fragment satisfies the following formula: t is tlast=N×tgop+T%t;
Wherein t is the duration of the non-last streaming media segment, tgopIs a key frame time interval, t, of the streaming medialastThe time length of the last streaming media fragment is N is a positive integer>n and T are the total duration of the streaming media.
8. A transmission device for streaming media, comprising a processor and a memory electrically connected to the processor, the memory being configured to store a computer program, and the processor being configured to invoke the computer program to perform the method of any one of claims 1 to 7.
9. A storage medium, characterized in that the storage medium stores a computer program executable to implement the method of any one of claims 1-7.
CN201910844044.5A 2019-09-06 2019-09-06 Storage medium, streaming media transmission and playing method, and slicing method and device Active CN110740342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910844044.5A CN110740342B (en) 2019-09-06 2019-09-06 Storage medium, streaming media transmission and playing method, and slicing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910844044.5A CN110740342B (en) 2019-09-06 2019-09-06 Storage medium, streaming media transmission and playing method, and slicing method and device

Publications (2)

Publication Number Publication Date
CN110740342A CN110740342A (en) 2020-01-31
CN110740342B true CN110740342B (en) 2022-02-18

Family

ID=69267528

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910844044.5A Active CN110740342B (en) 2019-09-06 2019-09-06 Storage medium, streaming media transmission and playing method, and slicing method and device

Country Status (1)

Country Link
CN (1) CN110740342B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102232298A (en) * 2011-04-07 2011-11-02 华为技术有限公司 Method, device and system for transmitting and processing media content
CN104602138A (en) * 2015-01-30 2015-05-06 青岛海信电器股份有限公司 Method and device for supporting HLS protocol by streaming media server
US9979926B1 (en) * 2015-06-09 2018-05-22 The Directv Group, Inc. Dynamic segment slicing for faster video playback
CN108260024A (en) * 2018-04-12 2018-07-06 腾讯科技(深圳)有限公司 Live data processing method, device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102843351B (en) * 2012-03-31 2016-01-27 华为技术有限公司 A kind of processing method of streaming media service, streaming media server and system
WO2017035783A1 (en) * 2015-09-01 2017-03-09 深圳好视网络科技有限公司 Streaming media transmission and play method, and transmission and play device
US20170280193A1 (en) * 2016-03-28 2017-09-28 Le Holdings(Beijing)Co., Ltd. Method and device for processing a streaming media file
CN107707937A (en) * 2017-09-22 2018-02-16 烽火通信科技股份有限公司 Time shift optimization method and system based on HLS protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102232298A (en) * 2011-04-07 2011-11-02 华为技术有限公司 Method, device and system for transmitting and processing media content
CN104602138A (en) * 2015-01-30 2015-05-06 青岛海信电器股份有限公司 Method and device for supporting HLS protocol by streaming media server
US9979926B1 (en) * 2015-06-09 2018-05-22 The Directv Group, Inc. Dynamic segment slicing for faster video playback
CN108260024A (en) * 2018-04-12 2018-07-06 腾讯科技(深圳)有限公司 Live data processing method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
唐辉.基于传输层的视频卡顿实时检测.《中国优秀硕士学位论文全文数据库信息科技辑》.2017,(第07期), *
基于传输层的视频卡顿实时检测;唐辉;《中国优秀硕士学位论文全文数据库信息科技辑》;20170715(第07期);参见第3章 *

Also Published As

Publication number Publication date
CN110740342A (en) 2020-01-31

Similar Documents

Publication Publication Date Title
US11356748B2 (en) Method, apparatus and system for slicing live streaming
US10244066B2 (en) Push notification delivery system
EP3340633B1 (en) Terminal, cache server, and method for acquiring video slices and device thereof
CN109756757B (en) Live broadcast data processing method and device, live broadcast method and device and live broadcast server
KR101633769B1 (en) System and method for secure asynchronous event notification for adaptive streaming based on iso base media file format
CN108063769B (en) Method and device for realizing content service and content distribution network node
US8589477B2 (en) Content information display device, system, and method used for creating content list information based on a storage state of contents in a cache
CN107147921B (en) Video playing acceleration method and device based on slice and intelligent CDN scheduling
CN108540868A (en) Processing method, device, server, terminal and the storage medium of HLS live streamings
CN105451071B (en) Video stream processing method, device and system
US20210250631A1 (en) Adaptive Bitrate Streaming Of Live Content with Manifest Update Push Notification or Long Poll
US20140282696A1 (en) Advertising download verification
WO2015120766A1 (en) Video optimisation system and method
CN104219286A (en) Method and device for processing stream media, client, CDN (content delivery network) node server and terminal
WO2021073539A1 (en) Hls playback method, client, server and storage medium
KR101809365B1 (en) Message Fragmentation Method using a MQTT Protocol in M2M/IoT Platforms
CN110740342B (en) Storage medium, streaming media transmission and playing method, and slicing method and device
CN108460042B (en) Page display method, related equipment and system
CN110213330B (en) Pre-push system, method, device, electronic equipment and computer readable medium
CN116961918A (en) Token acquisition method and device
JP6378631B2 (en) Video distribution system and video distribution method
CN114666627A (en) Method and device for preloading streaming media video, electronic equipment and storage medium
CN114301848A (en) CDN-based communication method, system, device and storage medium
CN113079386A (en) Video online playing method and device, electronic equipment and storage medium
US10204087B2 (en) Media interaction method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant