WO2020248324A1 - 一种流媒体数据的处理方法及流媒体处理服务器 - Google Patents

一种流媒体数据的处理方法及流媒体处理服务器 Download PDF

Info

Publication number
WO2020248324A1
WO2020248324A1 PCT/CN2019/096178 CN2019096178W WO2020248324A1 WO 2020248324 A1 WO2020248324 A1 WO 2020248324A1 CN 2019096178 W CN2019096178 W CN 2019096178W WO 2020248324 A1 WO2020248324 A1 WO 2020248324A1
Authority
WO
WIPO (PCT)
Prior art keywords
streaming media
file
replacement
media data
fragment
Prior art date
Application number
PCT/CN2019/096178
Other languages
English (en)
French (fr)
Inventor
郑振贵
Original Assignee
网宿科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 网宿科技股份有限公司 filed Critical 网宿科技股份有限公司
Priority to EP19805507.1A priority Critical patent/EP3780642A1/en
Priority to US16/717,608 priority patent/US11223856B2/en
Publication of WO2020248324A1 publication Critical patent/WO2020248324A1/zh

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 or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream 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/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/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 or manipulating encoded video stream scene graphs
    • H04N21/23424Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for inserting or substituting an advertisement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26258Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for generating a list of items to be played back in a given order, e.g. playlist, or scheduling item distribution according to such list
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2668Creating a channel for a dedicated end-user group, e.g. insertion of targeted commercials based on end-user profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/637Control signals issued by the client directed to the server or network components
    • H04N21/6377Control signals issued by the client directed to the server or network components directed to server
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • 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/84Generation or processing of descriptive data, e.g. content descriptors
    • 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/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of 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/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

Definitions

  • This application relates to the field of Internet technology, and in particular to a method for processing streaming media data and a streaming media processing server.
  • the HLS HTTP Live Streaming, HTTP live streaming
  • the streaming media server can split the audio and video content into multiple slice files according to a certain slice duration, and the format of the slice files can adopt the ts (transport stream) format.
  • the index file of the above-mentioned slice file can be established in the streaming media server, and the format of the index file is usually m3u8 format.
  • the streaming media player When the streaming media player plays the streaming media resources of the HLS protocol, it can first download the m3u8 index file of the streaming media resources from the streaming media server, and then download and play the corresponding ts files in turn according to the fragment information provided in the index file.
  • the modified streaming media resource needs to be uploaded and reviewed again.
  • the steps of slicing and indexing the re-uploaded streaming media resources are required.
  • the streaming media player since the original streaming media resources cannot be used, the streaming media player needs to re-download the index file to play the modified streaming media resources normally. This will undoubtedly increase the overhead of the streaming media server and the streaming media player, and at the same time cause the replacement of streaming media resources to be less efficient.
  • the purpose of this application is to provide a streaming media data processing method and streaming media processing server, which can save the overhead of the streaming media server and the streaming media player, and improve the efficiency of content replacement.
  • one aspect of the present application provides a method for processing streaming media data.
  • the method includes: obtaining an index file of streaming media data, the streaming media data is divided into multiple fragment files; File and data replacement information, determine the target segment file to be replaced among the multiple segment files; convert the preset replacement streaming media data into a replacement segment file that matches the target segment file, and Use the replacement fragment file to replace the target fragment file in the streaming media data to obtain the streaming media data after content replacement.
  • the streaming media processing server includes: an index file acquisition unit for acquiring an index file of streaming media data, the streaming media data is divided into A plurality of fragment files; a target fragment file determining unit for determining the target fragment file to be replaced among the plurality of fragment files according to the index file and data replacement information; a content replacement unit for replacing The preset replacement streaming media data is converted into a replacement fragment file matching the target fragment file, and the replacement fragment file is used to replace the target fragment file in the streaming media data to obtain a content replacement After the streaming data.
  • the streaming media processing server includes a processor and a memory.
  • the memory is used to store a computer program that is executed by the processor.
  • the streaming media processing server may obtain an index file of streaming media data that needs content replacement. Then, according to the data replacement information and the index file, among the multiple fragment files obtained by dividing the streaming media data, the target fragment file to be replaced can be determined. For these (or this) target fragment files, corresponding replacement streaming media data can be provided.
  • the streaming media processing server may read the replacement streaming media data, and then convert the replacement streaming media data into a replacement fragment file matching the target fragment file, and replace the streaming media with the replacement fragment file The target fragment file in the data, thereby obtaining the streaming media data after content replacement.
  • the streaming media data processing method and streaming media processing server provided by the present application can save the overhead of the streaming media server and the streaming media player, and improve the efficiency of content replacement.
  • FIG. 1 is a schematic structural diagram of a system where a streaming media processing server is located in an embodiment of the present application
  • FIG. 2 is a flowchart of a streaming media data processing method in an embodiment of the present application
  • FIG. 3 is a schematic diagram of the analysis flow of index files in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of determining a target fragment file in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of filling and replacing streaming media data in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of intercepting and replacing streaming media data in an embodiment of the present application.
  • FIG. 7 is a schematic diagram of functional modules of a streaming media processing server in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a streaming media processing server in an embodiment of the present application.
  • Fig. 9 is a schematic structural diagram of a computer terminal in an embodiment of the present application.
  • the streaming media processing server may be in the system architecture shown in FIG. 1.
  • the system may include the streaming media processing server, as well as a streaming media server and a streaming media playback client.
  • the streaming media server may store various streaming media data
  • the streaming media data may be various audio and video files, for example.
  • the streaming media processing server may obtain the access authority of the streaming media server, and may obtain streaming media data from the streaming media server, and upload streaming media data to the streaming media server.
  • the streaming media playback client may be a terminal device used by a user. The streaming media playback client can download the index file from the streaming media server, and play the corresponding streaming media data according to the index file.
  • the streaming media data processing method provided in this application may include the following steps.
  • the streaming media processing server may first obtain the index file of the streaming media data from the streaming media server, and the index file may be m3u8 Format file.
  • the streaming media data can be divided into multiple fragment files, and each fragment file can adopt the ts format.
  • fragment information of each fragment file may be recorded.
  • the index file may record the playback type of the streaming media data (on-demand or live), the maximum duration of each fragment file, the file identifier of each fragment file, the actual duration of each fragment file, etc. information. Among them, each item of information starts with its own label.
  • the tag that characterizes the playback type of streaming media data as on-demand can be EXT-X-ENDLIST; the tag that characterizes the actual duration of each fragment file can be EXTINF; the tag that characterizes the maximum duration of each fragment file can be It is EXT-X-TARGETDURATION.
  • the file identifier of the aforementioned fragmented file may be a character string used to characterize the fragmented file.
  • the file identifier may be the name of the fragmented file, or it may be a background number assigned by the streaming media server when the fragmented file is stored in the streaming media server.
  • S3 According to the index file and the data replacement information, determine the target fragment file to be replaced among the plurality of fragment files.
  • a list of fragmented files of the streaming media data can be constructed.
  • the fragmented file list one or more of the file identification, starting time node, duration, and ending time node of each fragmented file can be recorded.
  • the streaming media processing server can determine the start time node and the end time node of each fragment file by parsing the index file.
  • the streaming media processing server may parse the information starting with the above EXTINF tag. Specifically, the streaming media server may read the content of the index file line by line, and if the currently read content starts with a designated tag, it may parse the currently read content.
  • the designated label may be the above-mentioned label used to characterize the actual duration of each fragment file.
  • part of the content of the index file may be as follows:
  • the streaming media processing server can parse this part of the content to determine that the duration of the current fragmented file is 10 seconds.
  • the currently read content does not start with the specified tag, then the currently read content cannot provide information about the playback duration, so the currently read content can be skipped directly, and the index file is determined Whether the content has been read, if it has not been read, the content of the next line can be read continuously until the content of the index file is read.
  • the duration of each fragment file can be parsed.
  • the start time node and the end time node of each fragment file can be analyzed according to the analysis result. Specifically, when starting to analyze the index file, a global cumulative duration parameter can be set, and the initial value of the cumulative duration parameter can be zero. Then, when the streaming media processing server reads the content of the current fragment file in the index file, it may use the current accumulated duration in the accumulated duration parameter as the starting time node of the current fragment file. For example, when the content of the first fragmented file read by the streaming media processing server, the start time node of the first fragmented file may be 0.
  • the duration of the current segmented file can be accumulated to the accumulated duration parameter.
  • the duration of the current fragmented file can be added to the total duration, and the obtained result can be used as the total duration.
  • the end time node of the current fragment For example, assuming that the duration of the first fragmented file is 10 seconds, the end time node of the first fragmented file can be 10 seconds.
  • the data replacement information may be used to characterize the duration interval to be replaced in the streaming media data.
  • the data replacement information may include the starting time node to be replaced and the time length to be replaced. In this way, through the start time node to be replaced and the time length to be replaced, the time length interval to be replaced can be determined.
  • the duration interval may be 1 minute 10 seconds to 2 minutes 20 seconds in the streaming media data.
  • the target fragment file to be replaced can be determined among the fragment files obtained by dividing the streaming media data. Specifically, the start time node and the end time node of each fragment file can be determined according to the index file. Then, if a part of the content of a fragment file falls within the above-mentioned duration interval, then the fragment can be The file is used as the target fragment file to be replaced. As shown in Figure 4, the streaming media processing server can traverse each of the fragmented files. If the start time node or the end time node of the current fragmented file is within the time period to be replaced, the current As the target fragment file to be replaced. For example, in Fig. 4, the three slice files filled with shadow can all be used as the target slice files to be replaced.
  • the uploader of the streaming media data may provide replacement streaming media data for replacing the target segmented file.
  • the replacement streaming media data may also be prepared by the streaming media server in advance.
  • the formatted streaming media data For example, the video picture represented by the replacement streaming media data may be a picture with the words "this part of content will not be displayed".
  • the streaming media processing server determines the target fragment file to be replaced, it can read the preset replacement streaming media data, and after performing a series of processing on the replacement streaming media data, convert the replacement streaming media data Is a replacement fragment file that matches the target fragment file.
  • the duration covered by the target fragment file may be determined, and the determined duration may be compared with the total duration of the replacement streaming media data.
  • the duration covered by the target fragment file may refer to the total duration of each target fragment file to be replaced. Referring to FIG. 5, if the determined duration is greater than the total duration of the replacement streaming media data, it indicates that the duration of the replacement streaming media data is not enough. In this case, the replacement stream can be filled after the replacement streaming media data.
  • the content of the media data until the total duration of the replacement streaming media data after filling the content is consistent with the determined duration. For example, in FIG. 5, it is necessary to continue filling 1.5 times the content of the replacement streaming media data after the original replacement streaming media data, so that the duration of the replacement streaming media data after filling the content is consistent with the total duration of the target fragment file. Then, the replacement streaming media data filled with the content can be used as the aforementioned preset replacement streaming media data.
  • the determined duration is less than the total duration of the replacement streaming media data, it means that the total duration of the replacement streaming media data is too long. Then, as shown in Figure 6, the replacement streaming media A data segment consistent with the duration of the target segment file is intercepted from the data, and the intercepted data segment is used as the aforementioned preset replacement streaming media data.
  • the streaming media attributes of the processed replacement streaming media data may be converted to be consistent with the streaming media attributes of the target fragment file.
  • the streaming media attributes may include various attributes such as audio attributes, video attributes, Program Association Table (PAT) information, and Program Map Tables (PMT) information.
  • the video attribute includes at least one of a video encoding method, a video resolution, and a video frame rate
  • the audio attribute includes at least one of an audio encoding method, an audio sampling rate, and the number of audio channels.
  • the aforementioned audio attributes and video attributes may also include more or less content.
  • a video conversion tool such as ffmpeg can be used to convert the preset video attributes and audio attributes of the replacement streaming media data to be consistent with the video attributes and audio attributes of the target fragment file
  • the replacement streaming media data after the conversion of video attributes and audio attributes can be formatted, thereby converted into a stream file (ts file), and when the format conversion is performed, the program association table information and the program map of the stream file can be made
  • the table information is consistent with the program association table information and the program mapping table information of the target fragment file.
  • the technical solution provided in this application can be converted into streaming media attributes matching the streaming media data to be replaced.
  • the same piece of replacement streaming media data can also be applied to streaming media data with different streaming media attributes, thereby reducing the requirement for replacement streaming media data, thereby improving the replacement efficiency of streaming media data.
  • the replacement streaming media data after time length correction and attribute conversion may be divided into replacement fragment files matching the number of target fragment files.
  • the divided replacement fragment files not only match the number of target fragment files, but also have a one-to-one correspondence with the start time node, which can perfectly replace the target fragment files.
  • the replacement fragment file needs to be stored using the file identifier of the target fragment file.
  • the streaming media processing server may read the file identifier of each target segment file from the index file, and assign the read file identifier to the corresponding replacement segment file, respectively.
  • replacing the target fragment file in the streaming media data with the replacement fragment file carrying the file identifier can ensure that the index file of the streaming media data does not change.
  • the streaming media player client if the index file of streaming media data has been downloaded before, there is no need to download the index file again, and the replaced streaming media data can also be played directly according to the original index file. In this way, the content replacement process of streaming media data is imperceptible to the streaming media playback client, so there is no need to increase the additional overhead of the streaming media playback client.
  • the streaming media processing server includes:
  • An index file obtaining unit configured to obtain an index file of streaming media data, the streaming media data being divided into multiple fragmented files
  • a target fragment file determining unit configured to determine a target fragment file to be replaced among the plurality of fragment files according to the index file and data replacement information
  • the content replacement unit is configured to convert the preset replacement streaming media data into a replacement fragment file matching the target fragment file, and replace the target in the streaming media data with the replacement fragment file Fragment the file to obtain the streaming media data after content replacement.
  • the streaming media processing server further includes:
  • the attribute analysis unit is configured to read each of the target fragment files and analyze the streaming media attributes of the target fragment files
  • the content replacement unit is further configured to convert the streaming media attributes of the preset replacement streaming media data to be consistent with the streaming media attributes of the target segmented file, and divide the replacement streaming media data after the attribute conversion into Replacement fragment files matching the number of target fragment files.
  • the streaming media processing server further includes:
  • a duration comparison unit configured to determine the duration covered by the target fragment file, and compare the determined duration with the total duration of the replacement streaming media data
  • the cyclic complementing unit is configured to, if the determined duration is greater than the total duration of the replacement streaming media data, continue to fill the content of the replacement streaming media data after the replacement streaming media data until the replacement stream after the content is filled
  • the total duration of the media data is consistent with the determined duration, and the replacement streaming media data filled with content is used as the preset replacement streaming media data;
  • the interception unit is configured to, if the determined duration is less than the total duration of the replacement streaming media data, intercept a data segment consistent with the determined duration from the replacement streaming media data, and combine the intercepted data segment As the preset replacement streaming media data.
  • the content replacement unit includes:
  • the audio-video attribute conversion module is configured to convert the video attributes and audio attributes of the preset replacement streaming media data into the same video attributes and audio attributes as the target fragment files;
  • the video attributes include a video encoding method At least one of a video resolution and a video frame rate, and the audio attribute includes at least one of an audio encoding method, an audio sampling rate, and the number of audio channels;
  • the stream file conversion module is used to convert the replacement stream media data after the conversion of the video attribute and the audio attribute into a stream file, and the program association table information and the program map table information of the stream file and the program of the target fragment file
  • the association table information is consistent with the program map table information.
  • the content replacement unit includes:
  • a file identifier assignment module configured to read the file identifier of the target segment file from the index file, and assign the read file identifier to the replacement segment file;
  • the replacement module is configured to replace the target fragment file in the streaming media data with the replacement fragment file carrying the file identifier.
  • the present application also provides a streaming media processing server.
  • the streaming media processing server includes a processor and a memory.
  • the memory is used to store a computer program.
  • the computer program is executed by the processor, the The above-mentioned streaming media data processing method.
  • the computer terminal 10 may include one or more (only one is shown in the figure) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a processor for storing data
  • the memory 104 and the transmission module 106 for communication functions are only for illustration, and does not limit the structure of the above electronic device.
  • the computer terminal 10 may also include more or fewer components than those shown in FIG. 9 or have a different configuration from that shown in FIG. 9.
  • the memory 104 may be used to store software programs and modules of application software.
  • the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104.
  • the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 includes a memory remotely provided with respect to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the aforementioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 106 is used to receive or send data via a network.
  • the above-mentioned specific examples of the network may include a wireless network provided by the communication provider of the computer terminal 10.
  • the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
  • RF radio frequency
  • the streaming media processing server may obtain an index file of streaming media data that needs content replacement. Then, according to the data replacement information and the index file, among the multiple fragment files obtained by dividing the streaming media data, the target fragment file to be replaced can be determined. For these (or this) target fragment files, corresponding replacement streaming media data can be provided.
  • the streaming media processing server may read the replacement streaming media data, and then convert the replacement streaming media data into a replacement fragment file matching the target fragment file, and replace the streaming media with the replacement fragment file The target fragment file in the data, thereby obtaining the streaming media data after content replacement.
  • the streaming media data processing method and streaming media processing server provided by the present application can save the overhead of the streaming media server and the streaming media player, and improve the efficiency of content replacement.
  • each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be realized by hardware.
  • the above technical solutions can be embodied in the form of software products, which can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., include a number of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

一种流媒体数据的处理方法及流媒体处理服务器,其中,所述方法包括:获取流媒体数据的索引文件,所述流媒体数据被划分为多个分片文件(S1);根据所述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件(S3);将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,得到内容替换后的流媒体数据(S5)。上述技术方案,能够节省流媒体服务器和流媒体播放端的开销,并提高内容替的效率。

Description

一种流媒体数据的处理方法及流媒体处理服务器
交叉引用
本申请引用于2019年06月11日递交的名称为“一种流媒体数据的处理方法及流媒体处理服务器”的第201910499096.3号中国专利申请,其通过引用被全部并入本申请
技术领域
本申请涉及互联网技术领域,特别涉及一种流媒体数据的处理方法及流媒体处理服务器。
背景技术
在当前的流媒体服务中,HLS(HTTP Live Streaming,HTTP直播流)协议广泛应用于流媒体的点播和直播服务当中。按照HLS协议的规定,流媒体服务器可以将音视频内容按照一定的切片时长分割成多个切片文件,切片文件的格式可以采用ts(transport stream,传输流)格式。同时,在流媒体服务器中可以建立上述切片文件的索引文件,索引文件的格式通常为m3u8格式。当流媒体播放端播放HLS协议的流媒体资源时,可以先从流媒体服务器处下载流媒体资源的m3u8索引文件,再依据索引文件中提供的分片信息,依次下载和播放对应的ts文件。
随着网络中流媒体资源的不断丰富,各大网站对流媒体资源的审核也日趋规范。当前,如果流媒体资源中出现不合规定的内容,那么需要上传修改后的流媒体资源重新进行审核。在实际应用中,有时候需要修改的只是流媒体资源中的一小部分内容,但依然需要将流媒体服务器中整体的流媒体资源进行替换。具体地,对于流媒体服务器而言,需要针对重新上传的流媒体资源进行切片和建立索引文件的步骤。同时,对于流媒体播放端,由于原先的流媒体资源无法使用,从而导致流媒体播放器需要重新下载索引文件,才能正常播放修改后的流媒体资源。这样无疑会增加流媒体服务器和流媒体播放端的开销,同时还导致流媒体资源的替换效率较低。
发明内容
本申请的目的在于提供一种流媒体数据的处理方法及流媒体处理服务器,能够节省流媒体服务器和流媒体播放端的开销,并提高内容替换的效率。
为实现上述目的,本申请一方面提供一种流媒体数据的处理方法,所述方法包括:获取流媒体数据的索引文件,所述流媒体数据被划分为多个分片文件;根据所述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件;将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,得到内容替换后的流媒体数据。
为实现上述目的,本申请另一方面还提供一种流媒体处理服务器,所述流媒体处理服务器包括:索引文件获取单元,用于获取流媒体数据的索引文件,所述流媒体数据被划分为多个分片文件;目标分片文件确定单元,用于根据所 述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件;内容替换单元,用于将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,得到内容替换后的流媒体数据。
为实现上述目的,本申请另一方面还提供一种流媒体处理服务器,所述流媒体处理服务器包括处理器和存储器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现上述的流媒体数据的处理方法。
由上可见,本申请提供的技术方案,可以通过流媒体处理服务器完成对流媒体数据的内容替换过程。具体地,流媒体处理服务器可以获取需要进行内容替换的流媒体数据的索引文件。然后,根据数据替换信息和该索引文件,可以在流媒体数据划分得到的多个分片文件中,确定需要替换的目标分片文件。针对这些(或者这个)目标分片文件,可以提供相应的替换流媒体数据。流媒体处理服务器可以读取该替换流媒体数据,然后将该替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,从而得到内容替换后的流媒体数据。由上可见,在对流媒体数据进行内容替换时,并不需要更换整个流媒体数据的内容,而是可以在流媒体数据中确定出需要替换的一部分目标分片文件,然后将这部分目标分片文件用相匹配的替换分片文件进行替换即可。这样,在流媒体服务器中,并不需要执行重新分片和建立索引文件的步骤。另外,本申请提供的技术方案,只是针对流媒体数据中的分片文件进行替换,因此并不会改变流媒体数据的索引文件,这样,在流媒体播放端,使用原先的索引文件就能够正常播放内容替换后的流媒体数据,无需重新下载索引文件。因此,本申请提供的流 媒体数据的处理方法及流媒体处理服务器,能够节省流媒体服务器和流媒体播放端的开销,并提高内容替换的效率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例中流媒体处理服务器所处系统的结构示意图;
图2是本申请实施例中流媒体数据处理方法的流程图;
图3是本申请实施例中索引文件的解析流程示意图;
图4是本申请实施例中确定目标分片文件的示意图;
图5是本申请实施例中填充替换流媒体数据的示意图;
图6是本申请实施例中截取替换流媒体数据的示意图;
图7是本申请实施例中流媒体处理服务器的功能模块示意图;
图8是本申请实施例中流媒体处理服务器的结构示意图;
图9是本申请实施例中计算机终端的结构示意图。
具体实施例
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作进一步地详细描述。
本申请提供一种流媒体数据的处理方法,所述方法的执行主体可以是流 媒体处理服务器。请参阅图1,所述流媒体处理服务器可以处于图1所示的系统架构中。在该系统中,可以包括所述流媒体处理服务器,以及流媒体服务器和流媒体播放客户端。其中,所述流媒体服务器中可以存储各种流媒体数据,该流媒体数据例如可以是各类音视频文件。所述流媒体处理服务器可以获得所述流媒体服务器的访问权限,并可以从所述流媒体服务器中获取流媒体数据,以及向所述流媒体服务器上传流媒体数据。所述流媒体播放客户端,可以是用户使用的终端设备。所述流媒体播放客户端可以从流媒体服务器处下载索引文件,并根据索引文件播放对应的流媒体数据。
请参阅图2,本申请提供的流媒体数据的处理方法,可以包括以下步骤。
S1:获取流媒体数据的索引文件,所述流媒体数据被划分为多个分片文件。
在本实施例中,当流媒体服务器中出现需要进行内容替换的流媒体数据时,流媒体处理服务器首先可以从所述流媒体服务器中获取该流媒体数据的索引文件,该索引文件可以是m3u8格式的文件。根据HLS协议,所述流媒体数据可以被划分为多个分片文件,每个分片文件可以采用ts格式。在所述索引文件中,可以记录各个所述分片文件的分片信息。具体地,所述索引文件中可以记录流媒体数据的播放类型(点播还是直播)、每个分片文件的最大时长、各个分片文件的文件标识、各个分片文件的实际持续时长等各项信息。其中,每项信息都以各自的标签作为开头。例如,表征流媒体数据播放类型为点播的标签,可以是EXT-X-ENDLIST;表征各个分片文件的实际持续时长的标签,可以是EXTINF;表征每个分片文件的最大时长的标签,可以是EXT-X-TARGETDURATION。上述的分片文件的文件标识可以是用于表征分片 文件的字符串。例如,所述文件标识可以是分片文件的名称,也可以是分片文件在流媒体服务器中进行存储时,由流媒体服务器分配的后台编号。
S3:根据所述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件。
在本实施例中,通过解析所述流媒体数据的索引文件,可以构建出流媒体数据的分片文件列表。在该分片文件列表中,可以记录各个分片文件的文件标识、起始时间节点、持续时长和终止时间节点等信息中的一种或多种。这样,流媒体处理服务器通过解析所述索引文件,可以确定各个所述分片文件的起始时间节点和终止时间节点。
请参阅图3,为了确定各个分片文件的起始时间节点和终止时间节点,流媒体处理服务器可以针对以上述EXTINF标签为开头的信息进行解析。具体地,流媒体服务器可以逐行读取所述索引文件的内容,若当前读取的内容以指定标签为开头,则可以解析所述当前读取的内容。其中,所述指定标签便可以是上述用于表征各个分片文件的实际持续时长的标签。举例来说,在一个实际应用示例中,所述索引文件的部分内容可以如下所示:
{
#EXTINF:10,
2000kbps-00003.ts
#EXTINF:10,
2000kbps-00004.ts
}
其中,针对以#EXTINF为开头的内容,流媒体处理服务器可以解析这部 分内容,从而确定出当前分片文件的持续时间为10秒。
如果当前读取的内容未以所述指定标签为开头,那么表征当前读取的内容无法提供有关播放时长的信息,因此可以直接跳过所述当前读取的内容,并判断所述索引文件的内容是否读取完毕,若未读取完毕,则可以继续读取下一行的内容,直至所述索引文件的内容读取完毕为止。
这样,通过上述逐行读取的方式,可以解析出各个分片文件的持续时间。在本实施例中,可以根据解析的结果,分析出各个分片文件的起始时间节点和终止时间节点。具体地,在开始解析索引文件时,可以设置一个全局的累计时长参数,该累计时长参数的初始值可以是0。然后,流媒体处理服务器在所述索引文件中读取当前分片文件的内容时,可以将所述累计时长参数中当前累计的总时长作为所述当前分片文件的起始时间节点。例如,流媒体处理服务器读取到的第一个分片文件的内容时,该第一个分片文件的起始时间节点便可以是0。然后,在解析完当前分片文件的内容后,可以将当前分片文件的持续时长累加至所述累计时长参数中。这样,在将当前累计的总时长作为所述当前分片文件的起始时间节点之后,可以在所述总时长的基础上添加所述当前分片文件的持续时长,并将得到的结果作为所述当前分片的终止时间节点。例如,假设第一个分片文件的持续时长为10秒,那么第一个分片文件的终止时间节点便可以是10秒。
这样,通过不断更新累计时长参数中的数值,从而可以依次确定出各个分片文件的起始时间节点和终止时间节点。
在本实施例中,如果所述流媒体数据中存在需要修改的内容,可以提供对应的数据替换信息。所述数据替换信息可以用于表征所述流媒体数据中待替 换的时长区间。在实际应用中,所述数据替换信息中可以包括待替换的起始时间节点和待替换的时长。这样,通过待替换的起始时间节点和待替换的时长,便可以确定出待替换的时长区间。例如,该时长区间可以是流媒体数据中的1分10秒至2分20秒。
在本实施例中,根据上述的数据替换信息和索引文件,可以在所述流媒体数据划分得到的各个分片文件中,确定出待替换的目标分片文件。具体地,根据所述索引文件可以确定出各个分片文件的起始时间节点和终止时间节点,那么如果某个分片文件有一部分内容落入上述的时长区间内,那么便可以将该分片文件作为待替换的目标分片文件。如图4所示,流媒体处理服务器可以遍历各个所述分片文件,若当前的分片文件的起始时间节点或者终止时间节点位于所述待替换的时长区间内,便可以将所述当前的分片文件作为所述待替换的目标分片文件。例如在图4中,阴影填充的三个分片文件,均可以作为待替换的目标分片文件。
S5:将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,得到内容替换后的流媒体数据。
在本实施例中,流媒体数据的上传者可以提供用于替换所述目标分片文件的替换流媒体数据,当然,在实际应用中,所述替换流媒体数据也可以是流媒体服务器预先准备的格式化的流媒体数据。例如,所述替换流媒体数据表征的视频画面可以是带有“该部分内容不予展示”字样的画面。这样,流媒体处理服务器在确定出待替换的目标分片文件后,可以读取预设的替换流媒体数据,并对所述替换流媒体数据进行一系列处理后,将该替换流媒体数据转换为与所 述目标分片文件相匹配的替换分片文件。
考虑到所述预设的替换流媒体数据的时长与需要替换的目标分片文件的时长可能不一致,为了保证内容替换后,索引文件不发生变动,因此需要将替换流媒体数据的时长处理为与所述目标分片的时长保持一致。具体地,可以确定所述目标分片文件覆盖的时长,并将确定的所述时长与所述替换流媒体数据的总时长进行对比。其中,所述目标分片文件覆盖的时长,可以指待替换的各个目标分片文件的时长总和。请参阅图5,若确定的所述时长大于所述替换流媒体数据的总时长,则表明替换流媒体数据的时长不够,此时,可以在所述替换流媒体数据之后继续填充所述替换流媒体数据的内容,直至填充内容后的替换流媒体数据的总时长与确定的所述时长一致为止。例如在图5中,需要在原先的替换流媒体数据之后,继续填充1.5倍的替换流媒体数据的内容,才使得填充内容后的替换流媒体数据的时长与目标分片文件的总时长一致。然后,可以将填充内容后的替换流媒体数据作为上述的预设的替换流媒体数据。
另外,请参阅图6,若确定的所述时长小于所述替换流媒体数据的总时长,则表示替换流媒体数据的总时长过长,那么可以如图6所示,从所述替换流媒体数据中截取与目标分片文件的时长一致的数据片段,并将截取的所述数据片段作为上述的预设的替换流媒体数据。
在本实施例中,在对替换流媒体数据的数据长度进行上述的处理后,可以将处理后的替换流媒体数据的流媒体属性转换为与所述目标分片文件的流媒体属性一致。所述流媒体属性可以包括音频属性、视频属性、节目关联表(Program Association Table,PAT)信息和节目映射表(Program Map Tables,PMT)信息等各种属性。其中,所述视频属性包括视频编码方法、视频分辨率 和视频帧率中的至少一种,所述音频属性包括音频编码方式、音频采样率和音频声道数中的至少一种。当然,在实际应用中,上述的音频属性和视频属性还可以包括更多或者更少的内容。
在本实施例中,可以通过ffmpeg等视频转换工具,可以将所述预设的替换流媒体数据的视频属性和音频属性分别转换为与所述目标分片文件的视频属性和音频属性一致,并且可以对经过视频属性和音频属性转换后的替换流媒体数据进行格式转换,从而转换为流文件(ts文件),并且在进行格式转换时,可以使得所述流文件的节目关联表信息和节目映射表信息与所述目标分片文件的节目关联表信息和节目映射表信息保持一致。这样,无论所述预设的替换流媒体数据具备何种流媒体属性,通过本申请提供的技术方案,都能够转换为与待替换的流媒体数据相匹配的流媒体属性。此外,同一份替换流媒体数据,也可以适用于不同流媒体属性的流媒体数据,从而降低了对替换流媒体数据的要求,进而提高了流媒体数据的替换效率。
在本实施例中,经过时长校正和属性转换后的替换流媒体数据,可以被划分为与所述目标分片文件的数量相匹配的替换分片文件。具体地,划分后的替换分片文件,不仅与目标分片文件的数量相匹配,并且起始时间节点也一一对应,从而可以完美替代目标分片文件。
在本实方式中,为了保证索引文件不发生变化,替换分片文件需要使用目标分片文件的文件标识进行存储。具体地,流媒体处理服务器可以从所述索引文件中读取各个所述目标分片文件的文件标识,并将读取的所述文件标识分别赋予给对应的所述替换分片文件。这样,利用携带所述文件标识的所述替换分片文件替换所述流媒体数据中的所述目标分片文件,便可以保证流媒体数据 的索引文件不发生变化。对于流媒体播放客户端而言,如果之前下载过流媒体数据的索引文件,那么无需重新下载索引文件,也能够直接根据原先的索引文件进行替换后的流媒体数据的播放。这样,流媒体数据的内容替换过程,对于流媒体播放客户端而言是无感知的,从而不需要增加流媒体播放客户端的额外开销。
本申请还提供一种流媒体处理服务器,请参阅图7,所述流媒体处理服务器包括:
索引文件获取单元,用于获取流媒体数据的索引文件,所述流媒体数据被划分为多个分片文件;
目标分片文件确定单元,用于根据所述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件;
内容替换单元,用于将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,得到内容替换后的流媒体数据。
在一个实施例中,所述流媒体处理服务器还包括:
属性解析单元,用于读取各个所述目标分片文件,并解析所述目标分片文件的流媒体属性;
所述内容替换单元,还用于将所述预设的替换流媒体数据的流媒体属性转换为与所述目标分片文件的流媒体属性一致,并将属性转换后的替换流媒体数据划分为与所述目标分片文件的数量相匹配的替换分片文件。
在一个实施例中,所述流媒体处理服务器还包括:
时长对比单元,用于确定所述目标分片文件覆盖的时长,并将确定的所述 时长与所述替换流媒体数据的总时长进行对比;
循环补齐单元,用于若确定的所述时长大于所述替换流媒体数据的总时长,在所述替换流媒体数据之后继续填充所述替换流媒体数据的内容,直至填充内容后的替换流媒体数据的总时长与确定的所述时长一致为止,并将所述填充内容后的替换流媒体数据作为所述预设的替换流媒体数据;
截取单元,用于若确定的所述时长小于所述替换流媒体数据的总时长,从所述替换流媒体数据中截取与确定的所述时长一致的数据片段,并将截取的所述数据片段作为所述预设的替换流媒体数据。
在一个实施例中,所述内容替换单元包括:
音视频属性转换模块,用于将所述预设的替换流媒体数据的视频属性和音频属性分别转换为与所述目标分片文件的视频属性和音频属性一致;所述视频属性包括视频编码方法、视频分辨率和视频帧率中的至少一种,所述音频属性包括音频编码方式、音频采样率和音频声道数中的至少一种;
流文件转换模块,用于将经过视频属性和音频属性转换后的替换流媒体数据转换为流文件,并且所述流文件的节目关联表信息和节目映射表信息与所述目标分片文件的节目关联表信息和节目映射表信息保持一致。
在一个实施例中,所述内容替换单元包括:
文件标识赋予模块,用于从所述索引文件中读取所述目标分片文件的文件标识,并将读取的所述文件标识赋予所述替换分片文件;
替换模块,用于利用携带所述文件标识的所述替换分片文件替换所述流媒体数据中的所述目标分片文件。
请参阅图8,本申请还提供一种流媒体处理服务器,所述流媒体处理服 务器包括处理器和存储器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现上述的流媒体数据的处理方法。
请参阅图9,在本申请中,上述实施例中的技术方案均可以应用于如图9所示的计算机终端10上。计算机终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。本领域普通技术人员可以理解,图9所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图9中所示更多或者更少的组件,或者具有与图9所示不同的配置。
存储器104可用于存储应用软件的软件程序以及模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
由上可见,本申请提供的技术方案,可以通过流媒体处理服务器完成对流媒体数据的内容替换过程。具体地,流媒体处理服务器可以获取需要进行内容替换的流媒体数据的索引文件。然后,根据数据替换信息和该索引文件,可以在流媒体数据划分得到的多个分片文件中,确定需要替换的目标分片文件。针对这些(或者这个)目标分片文件,可以提供相应的替换流媒体数据。流媒体处理服务器可以读取该替换流媒体数据,然后将该替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,从而得到内容替换后的流媒体数据。由上可见,在对流媒体数据进行内容替换时,并不需要更换整个流媒体数据的内容,而是可以在流媒体数据中确定出需要替换的一部分目标分片文件,然后将这部分目标分片文件用相匹配的替换分片文件进行替换即可。这样,在流媒体服务器中,并不需要执行重新分片和建立索引文件的步骤。另外,本申请提供的技术方案,只是针对流媒体数据中的分片文件进行替换,因此并不会改变流媒体数据的索引文件,这样,在流媒体播放端,使用原先的索引文件就能够正常播放内容替换后的流媒体数据,无需重新下载索引文件。因此,本申请提供的流媒体数据的处理方法及流媒体处理服务器,能够节省流媒体服务器和流媒体播放端的开销,并提高内容替换的效率。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,针对服务器的实施例来说,均可以参照前述方法的实施例的介绍对照解释。
通过以上的实施例的描述,本领域的技术人员可以清楚地了解到各实施 例可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
以上所述仅为本申请的部分实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (14)

  1. 一种流媒体数据的处理方法,其中,所述方法包括:
    获取流媒体数据的索引文件,所述流媒体数据被划分为多个分片文件;
    根据所述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件;
    将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,得到内容替换后的流媒体数据。
  2. 根据权利要求1所述的方法,其中,所述数据替换信息用于表征所述流媒体数据中待替换的时长区间;
    相应地,根据所述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件包括:
    解析所述索引文件,以确定各个所述分片文件的起始时间节点和终止时间节点;
    遍历各个所述分片文件,若当前的分片文件的起始时间节点或者终止时间节点位于所述待替换的时长区间内,将所述当前的分片文件作为所述待替换的目标分片文件。
  3. 根据权利要求2所述的方法,其中,解析所述索引文件包括:
    逐行读取所述索引文件的内容,若当前读取的内容以指定标签为开头,解析所述当前读取的内容;所述指定标签用于表征分片文件的持续时长;
    若当前读取的内容未以所述指定标签为开头,跳过所述当前读取的内容,并判断所述索引文件的内容是否读取完毕,若未读取完毕,继续读取下一行的内容,直至所述索引文件的内容读取完毕为止。
  4. 根据权利要求2或3所述的方法,其中,确定各个所述分片文件的起始时间节点和终止时间节点包括:
    在所述索引文件中读取当前分片文件的内容时,将当前累计的总时长作为所述当前分片文件的起始时间节点;
    在所述总时长的基础上添加所述当前分片文件的持续时长,并将得到的结果作为所述当前分片的终止时间节点。
  5. 根据权利要求1所述的方法,其中,在所述多个分片文件中确定待替换的目标分片文件之后,所述方法还包括:
    读取各个所述目标分片文件,并解析所述目标分片文件的流媒体属性;
    相应地,将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件包括:
    将所述预设的替换流媒体数据的流媒体属性转换为与所述目标分片文件的流媒体属性一致,并将属性转换后的替换流媒体数据划分为与所述目标分片文件的数量相匹配的替换分片文件。
  6. 根据权利要求5所述的方法,其中,在将所述预设的替换流媒体数据的流媒体属性转换为与所述目标分片文件的流媒体属性一致之前,所述方法还包括:
    确定所述目标分片文件覆盖的时长,并将确定的所述时长与所述替换流媒体数据的总时长进行对比;
    若确定的所述时长大于所述替换流媒体数据的总时长,在所述替换流媒体数据之后继续填充所述替换流媒体数据的内容,直至填充内容后的替换流媒体数据的总时长与确定的所述时长一致为止,并将所述填充内容后的替换流媒体数据作为所述预设的替换流媒体数据;
    若确定的所述时长小于所述替换流媒体数据的总时长,从所述替换流媒体数据中截取与确定的所述时长一致的数据片段,并将截取的所述数据片段作为所述预设的替换流媒体数据。
  7. 根据权利要求5或6所述的方法,其中,将所述预设的替换流媒体数据的流媒体属性转换为与所述目标分片文件的流媒体属性一致包括:
    将所述预设的替换流媒体数据的视频属性和音频属性分别转换为与所述目标分片文件的视频属性和音频属性一致;所述视频属性包括视频编码方法、视频分辨率和视频帧率中的至少一种,所述音频属性包括音频编码方式、音频采样率和音频声道数中的至少一种;
    将经过视频属性和音频属性转换后的替换流媒体数据转换为流文件,并且所述流文件的节目关联表信息和节目映射表信息与所述目标分片文件的节目关联表信息和节目映射表信息保持一致。
  8. 根据权利要求1所述的方法,其中,利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件包括:
    从所述索引文件中读取所述目标分片文件的文件标识,并将读取的所述文件标识赋予所述替换分片文件;
    利用携带所述文件标识的所述替换分片文件替换所述流媒体数据中的所述目标分片文件。
  9. 一种流媒体处理服务器,其中,所述流媒体处理服务器包括:
    索引文件获取单元,用于获取流媒体数据的索引文件,所述流媒体数据被划分为多个分片文件;
    目标分片文件确定单元,用于根据所述索引文件和数据替换信息,在所述多个分片文件中确定待替换的目标分片文件;
    内容替换单元,用于将预设的替换流媒体数据转换为与所述目标分片文件相匹配的替换分片文件,并利用所述替换分片文件替换所述流媒体数据中的所述目标分片文件,得到内容替换后的流媒体数据。
  10. 根据权利要求9所述的流媒体处理服务器,其中,所述流媒体处理服务器还包括:
    属性解析单元,用于读取各个所述目标分片文件,并解析所述目标分片文件的流媒体属性;
    所述内容替换单元,还用于将所述预设的替换流媒体数据的流媒体属性转换为与所述目标分片文件的流媒体属性一致,并将属性转换后的替换流媒体数据划分为与所述目标分片文件的数量相匹配的替换分片文件。
  11. 根据权利要求10所述的流媒体处理服务器,其中,所述流媒体处理服务器还包括:
    时长对比单元,用于确定所述目标分片文件覆盖的时长,并将确定的所述时长与所述替换流媒体数据的总时长进行对比;
    循环补齐单元,用于若确定的所述时长大于所述替换流媒体数据的总时长,在所述替换流媒体数据之后继续填充所述替换流媒体数据的内容,直至填充内 容后的替换流媒体数据的总时长与确定的所述时长一致为止,并将所述填充内容后的替换流媒体数据作为所述预设的替换流媒体数据;
    截取单元,用于若确定的所述时长小于所述替换流媒体数据的总时长,从所述替换流媒体数据中截取与确定的所述时长一致的数据片段,并将截取的所述数据片段作为所述预设的替换流媒体数据。
  12. 根据权利要求10或11所述的流媒体处理服务器,其中,所述内容替换单元包括:
    音视频属性转换模块,用于将所述预设的替换流媒体数据的视频属性和音频属性分别转换为与所述目标分片文件的视频属性和音频属性一致;所述视频属性包括视频编码方法、视频分辨率和视频帧率中的至少一种,所述音频属性包括音频编码方式、音频采样率和音频声道数中的至少一种;
    流文件转换模块,用于将经过视频属性和音频属性转换后的替换流媒体数据转换为流文件,并且所述流文件的节目关联表信息和节目映射表信息与所述目标分片文件的节目关联表信息和节目映射表信息保持一致。
  13. 根据权利要求9所述的流媒体处理服务器,其中,所述内容替换单元包括:
    文件标识赋予模块,用于从所述索引文件中读取所述目标分片文件的文件标识,并将读取的所述文件标识赋予所述替换分片文件;
    替换模块,用于利用携带所述文件标识的所述替换分片文件替换所述流媒体数据中的所述目标分片文件。
  14. 一种流媒体处理服务器,其中,所述流媒体处理服务器包括处理器和存储器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现如权利要求1至8中任一所述的方法。
PCT/CN2019/096178 2019-06-11 2019-07-16 一种流媒体数据的处理方法及流媒体处理服务器 WO2020248324A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19805507.1A EP3780642A1 (en) 2019-06-11 2019-07-16 Streaming media data processing method and streaming media processing server
US16/717,608 US11223856B2 (en) 2019-06-11 2019-12-17 Method for processing streaming media data and server for processing streaming media

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910499096.3 2019-06-11
CN201910499096.3A CN110267117B (zh) 2019-06-11 2019-06-11 一种流媒体数据的处理方法及流媒体处理服务器

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/717,608 Continuation US11223856B2 (en) 2019-06-11 2019-12-17 Method for processing streaming media data and server for processing streaming media

Publications (1)

Publication Number Publication Date
WO2020248324A1 true WO2020248324A1 (zh) 2020-12-17

Family

ID=67917456

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096178 WO2020248324A1 (zh) 2019-06-11 2019-07-16 一种流媒体数据的处理方法及流媒体处理服务器

Country Status (4)

Country Link
US (1) US11223856B2 (zh)
EP (1) EP3780642A1 (zh)
CN (1) CN110267117B (zh)
WO (1) WO2020248324A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111031354B (zh) * 2019-12-09 2020-12-01 腾讯科技(深圳)有限公司 一种多媒体播放方法、装置及存储介质
CN111246315B (zh) * 2020-01-21 2022-06-03 咪咕视讯科技有限公司 视频交互方法、系统、边缘节点、客户端及存储介质
CN112866409B (zh) * 2021-02-08 2022-10-11 深圳市杉岩数据技术有限公司 基于对象存储分片上传的对象传送及收集方法、终端设备
CN114363304B (zh) * 2021-12-27 2024-04-19 浪潮通信技术有限公司 Rtp视频流存储、播放方法及装置
CN115086708B (zh) * 2022-06-06 2024-03-08 北京奇艺世纪科技有限公司 一种视频播放方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105959746A (zh) * 2016-06-01 2016-09-21 北京奇艺世纪科技有限公司 一种文件生成方法及装置
CN106210809A (zh) * 2016-08-09 2016-12-07 亦非云互联网技术(上海)有限公司 一种视频直播中插播广告的方法及系统
CN109155864A (zh) * 2016-05-04 2019-01-04 维丹格尔股份有限公司 无缝流传输和过滤
US10313412B1 (en) * 2017-03-29 2019-06-04 Twitch Interactive, Inc. Latency reduction for streaming content replacement

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9301020B2 (en) * 2010-11-30 2016-03-29 Google Technology Holdings LLC Method of targeted ad insertion using HTTP live streaming protocol
CN104041061A (zh) * 2011-08-10 2014-09-10 瑞典爱立信有限公司 媒体流处置
US10476923B2 (en) * 2013-04-05 2019-11-12 Arris Enterprises Llc Filtering content for adaptive streaming
US9319730B2 (en) * 2014-01-13 2016-04-19 Spb Tv Ag Method and a system for targeted video stream insertion
US20150302487A1 (en) * 2014-04-17 2015-10-22 Ericsson Television Inc. Method and arrangement for providing adaptive bitrate-dynamic advertisements
US9955218B2 (en) * 2015-04-28 2018-04-24 Rovi Guides, Inc. Smart mechanism for blocking media responsive to user environment
CN105897672A (zh) * 2015-11-16 2016-08-24 乐视云计算有限公司 网络直播方法、装置及系统
US20170147830A1 (en) * 2015-11-24 2017-05-25 Comcast Cable Communications, Llc Adaptive Rights Management System
US10114689B1 (en) * 2015-12-28 2018-10-30 Amazon Technologies, Inc. Dynamic playlist generation
US10602235B2 (en) * 2016-12-29 2020-03-24 Arris Enterprises Llc Video segment detection and replacement
TWI647955B (zh) * 2017-06-05 2019-01-11 中華電信股份有限公司 Linear channel replacement film system and method thereof
CN109040827B (zh) * 2018-08-27 2021-07-13 Tcl移动通信科技(宁波)有限公司 一种视频文件的播放方法、存储介质及智能终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109155864A (zh) * 2016-05-04 2019-01-04 维丹格尔股份有限公司 无缝流传输和过滤
CN105959746A (zh) * 2016-06-01 2016-09-21 北京奇艺世纪科技有限公司 一种文件生成方法及装置
CN106210809A (zh) * 2016-08-09 2016-12-07 亦非云互联网技术(上海)有限公司 一种视频直播中插播广告的方法及系统
US10313412B1 (en) * 2017-03-29 2019-06-04 Twitch Interactive, Inc. Latency reduction for streaming content replacement

Also Published As

Publication number Publication date
EP3780642A4 (en) 2021-02-17
CN110267117B (zh) 2020-11-27
US20200396492A1 (en) 2020-12-17
CN110267117A (zh) 2019-09-20
EP3780642A1 (en) 2021-02-17
US11223856B2 (en) 2022-01-11

Similar Documents

Publication Publication Date Title
WO2020248324A1 (zh) 一种流媒体数据的处理方法及流媒体处理服务器
US11245940B2 (en) Method and apparatus for transmitting media data in multimedia transport system
US10595065B2 (en) Method and apparatus for transmitting and receiving multi-media services
US11374993B2 (en) Reception device, reception method, transmission device, and transmission method
US10116572B2 (en) Method, device, and system for acquiring streaming media data
US11575717B2 (en) Receiving device, reception method, transmitting device, and transmission method
CN108712654B (zh) 一种音视频流的转码方法及设备
CN108124202B (zh) 一种使流媒体服务器支持hls协议的方法
US9246971B2 (en) System and method for segment demarcation and identification in adaptive streaming
CN107634930B (zh) 一种媒体数据的获取方法和装置
US9628547B2 (en) Media file receiving and media file sending methods, apparatuses, and systems
CN105828096B (zh) 媒体流文件的处理方法和装置
US20150020138A1 (en) Mmt asset structure for supporting random access to systems for transmitting coded media data in heterogeneous networks, and method and apparatus for generating same
WO2011032382A1 (zh) 一种推送视频及数据内容实现本地点播的方法及系统
CN104618738A (zh) 一种智能电视节目播放方法及装置
CN104918108A (zh) 一种基于hls协议的视频精确定位装置及方法
WO2018014545A1 (zh) 一种码流数据的处理方法及装置
CN106658150B (zh) 一种实现回看处理的方法及装置
KR102384709B1 (ko) 수신 장치, 수신 방법, 송신 장치, 및 송신 방법
CN114173145A (zh) 一种基于hls协议动态码率低延迟直播方法
CN113207007A (zh) 基于hls协议的直播录制方法
KR20160033027A (ko) 멀티미디어의 전송 또는 수신 방법 및 그 장치
CN103002324A (zh) 一种3g手机电视直播方法及系统

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2019805507

Country of ref document: EP

Effective date: 20191127

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

Ref document number: 19805507

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE