CN109089174B - Multimedia data stream processing method and device and computer storage medium - Google Patents

Multimedia data stream processing method and device and computer storage medium Download PDF

Info

Publication number
CN109089174B
CN109089174B CN201810934773.5A CN201810934773A CN109089174B CN 109089174 B CN109089174 B CN 109089174B CN 201810934773 A CN201810934773 A CN 201810934773A CN 109089174 B CN109089174 B CN 109089174B
Authority
CN
China
Prior art keywords
data stream
duration
multimedia data
reading
target multimedia
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
CN201810934773.5A
Other languages
Chinese (zh)
Other versions
CN109089174A (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.)
China Mobile Communications Group Co Ltd
MIGU Video Technology Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Video Technology Co Ltd
MIGU Culture 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 China Mobile Communications Group Co Ltd, MIGU Video Technology Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201810934773.5A priority Critical patent/CN109089174B/en
Publication of CN109089174A publication Critical patent/CN109089174A/en
Application granted granted Critical
Publication of CN109089174B publication Critical patent/CN109089174B/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/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 invention discloses a method for processing multimedia data stream, which comprises the following steps: receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server; determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream; the attribute information is used for indicating whether the target multimedia data stream is segmented or not; if the target multimedia data stream is determined not to be segmented, determining the reading duration; the reading time length is used for representing the time length of a transport stream TS file to be generated; based on the reading duration, sequentially reading data with corresponding duration from the target multimedia data stream, and obtaining a corresponding TS file according to the read data; and respectively transmitting the obtained TS files to the client. The embodiment of the invention also discloses a device for processing the multimedia data stream and a computer storage medium.

Description

Multimedia data stream processing method and device and computer storage medium
Technical Field
The present invention relates to the field of streaming media technologies, and in particular, to a method and an apparatus for processing a multimedia data stream, and a computer storage medium.
Background
Currently, when a dynamic multimedia Transport (HTTP Live Streaming, HLS) protocol is used for multimedia data Stream transmission, a server may segment the entire multimedia data Stream to form small HTTP-based Transport Stream (TS) files for storage; and then, the server side sequentially transmits the stored TS files to the client side according to the request message sent by the client side.
Generally, a server side performs segmentation after the length of a read multimedia data stream reaches a fixed segmentation duration to form a TS file and transmits the TS file to a client side; therefore, the client will cause a certain delay in playing. In practical application, different service scenarios have different requirements on data delay; therefore, the server side can segment the multimedia data stream into TS files with different durations according to different service scenes; thus, multiple TS files with different durations may be generated from the same multimedia stream, and when there are many multimedia data streams stored in the server, a large number of TS files occupy most of the storage resources and processing resources of the server.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for processing a multimedia data stream, and a computer storage medium, which solve the problem in the prior art that a large amount of storage resources and processing resources are occupied.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
in a first aspect, a method for processing a multimedia data stream is provided, the method including:
receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server;
determining whether the target multimedia data stream is segmented or not based on the attribute information of the target multimedia data stream; the attribute information is used for indicating whether the target multimedia data stream is segmented or not;
if the target multimedia data stream is determined not to be segmented, determining the reading duration; the reading time length is used for representing the time length of a transport stream TS file to be generated;
based on the reading duration, sequentially reading data with corresponding duration from the target multimedia data stream, and obtaining a corresponding TS file according to the read data;
and respectively transmitting the obtained TS files to the client.
In a second aspect, an apparatus for processing a multimedia data stream is provided, the apparatus comprising:
the receiving unit is used for receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server;
the determining unit is used for determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream; the attribute information is used for indicating whether the target multimedia data stream is segmented or not; if the target multimedia data stream is determined not to be segmented, determining the reading duration; the reading time length is used for representing the time length of a transport stream TS file to be generated;
the processing unit is used for sequentially reading data with corresponding duration from the target multimedia data stream based on the reading duration and obtaining a corresponding TS file according to the read data; and respectively transmitting the obtained TS files to the client.
In a third aspect, an apparatus for processing a multimedia data stream is provided, the apparatus comprising: a processor and a memory configured to store a computer program capable of running on the processor,
wherein the processor is configured to execute the steps of the method for processing multimedia data streams of the first aspect when running the computer program.
In a fourth aspect, a computer-readable storage medium is provided, which is characterized by storing one or more programs, which are executable by one or more processors, to implement the steps of the method for processing a multimedia data stream according to the first aspect.
The method, the device and the computer-readable storage medium for processing the multimedia data stream provided by the embodiment of the invention comprise the steps of firstly, receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server; then, determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream; if the target multimedia data stream is determined not to be segmented, determining the reading duration; based on the reading duration, sequentially reading data with corresponding duration from the target multimedia data stream, and obtaining a corresponding TS file according to the read data; finally, the obtained TS files are respectively transmitted to the client; thus, the server can read the data in the target multimedia data stream according to the specified time length, and a TS file is formed when the multimedia data stream with the corresponding time length is read each time until the data of the multimedia data stream is completely read; therefore, in the process of data transmission, the server side can directly read and send the media data stream with corresponding duration, and the multimedia data stream does not need to be segmented, so that a large number of TS (transport stream) files needing to be stored cannot be generated, the load of the server side is reduced, and the processing speed and the performance are improved.
Drawings
In the drawings, which are not necessarily drawn to scale, like reference numerals may describe similar components in different views. The drawings illustrate generally, by way of example, but not by way of limitation, various embodiments discussed herein.
Fig. 1 is a flowchart illustrating a method for processing a multimedia data stream according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another method for processing a multimedia data stream according to an embodiment of the present invention;
FIG. 3 is a block diagram of a device for processing multimedia data streams according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a hardware structure of a device for processing a multimedia data stream according to an embodiment of the present invention.
Detailed Description
So that the manner in which the features and elements of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings.
In the prior art, when multimedia data stream transmission is performed based on an HLS protocol, a server side firstly divides a multimedia stream in advance according to a division duration to obtain a plurality of TS files with corresponding durations; and then, sequentially transmitting the TS files to the client. The server side performs segmentation after the length of the read multimedia data stream reaches the segmentation duration and transmits the segmentation to the client side one by one, so that the client side receives the TS file and decodes and plays the TS file, a certain delay is inevitably caused, and the size of the delay is directly related to the segmentation duration when the server side segments the multimedia stream; it can be understood that the longer the slicing duration is, the larger the corresponding delay is.
Because different service scenes have different requirements on time delay, the corresponding segmentation time lengths of the service end under different service scenes are different. For example, the server provides multimedia services for the client a and the client B, where the user corresponding to the client a is a VIP user, and the user corresponding to the client B is a normal user; when the server receives the multimedia data stream, the server can segment the multimedia data stream by using the time length of 3 seconds as a unit and the time length of 10 seconds as a unit respectively; if the total time length corresponding to the multimedia data stream is 3 minutes, the server side obtains 60 TS files with the time length of 3 seconds and 18 TS files with the time length of 10 seconds after segmentation, at this time, the server side needs to store the obtained 78 TS files, obtains the corresponding TS files from the stored 78 TS files after receiving a playing request of the client side A or the client side B, and sends the obtained TS files to the client side A or the client side B.
Therefore, when the slicing durations are different, the same multimedia stream may generate a plurality of different TS files. When the multimedia stream stored by the server is large, a large amount of TS files generated in different segmentation durations inevitably occupy a large amount of storage resources and processing resources of the server.
In order to solve the above problem, an embodiment of the present invention provides a method for processing a multimedia data stream, as shown in fig. 1, the method for processing a multimedia data stream includes the following steps:
step 101, receiving a request message sent by a client.
Wherein the request message is used for requesting the target multimedia data stream from the server.
Here, the step 101 of receiving the request message sent by the client may be implemented by the server; wherein the server may be any type of electronic device that provides multimedia data streams. The multimedia data stream refers to an audio, video or multimedia file played in a network in a streaming transmission manner, for convenience of description, the invention is described by taking video as an example, and application scenes in other formats are referred to each other.
In other embodiments of the present invention, the request message is sent by the client, and the target multimedia data stream is a multimedia data stream requested by the client.
And 102, determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream.
Wherein the attribute information is used for indicating whether the target multimedia data stream is segmented or not.
In other embodiments of the present invention, the step 102 may be implemented by a server, based on the attribute information corresponding to the target multimedia data stream, to determine whether the target multimedia data stream is split. The attribute information corresponding to the multimedia data stream may include information such as a data type, a storage location, and a maximum duration supporting reading of the multimedia data stream.
Specifically, after receiving a request from a client, a server first needs to determine whether a target multimedia data stream requested by the client has been segmented; here, the splitting refers to physical splitting, that is, the target multimedia data stream is formed by a plurality of independent TS files formed after the splitting. If the requested data is segmented, the server sequentially transmits a plurality of independent TS segmentation files corresponding to the requested target multimedia data stream to the client; if the requested data is not segmented, the data requested by the client can be considered to be still a complete multimedia data stream.
And 103, if the target multimedia data stream is determined not to be segmented, determining the reading duration.
And the reading time length is used for representing the time length of the transport stream TS file to be generated.
Here, if it is determined that the target multimedia data stream is not segmented, step 103 may determine that the reading duration is implemented by the server.
In other embodiments of the present invention, the reading duration refers to a time unit of reading the target multimedia data stream; and after the target multimedia data stream is read according to the reading time length, a TS file with corresponding time length can be formed. That is, the reading time duration can be understood as the time duration of the transport stream TS file to be generated; here, the TS file refers to a file encapsulated using a TS encapsulation format, and is characterized in that each TS file can be independently decoded.
In this embodiment, the reading duration may be understood as a "virtual" slicing duration, that is, a duration of obtaining the TS file without actually slicing the multimedia data stream by the server. Here, the server does not store the multimedia data stream after segmenting the multimedia data stream, but stores the entire multimedia data stream, so that the server directly reads the multimedia data stream according to the reading time length after receiving the request of the client.
And step 104, sequentially reading data with corresponding duration from the target multimedia data stream based on the reading duration, and obtaining a corresponding TS file according to the read data.
And 105, respectively transmitting the obtained TS files to the client.
Here, the step 104 may be implemented by the server sequentially reading data with corresponding duration from the target multimedia data stream based on the read duration, obtaining corresponding TS files according to the read data, and respectively transmitting the obtained TS files to the client in the step 105.
In other embodiments of the present invention, after determining the reading duration, that is, the "virtual" slicing duration, the server may read the request data of the corresponding duration according to the determined "virtual" slicing duration; specifically, the server sequentially reads the target multimedia data streams with corresponding duration according to the reading duration; here, after reading the target multimedia data stream with corresponding duration each time, a TS file is obtained; thus, the server reads the multimedia data stream with the corresponding duration in sequence, and a corresponding TS file is formed. Wherein, all TS files form the target multimedia data stream; that is, after the server sequentially reads the multimedia data streams, all the data in the multimedia data streams can be completely read.
Preferably, the server sends the formed TS file with the corresponding duration to the client after reading the multimedia data stream each time.
In another embodiment of the present invention, the server does not store the at least TS file, but directly sends the at least TS file to the client, so that the client plays the plurality of TS files.
For example, the server determines that the "virtual" segmentation duration is 3 seconds according to the request message, and the server may read the multimedia data stream with the duration of 3 seconds each time to obtain a plurality of TS files with the duration of 3 seconds, and then directly transmit the obtained TS files with the duration of 3 seconds to the client.
The method for processing the multimedia data stream provided by the embodiment of the invention comprises the following steps of firstly, receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server; then determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream; if the target multimedia data stream is determined not to be segmented, determining the reading duration; based on the reading duration, sequentially reading data with corresponding duration from the target multimedia data stream, and obtaining a corresponding TS file according to the read data; finally, the obtained TS files are respectively transmitted to the client; thus, the server can read the target multimedia data stream with the specified duration in sequence according to the specified duration, and a TS file is formed when the multimedia data stream with the corresponding duration is read each time until the data of the multimedia data stream is completely read; therefore, in the process of data transmission, the server side can directly read and send the media data stream with corresponding duration, and the multimedia data stream does not need to be segmented, so that a large number of TS (transport stream) files needing to be stored cannot be generated, the load of the server side is reduced, and the processing speed and the performance are improved.
Based on the foregoing embodiments, an embodiment of the present invention provides a method for processing a multimedia data stream, as shown in fig. 2, the method for processing the multimedia data stream includes the following steps:
step 201, the server adds a segmentation parameter to the attribute information corresponding to the target multimedia data stream.
And the segmentation parameter is used for indicating whether to segment the target multimedia data stream.
In practical application, the server can transmit the multimedia data stream by using an HLS protocol; specifically, after receiving the request message, the server searches for an index file corresponding to the request data according to the request message, where the index file includes all attribute information of the request message. And the server reads the target multimedia data stream according to the index file corresponding to the request data and the rule in the index file.
In this embodiment, the server may modify the HLS protocol in advance, so that when the server transmits the multimedia data stream based on the HLS protocol, the server may not perform data stream segmentation on the multimedia data stream, that is, physically segment the multimedia data stream.
In other embodiments of the present invention, the server may modify attribute information of the target multimedia data stream in the index file, and add a segmentation parameter, where the segmentation parameter is used to indicate whether to segment the target multimedia data stream. Here, the index file is preferably a file in M3U8 format.
In general, an example of an unmodified M3U8 index file is as follows:
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE
#EXTINF:10,
#EXT-X-ENDLIST
wherein, the label "# EXTM 3U" is a file header for identifying the M3U8 index file; the label "# EXT-X-MEDIA-SEQUENCE" specifies the SEQUENCE number of the first TS file in the M3U8 index file, where each TS file has a unique fixed SEQUENCE number in the M3U8 index file; in the above example, 0 denotes that the sequence number of the first TS file is 0; the label "# EXT-X-TARGETDURATION" specifies the maximum duration of each TS file, 10 indicating that the maximum duration of each TS file is 10 seconds in the above example; the label "# EXT-X-ALLOW-CACHE" is used to indicate whether the client can CACHE the content of the multimedia data stream; the tag "# extinn" specifies the duration information of the subsequent TS file; the label "# EXT-X-ENDLIST" is the terminator for the M3U8 index file.
In this embodiment, the server may add a new tag between the tag "# EXT-X-target determination" and the tag "# EXT-X-ALLOW-CACHE" for storing the segmentation parameter; preferably, "# EXT-X-VIRTUALSLICE"; the newly added tag identifies the splitting mode through the saved splitting parameter, that is, the tag may be used to indicate whether to physically split the multimedia data stream in the process of transmitting the multimedia data stream.
For example, when the value of the newly added label "# EXT-X-virtuallist" is 0 or null, it may be determined that the server does not perform data stream segmentation on the requested multimedia data stream; when the newly added field takes other values, it can be determined that the server needs to perform data stream segmentation on the requested multimedia data stream, that is, physical actual segmentation.
It should be noted that the value of the newly added label "# EXT-X-virtuallist" may be manually preset to determine the splitting manner of the multimedia data stream when the server transmits the multimedia data stream based on the HLS protocol.
In other embodiments of the present invention, the server may determine the splitting manner of the request data according to the value of the modified label "# EXT-X-virtuallist" of the M3U8 index file.
Specifically, when the value of the newly added label "# EXT-X-virtuallist" is to determine that the segmentation mode is to perform data stream segmentation, that is, to perform physical actual segmentation on the multimedia data stream, the server may segment the obtained multimedia data stream according to a preset segmentation duration to obtain a plurality of independent TS segmentation files, and then, the server stores the plurality of TS segmentation files. Here, the preset splitting duration may be a preset duration, or may be a default duration in the M3U8 index file, which is not limited in this embodiment.
In addition, when the value of the newly added label "# EXT-X-virtuallist" determines that the segmentation mode is not the data stream segmentation, the server may not segment the acquired multimedia data stream, and at this time, the server may only store the acquired multimedia stream.
Step 202, the server receives a request message sent by the client.
Wherein the request message is used for requesting the target multimedia data stream from the server.
Step 203, the server determines whether the target multimedia data stream is segmented based on the segmentation parameters in the attribute information of the target multimedia data stream.
Specifically, the server may determine whether the target multimedia data stream is split based on the splitting parameter stored in the newly added tag in the M3U8 index file.
For example, if the segmentation parameter corresponding to the segmentation functional label "# EXT-X-virtuallist" is 0 or the value is null, it may be determined that the server has not segmented the target multimedia data stream; and when the value of the newly added field is other, the server can be judged to segment the target multimedia data stream, namely, the physical actual segmentation.
And if the judgment result is that the server performs data stream segmentation on the requested multimedia data stream, the server sequentially transmits a plurality of independent TS segmentation files corresponding to the requested multimedia data stream to the client. If the determination result is that the server has not performed data stream segmentation on the requested multimedia data stream, step 204 is executed.
And 204, if the server determines that the target multimedia data stream is not segmented, determining the reading duration.
And the reading time length is used for representing the time length of the transport stream TS file to be generated. In this embodiment, the reading duration may be understood as a "virtual" slicing duration, that is, a duration of obtaining the TS file without actually slicing the multimedia data stream by the server.
Specifically, the server judges the type of the reading duration based on attribute information corresponding to the requested multimedia data stream; in this embodiment, the attribute information further includes a duration parameter; the duration parameter is used for indicating whether the time length of the TS file to be generated is a fixed time length.
Further, when the duration of the TS file to be generated is determined to be fixed according to the duration parameter, determining the reading duration according to the request message, and/or determining the reading duration according to the current network transmission quality. And when the duration of the TS file to be generated is determined not to be fixed according to the duration parameter, determining the reading duration according to the initial reading duration, the total duration of the generated TS file and a preset time threshold.
Preferably, the server may determine the type of the reading duration according to the attribute information of the allowable reading duration in the index file corresponding to the target multimedia data stream; specifically, the server may determine whether the read duration type is a fixed duration according to a value of a "# EXT-X-target duration" tag in the M3U8 index file; when the value of the tag is not 0, the reading duration type can be determined to be a fixed duration, and at this time, the server can determine the reading duration according to the request message and/or determine the reading duration according to the current network transmission quality; and when the value of the field is 0, determining that the type of the reading time length is a non-fixed time length, and at this time, the server may determine the reading time length according to the initial reading time length, the total time length of the generated TS file, and a preset time threshold.
Here, the length of the time delay is determined by the size of the reading time, because the server can form a TS file and transmit the TS file to the client after reading the multimedia data stream with the specified time; it can be understood that the smaller the duration of reading, the shorter the resulting time delay. Therefore, the reading time can be determined according to the requirement of the client on the time delay.
In other embodiments of the present invention, when the duration of the TS file to be generated is determined to be a fixed duration according to the duration parameter, the reading duration is determined according to the request message, and/or the reading duration is determined according to the current network transmission quality. Here, the request message includes at least one of:
a first parameter for identifying a service mode in which the client is currently located, wherein the service mode in which the client is currently located is an on-demand mode or a live broadcast mode; and the second parameter is used for identifying whether the user corresponding to the client is the user accessing the server for the first time.
That is, the server may determine the reading duration according to the current service mode of the client, where the service mode includes an on-demand mode and a live mode, and when the data requested by the client is data in the live mode, a smaller reading duration between 1 second and 3 seconds may be set; a larger read time period of between 10 seconds and 20 seconds may be set when it is determined that the client is currently in the on-demand mode.
Secondly, the server can also judge whether the user corresponding to the client is a new user for sending the multimedia data stream request for the first time; when the user corresponding to the client is a new user, in order to reduce the waiting time of the new user and improve the experience of the new user, the server can set a shorter reading time.
Further, the server can also determine the reading duration according to the network transmission environment; here, if the network transmission quality is high and the code rate corresponding to the multimedia data stream is low, a large reading duration may be set; if the network transmission quality is poor and the corresponding code rate is high, a small reading time length can be set.
In other embodiments of the present invention, the server may further determine the reading duration according to the data type requested by the client; here, the data types may be classified into a data type having a high requirement on real-time and a data type having a normal requirement on real-time; for example, the type of data that is more real-time critical may be "ball game" type data.
In other embodiments of the present invention, when it is determined that the duration of the TS file to be generated is not a fixed duration according to the duration parameter, the reading duration is determined according to an initial reading duration, a total duration of the generated TS file, and a preset time threshold.
Here, the generated TS file refers to a TS file that has been read but has not been transmitted to the client. In addition, the preset time threshold may be a time length preset by the server. The initial reading time length can be a preset time length, or the reading time length can be determined according to the request message, and/or the initial reading time length can be determined according to the current network transmission quality; the manner of determining the reading duration according to the request message and/or determining the initial reading duration according to the current network transmission quality is the same as that described above, and is not described herein again.
Specifically, the server reads a target multimedia data stream according to an initial reading time length, when the total time length of the generated TS file is greater than the preset time threshold value, the initial reading time length is increased, and the increased initial reading time length is determined as the reading time length; and when the total time length of the generated TS file is not greater than the preset time threshold, keeping the reading time length unchanged, or reducing the initial reading time length, and determining the reduced initial reading time length as the reading time length.
For example, in a live scene, the server may send a multimedia data stream downloaded in real time to the client in a TS file manner, where when the currently downloaded multimedia data stream is sent to the client in the TS file, the server may simultaneously download subsequent multimedia data streams. If the preset threshold is 10 seconds, the current reading time length is 1 second, and when the server detects that the total time length of the subsequently downloaded multimedia data stream is greater than 10 seconds, the current reading time length can be adjusted from 1 second to 5 seconds.
And step 205, the server sequentially reads the data with the corresponding duration from the target multimedia data stream based on the reading duration, and obtains the corresponding TS file according to the read data.
And step 206, the server transmits the obtained TS files to the client respectively.
The method for processing the multimedia data stream provided by the embodiment of the invention comprises the following steps of firstly, receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server; then, determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream; if the target multimedia data stream is determined not to be segmented, determining the reading duration; based on the reading duration, sequentially reading data with corresponding duration from the target multimedia data stream, and obtaining a corresponding TS file according to the read data; finally, the obtained TS files are respectively transmitted to the client; reading the multimedia data stream with the set time length for multiple times, and forming a TS file when reading the multimedia data stream with the corresponding time length each time until the data of the multimedia data stream is completely read; therefore, in the process of data transmission, the server side can directly read and send the media data stream with corresponding duration, and the multimedia data stream does not need to be segmented, so that a large number of TS (transport stream) files needing to be stored cannot be generated, the load of the server side is reduced, and the processing speed and the performance are improved.
To implement the method according to the embodiment of the present invention, an embodiment of the present invention further provides a device for processing a multimedia data stream, as shown in fig. 3, where the device includes:
a receiving unit 31, configured to receive a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server;
a determining unit 32, configured to determine whether the target multimedia data stream is split based on attribute information corresponding to the target multimedia data stream; the attribute information is used for indicating whether the target multimedia data stream is segmented or not; if the target multimedia data stream is determined not to be segmented, determining the reading duration; the reading time length is used for representing the time length of a transport stream TS file to be generated;
the processing unit 33 is configured to sequentially read data with a corresponding duration from the target multimedia data stream based on the read duration, and obtain a corresponding TS file according to the read data; and respectively transmitting the obtained TS files to the client.
In other embodiments of the present invention, the,
the processing unit 33 is further configured to add a segmentation parameter to the attribute information corresponding to the target multimedia data stream; the segmentation parameter is used for indicating whether to segment the target multimedia data stream;
the determining unit 32 is specifically configured to determine whether the target multimedia data stream is split based on the splitting parameter in the attribute information.
In other embodiments of the present invention, the attribute information further includes a duration parameter, where the duration parameter is used to indicate whether the duration of the TS file to be generated is a fixed duration;
the determining unit 32 is specifically configured to determine, when the duration of the TS file to be generated is determined to be a fixed duration according to the duration parameter, a reading duration according to the request message, and/or determine the reading duration according to the current network transmission quality; and when the duration of the TS file to be generated is determined not to be fixed according to the duration parameter, determining the reading duration according to the initial reading duration, the total duration of the generated TS file and a preset time threshold.
In other embodiments of the invention, the request message includes at least one of:
a first parameter for identifying a service mode in which the client is currently located, wherein the service mode in which the client is currently located is an on-demand mode or a live broadcast mode;
and the second parameter is used for identifying whether the user corresponding to the client is the user accessing the server for the first time.
In other embodiments of the present invention, the processing unit 33 is further configured to determine that, when the total time length of the generated TS file is greater than the preset time threshold, the initial reading time length is increased, and determine the increased initial reading time length as the initial reading time length; and when the total time length of the generated TS file is not greater than the preset time threshold, keeping the reading time length unchanged, or reducing the initial reading time length, and determining the reduced initial reading time length as the reading time length.
Based on the hardware implementation of each unit in the license plate accurate positioning device, in order to implement the processing method of the multimedia data stream provided in the embodiment of the present invention, an embodiment of the present invention further provides a processing device of the multimedia data stream, and as shown in fig. 4, the processing device 40 of the multimedia data stream includes: a processor 41 and a memory 42 configured to store a computer program capable of running on the processor,
wherein the processor 41 is configured to execute the steps of the method for processing multimedia data stream in the foregoing embodiments when running the computer program.
In practice, of course, the various components of the device 40 are coupled together by a bus system 43, as shown in FIG. 4. It will be appreciated that the bus system 43 is used to enable communications among the components. The bus system 43 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as bus system 43 in fig. 4.
In an exemplary embodiment, the present invention further provides a computer readable storage medium, such as a memory 42, comprising a computer program, which is executable by a processor 41 of a license plate pinpointing device 40 to perform the steps of the aforementioned method. The computer-readable storage medium may be a magnetic random access Memory (FRAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM), among other memories.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for processing a multimedia data stream, the method comprising:
receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server;
determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream; the attribute information is used for indicating whether the target multimedia data stream is segmented or not;
if the target multimedia data stream is determined not to be segmented, determining the reading duration; the reading time length is used for representing the time length of a transport stream TS file to be generated;
based on the reading duration, sequentially reading data with corresponding duration from the target multimedia data stream, and obtaining a corresponding TS file according to the read data;
and respectively transmitting the obtained TS files to the client.
2. The method of claim 1, wherein before receiving the request message sent by the client, the method further comprises:
adding segmentation parameters in attribute information corresponding to the target multimedia data stream; the segmentation parameter is used for indicating whether to segment the target multimedia data stream;
the determining whether the target multimedia data stream is segmented based on the attribute information corresponding to the target multimedia data stream includes:
and determining whether the target multimedia data stream is segmented or not based on the segmentation parameters in the attribute information.
3. The method according to claim 1, wherein the attribute information further includes a duration parameter, the duration parameter is used to indicate whether the duration of the TS file to be generated is a fixed duration, and the determining the reading duration includes:
when the duration of the TS file to be generated is determined to be fixed according to the duration parameter, determining the reading duration according to the request message, and/or determining the reading duration according to the current network transmission quality;
and when the duration of the TS file to be generated is determined not to be fixed according to the duration parameter, determining the reading duration according to the initial reading duration, the total duration of the generated TS file and a preset time threshold.
4. The method of claim 3, wherein the request message comprises at least one of:
a first parameter for identifying a service mode in which the client is currently located, wherein the service mode in which the client is currently located is an on-demand mode or a live broadcast mode;
and the second parameter is used for identifying whether the user corresponding to the client is the user accessing the server for the first time.
5. The method according to claim 3, wherein the determining the reading duration according to the initial reading duration, the total duration of the generated TS files and a preset time threshold comprises:
when the total time length of the generated TS file is greater than the preset time threshold, increasing the initial reading time length, and determining the increased initial reading time length as the reading time length;
and when the total time length of the generated TS file is not greater than the preset time threshold, keeping the reading time length unchanged, or reducing the initial reading time length, and determining the reduced initial reading time length as the reading time length.
6. An apparatus for processing a multimedia data stream, the apparatus comprising:
the receiving unit is used for receiving a request message sent by a client; wherein, the request message is used for requesting a target multimedia data stream from a server;
the determining unit is used for determining whether the target multimedia data stream is segmented or not based on the attribute information corresponding to the target multimedia data stream; the attribute information is used for indicating whether the target multimedia data stream is segmented or not; if the target multimedia data stream is determined not to be segmented, determining the reading duration; the reading time length is used for representing the time length of a transport stream TS file to be generated;
the processing unit is used for sequentially reading data with corresponding duration from the target multimedia data stream based on the reading duration and obtaining a corresponding TS file according to the read data; and respectively transmitting the obtained TS files to the client.
7. The apparatus of claim 6, wherein:
the processing unit is further configured to add a segmentation parameter to attribute information corresponding to the target multimedia data stream; the segmentation parameter is used for indicating whether to segment the target multimedia data stream;
the determining unit is specifically configured to determine whether the target multimedia data stream is split based on the splitting parameter in the attribute information.
8. The apparatus according to claim 6, wherein the attribute information further includes a duration parameter, and the duration parameter is used to indicate whether the duration of the TS file to be generated is a fixed duration;
the determining unit is specifically configured to determine a reading duration according to the request message when the duration of the TS file to be generated is determined to be a fixed duration according to the duration parameter, and/or determine the reading duration according to the current network transmission quality; and when the duration of the TS file to be generated is determined not to be fixed according to the duration parameter, determining the reading duration according to the relationship between the initial reading duration, the total duration of the generated TS file and a preset time threshold.
9. An apparatus for processing a multimedia data stream, the apparatus comprising: a processor and a memory configured to store a computer program capable of running on the processor,
wherein the processor is configured to execute the steps of the method for processing a multimedia data stream according to any of claims 1 to 5 when running the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs which are executable by one or more processors to implement the steps of the method of processing a multimedia data stream according to any one of claims 1 to 5.
CN201810934773.5A 2018-08-16 2018-08-16 Multimedia data stream processing method and device and computer storage medium Active CN109089174B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810934773.5A CN109089174B (en) 2018-08-16 2018-08-16 Multimedia data stream processing method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810934773.5A CN109089174B (en) 2018-08-16 2018-08-16 Multimedia data stream processing method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN109089174A CN109089174A (en) 2018-12-25
CN109089174B true CN109089174B (en) 2020-12-22

Family

ID=64793536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810934773.5A Active CN109089174B (en) 2018-08-16 2018-08-16 Multimedia data stream processing method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN109089174B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110324681B (en) * 2019-07-08 2021-05-25 广州酷狗计算机科技有限公司 Slicing method, device, storage medium and transmission system of multimedia data
CN110505278B (en) * 2019-07-19 2021-09-14 联想(北京)有限公司 Data stream processing method, server and computer storage medium
CN111597153A (en) * 2020-05-13 2020-08-28 湖南国科微电子股份有限公司 HLS-based file management method and device, electronic equipment and storage medium
CN112565381B (en) * 2020-11-30 2022-05-31 杭州迪普科技股份有限公司 Data packet forwarding method, device and equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101472189A (en) * 2007-12-24 2009-07-01 新奥特(北京)视频技术有限公司 Acceptance system capable of cutting file during acceptance process
CN102685088A (en) * 2011-09-06 2012-09-19 天脉聚源(北京)传媒科技有限公司 Method for playing M3U8 stream media
CN103064935A (en) * 2012-12-24 2013-04-24 深圳先进技术研究院 System and method for multimedia data parallel processing
CN103067745A (en) * 2011-10-24 2013-04-24 北大方正集团有限公司 Video data segmentation method, video data segmentation device, video data online editing method and video data online editing system
CN105357544A (en) * 2015-10-29 2016-02-24 浪潮软件集团有限公司 HLS-based multimedia file processing method and server
CN105657443A (en) * 2015-12-30 2016-06-08 深圳市云宙多媒体技术有限公司 Live broadcast and time shifting playing method and system
CN107277081A (en) * 2016-04-06 2017-10-20 北京优朋普乐科技有限公司 Section method for down loading and device, the stream media system of stream medium data
CN107370726A (en) * 2017-06-22 2017-11-21 上海网达软件股份有限公司 A kind of virtual sliced sheet method and system for disributed media file trans-coding system
CN107613321A (en) * 2016-07-12 2018-01-19 北京数码视讯科技股份有限公司 A kind of method of program recording and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10158894B2 (en) * 2015-12-15 2018-12-18 Telefonaktiebolaget Lm Ericsson (Publ) Edge media router device for facilitating distribution and delivery of media content having end-to-end encryption

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101472189A (en) * 2007-12-24 2009-07-01 新奥特(北京)视频技术有限公司 Acceptance system capable of cutting file during acceptance process
CN102685088A (en) * 2011-09-06 2012-09-19 天脉聚源(北京)传媒科技有限公司 Method for playing M3U8 stream media
CN103067745A (en) * 2011-10-24 2013-04-24 北大方正集团有限公司 Video data segmentation method, video data segmentation device, video data online editing method and video data online editing system
CN103064935A (en) * 2012-12-24 2013-04-24 深圳先进技术研究院 System and method for multimedia data parallel processing
CN105357544A (en) * 2015-10-29 2016-02-24 浪潮软件集团有限公司 HLS-based multimedia file processing method and server
CN105657443A (en) * 2015-12-30 2016-06-08 深圳市云宙多媒体技术有限公司 Live broadcast and time shifting playing method and system
CN107277081A (en) * 2016-04-06 2017-10-20 北京优朋普乐科技有限公司 Section method for down loading and device, the stream media system of stream medium data
CN107613321A (en) * 2016-07-12 2018-01-19 北京数码视讯科技股份有限公司 A kind of method of program recording and device
CN107370726A (en) * 2017-06-22 2017-11-21 上海网达软件股份有限公司 A kind of virtual sliced sheet method and system for disributed media file trans-coding system

Also Published As

Publication number Publication date
CN109089174A (en) 2018-12-25

Similar Documents

Publication Publication Date Title
CN109089174B (en) Multimedia data stream processing method and device and computer storage medium
US10200723B2 (en) Converting live streaming content to video-on-demand streaming content
RU2528146C2 (en) Method, apparatus and system for parallel advertisement assembly
CN109600437B (en) Downloading method of streaming media resource and cache server
CN110933517B (en) Code rate switching method, client and computer readable storage medium
CN108063769B (en) Method and device for realizing content service and content distribution network node
US11563992B2 (en) Video playback quality detection method and apparatus
US11863841B2 (en) Video playing control method and system
WO2015169172A1 (en) Network video playing method and device
CN110290396B (en) Video processing method, device, system, equipment and storage medium
CN110401858B (en) Video playing method and device, electronic equipment and storage medium
CN111064969B (en) Streaming media data transmission method, equipment, device and computer storage medium
CN111385660B (en) Video on demand method, device, equipment and storage medium
WO2024082688A1 (en) Method and apparatus for playing gift special-effect resource
CN111510790B (en) Video request method, system, computer device and computer readable storage medium
CN112203105A (en) New media mobile live broadcasting method and system
CN109587517B (en) Multimedia file playing method and device, server and storage medium
CN113473247B (en) Video playing request processing method, device and system and electronic equipment
CN114666627A (en) Method and device for preloading streaming media video, electronic equipment and storage medium
KR20190048186A (en) Multipath-based split transmission system and streaming method for adaptive streaming service
CN113438313B (en) Video continuous playing processing method, related device and readable storage medium
CN117998140A (en) Live video data prefetching method, device, equipment, storage medium and product
CN117793392A (en) Short-connection live-broadcast source-returning method and CDN cluster of short-connection live-broadcast source-returning method
CN114866815A (en) Audio and video data playing method and device, electronic equipment and system
CN115834925A (en) Video transcoding method, device, equipment and medium

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