WO2017035786A1 - Method, device, and system for playing and checking streaming media file - Google Patents

Method, device, and system for playing and checking streaming media file Download PDF

Info

Publication number
WO2017035786A1
WO2017035786A1 PCT/CN2015/088765 CN2015088765W WO2017035786A1 WO 2017035786 A1 WO2017035786 A1 WO 2017035786A1 CN 2015088765 W CN2015088765 W CN 2015088765W WO 2017035786 A1 WO2017035786 A1 WO 2017035786A1
Authority
WO
WIPO (PCT)
Prior art keywords
data block
file
streaming media
data
server
Prior art date
Application number
PCT/CN2015/088765
Other languages
French (fr)
Chinese (zh)
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 PCT/CN2015/088765 priority Critical patent/WO2017035786A1/en
Publication of WO2017035786A1 publication Critical patent/WO2017035786A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received

Definitions

  • the invention belongs to the field of the Internet, and in particular relates to a method, device and system for playing and verifying streaming media files.
  • the currently used streaming media protocols mainly include HTTP progressive download and RTSP/RTP-based.
  • Real-time streaming protocol mainly include HTTP progressive download and RTSP/RTP-based.
  • HTTP progressive download mainly include HTTP progressive download and RTSP/RTP-based.
  • Real-time streaming protocol mainly include HTTP progressive download and RTSP/RTP-based.
  • HTTP Live Streaming is a method of using the more typical HTTP progressive download.
  • the encoder compresses and encodes the collected audio and video data into an audio/video elementary stream conforming to a specific standard, and can also use the encoded file.
  • the files after the encoding is complete must be H.264 video and AAC audio.
  • the encoded video and audio are then packaged into an MPEG TS format.
  • the encapsulated MPEGTS is stream-divided to split the MPEG transport stream into a plurality of ts. Fragmentation of the file.
  • the segmentation process usually divides the slice by time, for example, it is divided into one slice for 10s duration, and if the code stream is high, the slice can be divided into 5 segments.
  • Second. And generate an index file (suffix m3u8) containing pointers to these small TS fragments, and put the index file and the cut TS fragments into a common WEB server.
  • the index and the slice are downloaded through the standard HTTP protocol, and the video can be clicked or broadcasted. Since the data is transmitted through the HTTP protocol, there is no firewall or proxy problem, and the segment file is in the HLS technology. The duration is very short, and the client can quickly select and switch the bit rate to accommodate playback under different bandwidth conditions.
  • the current HLS playback technology is usually used for data transfer between a single server and a client. If the data on the server is damaged, it will affect the video playback quality of all clients.
  • the currently used streaming media protocols mainly include HTTP progressive download and RTSP/RTP-based.
  • Real-time streaming protocol mainly include HTTP progressive download and RTSP/RTP-based.
  • HTTP progressive download mainly include HTTP progressive download and RTSP/RTP-based.
  • Real-time streaming protocol mainly include HTTP progressive download and RTSP/RTP-based.
  • HTTP Live Streaming is a method of using the more typical HTTP progressive download.
  • the encoder compresses and encodes the collected audio and video data into an audio/video elementary stream conforming to a specific standard, and can also use the encoded file.
  • the files after the encoding is complete must be H.264 video and AAC audio.
  • the encoded video and audio are then packaged into an MPEG TS format.
  • the encapsulated MPEGTS is stream-divided to split the MPEG transport stream into a plurality of ts. Fragmentation of the file.
  • the segmentation process usually divides the slice by time, for example, it is divided into one slice for 10s duration, and if the code stream is high, the slice can be divided into 5 segments.
  • Second. And generate an index file (suffix m3u8) containing pointers to these small TS fragments, and put the index file and the cut TS fragments into a common WEB server.
  • the index and the slice are downloaded through the standard HTTP protocol, and the video can be clicked or broadcasted. Since the data is transmitted through the HTTP protocol, there is no firewall or proxy problem, and the segment file is in the HLS technology. The duration is very short, and the client can quickly select and switch the bit rate to accommodate playback under different bandwidth conditions.
  • the current HLS playback technology is usually used for data transfer between a single server and a client. If the data on the server is damaged, it will affect the video playback quality of all clients.
  • an embodiment of the present invention provides a method for playing and verifying a streaming media file, where the method includes:
  • the data block whose check information does not match is downloaded to the check server.
  • the Obtaining a merged file generated after the streaming media fragmentation according to the HLS technology, and cutting the preset size of the merged file license into a plurality of data blocks, and including, in each data block, a sequence number corresponding to the data block and a verification information step specific include:
  • the merged file is sequentially cut according to a preset size to obtain a plurality of data blocks, where the data block includes a serial number corresponding to the data block and corresponding verification information.
  • the method further includes:
  • the shards are formed according to the acquired data blocks, and are sent to the player for playback.
  • the step of storing the data block to the calibration server and the plurality of P2P servers includes:
  • a partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
  • the step of the P2P client downloading a data block from the P2P server includes:
  • the data block download task of the corresponding size is allocated to each P2P server, and the data block is downloaded according to the allocated download task.
  • the method Before the step of acquiring the merged file generated after the streaming media is fragmented according to the HLS technology, the method further includes:
  • the encoder Encoding the video, the encoder encodes the collected video data into a video of H.264 format, and encodes the collected audio data into audio of ACC format;
  • the encoded video and audio are packaged into a streaming media file in MPEG format.
  • an embodiment of the present invention provides a playback verification device for a streaming media file, where the device includes:
  • a streaming media file cutting unit configured to acquire a merged file generated after the streaming media fragmentation according to the HLS technology, and cut the preset size of the merged file license into a plurality of data blocks, and include the data block corresponding to each data block.
  • a data block storage unit configured to store the data block to a calibration server and a plurality of P2P servers;
  • a first downloading unit configured to download, by the P2P client, the data block from the P2P server according to the sequence number of the data block;
  • a check unit configured to calculate a check value for the downloaded data block, and determine whether the calculated check value matches the check information stored in the data block;
  • a second downloading unit configured to: if the check value does not match the verification information stored in the data block, download a data block that does not match the verification information to the verification server.
  • the streaming media file cutting unit specifically includes:
  • a first segmentation subunit configured to acquire a streaming media file, and divide the streaming media file according to a preset duration, to obtain a plurality of fragments corresponding to the streaming media file, and an offset including the fragmentation And an index file pointing to the pointer of the shard;
  • a merging sub-unit configured to merge the index file with the shard that is divided by the streaming media file to generate a merged file
  • the second segmentation sub-unit is configured to sequentially cut the merged file according to a preset size to obtain a plurality of data blocks, where the data block includes a sequence number corresponding to the data block and corresponding verification information.
  • the device further includes:
  • An index file generating unit configured to generate an index file according to the obtained data block if the check value matches the check information stored in the data block;
  • a data block obtaining unit configured to calculate and acquire a data block corresponding to the fragment according to the fragment pointed by the pointer in the index file, and the size of the data block and the offset of the fragment;
  • the slice sending and playing unit is configured to form a slice according to the acquired data block, and send it to the player for playing.
  • the data storage unit is specifically configured to:
  • a partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
  • the first downloading unit includes:
  • a communication speed information obtaining subunit configured to acquire communication speed information between the P2P client and the plurality of P2P servers
  • a task allocation subunit configured to allocate a data block download task of a corresponding size to each P2P server according to the communication speed information between the P2P client and the plurality of P2P servers, and perform data block according to the allocated download task. download.
  • the method further includes:
  • a coding unit configured to encode the video, and encode the collected video data into a video of H.264 format, and encode the collected audio data into audio of ACC format;
  • a closed unit for encapsulating the encoded video and audio into a streaming media file in MPEG format A closed unit for encapsulating the encoded video and audio into a streaming media file in MPEG format.
  • an embodiment of the present invention provides a playback verification system for a streaming media file, where the playback verification system includes:
  • the P2P server is configured to store the cut data block, where the data block includes a sequence number corresponding to the data block, where the file to be cut is a segment after the segmentation of the streaming media file and an index corresponding to the segment a file after the file is merged, the index file includes an offset of the slice and a pointer to the slice;
  • the verification server stores all the data blocks after the stream media file is cut, and the data block includes a sequence number corresponding to the data block, wherein the file to be cut is a segmentation of the stream media file and the segmentation a merged file of the index file corresponding to the fragment, where the index file includes an offset of the fragment and a pointer to the fragment;
  • the P2P client is configured to obtain a data block from one or more P2P servers, calculate a check value for the obtained data block, and determine whether the calculated check value matches the check information stored in the data block. If the check value does not match the verification information stored in the data block, downloading a data block whose verification information does not match to the verification server, and obtaining an index file according to the serial number of the downloaded verified data block, The index file is parsed to obtain the size of the fragment of the streaming media file to be played and the data block to be read, and the downloaded data block is sent to the player for playback.
  • the streaming media file is cut into a plurality of data blocks according to a preset size, and then the data blocks are stored in a plurality of P2P servers, and since each data block includes a corresponding data block number, the P2P
  • the client can download the required data block from different P2P servers according to the sequence number of the data block, and perform verification according to the verification information in the data block.
  • the server re-downloads, so that the data in the P2P server is damaged, the undamaged data can be automatically verified and downloaded, thereby improving the quality of the playback.
  • FIG. 1 is a flowchart showing an implementation process of a playback verification method for a streaming media file according to a first embodiment of the present invention
  • FIG. 2 is a flowchart showing an implementation process of a method for generating a merged file according to a second embodiment of the present invention
  • FIG. 3 is a flowchart of implementing a method for playing a streaming media file according to a third embodiment of the present invention.
  • FIG. 4 is a flowchart showing an implementation process of a playback verification method for a streaming media file according to a fourth embodiment of the present invention.
  • FIG. 5 is a flowchart of an implementation process of a playback verification method for a streaming media file according to a fifth embodiment of the present invention.
  • FIG. 6 is a flowchart showing an implementation process of a playback verification method for a streaming media file according to a sixth embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a playback verification device for a streaming media file according to a seventh embodiment of the present invention.
  • the purpose of the embodiment of the present invention is to solve the problem of data transmission between a single server and a client when using the HLS technology for video playback in the prior art. If the data on the server is damaged, the video playback of all the clients will be affected. quality.
  • the present invention cuts a streaming media file into a plurality of data blocks according to a preset size, and then stores the data blocks in a plurality of P2P servers, since each data block includes a corresponding data block serial number. Therefore, the P2P client can download the required data block from different P2P servers according to the sequence number of the data block, and perform verification according to the verification information in the data block, and cannot pass the verification when the data block is damaged, and When the data is re-downloaded in the verification server, so that the data in the P2P server is damaged, the undamaged data can be automatically verified and downloaded, thereby improving the quality of the playback.
  • the details will be described below with reference to the drawings.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 1 is a flowchart showing an implementation process of a method for storing a streaming media file according to a first embodiment of the present invention, which is described in detail as follows:
  • step S101 the merge file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the data sequence corresponding to the data block is included in each data block. Verify the information.
  • the streaming media file obtained in the embodiment of the present invention is used for storing in a P2P server for downloading by the P2P client.
  • the streaming file fragment file and the index file are set in the same server. If the fragment file is damaged, if the file cannot be repaired effectively, all the client downloads the damaged fragment file. Playback will affect the playback quality of streaming media files.
  • the present invention proposes to further cut the merged file after the streaming media file fragmentation by the HLS technology, generate a plurality of data blocks, and include the sequence number of the data block and the verification information in each data block.
  • sequence numbers of the data blocks are sequentially sorted according to the set starting values. For example, the numbers can be numbered starting from 1, and the data blocks are cut according to the order, such as data block 1, data block 2, data block 3, etc. Data block N.
  • Cutting the merged file may be performed by the user using a cutting tool to cut the data, or the cutting algorithm may be integrated into the software to automatically cut the merged file.
  • the user uses the cutting tool method, for example, after generating the merged file, importing the merged file into the cutting tool, generating the required data block in the specified folder, and the name of the folder can be set to correspond to the streaming media file.
  • the name is a name.
  • the cut data block can be stored in the disk or the memory. If it is stored in the memory, the data block can be sent to other P2P servers or the verification server relatively quickly.
  • the merged file described in the embodiment of the present invention may be a file composed of all the fragments, or may be a file including a slice file and an index file. If the merged file is a full slice file, the first sequence number of the data block corresponds to the start position of the first slice.
  • the data block generated by the index file needs to be considered when calculating the correspondence between the sequence number and the slice of the data block.
  • the size of the index file is 10K
  • the size of each data block is 1K
  • the data block number corresponding to the starting position of the first fragment is number 11.
  • step S102 the data block is stored in a correction server and a plurality of P2P servers.
  • the difference from the traditional P2P server structure is that the present invention further includes a verification server, and the data block can be stored in the P2P server and the verification server.
  • the data block stored in the P2P server and the verification server includes a data block sequence number and an identifier of the stream media corresponding to each data block, and the plurality of data blocks may be stored in a folder including a stream file identifier name. Achieve the distinction between different streaming media files.
  • the P2P server described in the embodiment of the present invention may be each terminal when performing streaming media file transmission and playback.
  • the terminal where the user A is located can serve as a P2P server, and provides the downloaded data, which is downloaded by other P2P clients. That is, the terminal where the user is located can serve as both a P2P client and a P2P server.
  • step S103 the P2P client downloads the data block from the P2P server according to the sequence number of the data block.
  • the data block that needs to be downloaded in the embodiment of the present invention may be generally determined according to the size of the data block sequence number. For example, when the sequence number of the currently downloaded data block is N, the sequence number of the data block that needs to be downloaded most currently is N+1.
  • the sequence number of the data block downloaded in the first P2P server may be set to ab, and the data block downloaded in the second P2P server.
  • the sequence number interval is bc
  • the sequence number of the data block downloaded in the third P2P server is cd, and a ⁇ b ⁇ c ⁇ d, then when the data block is downloaded, the priority is lower from the data block number interval.
  • the P2P server performs downloading, such as preferentially downloading data blocks from the first P2P server.
  • step S104 a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block.
  • each data block for example, a 4-byte CRC check value storage space can be allocated.
  • a CRC check calculation is performed to obtain each data block. CRC check information and store the check information at a predetermined location.
  • the specific verification process is as follows:
  • the client performs check calculation on the data in the received data block, for example, can calculate the CRC, obtains the CRC calculation result, and compares it with the verification information stored in the data block. If the two are consistent, the data block is described. It is complete and has not been damaged. If the two are inconsistent, the data is corrupted. If you use a corrupted block for playback, the playback quality will be affected.
  • step S105 if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
  • the data block is damaged, and after obtaining the serial number of the damaged data block, according to the data block Serial number, re-download the data block corresponding to the serial number to other servers.
  • the embodiment of the present invention may also perform statistics on the integrity of the data downloaded by the P2P server.
  • the damage rate of the data downloaded from a P2P server reaches a predetermined value, Then, the download of the data block from the P2P server can be suspended, thereby improving the efficiency of the complete high data block download.
  • the message may also be sent to the P2P server, and the message content may be information such as a data block number indicating the damage.
  • the streaming media file is cut into a plurality of data blocks according to a preset size, and then the data block is stored in a plurality of P2P servers. Since each data block includes a corresponding data block serial number, the P2P is The client can download the required data block from different P2P servers according to the sequence number of the data block, and perform verification according to the verification information in the data block. When the data block is damaged, the verification cannot be passed, and the verification is performed. When the server re-downloads, so that the data in the P2P server is damaged, the undamaged data can be automatically verified and downloaded, thereby improving the quality of the playback.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • FIG. 2 is a flowchart showing an implementation process of a method for generating a merged file according to the first embodiment of the present invention, which is described in detail as follows:
  • step S201 the streaming media file is obtained, and the streaming media file is segmented according to a preset duration to obtain a plurality of fragments corresponding to the streaming media file, and an offset and a pointing point including the fragment.
  • the index file of the pointer of the fragment is obtained, and the streaming media file is segmented according to a preset duration to obtain a plurality of fragments corresponding to the streaming media file, and an offset and a pointing point including the fragment.
  • the index file of the pointer of the fragment is obtained, and the streaming media file is segmented according to a preset duration to obtain a plurality of fragments corresponding to the streaming media file, and an offset and a pointing point including the fragment.
  • the current video source generally includes two categories: an on-demand VOD video data source and a live data source. If it is an on-demand VOD video data source, determine whether the format is MPEG. If not, the video data source needs to be performed. Format conversion.
  • the existing video data source needs to be converted accordingly, and the conversion method can select an existing conversion tool according to the format to be converted and the MPEG format, and the user can call The existing tools are completed, and other formats and MPEG conversion algorithms can be integrated in the system. After the format of the source video data source is judged, the corresponding algorithm is called to complete the format conversion.
  • the format conversion process may include a direct conversion algorithm, and may also include an indirect conversion algorithm, for example, a video data source of an MP4 format or a DVD format may be directly converted into video data of an MPEG format. It is also possible to convert the video data source of the DVD format into the video data of the MP4 format, and then convert the video data of the MP4 format into the video data of the MPEG format.
  • the preset duration of the segmentation of the streaming media file may be based on a different duration value according to the code rate. For example, the correspondence between different code rate ranges and durations can be set.
  • the first duration and the second duration decrease as the code rate increases. That is, the file size of each slice is controlled. For example, for a streaming media file with a normal bit rate, you can use a preset duration of 10s for segmentation. .
  • the streaming media can be divided into 540 fragments.
  • Each shard is formatted as ts, usually with a suffix of '.ts' appended to each file.
  • it also includes generating an index file corresponding to the shards, including an offset of each shard and a pointer to each shard in the index file.
  • the offset of the slice can be understood as the offset of the time or size of each slice from the starting position. Taking the time offset as an example, for example, the offset of the Nth slice is a time. Point, the offset of the N+1th slice is the b time point, then the size of the N+1th slice is the video data within the duration of ba.
  • the size of the slice can be directly obtained by subtracting the offset. For example, if the offset of the Nth slice is a, and the offset of the N+1th slice is b, then the size of the N+1th slice is b-a.
  • the pointer to the slice is used to sequentially play the slice according to the pointer in the index file.
  • the preset duration may be set in an index file, and multiple pointers included in the index file may be used to indicate the name and order of the play.
  • the shard can be associated with a pointer in the index file, and the pointers are sequentially stored in chronological order.
  • step S202 the index file is merged with the slice segmented by the streaming media file to generate a merged file.
  • the index file and the shards are combined, so that a large number of shards can be collectively managed, for example, for one streaming media file, including hundreds of shards, in the prior art.
  • a large number of shards can be collectively managed, for example, for one streaming media file, including hundreds of shards, in the prior art.
  • the present application solves the problem of complicated file management by re-segmenting after packaging and combining, and will be further explained in step S103.
  • the index file and the segmented slice of the streaming media file are merged, and the index file may be selected first, and the segmented slice of the streaming media file may be merged in a later manner. That is, in the merged file, the index file corresponding to the fragment of the streaming media file can be preferentially read. It can be understood that this is only a preferred combination, but it is not limited to this combination.
  • the size information of the index file needs to be included to facilitate distinguishing from the fragmentation of the streaming media file in the merged file.
  • step S203 the merged file is sequentially cut according to a preset size to obtain a plurality of data blocks, where the data block includes a serial number corresponding to the data block and corresponding verification information.
  • the cut is required, and the cut object may be a set of fragments in the merged file, or the entire merged file may be cut, and the entire merged file is performed by Han.
  • the cut object may be a set of fragments in the merged file, or the entire merged file may be cut, and the entire merged file is performed by Han.
  • it is necessary to record the size information of the index file, so as to facilitate the subsequent calculation of the correspondence between the cut data block and the position of the slice.
  • the merged file is cut to obtain a data block, and the preset size of the data block may be 1 KB or the like.
  • the data block after the cutting is 1 KB.
  • the sliced data block is much smaller than the slice, and therefore, one slice consists of a plurality of data blocks.
  • the size and offset of each slice can be obtained, and the starting point of the data block included in each slice can be obtained by combining the sequence numbers of each data block. position.
  • the cut object may be a set of fragments in the merged file, and the starting position of each slice is calculated according to the manner described in step S101. For example, for one of the fragments, the starting point of the data is 56.52M. The end position is 58.2M, then the size of the fragment can be calculated to be 1.68M, and the corresponding data includes 1680. If the sequence number of the first data block is 1, the corresponding data block of the fragment is the number 56520. A block of data between the serial numbers 58200.
  • the object to be cut includes the index file, it is necessary to remove the data block number occupied by the index file, such as the size of the index file 5K, then if for one of the fragments, the starting point of the data is 56.52M, and the ending position is 58.2M. Then, the size of the slice can be calculated to be 1.68M, and the corresponding data includes 1680. If the sequence number of the first data block is 1, the data block corresponding to the slice is the sequence number 56520+50 to the serial number 58200+50. Data block between.
  • the present invention specifically introduces a process of generating a merged file, by cutting the merged file, so that each data block after cutting corresponds to a slice file and an index file of the streaming media file, thereby conveniently transmitting the data block at most P2P servers are managed to improve the download efficiency of P2P clients based on HLS technology.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • FIG. 3 is a flowchart showing an implementation process of playing according to a data block after determining whether the calculated check value matches the verification information stored in the data block according to the first embodiment of the present invention, as follows:
  • step S301 if the check value matches the check information stored in the data block, an index file is generated according to the acquired data block.
  • a data block number is stored in the data block, and the data block is downloaded from one or more P2P servers according to the size of the serial number in the data block.
  • a task of downloading a sequence number range of different P2P servers can be set, thereby realizing simultaneous downloading of required data blocks in a plurality of P2P servers, and the downloaded data blocks are not repeated.
  • the downloaded data blocks need to be combined into slices, so the downloaded data blocks can be preferentially stored in the memory and quickly combined through the memory.
  • the index file can be downloaded before the data block is downloaded.
  • the index file may be obtained according to the serial number in the downloaded data and the size of the index file.
  • step S302 the data block corresponding to the fragment is calculated and acquired according to the fragment pointed to by the pointer in the index file, and the size of the data block and the offset of the fragment.
  • the index file in the downloaded data block is parsed. Since the index sequence of the slice is included in the index file, the play sequence of the slice can be obtained by the pointer sequence. In addition, the offset of each slice is included in the index file, and the size of the slice can be calculated according to the offset.
  • step S303 a slice is formed according to the acquired data block, and sent to the player for playback.
  • the sequence number range of the data block corresponding to each slice can be obtained.
  • the fragment to be played can be obtained, and the corresponding data block number is searched according to the played fragment, and the request for acquiring the corresponding data block is sent to the P2P server, according to the data block returned by the P2P server.
  • the piece to be played can be obtained, and the piece can be sent to the player to play the streaming file.
  • the embodiment of the present invention specifically introduces the playback of the streaming media file by using the acquired data block.
  • the data block can be quickly downloaded to obtain better image or sound playback quality.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • FIG. 4 is a schematic diagram of an implementation procedure of a playback verification method for a streaming media file according to Embodiment 4 of the present invention, which is as follows:
  • step S401 the merged file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the data sequence corresponding to the data block is included in each data block. Verify the information.
  • step S402 a partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
  • the data stored in the P2P server is specifically limited in the embodiment of the present invention, including the following storage manners:
  • all the data blocks cut by the streaming media file are stored in a plurality of P2P servers, and when the P2P client downloads and plays the streaming media file, the data block of any serial number can be downloaded from any P2P server.
  • the advantage of this method is that when any one of the P2P servers fails, the impact on the P2P client is relatively small, but the P2P server requires a large space for data storage;
  • each P2P server stores only a part of data blocks, for example, in the server 1, the data block numbers are 1-3, 10-12, and the server 2 stores 4-6. 13-15... Store 7-9, 16-18... in server 3.
  • the server 1 stores only a part of data blocks, for example, in the server 1, the data block numbers are 1-3, 10-12, and the server 2 stores 4-6. 13-15... Store 7-9, 16-18... in server 3.
  • P2P clients can be quickly accessed from different P2P servers. Download the data block to improve the smoothness of playback.
  • the third method is a collection of the first mode and the second mode, that is, storing all the data blocks cut by the streaming media file in a part of the P2P server, and storing a part of the data blocks in another part of the P2P server, It can improve the download speed of P2P terminals, and can also reduce the impact on P2P clients when some P2P servers fail.
  • step S403 the P2P client downloads the data block from the P2P server according to the sequence number of the data block.
  • step S404 a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block.
  • step S405 if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
  • the embodiment of the present invention specifically describes the storage of data, and according to specific needs, different data block storage modes may be selected, which may be beneficial to improve data download speed or save storage space.
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • FIG. 5 is a schematic diagram of an implementation procedure of a playback verification method for a streaming media file according to a fifth embodiment of the present invention, which is described in detail as follows:
  • step S501 a merge file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the data sequence corresponding to the data block is included in each data block. Verify the information.
  • step S502 the data block is stored to a correction server and a plurality of P2P servers.
  • step S503 communication speed information between the P2P client and the plurality of P2P servers is acquired.
  • step S504 according to the communication speed information between the P2P client and the plurality of P2P servers, a data block download task of a corresponding size is allocated to each P2P server, and the data block is downloaded according to the allocated download task.
  • the connection speed of the P2P server can be tested before downloading, the number of download tasks of the server with high transmission speed is set, and the number of servers with low transmission speed is set less. By downloading the amount of tasks, the download speed can be further improved, and the network resources of the P2P client can be fully utilized.
  • step S505 a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block.
  • step S506 if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
  • the embodiment of the present invention corresponds to the method for storing a streaming media file according to the first embodiment.
  • the P2P playback of the HLS based on the HTTP protocol can be realized, that is, the playback speed can be improved, and the data management is facilitated.
  • fast switching of different code rates can be achieved.
  • FIG. 6 is a flowchart of an implementation procedure of a playback verification method for a streaming media file according to Embodiment 6 of the present invention, which is as follows:
  • step S601 the video is encoded, and the encoded video data is encoded into a video of H.264 format by the encoder, the collected audio data is encoded into audio of ACC format, and the encoded video and audio are encapsulated into MPEG format. Streaming media files.
  • the video source is a live data source, it needs to include encoding and encapsulating the live data source to generate MPEG (English full name: Moving Picture Experts) Group, Chinese full name: Dynamic Image Experts Group) format streaming media files.
  • MPEG English full name: Moving Picture Experts
  • the encoding process of the collected live data source can be generally performed by an encoder.
  • the encoder can be a hardware device or a software program.
  • the encoder of the hardware device is connected to the satellite receiver or camera to encode the input signal to generate video and AAC conforming to the H.264 standard (English full name is Advanced) Audio Coding, the full name of Chinese: Advanced Audio Coding, standard audio format, and package it as an MPEG TS file.
  • step S602 the merged file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the serial number corresponding to the data block is included in each data block.
  • step S603 the data block is stored to a correction server and a plurality of P2P servers;
  • step S604 according to the sequence number of the data block, the P2P client downloads the data block from the P2P server;
  • step S605 a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block;
  • step S606 if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
  • the video source file is judged.
  • the format of the source file is automatically converted, thereby improving the adaptability of the streaming media file playing verification according to the present invention.
  • FIG. 7 is a schematic structural diagram of a playback verification device for a streaming media file according to an embodiment of the present invention, which is described in detail as follows:
  • the streaming media file cutting unit 701 is configured to obtain a merged file generated after the streaming media fragmentation according to the HLS technology, and cut the preset file license preset size into a plurality of data blocks, and include the data block in each data block. Corresponding serial number and verification information;
  • a data block storage unit 702 configured to store the data block to a calibration server and a plurality of P2P servers;
  • a first downloading unit 703, configured to download, by the P2P client, a data block from the P2P server according to the sequence number of the data block;
  • the checking unit 704 is configured to calculate a check value for the downloaded data block, and determine whether the calculated check value matches the check information stored in the data block;
  • the second downloading unit 705 is configured to download, to the verification server, a data block whose verification information does not match if the check value does not match the verification information stored in the data block.
  • the streaming media file cutting unit specifically includes:
  • a first segmentation subunit configured to acquire a streaming media file, and divide the streaming media file according to a preset duration, to obtain a plurality of fragments corresponding to the streaming media file, and an offset including the fragmentation And an index file pointing to the pointer of the shard;
  • a merging sub-unit configured to merge the index file with the shard that is divided by the streaming media file to generate a merged file
  • the second segmentation sub-unit is configured to sequentially cut the merged file according to a preset size to obtain a plurality of data blocks, where the data block includes a sequence number corresponding to the data block and corresponding verification information.
  • the device further comprises:
  • An index file generating unit configured to generate an index file according to the obtained data block if the check value matches the check information stored in the data block;
  • a data block obtaining unit configured to calculate and acquire a data block corresponding to the fragment according to the fragment pointed by the pointer in the index file, and the size of the data block and the offset of the fragment;
  • the slice sending and playing unit is configured to form a slice according to the acquired data block, and send it to the player for playing.
  • the data storage unit is specifically configured to:
  • a partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
  • the first download unit comprises:
  • a communication speed information obtaining subunit configured to acquire communication speed information between the P2P client and the plurality of P2P servers
  • a task allocation subunit configured to allocate a data block download task of a corresponding size to each P2P server according to the communication speed information between the P2P client and the plurality of P2P servers, and perform data block according to the allocated download task. download.
  • the method further includes:
  • a coding unit configured to encode the video, and encode the collected video data into a video of H.264 format, and encode the collected audio data into audio of ACC format;
  • a closed unit for encapsulating the encoded video and audio into a streaming media file in MPEG format A closed unit for encapsulating the encoded video and audio into a streaming media file in MPEG format.
  • the streaming media file playback verification device in the embodiment of the present invention corresponds to the streaming media file playback verification method in the first embodiment to the sixth embodiment, and details are not described herein.
  • an embodiment of the present invention provides a playback verification system for a streaming media file, where the system includes:
  • the P2P server is configured to store the cut data block, where the data block includes a sequence number corresponding to the data block, where the file to be cut is a segment after the segmentation of the streaming media file and an index corresponding to the segment a file after the file is merged, the index file includes an offset of the slice and a pointer to the slice;
  • the verification server stores all the data blocks after the stream media file is cut, and the data block includes a sequence number corresponding to the data block, wherein the file to be cut is a segmentation of the stream media file and the segmentation a merged file of the index file corresponding to the fragment, where the index file includes an offset of the fragment and a pointer to the fragment;
  • the P2P client is configured to obtain a data block from one or more P2P servers, calculate a check value for the obtained data block, and determine whether the calculated check value matches the check information stored in the data block. If the check value does not match the verification information stored in the data block, downloading a data block whose verification information does not match to the verification server, and obtaining an index file according to the serial number of the downloaded verified data block, The index file is parsed to obtain the size of the fragment of the streaming media file to be played and the data block to be read, and the downloaded data block is sent to the player for playback.
  • the streaming media file play verification system in the embodiment of the present invention may be used to perform the play verification of the streaming media files in the first to seventh embodiments, and details are not described herein.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM, Read-Only) Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A method for playing and checking a streaming media file comprises: acquire a combined file generated by segmenting streaming media according to HLS technology, and cut the combined file into a plurality of data blocks according to a preset size (S101); store the data blocks to a correction server and a plurality of P2P servers (S102); a P2P client downloads the data blocks from the P2P servers (S103); calculate check values for the downloaded data blocks and determine whether the calculated check values are consistent with check information stored in the data blocks (S104); if the check values are not consistent with the check information stored in the data blocks, download, from the correction server, data blocks of which the check information are not consistent with the check values (S105). By means of the solution, when the data in the P2P servers are corrupted, a check and downloading of uncorrupted data can be automatically performed, thus improving the playback quality.

Description

一种流媒体文件的播放校验方法、装置和系统 Playback verification method, device and system for streaming media files 技术领域Technical field
本发明属于互联网领域,尤其涉及一种流媒体文件的播放校验方法、装置和系统。  The invention belongs to the field of the Internet, and in particular relates to a method, device and system for playing and verifying streaming media files.
背景技术Background technique
在流媒体文件点播传输时,目前常用的流媒体协议主要有 HTTP 渐进下载和基于 RTSP/RTP 的实时流媒体协议。其中,苹果公开开发的HLS技术(英文全称为: HTTP Live Streaming )是一种使用较为典型的HTTP渐进下载的方法。 At the time of streaming media file on-demand transmission, the currently used streaming media protocols mainly include HTTP progressive download and RTSP/RTP-based. Real-time streaming protocol. Among them, the HLS technology developed by Apple (English full name: HTTP Live Streaming) is a method of using the more typical HTTP progressive download.
在使用HLS技术进行视频点播时,需要对点播的内容进行准备,首先进行视频采集,编码器将采集的音视频数据压缩编码为符合特定标准的音视频基本流,也可以使用编码完后的文件,但编码完成后的文件一定为H.264视频和AAC音频。然后将编码后的视频和音频封装成为MPEGTS格式。 When using HLS technology for video on demand, it is necessary to prepare the content of the on-demand video. First, the video is collected, and the encoder compresses and encodes the collected audio and video data into an audio/video elementary stream conforming to a specific standard, and can also use the encoded file. However, the files after the encoding is complete must be H.264 video and AAC audio. The encoded video and audio are then packaged into an MPEG TS format.
然后对封装后的MPEGTS进行流分割,将 MPEG传输流分割成很多个 ts 的文件的分片。分割过程通常是按时间进行分片,比如分割为一个分片为10s时长,而如果码流高可以分割分片的时长为 5 秒。并生成含有指向这些小TS分片指针的索引文件(后缀为m3u8),将索引文件和切割后的TS分片放到普通的WEB服务器中。 Then, the encapsulated MPEGTS is stream-divided to split the MPEG transport stream into a plurality of ts. Fragmentation of the file. The segmentation process usually divides the slice by time, for example, it is divided into one slice for 10s duration, and if the code stream is high, the slice can be divided into 5 segments. second. And generate an index file (suffix m3u8) containing pointers to these small TS fragments, and put the index file and the cut TS fragments into a common WEB server.
当客户端需要播放时,通过标准的HTTP协议下载索引和分片,即可实现视频的点播或者直播,由于数据通过HTTP协议传输,所以不存在防火墙或者代理的问题,并且HLS技术中分段文件的时长很短,客户端可以很快的选择和切换码率,以适应不同带宽条件下的播放。 When the client needs to play, the index and the slice are downloaded through the standard HTTP protocol, and the video can be clicked or broadcasted. Since the data is transmitted through the HTTP protocol, there is no firewall or proxy problem, and the segment file is in the HLS technology. The duration is very short, and the client can quickly select and switch the bit rate to accommodate playback under different bandwidth conditions.
但是,目前的HLS播放技术通常用于单个服务器与客户端之间的数据传送,如果服务器上的数据损坏,则会影响所有的客户端的视频播放质量。 However, the current HLS playback technology is usually used for data transfer between a single server and a client. If the data on the server is damaged, it will affect the video playback quality of all clients.
技术问题technical problem
在流媒体文件点播传输时,目前常用的流媒体协议主要有 HTTP 渐进下载和基于 RTSP/RTP 的实时流媒体协议。其中,苹果公开开发的HLS技术(英文全称为: HTTP Live Streaming )是一种使用较为典型的HTTP渐进下载的方法。 At the time of streaming media file on-demand transmission, the currently used streaming media protocols mainly include HTTP progressive download and RTSP/RTP-based. Real-time streaming protocol. Among them, the HLS technology developed by Apple (English full name: HTTP Live Streaming) is a method of using the more typical HTTP progressive download.
在使用HLS技术进行视频点播时,需要对点播的内容进行准备,首先进行视频采集,编码器将采集的音视频数据压缩编码为符合特定标准的音视频基本流,也可以使用编码完后的文件,但编码完成后的文件一定为H.264视频和AAC音频。然后将编码后的视频和音频封装成为MPEGTS格式。 When using HLS technology for video on demand, it is necessary to prepare the content of the on-demand video. First, the video is collected, and the encoder compresses and encodes the collected audio and video data into an audio/video elementary stream conforming to a specific standard, and can also use the encoded file. However, the files after the encoding is complete must be H.264 video and AAC audio. The encoded video and audio are then packaged into an MPEG TS format.
然后对封装后的MPEGTS进行流分割,将 MPEG传输流分割成很多个 ts 的文件的分片。分割过程通常是按时间进行分片,比如分割为一个分片为10s时长,而如果码流高可以分割分片的时长为 5 秒。并生成含有指向这些小TS分片指针的索引文件(后缀为m3u8),将索引文件和切割后的TS分片放到普通的WEB服务器中。 Then, the encapsulated MPEGTS is stream-divided to split the MPEG transport stream into a plurality of ts. Fragmentation of the file. The segmentation process usually divides the slice by time, for example, it is divided into one slice for 10s duration, and if the code stream is high, the slice can be divided into 5 segments. second. And generate an index file (suffix m3u8) containing pointers to these small TS fragments, and put the index file and the cut TS fragments into a common WEB server.
当客户端需要播放时,通过标准的HTTP协议下载索引和分片,即可实现视频的点播或者直播,由于数据通过HTTP协议传输,所以不存在防火墙或者代理的问题,并且HLS技术中分段文件的时长很短,客户端可以很快的选择和切换码率,以适应不同带宽条件下的播放。 When the client needs to play, the index and the slice are downloaded through the standard HTTP protocol, and the video can be clicked or broadcasted. Since the data is transmitted through the HTTP protocol, there is no firewall or proxy problem, and the segment file is in the HLS technology. The duration is very short, and the client can quickly select and switch the bit rate to accommodate playback under different bandwidth conditions.
但是,目前的HLS播放技术通常用于单个服务器与客户端之间的数据传送,如果服务器上的数据损坏,则会影响所有的客户端的视频播放质量。 However, the current HLS playback technology is usually used for data transfer between a single server and a client. If the data on the server is damaged, it will affect the video playback quality of all clients.
技术解决方案Technical solution
第一方面,本发明实施例提供了 流媒体文件的播放校验方法,所述方法包括: In a first aspect, an embodiment of the present invention provides a method for playing and verifying a streaming media file, where the method includes:
获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息; Obtaining a merged file generated after the streaming media is fragmented according to the HLS technology, and cutting the preset size of the merged file license into a plurality of data blocks, and including, in each data block, a serial number corresponding to the data block and verification information;
将所述数据块存放至校正服务器以及多个P2P服务器; Storing the data block to a calibration server and a plurality of P2P servers;
根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块; And downloading, by the P2P client, the data block from the P2P server according to the sequence number of the data block;
对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符; Calculating a check value for the downloaded data block, and determining whether the calculated check value matches the check information stored in the data block;
如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。 If the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
结合第一方面,在第一方面的第一种可能实现方式中,所述 获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息步骤具体包括: In conjunction with the first aspect, in a first possible implementation of the first aspect, the Obtaining a merged file generated after the streaming media fragmentation according to the HLS technology, and cutting the preset size of the merged file license into a plurality of data blocks, and including, in each data block, a sequence number corresponding to the data block and a verification information step specific include:
获取流媒体文件,根据预设的时长对所述流媒体文件进行分割,得到所述流媒体文件对应的多个分片,以及包含所述分片的偏移量和指向所述分片的指针的索引文件; Obtaining a streaming media file, and dividing the streaming media file according to a preset duration, obtaining a plurality of fragments corresponding to the streaming media file, and an offset including the fragment and a pointer to the fragment Index file
将所述索引文件与所述流媒体文件分割后的分片进行合并,生成合并后的文件; Combining the index file with the segmentation of the stream media file to generate a merged file;
将所述合并后的文件按照预设的大小进行按序切割,得到多个数据块,所述数据块中包括数据块对应的序号以及对应的校验信息。 The merged file is sequentially cut according to a preset size to obtain a plurality of data blocks, where the data block includes a serial number corresponding to the data block and corresponding verification information.
结合第一方面的第一种可能实现方式,在第一方面的第二种可能实现方式中, 在所述对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符步骤之后,所述方法还包括: In conjunction with the first possible implementation of the first aspect, in a second possible implementation of the first aspect, After the step of calculating the check value for the downloaded data block and determining whether the calculated check value matches the verification information stored in the data block, the method further includes:
如果所述校验值与数据块中存储的校验信息相符,则根据获取的数据块生成索引文件; If the check value matches the check information stored in the data block, generating an index file according to the obtained data block;
根据所述索引文件中的指针所指向的分片,以及所述数据块的大小、分片的偏移量计算并获取分片所对应的数据块; Calculating and acquiring a data block corresponding to the fragment according to the fragment pointed to by the pointer in the index file, and the size of the data block and the offset of the fragment;
根据获取的数据块构成分片,发送至播放器进行播放。 The shards are formed according to the acquired data blocks, and are sent to the player for playback.
结合第一方面,在第一方面的第三种可能实现方式中, 所述将所述数据块存放至校正服务器以及多个P2P服务器步骤包括: In conjunction with the first aspect, in a third possible implementation of the first aspect, The step of storing the data block to the calibration server and the plurality of P2P servers includes:
将所述流媒体文件的部分数据块或者全部数据块存放至多个P2P服务器,以及将所述流媒体文件的全部数据块存放至校正服务器。 A partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
结合第一方面,在第一方面的第四种可能实现方式中, 所述P2P客户端从所述P2P服务器中下载数据块步骤包括: In conjunction with the first aspect, in a fourth possible implementation of the first aspect, The step of the P2P client downloading a data block from the P2P server includes:
获取P2P客户端与多个P2P服务器之间的通信速度信息; Obtaining communication speed information between the P2P client and multiple P2P servers;
根据所述P2P客户端与多个P2P服务器之间的通信速度信息,分配相应大小的数据块下载任务至各个P2P服务器,根据分配的所述下载任务对数据块进行下载。 And according to the communication speed information between the P2P client and the plurality of P2P servers, the data block download task of the corresponding size is allocated to each P2P server, and the data block is downloaded according to the allocated download task.
结合第一方面,在第一方面的第五种可能实现方式中, 所述获取根据HLS技术对流媒体分片后生成的合并文件步骤之前,所述方法还包括: In conjunction with the first aspect, in a fifth possible implementation of the first aspect, Before the step of acquiring the merged file generated after the streaming media is fragmented according to the HLS technology, the method further includes:
对视频进行编码,由编码器将采集的视频数据编码为H.264格式的视频,将采集音频数据编码为ACC格式的音频; Encoding the video, the encoder encodes the collected video data into a video of H.264 format, and encodes the collected audio data into audio of ACC format;
将编码后的视频和音频封装为MPEG格式的流媒体文件。 The encoded video and audio are packaged into a streaming media file in MPEG format.
第二方面,本发明实施例提供了一种 流媒体文件的播放校验装置,所述装置包括: In a second aspect, an embodiment of the present invention provides a playback verification device for a streaming media file, where the device includes:
流媒体文件切割单元,用于获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息; a streaming media file cutting unit, configured to acquire a merged file generated after the streaming media fragmentation according to the HLS technology, and cut the preset size of the merged file license into a plurality of data blocks, and include the data block corresponding to each data block. Serial number and verification information;
数据块存放单元,用于将所述数据块存放至校正服务器以及多个P2P服务器; a data block storage unit, configured to store the data block to a calibration server and a plurality of P2P servers;
第一下载单元,用于根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块; a first downloading unit, configured to download, by the P2P client, the data block from the P2P server according to the sequence number of the data block;
校验单元,用于对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符; a check unit, configured to calculate a check value for the downloaded data block, and determine whether the calculated check value matches the check information stored in the data block;
第二下载单元,用于如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。 And a second downloading unit, configured to: if the check value does not match the verification information stored in the data block, download a data block that does not match the verification information to the verification server.
结合第二方面,在第二方面的第一种可能实现方式中,所述 流媒体文件切割单元具体包括: With reference to the second aspect, in a first possible implementation of the second aspect, the streaming media file cutting unit specifically includes:
第一分割子单元,用于获取流媒体文件,根据预设的时长对所述流媒体文件进行分割,得到所述流媒体文件对应的多个分片,以及包含所述分片的偏移量和指向所述分片的指针的索引文件; a first segmentation subunit, configured to acquire a streaming media file, and divide the streaming media file according to a preset duration, to obtain a plurality of fragments corresponding to the streaming media file, and an offset including the fragmentation And an index file pointing to the pointer of the shard;
合并子单元,用于将所述索引文件与所述流媒体文件分割后的分片进行合并,生成合并后的文件; a merging sub-unit, configured to merge the index file with the shard that is divided by the streaming media file to generate a merged file;
第二分割子单元,用于将所述合并后的文件按照预设的大小进行按序切割,得到多个数据块,所述数据块中包括数据块对应的序号以及对应的校验信息。 The second segmentation sub-unit is configured to sequentially cut the merged file according to a preset size to obtain a plurality of data blocks, where the data block includes a sequence number corresponding to the data block and corresponding verification information.
结合第二方面的第一种可能实现方式,在第二方面的第二种可能实现方式中, 所述装置还包括: With reference to the first possible implementation of the second aspect, in a second possible implementation manner of the second aspect, the device further includes:
索引文件生成单元,用于如果所述校验值与数据块中存储的校验信息相符,则根据获取的数据块生成索引文件; An index file generating unit, configured to generate an index file according to the obtained data block if the check value matches the check information stored in the data block;
数据块获取单元,用于根据所述索引文件中的指针所指向的分片,以及所述数据块的大小、分片的偏移量计算并获取分片所对应的数据块; a data block obtaining unit, configured to calculate and acquire a data block corresponding to the fragment according to the fragment pointed by the pointer in the index file, and the size of the data block and the offset of the fragment;
分片发送播放单元,用于根据获取的数据块构成分片,发送至播放器进行播放。 The slice sending and playing unit is configured to form a slice according to the acquired data block, and send it to the player for playing.
结合第二方面,在第二方面的第三种可能实现方式中, 所述数据存储单元具体用于: With reference to the second aspect, in a third possible implementation manner of the second aspect, the data storage unit is specifically configured to:
将所述流媒体文件的部分数据块或者全部数据块存放至多个P2P服务器,以及将所述流媒体文件的全部数据块存放至校正服务器。 A partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
结合第二方面,在第二方面的第四种可能实现方式中, 所述第一下载单元包括: With reference to the second aspect, in a fourth possible implementation manner of the second aspect, the first downloading unit includes:
通信速度信息获取子单元,用于获取P2P客户端与多个P2P服务器之间的通信速度信息; a communication speed information obtaining subunit, configured to acquire communication speed information between the P2P client and the plurality of P2P servers;
下载任务分配子单元,用于根据所述P2P客户端与多个P2P服务器之间的通信速度信息,分配相应大小的数据块下载任务至各个P2P服务器,根据分配的所述下载任务对数据块进行下载。 a task allocation subunit, configured to allocate a data block download task of a corresponding size to each P2P server according to the communication speed information between the P2P client and the plurality of P2P servers, and perform data block according to the allocated download task. download.
结合第二方面,在第二方面的第五种可能实现方式中, 所述方法还包括: With reference to the second aspect, in a fifth possible implementation manner of the second aspect, the method further includes:
编码单元,用于对视频进行编码,由编码器将采集的视频数据编码为H.264格式的视频,将采集音频数据编码为ACC格式的音频; a coding unit, configured to encode the video, and encode the collected video data into a video of H.264 format, and encode the collected audio data into audio of ACC format;
封闭单元,用于将编码后的视频和音频封装为MPEG格式的流媒体文件。 A closed unit for encapsulating the encoded video and audio into a streaming media file in MPEG format.
第三方面,本发明实施例提供了一种 流媒体文件的播放校验系统,所述播放校验系统包括: In a third aspect, an embodiment of the present invention provides a playback verification system for a streaming media file, where the playback verification system includes:
P2P 服务器,所述P2P服务器用于存放切割后的数据块,所述数据块中包括数据块对应的序号,其中待切割的文件为流媒体文件进行分割后的分片以及所述分片对应的索引文件合并后的文件,所述索引文件中包含所述分片的偏移量以及指向所述分片的指针; P2P a server, the P2P server is configured to store the cut data block, where the data block includes a sequence number corresponding to the data block, where the file to be cut is a segment after the segmentation of the streaming media file and an index corresponding to the segment a file after the file is merged, the index file includes an offset of the slice and a pointer to the slice;
校验服务器,所述校验服务器中存放流媒体文件切割后的所有数据块,所述数据块中包括数据块对应的序号,其中待切割的文件为流媒体文件进行分割后的分片以及所述分片对应的索引文件合并后的文件,所述索引文件中包含所述分片的偏移量以及指向所述分片的指针; a verification server, wherein the verification server stores all the data blocks after the stream media file is cut, and the data block includes a sequence number corresponding to the data block, wherein the file to be cut is a segmentation of the stream media file and the segmentation a merged file of the index file corresponding to the fragment, where the index file includes an offset of the fragment and a pointer to the fragment;
P2P 客户端,所述P2P客户端用于从一个或者多个P2P服务器中获取数据块,对获取的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符,如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块,根据下载的校验后的数据块的序号得到索引文件,解析所述索引文件,得到需要播放的流媒体文件的分片的大小以及需要读取的数据块,并将下载校验后的数据块构成分片发送至播放器进行播放。 P2P The client, the P2P client is configured to obtain a data block from one or more P2P servers, calculate a check value for the obtained data block, and determine whether the calculated check value matches the check information stored in the data block. If the check value does not match the verification information stored in the data block, downloading a data block whose verification information does not match to the verification server, and obtaining an index file according to the serial number of the downloaded verified data block, The index file is parsed to obtain the size of the fragment of the streaming media file to be played and the data block to be read, and the downloaded data block is sent to the player for playback.
有益效果Beneficial effect
在本发明中,将流媒体文件按预设的大小切割为多个数据块,然后将所述数据块存储在多个P2P服务器中,由于每个数据块中包括对应的数据块序号,因此P2P客户端可以根据数据块的序号从不同的P2P服务器中下载所需要的数据块,并且根据数据块中的校验信息进行校验,当数据块受损后则不能通过校验,并在校验服务器中重新下载,从而使得P2P服务器中的数据受损时,也能够自动的校验以及下载未受损的数据,从而有利于提高播放的质量。 In the present invention, the streaming media file is cut into a plurality of data blocks according to a preset size, and then the data blocks are stored in a plurality of P2P servers, and since each data block includes a corresponding data block number, the P2P The client can download the required data block from different P2P servers according to the sequence number of the data block, and perform verification according to the verification information in the data block. When the data block is damaged, the verification cannot be passed, and the verification is performed. When the server re-downloads, so that the data in the P2P server is damaged, the undamaged data can be automatically verified and downloaded, thereby improving the quality of the playback.
附图说明DRAWINGS
图1是本发明第一实施例 提供的流媒体文件的播放校验方法 的实现流程; 1 is a flowchart showing an implementation process of a playback verification method for a streaming media file according to a first embodiment of the present invention;
图2是本发明第二实施例 提供的合并文件的生成方法 的实现流程; 2 is a flowchart showing an implementation process of a method for generating a merged file according to a second embodiment of the present invention;
图3是本发明第三实施例 提供的流媒体文件的播放方法 的实现流程; 3 is a flowchart of implementing a method for playing a streaming media file according to a third embodiment of the present invention;
图4是本发明第四实施例 提供的流媒体文件的播放校验方法 的实现流程; 4 is a flowchart showing an implementation process of a playback verification method for a streaming media file according to a fourth embodiment of the present invention;
图5是本发明第五实施例 提供的流媒体文件的播放校验方法 的实现流程; FIG. 5 is a flowchart of an implementation process of a playback verification method for a streaming media file according to a fifth embodiment of the present invention;
图6是本发明第六实施例 提供的流媒体文件的播放校验方法 的实现流程; 6 is a flowchart showing an implementation process of a playback verification method for a streaming media file according to a sixth embodiment of the present invention;
图7为本发明第七实施例提供的流媒体文件的播放校验装置的 结构示意图。 FIG. 7 is a schematic structural diagram of a playback verification device for a streaming media file according to a seventh embodiment of the present invention.
本发明的实施方式Embodiments of the invention
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。 The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明实施例的目的在于解决现有技术中使用HLS技术进行视频播放时,通常用于单个服务器与客户端之间的数据传送,如果服务器上的数据损坏,则会影响所有的客户端的视频播放质量。 The purpose of the embodiment of the present invention is to solve the problem of data transmission between a single server and a client when using the HLS technology for video playback in the prior art. If the data on the server is damaged, the video playback of all the clients will be affected. quality.
为解决该问题,本发明通过将流媒体文件按预设的大小切割为多个数据块,然后将所述数据块存储在多个P2P服务器中,由于每个数据块中包括对应的数据块序号,因此P2P客户端可以根据数据块的序号从不同的P2P服务器中下载所需要的数据块,并且根据数据块中的校验信息进行校验,当数据块受损后则不能通过校验,并在校验服务器中重新下载,从而使得P2P服务器中的数据受损时,也能够自动的校验以及下载未受损的数据,从而有利于提高播放的质量。下面结合附图具体进行说明。 To solve this problem, the present invention cuts a streaming media file into a plurality of data blocks according to a preset size, and then stores the data blocks in a plurality of P2P servers, since each data block includes a corresponding data block serial number. Therefore, the P2P client can download the required data block from different P2P servers according to the sequence number of the data block, and perform verification according to the verification information in the data block, and cannot pass the verification when the data block is damaged, and When the data is re-downloaded in the verification server, so that the data in the P2P server is damaged, the undamaged data can be automatically verified and downloaded, thereby improving the quality of the playback. The details will be described below with reference to the drawings.
实施例一: Embodiment 1:
图1示出了本发明第一实施例提供的流媒体文件的存储方法的实现流程,详述如下: FIG. 1 is a flowchart showing an implementation process of a method for storing a streaming media file according to a first embodiment of the present invention, which is described in detail as follows:
在步骤S101中,获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息。 In step S101, the merge file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the data sequence corresponding to the data block is included in each data block. Verify the information.
具体的,本发明实施例中获取的流媒体文件,是用于存放在P2P服务器中供P2P客户端下载。 Specifically, the streaming media file obtained in the embodiment of the present invention is used for storing in a P2P server for downloading by the P2P client.
由于现有技术中使用HLS技术对流媒体文件进行分片时,需要通过索引文件管理多个分片,包括管理分片的时长以及分片的指针信息,如果将分片以及索引文件发送至多个服务器进行共享下载时,则会导致多个分片的管理较为麻烦。 When the streaming media file is fragmented by using the HLS technology in the prior art, multiple fragments need to be managed through the index file, including managing the duration of the fragment and the pointer information of the fragment, if the fragment and the index file are sent to multiple servers. When sharing downloads, it will lead to more troublesome management of multiple shards.
而将流媒体的分片文件以及索引文件设置在同一服务器中,如果其中的分片文件出现损坏,在不能够有效的对文件进行修复时,导致所有的客户端下载的受损的分片文件进行播放,会影响流媒体文件的播放质量。 The streaming file fragment file and the index file are set in the same server. If the fragment file is damaged, if the file cannot be repaired effectively, all the client downloads the damaged fragment file. Playback will affect the playback quality of streaming media files.
为解决上述问题,本发明提出将HLS技术对流媒体文件分片后的合并文件进行进一步的切割,生成多个数据块,并且在每个数据块中包含数据块的序号以及校验信息。 In order to solve the above problem, the present invention proposes to further cut the merged file after the streaming media file fragmentation by the HLS technology, generate a plurality of data blocks, and include the sequence number of the data block and the verification information in each data block.
所述数据块的序号,根据设置的起始值依次进行排序,比如可以从1开始编号,对切割的数据块,按照先后顺序分配序号,比如数据块1、数据块2、数据块3……数据块N。 The sequence numbers of the data blocks are sequentially sorted according to the set starting values. For example, the numbers can be numbered starting from 1, and the data blocks are cut according to the order, such as data block 1, data block 2, data block 3, etc. Data block N.
对所述合并文件进行切割,可以由用户使用切割工具对数据进行切割,也可以将切割算法集成在软件中,自动完成对合并文件的切割。 Cutting the merged file may be performed by the user using a cutting tool to cut the data, or the cutting algorithm may be integrated into the software to automatically cut the merged file.
用户使用切割工具的方法,比如生成合并的文件后,将合并文件导入到切割工具中,在指定的文件夹中生成所需要的数据块,并且所述文件夹的名称可以设置为流媒体文件对应的名称。 The user uses the cutting tool method, for example, after generating the merged file, importing the merged file into the cutting tool, generating the required data block in the specified folder, and the name of the folder can be set to correspond to the streaming media file. The name.
系统自动对合并文件进行切割时,可以将切割后的数据块存放在磁盘或者内存中,如果存放在内存中,可以较为快速的将数据块发送至其它P2P服务器或者校验服务器。 When the system automatically cuts the merged file, the cut data block can be stored in the disk or the memory. If it is stored in the memory, the data block can be sent to other P2P servers or the verification server relatively quickly.
本发明实施例中所述的合并文件,可以为全部的分片构成的文件,也可以为包括分片文件和索引文件构成的文件。如果切割的合并文件为全部的分片文件,那么数据块的第一个序号即对应第一个分片的起点位置。 The merged file described in the embodiment of the present invention may be a file composed of all the fragments, or may be a file including a slice file and an index file. If the merged file is a full slice file, the first sequence number of the data block corresponds to the start position of the first slice.
如果切割的合并文件为分片文件和索引文件构成,则在进行数据块的序号与分片的对应关系计算时,需要考虑由索引文件所产生的数据块。比如索引文件的大小为10K,每个数据块的大小为1K时,优选对索引文件进行切割以及分配序号时,由序号1至序号10对应为索引文件。第一个分片的起点位置对应的数据块序号为序号11。 If the merged file is composed of a slice file and an index file, the data block generated by the index file needs to be considered when calculating the correspondence between the sequence number and the slice of the data block. For example, when the size of the index file is 10K, and the size of each data block is 1K, it is preferable to cut the index file and assign the serial number, and the serial number 1 to the serial number 10 correspond to the index file. The data block number corresponding to the starting position of the first fragment is number 11.
在步骤S102中,将所述数据块存放至校正服务器以及多个P2P服务器。 In step S102, the data block is stored in a correction server and a plurality of P2P servers.
在本发明实施例中,与传统的P2P服务器结构不同之处在于,本发明还包括校验服务器,在P2P服务器以及校验服务器中可以存储数据块。 In the embodiment of the present invention, the difference from the traditional P2P server structure is that the present invention further includes a verification server, and the data block can be stored in the P2P server and the verification server.
在所述P2P服务器以及校验服务器中存储的数据块,包括数据块序号以及每个数据块对应的流媒体的标识,可以将多个数据块存放在包括流媒体文件标识名称的文件夹中,实现对不同流媒体文件的区分。 The data block stored in the P2P server and the verification server includes a data block sequence number and an identifier of the stream media corresponding to each data block, and the plurality of data blocks may be stored in a folder including a stream file identifier name. Achieve the distinction between different streaming media files.
另外,在本发明实施例中所述的P2P服务器,可以为进行流媒体文件传输播放时的各个终端。比如用户A在下载了部分流媒体文件对应的数据块后,所述用户A所在的终端即可以作为P2P服务器,提供其已下载的数据,由其它P2P客户端进行下载。也即,用户所在的终端可以同时作为P2P客户端,也可以作为P2P服务器。 In addition, the P2P server described in the embodiment of the present invention may be each terminal when performing streaming media file transmission and playback. For example, after user A downloads a data block corresponding to a part of the streaming media file, the terminal where the user A is located can serve as a P2P server, and provides the downloaded data, which is downloaded by other P2P clients. That is, the terminal where the user is located can serve as both a P2P client and a P2P server.
在步骤S103中,根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块。 In step S103, the P2P client downloads the data block from the P2P server according to the sequence number of the data block.
具体的,本发明实施例中所述需要下载的数据块,一般可以根据数据块序号的大小确定。比如当前已下载的数据块的序号为N时,则当前最需要下载的数据块的序号为N+1。 Specifically, the data block that needs to be downloaded in the embodiment of the present invention may be generally determined according to the size of the data block sequence number. For example, when the sequence number of the currently downloaded data block is N, the sequence number of the data block that needs to be downloaded most currently is N+1.
当然,也可以设定在多个P2P服务器中进行数据块的下载时,可以设定在第一个P2P服务器中下载的数据块的序号区间为a-b,在第二个P2P服务器中下载的数据块的序号区间为b-c,在第三个P2P服务器中下载的数据块的序号区间为c-d,并且a<b<c<d,那么在进行数据块的下载时,优先从数据块序号区间较低的P2P服务器进行下载,比如优先从第一P2P服务器中进行数据块的下载。 Of course, when the data block is downloaded in multiple P2P servers, the sequence number of the data block downloaded in the first P2P server may be set to ab, and the data block downloaded in the second P2P server. The sequence number interval is bc, and the sequence number of the data block downloaded in the third P2P server is cd, and a<b<c<d, then when the data block is downloaded, the priority is lower from the data block number interval. The P2P server performs downloading, such as preferentially downloading data blocks from the first P2P server.
在步骤S104中,对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符。 In step S104, a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block.
由于每个数据块中存储有校验信息,比如可以分配4个字节的CRC校验值存储空间,在步骤S101中对每个数据进行切割后,执行CRC校验计算,得到每个数据块的CRC校验信息,并将所述校验信息存储在预定的位置处。 Since the check information is stored in each data block, for example, a 4-byte CRC check value storage space can be allocated. After each data is cut in step S101, a CRC check calculation is performed to obtain each data block. CRC check information and store the check information at a predetermined location.
在数据传输使用过程中,只要所述校验信息完整,则可以完成对所述数据块的校验操作。具体的校验过程如下: During the data transmission use, as long as the verification information is complete, the verification operation of the data block can be completed. The specific verification process is as follows:
P2P 客户端对接收的数据块中的数据进行校验计算,比如可以为CRC计算,得到CRC计算结果,将其与存储在数据块中的校验信息进行比较,如果两者一致,则说明数据块是完整的,没有受到损坏。如果两者不一致,则说明数据已损坏,如果使用损坏的数据块进行播放,则会影响播放质量。 P2P The client performs check calculation on the data in the received data block, for example, can calculate the CRC, obtains the CRC calculation result, and compares it with the verification information stored in the data block. If the two are consistent, the data block is described. It is complete and has not been damaged. If the two are inconsistent, the data is corrupted. If you use a corrupted block for playback, the playback quality will be affected.
在步骤S105中,如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。 In step S105, if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
如果存储在数据块中的校验信息与对数据块进行校验计算的校验值不相一致,则说明数据块受到损害,在获取该损害的数据块的序号后,根据所述数据块的序号,向其它服务器重新下载所述序号对应的数据块。 If the check information stored in the data block does not coincide with the check value of the check calculation of the data block, the data block is damaged, and after obtaining the serial number of the damaged data block, according to the data block Serial number, re-download the data block corresponding to the serial number to other servers.
另外,为提高播放的流畅性以及提高下载效率,本发明实施例还可以对P2P服务器下载的数据的完整性进行统计,当从某个P2P服务器中下载的数据的受损率达到预定值时,则可中止从该P2P服务器进行数据块的下载,从而提完整高数据块下载的效率。 In addition, in order to improve the fluency of the playback and improve the downloading efficiency, the embodiment of the present invention may also perform statistics on the integrity of the data downloaded by the P2P server. When the damage rate of the data downloaded from a P2P server reaches a predetermined value, Then, the download of the data block from the P2P server can be suspended, thereby improving the efficiency of the complete high data block download.
另外,当从某个P2P服务器中下载的数据的受损率达到预定值时,还可以发送消息至所述P2P服务器,所述消息内容可以为提示损坏的数据块序号等信息。 In addition, when the damage rate of the data downloaded from a certain P2P server reaches a predetermined value, the message may also be sent to the P2P server, and the message content may be information such as a data block number indicating the damage.
本发明实施例通过将流媒体文件按预设的大小切割为多个数据块,然后将所述数据块存储在多个P2P服务器中,由于每个数据块中包括对应的数据块序号,因此P2P客户端可以根据数据块的序号从不同的P2P服务器中下载所需要的数据块,并且根据数据块中的校验信息进行校验,当数据块受损后则不能通过校验,并在校验服务器中重新下载,从而使得P2P服务器中的数据受损时,也能够自动的校验以及下载未受损的数据,从而有利于提高播放的质量。 In the embodiment of the present invention, the streaming media file is cut into a plurality of data blocks according to a preset size, and then the data block is stored in a plurality of P2P servers. Since each data block includes a corresponding data block serial number, the P2P is The client can download the required data block from different P2P servers according to the sequence number of the data block, and perform verification according to the verification information in the data block. When the data block is damaged, the verification cannot be passed, and the verification is performed. When the server re-downloads, so that the data in the P2P server is damaged, the undamaged data can be automatically verified and downloaded, thereby improving the quality of the playback.
实施例二: Embodiment 2:
图2为本发明在实施例一的基础上,具体介绍合并文件的生成方法的实现流程,详述如下: FIG. 2 is a flowchart showing an implementation process of a method for generating a merged file according to the first embodiment of the present invention, which is described in detail as follows:
在步骤S201中,获取流媒体文件,根据预设的时长对所述流媒体文件进行分割,得到所述流媒体文件对应的多个分片,以及包含所述分片的偏移量和指向所述分片的指针的索引文件。 In step S201, the streaming media file is obtained, and the streaming media file is segmented according to a preset duration to obtain a plurality of fragments corresponding to the streaming media file, and an offset and a pointing point including the fragment. The index file of the pointer of the fragment.
具体的,目前视频源一般包含两大类:点播的VOD视频数据源和直播的数据源,如果为点播的VOD视频数据源,判断其格式是否为MPEG,如果不是,则需要对视频数据源进行格式的转换。 Specifically, the current video source generally includes two categories: an on-demand VOD video data source and a live data source. If it is an on-demand VOD video data source, determine whether the format is MPEG. If not, the video data source needs to be performed. Format conversion.
比如得到的视频数据源为DVD格式,或者MP4格式等,那么需要对现有的视频数据源进行相应的转换,转换方法可以根据待转换的格式和MPEG格式选择现有的转换工具,通过用户调用现有的工具完成,也可以在系统中集成其它格式与MPEG转换的算法,在对源视频数据源的格式进行判断后,调用相应的算法完成格式的转换。 For example, if the obtained video data source is a DVD format or an MP4 format, then the existing video data source needs to be converted accordingly, and the conversion method can select an existing conversion tool according to the format to be converted and the MPEG format, and the user can call The existing tools are completed, and other formats and MPEG conversion algorithms can be integrated in the system. After the format of the source video data source is judged, the corresponding algorithm is called to complete the format conversion.
其中,格式的转换过程可以包括直接转换算法,也可以包括间接转换算法,比如可以将MP4格式、DVD格式的视频数据源直接转换为MPEG格式的视频数据。也可以将DVD格式的视频数据源先转换为MP4格式的视频数据,然后再将MP4格式的视频数据转换为MPEG格式的视频数据。 The format conversion process may include a direct conversion algorithm, and may also include an indirect conversion algorithm, for example, a video data source of an MP4 format or a DVD format may be directly converted into video data of an MPEG format. It is also possible to convert the video data source of the DVD format into the video data of the MP4 format, and then convert the video data of the MP4 format into the video data of the MPEG format.
其中,对所述流媒体文件进行分割的预设的时长,可以根据码率的高低而相应的选用不同的时长值。比如可以设定不同的码率范围与时长的对应关系,通过检测待分割的流媒体文件,当码率在第一范围时,则对应第一时长,当码率在第二范围时,对应第二时长。其中,第一时长和第二时长,随着码率的增加而减小。即对于每个分片的文件大小进行控制。比如对于正常码率的流媒体文件,可以选用10s的预设时长进行分割 。 The preset duration of the segmentation of the streaming media file may be based on a different duration value according to the code rate. For example, the correspondence between different code rate ranges and durations can be set. By detecting the streaming media file to be divided, when the code rate is in the first range, the first time length is corresponding, and when the code rate is in the second range, corresponding to the first Two hours long. The first duration and the second duration decrease as the code rate increases. That is, the file size of each slice is controlled. For example, for a streaming media file with a normal bit rate, you can use a preset duration of 10s for segmentation. .
当流媒体时长为1.5小时,预设时长为10s,则可以将流媒体分割为540个分片。每个分片的格式为ts,通常在每个文件的后面添加'.ts'的后缀。 When the streaming time is 1.5 hours and the preset duration is 10s, the streaming media can be divided into 540 fragments. Each shard is formatted as ts, usually with a suffix of '.ts' appended to each file.
为了便于对大量的分片进行管理,还包括生成一个与所述分片对应的索引文件,在所述索引文件中包括每个分片的偏移量以及指向每个分片的指针。 In order to facilitate management of a large number of shards, it also includes generating an index file corresponding to the shards, including an offset of each shard and a pointer to each shard in the index file.
其中,所述分片的偏移量,可以理解为每个分片偏离起点位置的时间或者大小的偏移量,以时间偏移为例,比如第N个分片的偏移量为a时间点,第N+1个分片的偏移量为b时间点,那么第N+1个分片的大小即为b-a的时长内的视频数据。 The offset of the slice can be understood as the offset of the time or size of each slice from the starting position. Taking the time offset as an example, for example, the offset of the Nth slice is a time. Point, the offset of the N+1th slice is the b time point, then the size of the N+1th slice is the video data within the duration of ba.
如果偏移量为数据大小,那么通过偏移量相减,即可直接得到分片的大小。比如第N个分片的偏移量为a,第N+1个分片的偏移量为b,那么第N+1个分片的大小即为b-a。 If the offset is the data size, the size of the slice can be directly obtained by subtracting the offset. For example, if the offset of the Nth slice is a, and the offset of the N+1th slice is b, then the size of the N+1th slice is b-a.
所述指向分片的指针,用于根据索引文件中的指针依次对分片进行调用播放。 The pointer to the slice is used to sequentially play the slice according to the pointer in the index file.
其中,所述预设时长可以在索引文件中进行设定,所述索引文件中包括的多个指针,可以用于指示播放的名称和顺序。比如可将分片与索引文件中的指针相对应,且指针根据时间顺序依次进行存储。 The preset duration may be set in an index file, and multiple pointers included in the index file may be used to indicate the name and order of the play. For example, the shard can be associated with a pointer in the index file, and the pointers are sequentially stored in chronological order.
在步骤S202中,将所述索引文件与所述流媒体文件分割后的分片进行合并,生成合并后的文件。 In step S202, the index file is merged with the slice segmented by the streaming media file to generate a merged file.
在本发明实施例中,将所述索引文件以及分片进行合并,从而可以将数量较多的分片集中进行管理,比如对于一个流媒体文件,其包括数百个分片,现有技术中,通过索引文件对数百个分片进行管理时,需要耗费较多的系统资源,并且不利于将分片发送至其它服务器中进行文件的P2P共享。本申请通过打包合并后重新进行分割来解决文件多管理复杂的问题,将在步骤S103中作进一步的说明。 In the embodiment of the present invention, the index file and the shards are combined, so that a large number of shards can be collectively managed, for example, for one streaming media file, including hundreds of shards, in the prior art. When managing hundreds of shards through an index file, it requires a lot of system resources, and is not conducive to sending shards to other servers for P2P sharing of files. The present application solves the problem of complicated file management by re-segmenting after packaging and combining, and will be further explained in step S103.
在本步骤中,对所述索引文件和所述流媒体文件分割后的分片进行合并的方式,可以选用索引文件在前,所述流媒体文件分割后的分片在后的方式进行合并。即合并后的文件中,可以优先读取所述流媒体文件的分片所对应的索引文件。可以理解的是,这只是一种较佳的合并方式,但并不局限于这种合并方式。 In this step, the index file and the segmented slice of the streaming media file are merged, and the index file may be selected first, and the segmented slice of the streaming media file may be merged in a later manner. That is, in the merged file, the index file corresponding to the fragment of the streaming media file can be preferentially read. It can be understood that this is only a preferred combination, but it is not limited to this combination.
另外,在合并后的文件中,需要包括所述索引文件的大小信息,以便于与合并后的文件中的流媒体文件的分片进行区分。 In addition, in the merged file, the size information of the index file needs to be included to facilitate distinguishing from the fragmentation of the streaming media file in the merged file.
在步骤S203中,将所述合并后的文件按照预设的大小进行按序切割,得到多个数据块,所述数据块中包括数据块对应的序号以及对应的校验信息。 In step S203, the merged file is sequentially cut according to a preset size to obtain a plurality of data blocks, where the data block includes a serial number corresponding to the data block and corresponding verification information.
对合并后的文件,需要重新进行切割,所述切割的对象,可以为合并后的文件中的分片构成的集合,也可以对整个合并后的文件进行切割,汉对整个合并后的文件进行切割时,需要记录索引文件的大小信息,以便于后续对切割后的数据块与分片的位置进行对应关系的计算。 For the merged file, the cut is required, and the cut object may be a set of fragments in the merged file, or the entire merged file may be cut, and the entire merged file is performed by Han. When cutting, it is necessary to record the size information of the index file, so as to facilitate the subsequent calculation of the correspondence between the cut data block and the position of the slice.
将所述合并后的文件进行切割得到数据块,所述数据块的预设的大小可以为1KB等,根据上述分割后的分片为10s的方式相比,切割后的数据块为1KB时,切割后的数据块远小于分片,因此,一个分片包括多个数据块构成。 The merged file is cut to obtain a data block, and the preset size of the data block may be 1 KB or the like. When the divided data block is 1 KB, the data block after the cutting is 1 KB. The sliced data block is much smaller than the slice, and therefore, one slice consists of a plurality of data blocks.
另外,根据索引文件中记录的分片的偏移理,可以得到每个分片的大小以及偏移量,结合每个数据块的序号,即可得到每个分片包括的数据块的起始点位置。 In addition, according to the offset of the fragments recorded in the index file, the size and offset of each slice can be obtained, and the starting point of the data block included in each slice can be obtained by combining the sequence numbers of each data block. position.
比如,切割的对象,可以为合并后的文件中的分片构成的集合,根据步骤S101中介绍的方式,计算每个分片的起点位置,比如对于其中一个分片,数据的起点为56.52M,结束位置为58.2M位置,那么可以计算得到该分片的大小为1.68M,对应的数据包括1680个,如果第一个数据块的序号为1,那么该分片对应的数据块为序号56520至序号58200之间的数据块。 For example, the cut object may be a set of fragments in the merged file, and the starting position of each slice is calculated according to the manner described in step S101. For example, for one of the fragments, the starting point of the data is 56.52M. The end position is 58.2M, then the size of the fragment can be calculated to be 1.68M, and the corresponding data includes 1680. If the sequence number of the first data block is 1, the corresponding data block of the fragment is the number 56520. A block of data between the serial numbers 58200.
而如果切割的对象包括索引文件,则需要去除索引文件所占有的数据块序号,比如索引文件的大小5K,那么如果对于其中一个分片,数据的起点为56.52M,结束位置为58.2M位置,那么可以计算得到该分片的大小为1.68M,对应的数据包括1680个,如果第一个数据块的序号为1,那么该分片对应的数据块为序号56520+50至序号58200+50之间的数据块。 If the object to be cut includes the index file, it is necessary to remove the data block number occupied by the index file, such as the size of the index file 5K, then if for one of the fragments, the starting point of the data is 56.52M, and the ending position is 58.2M. Then, the size of the slice can be calculated to be 1.68M, and the corresponding data includes 1680. If the sequence number of the first data block is 1, the data block corresponding to the slice is the sequence number 56520+50 to the serial number 58200+50. Data block between.
本发明具体介绍了合并文件的生成过程,通过对所述合并文件进行切割,使得切割后的每个数据块与流媒体文件的分片文件以及索引文件对应,从而能够便利的将数据块发送至多个P2P服务器进行管理,提高基于HLS技术的P2P客户端的下载效率。 The present invention specifically introduces a process of generating a merged file, by cutting the merged file, so that each data block after cutting corresponds to a slice file and an index file of the streaming media file, thereby conveniently transmitting the data block at most P2P servers are managed to improve the download efficiency of P2P clients based on HLS technology.
实施例三: Embodiment 3:
图3为本发明实施例基于实施例一的基础上,在判断计算的校验值是否与数据块中存储的校验信息相符之后,根据数据块进行播放的实现流程,详述如下: FIG. 3 is a flowchart showing an implementation process of playing according to a data block after determining whether the calculated check value matches the verification information stored in the data block according to the first embodiment of the present invention, as follows:
在步骤S301中,如果所述校验值与数据块中存储的校验信息相符,则根据获取的数据块生成索引文件。 In step S301, if the check value matches the check information stored in the data block, an index file is generated according to the acquired data block.
在所述数据块中存储有数据块序号,根据所述数据块中序号的大小,从一个或者多个P2P服务器中下载数据块。 A data block number is stored in the data block, and the data block is downloaded from one or more P2P servers according to the size of the serial number in the data block.
当从一个P2P服务器中下载数据块,则只需要根据数据块序号的大小,从小到大依次进行下载即可。 When downloading data blocks from a P2P server, it is only necessary to download them in order from the smallest to the largest according to the size of the data block number.
当从多个P2P服务器中下载数据块,则可以设定不同P2P服务器的下载的序号范围的任务,从而实现在多个P2P服务器中同时下载所需要的数据块,并且下载的数据块不会重复。 When downloading data blocks from a plurality of P2P servers, a task of downloading a sequence number range of different P2P servers can be set, thereby realizing simultaneous downloading of required data blocks in a plurality of P2P servers, and the downloaded data blocks are not repeated. .
将下载的数据块需要组合成分片,因此可以优先将下载的数据块存放在内存中,通过内存快速进行组合。 The downloaded data blocks need to be combined into slices, so the downloaded data blocks can be preferentially stored in the memory and quickly combined through the memory.
当下载的数据块中不包括的索引文件时,可以在下载数据块前先下载索引文件。当所述索引文件位于所述数据块中时,可根据下载的数据中的序号以及索引文件的大小,得到所述索引文件。 When an index file is not included in the downloaded data block, the index file can be downloaded before the data block is downloaded. When the index file is located in the data block, the index file may be obtained according to the serial number in the downloaded data and the size of the index file.
在步骤S302中,根据所述索引文件中的指针所指向的分片,以及所述数据块的大小、分片的偏移量计算并获取分片所对应的数据块。 In step S302, the data block corresponding to the fragment is calculated and acquired according to the fragment pointed to by the pointer in the index file, and the size of the data block and the offset of the fragment.
对所述下载的数据块中的索引文件进行解析,由于在索引文件中包括分片的指针序列,通过该指针序列可以得到分片的播放顺序。另外,在索引文件中包括每个分片的偏移量,根据偏移量可以计算得到分片的大小。 The index file in the downloaded data block is parsed. Since the index sequence of the slice is included in the index file, the play sequence of the slice can be obtained by the pointer sequence. In addition, the offset of each slice is included in the index file, and the size of the slice can be calculated according to the offset.
在步骤S303中,根据获取的数据块构成分片,发送至播放器进行播放。 In step S303, a slice is formed according to the acquired data block, and sent to the player for playback.
在每个分片的大小都可以计算出来后,根据计算的分片的大小,可以得到每个分片对应的数据块的序号范围。 After the size of each slice can be calculated, according to the calculated size of the slice, the sequence number range of the data block corresponding to each slice can be obtained.
根据索引文件中的指针序列,可以得到需要播放的分片,根据所述播放的分片,查找对应的数据块号,向P2P服务器发送获取对应的数据块的请求,根据P2P服务器返回的数据块进行组合,即可得到需要播放的分片,将所述分片发送至播放器即可进行流媒体文件的播放。 According to the sequence of pointers in the index file, the fragment to be played can be obtained, and the corresponding data block number is searched according to the played fragment, and the request for acquiring the corresponding data block is sent to the P2P server, according to the data block returned by the P2P server. By combining, the piece to be played can be obtained, and the piece can be sent to the player to play the streaming file.
本发明实施例具体介绍通过获取的数据块完成对流媒体文件的播放,通过这种方式可以快速的下载数据块,获取更好的图像或声音播放质量。 The embodiment of the present invention specifically introduces the playback of the streaming media file by using the acquired data block. In this way, the data block can be quickly downloaded to obtain better image or sound playback quality.
实施例四: Embodiment 4:
图4为本发明实施例四提供的流媒体文件的播放校验方法的实现程序,详述如下: FIG. 4 is a schematic diagram of an implementation procedure of a playback verification method for a streaming media file according to Embodiment 4 of the present invention, which is as follows:
在步骤S401中,获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息。 In step S401, the merged file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the data sequence corresponding to the data block is included in each data block. Verify the information.
在步骤S402中,将所述流媒体文件的部分数据块或者全部数据块存放至多个P2P服务器,以及将所述流媒体文件的全部数据块存放至校正服务器。 In step S402, a partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
与实施例一不同之处在于,本发明实施例中对P2P服务器中存储的数据进行了具体限定,包括以下存储方式: The difference from the first embodiment is that the data stored in the P2P server is specifically limited in the embodiment of the present invention, including the following storage manners:
第一种方式,在多个P2P服务器中存储所述流媒体文件切割后的所有数据块,在P2P客户进行流媒体文件的下载播放时,可以从任意一台P2P服务器中下载任意序号的数据块,这种方式的好处在于,在其中任意一台P2P服务器出现故障时,对P2P客户的影响比较小,但P2P服务器中需要较大的空间进行数据的存储; In the first mode, all the data blocks cut by the streaming media file are stored in a plurality of P2P servers, and when the P2P client downloads and plays the streaming media file, the data block of any serial number can be downloaded from any P2P server. The advantage of this method is that when any one of the P2P servers fails, the impact on the P2P client is relatively small, but the P2P server requires a large space for data storage;
第二种方式,在多个P2P服务器中,每个P2P服务器只存储一部分数据块,比如在服务器1中存储数据块序号为1-3、10-12……在服务器2中存储4-6,13-15……,在服务器3中存储7-9,16-18……,当然这只是一种举例,通过多个P2P服务器的数据配合,可以使得P2P客户端可以快速的从不同的P2P服务器下载得到数据块,从而提高播放的流畅性。 In the second method, in a plurality of P2P servers, each P2P server stores only a part of data blocks, for example, in the server 1, the data block numbers are 1-3, 10-12, and the server 2 stores 4-6. 13-15... Store 7-9, 16-18... in server 3. Of course, this is just an example. Through the data cooperation of multiple P2P servers, P2P clients can be quickly accessed from different P2P servers. Download the data block to improve the smoothness of playback.
第三种方式,即为第一种方式与第二种方式的集合,即在一部分P2P服务器中存储所述流媒体文件切割后的所有数据块,在另一部分P2P服务器中存储一部分数据块,既可以提高P2P终端下载的速度,也能够尽可能的减小部分P2P服务器出现故障时对P2P客户端造成的影响。 The third method is a collection of the first mode and the second mode, that is, storing all the data blocks cut by the streaming media file in a part of the P2P server, and storing a part of the data blocks in another part of the P2P server, It can improve the download speed of P2P terminals, and can also reduce the impact on P2P clients when some P2P servers fail.
在步骤S403中,根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块。 In step S403, the P2P client downloads the data block from the P2P server according to the sequence number of the data block.
在步骤S404中,对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符。 In step S404, a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block.
在步骤S405中,如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。 In step S405, if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
本发明实施例通过对数据的存储进行了具体的说明,根据具体的需要,可以选择不同的数据块存储方式,可以有利于提高数据下载速度,或者可以节省存储空间。 The embodiment of the present invention specifically describes the storage of data, and according to specific needs, different data block storage modes may be selected, which may be beneficial to improve data download speed or save storage space.
实施例五: Embodiment 5:
图5为本发明第五实施例提供的流媒体文件的播放校验方法的实现程序,详述如下: FIG. 5 is a schematic diagram of an implementation procedure of a playback verification method for a streaming media file according to a fifth embodiment of the present invention, which is described in detail as follows:
在步骤S501中,获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息。 In step S501, a merge file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the data sequence corresponding to the data block is included in each data block. Verify the information.
在步骤S502中,将所述数据块存放至校正服务器以及多个P2P服务器。 In step S502, the data block is stored to a correction server and a plurality of P2P servers.
在步骤S503中,获取P2P客户端与多个P2P服务器之间的通信速度信息。 In step S503, communication speed information between the P2P client and the plurality of P2P servers is acquired.
在步骤S504中,根据所述P2P客户端与多个P2P服务器之间的通信速度信息,分配相应大小的数据块下载任务至各个P2P服务器,根据分配的所述下载任务对数据块进行下载。 In step S504, according to the communication speed information between the P2P client and the plurality of P2P servers, a data block download task of a corresponding size is allocated to each P2P server, and the data block is downloaded according to the allocated download task.
由于不同的P2P服务器传输的速率不相同,因此,在下载前可以对P2P服务器的连接速度进行测试,将传输速度高的服务器设置较多的下载任务量,对传输速度低的服务器设置较少的下载任务量,从而能够进一步提高下载的速度的同时,也可以有助于P2P客户端的网络资源的充分利用。 Since the transmission speeds of different P2P servers are different, the connection speed of the P2P server can be tested before downloading, the number of download tasks of the server with high transmission speed is set, and the number of servers with low transmission speed is set less. By downloading the amount of tasks, the download speed can be further improved, and the network resources of the P2P client can be fully utilized.
在步骤S505中,对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符。 In step S505, a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block.
在步骤S506中,如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。 In step S506, if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
本发明实施例与实施例一所述的流媒体文件的存储方法对应,通过这种流媒体文件的播放方法,可以实现基于HTTP协议的HLS的P2P播放,即能够提高播放速度,方便数据管理的同时,可以实现不同码率的快速切换。 The embodiment of the present invention corresponds to the method for storing a streaming media file according to the first embodiment. Through the streaming method of the streaming media file, the P2P playback of the HLS based on the HTTP protocol can be realized, that is, the playback speed can be improved, and the data management is facilitated. At the same time, fast switching of different code rates can be achieved.
实施例六: Example 6:
图6为本发明实施例六提供的流媒体文件的播放校验方法的实现程序,详述如下: FIG. 6 is a flowchart of an implementation procedure of a playback verification method for a streaming media file according to Embodiment 6 of the present invention, which is as follows:
在步骤S601中,对视频进行编码,由编码器将采集的视频数据编码为H.264格式的视频,将采集音频数据编码为ACC格式的音频,将编码后的视频和音频封装为MPEG格式的流媒体文件。 In step S601, the video is encoded, and the encoded video data is encoded into a video of H.264 format by the encoder, the collected audio data is encoded into audio of ACC format, and the encoded video and audio are encapsulated into MPEG format. Streaming media files.
如果判断视频源为直播的数据源,则需要包括对直播的数据源进行编码和封装,生成MPEG(英文全称为:Moving Picture Experts Group,中文全称为:动态图像专家组)格式的流媒体文件。 If it is determined that the video source is a live data source, it needs to include encoding and encapsulating the live data source to generate MPEG (English full name: Moving Picture Experts) Group, Chinese full name: Dynamic Image Experts Group) format streaming media files.
其中,对所述采集的直播数据源进行编码过程,一般可以由编码器完成。编码器可以是硬件设备,也可以为软件程序。硬件设备的编码器与卫星接收机或摄像机连接,将输入的信号进行编码,生成符合H.264标准的视频和AAC(英文全称为Advanced Audio Coding,中文全称为:高级音频编码)标准音频格式,并将其封装为MPEG的TS文件。 The encoding process of the collected live data source can be generally performed by an encoder. The encoder can be a hardware device or a software program. The encoder of the hardware device is connected to the satellite receiver or camera to encode the input signal to generate video and AAC conforming to the H.264 standard (English full name is Advanced) Audio Coding, the full name of Chinese: Advanced Audio Coding, standard audio format, and package it as an MPEG TS file.
在步骤S602中,获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息; In step S602, the merged file generated after the streaming media fragmentation according to the HLS technology is acquired, and the preset file license preset size is cut into a plurality of data blocks, and the serial number corresponding to the data block is included in each data block. Calibration information;
在步骤S603中,将所述数据块存放至校正服务器以及多个P2P服务器; In step S603, the data block is stored to a correction server and a plurality of P2P servers;
在步骤S604中,根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块; In step S604, according to the sequence number of the data block, the P2P client downloads the data block from the P2P server;
在步骤S605中,对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符; In step S605, a check value is calculated for the downloaded data block, and it is determined whether the calculated check value matches the check information stored in the data block;
在步骤S606中,如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。 In step S606, if the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
本发明实施例通过对视频源文件进行判断,当视频源文件不满足转换要求时,则自动对源文件的格式进行转换,提高本发明所述流媒体文件播放校验的适应性。 In the embodiment of the present invention, the video source file is judged. When the video source file does not meet the conversion requirement, the format of the source file is automatically converted, thereby improving the adaptability of the streaming media file playing verification according to the present invention.
实施例七: Example 7:
图7本发明实施例提供的流媒体文件的播放校验装置的结构示意图,详述如下: FIG. 7 is a schematic structural diagram of a playback verification device for a streaming media file according to an embodiment of the present invention, which is described in detail as follows:
本发明实施例所述流媒体文件的播放校验装置,包括: The playback verification device of the streaming media file according to the embodiment of the present invention includes:
流媒体文件切割单元701,用于获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息; The streaming media file cutting unit 701 is configured to obtain a merged file generated after the streaming media fragmentation according to the HLS technology, and cut the preset file license preset size into a plurality of data blocks, and include the data block in each data block. Corresponding serial number and verification information;
数据块存放单元702,用于将所述数据块存放至校正服务器以及多个P2P服务器; a data block storage unit 702, configured to store the data block to a calibration server and a plurality of P2P servers;
第一下载单元703,用于根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块; a first downloading unit 703, configured to download, by the P2P client, a data block from the P2P server according to the sequence number of the data block;
校验单元704,用于对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符; The checking unit 704 is configured to calculate a check value for the downloaded data block, and determine whether the calculated check value matches the check information stored in the data block;
第二下载单元705,用于如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。 The second downloading unit 705 is configured to download, to the verification server, a data block whose verification information does not match if the check value does not match the verification information stored in the data block.
优选的,所述流媒体文件切割单元具体包括: Preferably, the streaming media file cutting unit specifically includes:
第一分割子单元,用于获取流媒体文件,根据预设的时长对所述流媒体文件进行分割,得到所述流媒体文件对应的多个分片,以及包含所述分片的偏移量和指向所述分片的指针的索引文件; a first segmentation subunit, configured to acquire a streaming media file, and divide the streaming media file according to a preset duration, to obtain a plurality of fragments corresponding to the streaming media file, and an offset including the fragmentation And an index file pointing to the pointer of the shard;
合并子单元,用于将所述索引文件与所述流媒体文件分割后的分片进行合并,生成合并后的文件; a merging sub-unit, configured to merge the index file with the shard that is divided by the streaming media file to generate a merged file;
第二分割子单元,用于将所述合并后的文件按照预设的大小进行按序切割,得到多个数据块,所述数据块中包括数据块对应的序号以及对应的校验信息。 The second segmentation sub-unit is configured to sequentially cut the merged file according to a preset size to obtain a plurality of data blocks, where the data block includes a sequence number corresponding to the data block and corresponding verification information.
优选的,所述装置还包括: Preferably, the device further comprises:
索引文件生成单元,用于如果所述校验值与数据块中存储的校验信息相符,则根据获取的数据块生成索引文件; An index file generating unit, configured to generate an index file according to the obtained data block if the check value matches the check information stored in the data block;
数据块获取单元,用于根据所述索引文件中的指针所指向的分片,以及所述数据块的大小、分片的偏移量计算并获取分片所对应的数据块; a data block obtaining unit, configured to calculate and acquire a data block corresponding to the fragment according to the fragment pointed by the pointer in the index file, and the size of the data block and the offset of the fragment;
分片发送播放单元,用于根据获取的数据块构成分片,发送至播放器进行播放。 The slice sending and playing unit is configured to form a slice according to the acquired data block, and send it to the player for playing.
优选的,所述数据存储单元具体用于: Preferably, the data storage unit is specifically configured to:
将所述流媒体文件的部分数据块或者全部数据块存放至多个P2P服务器,以及将所述流媒体文件的全部数据块存放至校正服务器。 A partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
优选的,所述第一下载单元包括: Preferably, the first download unit comprises:
通信速度信息获取子单元,用于获取P2P客户端与多个P2P服务器之间的通信速度信息; a communication speed information obtaining subunit, configured to acquire communication speed information between the P2P client and the plurality of P2P servers;
下载任务分配子单元,用于根据所述P2P客户端与多个P2P服务器之间的通信速度信息,分配相应大小的数据块下载任务至各个P2P服务器,根据分配的所述下载任务对数据块进行下载。 a task allocation subunit, configured to allocate a data block download task of a corresponding size to each P2P server according to the communication speed information between the P2P client and the plurality of P2P servers, and perform data block according to the allocated download task. download.
优选的,所述方法还包括: Preferably, the method further includes:
编码单元,用于对视频进行编码,由编码器将采集的视频数据编码为H.264格式的视频,将采集音频数据编码为ACC格式的音频; a coding unit, configured to encode the video, and encode the collected video data into a video of H.264 format, and encode the collected audio data into audio of ACC format;
封闭单元,用于将编码后的视频和音频封装为MPEG格式的流媒体文件。 A closed unit for encapsulating the encoded video and audio into a streaming media file in MPEG format.
本发明实施例所述流媒体文件播放检验装置,与实施例一至六所述流媒体文件播放校验方法对应,在此不作重复赘述。 The streaming media file playback verification device in the embodiment of the present invention corresponds to the streaming media file playback verification method in the first embodiment to the sixth embodiment, and details are not described herein.
另外,本发明实施例提供了一种流媒体文件的播放校验系统,所述系统包括: In addition, an embodiment of the present invention provides a playback verification system for a streaming media file, where the system includes:
P2P 服务器,所述P2P服务器用于存放切割后的数据块,所述数据块中包括数据块对应的序号,其中待切割的文件为流媒体文件进行分割后的分片以及所述分片对应的索引文件合并后的文件,所述索引文件中包含所述分片的偏移量以及指向所述分片的指针; P2P a server, the P2P server is configured to store the cut data block, where the data block includes a sequence number corresponding to the data block, where the file to be cut is a segment after the segmentation of the streaming media file and an index corresponding to the segment a file after the file is merged, the index file includes an offset of the slice and a pointer to the slice;
校验服务器,所述校验服务器中存放流媒体文件切割后的所有数据块,所述数据块中包括数据块对应的序号,其中待切割的文件为流媒体文件进行分割后的分片以及所述分片对应的索引文件合并后的文件,所述索引文件中包含所述分片的偏移量以及指向所述分片的指针; a verification server, wherein the verification server stores all the data blocks after the stream media file is cut, and the data block includes a sequence number corresponding to the data block, wherein the file to be cut is a segmentation of the stream media file and the segmentation a merged file of the index file corresponding to the fragment, where the index file includes an offset of the fragment and a pointer to the fragment;
P2P 客户端,所述P2P客户端用于从一个或者多个P2P服务器中获取数据块,对获取的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符,如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块,根据下载的校验后的数据块的序号得到索引文件,解析所述索引文件,得到需要播放的流媒体文件的分片的大小以及需要读取的数据块,并将下载校验后的数据块构成分片发送至播放器进行播放。 P2P The client, the P2P client is configured to obtain a data block from one or more P2P servers, calculate a check value for the obtained data block, and determine whether the calculated check value matches the check information stored in the data block. If the check value does not match the verification information stored in the data block, downloading a data block whose verification information does not match to the verification server, and obtaining an index file according to the serial number of the downloaded verified data block, The index file is parsed to obtain the size of the fragment of the streaming media file to be played and the data block to be read, and the downloaded data block is sent to the player for playback.
本发明实施例中所述流媒体文件播放校验系统,可用于执行实施例一至七所述流媒体文件的播放校验,在此不作重复赘述。 The streaming media file play verification system in the embodiment of the present invention may be used to perform the play verification of the streaming media files in the first to seventh embodiments, and details are not described herein.
在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。 In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。 The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。 In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。 The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM, Read-Only) Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。 The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. Within the scope.

Claims (13)

  1. 一种流媒体文件的播放校验方法,其特征在于,所述方法包括: A method for verifying playback of a streaming media file, the method comprising:
    获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息;Obtaining a merged file generated after the streaming media is fragmented according to the HLS technology, and cutting the preset size of the merged file license into a plurality of data blocks, and including, in each data block, a serial number corresponding to the data block and verification information;
    将所述数据块存放至校正服务器以及多个P2P服务器;Storing the data block to a calibration server and a plurality of P2P servers;
    根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块;And downloading, by the P2P client, the data block from the P2P server according to the sequence number of the data block;
    对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符;Calculating a check value for the downloaded data block, and determining whether the calculated check value matches the check information stored in the data block;
    如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。If the check value does not match the check information stored in the data block, the data block whose check information does not match is downloaded to the check server.
  2. 根据权利要求1所述方法,其特征在于,所述获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息步骤具体包括:The method according to claim 1, wherein the acquiring a merged file generated after streaming the media according to the HLS technology, and cutting the preset size of the merged file license into a plurality of data blocks, in each data block The step of including the sequence number corresponding to the data block and the verification information specifically includes:
    获取流媒体文件,根据预设的时长对所述流媒体文件进行分割,得到所述流媒体文件对应的多个分片,以及包含所述分片的偏移量和指向所述分片的指针的索引文件;Obtaining a streaming media file, and dividing the streaming media file according to a preset duration, obtaining a plurality of fragments corresponding to the streaming media file, and an offset including the fragment and a pointer to the fragment Index file
    将所述索引文件与所述流媒体文件分割后的分片进行合并,生成合并后的文件;Combining the index file with the segmentation of the stream media file to generate a merged file;
    将所述合并后的文件按照预设的大小进行按序切割,得到多个数据块,所述数据块中包括数据块对应的序号以及对应的校验信息。The merged file is sequentially cut according to a preset size to obtain a plurality of data blocks, where the data block includes a serial number corresponding to the data block and corresponding verification information.
  3. 根据权利要求2所述方法,其特征在于,在所述对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符步骤之后,所述方法还包括:The method according to claim 2, wherein after the step of calculating a check value for the downloaded data block and determining whether the calculated check value matches the verification information stored in the data block, the method further includes :
    如果所述校验值与数据块中存储的校验信息相符,则根据获取的数据块生成索引文件;If the check value matches the check information stored in the data block, generating an index file according to the obtained data block;
    根据所述索引文件中的指针所指向的分片,以及所述数据块的大小、分片的偏移量计算并获取分片所对应的数据块;Calculating and acquiring a data block corresponding to the fragment according to the fragment pointed to by the pointer in the index file, and the size of the data block and the offset of the fragment;
    根据获取的数据块构成分片,发送至播放器进行播放。The shards are formed according to the acquired data blocks, and are sent to the player for playback.
  4. 根据权利要求1所述方法,其特征在于,所述将所述数据块存放至校正服务器以及多个P2P服务器步骤包括:The method of claim 1, wherein the storing the data block to the calibration server and the plurality of P2P servers comprises:
    将所述流媒体文件的部分数据块或者全部数据块存放至多个P2P服务器,以及将所述流媒体文件的全部数据块存放至校正服务器。A partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
  5. 根据权利要求1所述方法,其特征在于,所述P2P客户端从所述P2P服务器中下载数据块步骤包括:The method according to claim 1, wherein the step of the P2P client downloading the data block from the P2P server comprises:
    获取P2P客户端与多个P2P服务器之间的通信速度信息;Obtaining communication speed information between the P2P client and multiple P2P servers;
    根据所述P2P客户端与多个P2P服务器之间的通信速度信息,分配相应大小的数据块下载任务至各个P2P服务器,根据分配的所述下载任务对数据块进行下载。And according to the communication speed information between the P2P client and the plurality of P2P servers, the data block download task of the corresponding size is allocated to each P2P server, and the data block is downloaded according to the allocated download task.
  6. 根据权利要求1所述方法,其特征在于,所述获取根据HLS技术对流媒体分片后生成的合并文件步骤之前,所述方法还包括:The method according to claim 1, wherein the method further comprises: before the step of acquiring a merged file generated after the streaming media is fragmented according to the HLS technology, the method further comprises:
    对视频进行编码,由编码器将采集的视频数据编码为H.264格式的视频,将采集音频数据编码为ACC格式的音频;Encoding the video, the encoder encodes the collected video data into a video of H.264 format, and encodes the collected audio data into audio of ACC format;
    将编码后的视频和音频封装为MPEG格式的流媒体文件。The encoded video and audio are packaged into a streaming media file in MPEG format.
  7. 一种流媒体文件的播放校验装置,其特征在于,所述装置包括:A playback verification device for streaming media files, characterized in that the device comprises:
    流媒体文件切割单元,用于获取根据HLS技术对流媒体分片后生成的合并文件,将所述合并文件执照预设大小切割为多个数据块,在每个数据块中包括所述数据块对应的序号以及校验信息;a streaming media file cutting unit, configured to acquire a merged file generated after the streaming media fragmentation according to the HLS technology, and cut the preset size of the merged file license into a plurality of data blocks, and include the data block corresponding to each data block. Serial number and verification information;
    数据块存放单元,用于将所述数据块存放至校正服务器以及多个P2P服务器;a data block storage unit, configured to store the data block to a calibration server and a plurality of P2P servers;
    第一下载单元,用于根据所述数据块的序号,P2P客户端从所述P2P服务器中下载数据块;a first downloading unit, configured to download, by the P2P client, the data block from the P2P server according to the sequence number of the data block;
    校验单元,用于对下载的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符;a check unit, configured to calculate a check value for the downloaded data block, and determine whether the calculated check value matches the check information stored in the data block;
    第二下载单元,用于如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块。And a second downloading unit, configured to: if the check value does not match the verification information stored in the data block, download a data block that does not match the verification information to the verification server.
  8. 根据权利要求7所述装置,其特征在于,所述流媒体文件切割单元具体包括:The device according to claim 7, wherein the streaming media file cutting unit comprises:
    第一分割子单元,用于获取流媒体文件,根据预设的时长对所述流媒体文件进行分割,得到所述流媒体文件对应的多个分片,以及包含所述分片的偏移量和指向所述分片的指针的索引文件;a first segmentation subunit, configured to acquire a streaming media file, and divide the streaming media file according to a preset duration, to obtain a plurality of fragments corresponding to the streaming media file, and an offset including the fragmentation And an index file pointing to the pointer of the shard;
    合并子单元,用于将所述索引文件与所述流媒体文件分割后的分片进行合并,生成合并后的文件;a merging sub-unit, configured to merge the index file with the shard that is divided by the streaming media file to generate a merged file;
    第二分割子单元,用于将所述合并后的文件按照预设的大小进行按序切割,得到多个数据块,所述数据块中包括数据块对应的序号以及对应的校验信息。The second segmentation sub-unit is configured to sequentially cut the merged file according to a preset size to obtain a plurality of data blocks, where the data block includes a sequence number corresponding to the data block and corresponding verification information.
  9. 根据权利要求8所述装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    索引文件生成单元,用于如果所述校验值与数据块中存储的校验信息相符,则根据获取的数据块生成索引文件;An index file generating unit, configured to generate an index file according to the obtained data block if the check value matches the check information stored in the data block;
    数据块获取单元,用于根据所述索引文件中的指针所指向的分片,以及所述数据块的大小、分片的偏移量计算并获取分片所对应的数据块;a data block obtaining unit, configured to calculate and acquire a data block corresponding to the fragment according to the fragment pointed by the pointer in the index file, and the size of the data block and the offset of the fragment;
    分片发送播放单元,用于根据获取的数据块构成分片,发送至播放器进行播放。The slice sending and playing unit is configured to form a slice according to the acquired data block, and send it to the player for playing.
  10. 根据权利要求7所述装置,其特征在于,所述数据存储单元具体用于:The device according to claim 7, wherein the data storage unit is specifically configured to:
    将所述流媒体文件的部分数据块或者全部数据块存放至多个P2P服务器,以及将所述流媒体文件的全部数据块存放至校正服务器。A partial data block or all data blocks of the streaming media file are stored in a plurality of P2P servers, and all data blocks of the streaming media files are stored in a correction server.
  11. 根据权利要求7所述装置,其特征在于,所述第一下载单元包括:The apparatus according to claim 7, wherein said first downloading unit comprises:
    通信速度信息获取子单元,用于获取P2P客户端与多个P2P服务器之间的通信速度信息;a communication speed information obtaining subunit, configured to acquire communication speed information between the P2P client and the plurality of P2P servers;
    下载任务分配子单元,用于根据所述P2P客户端与多个P2P服务器之间的通信速度信息,分配相应大小的数据块下载任务至各个P2P服务器,根据分配的所述下载任务对数据块进行下载。a task allocation subunit, configured to allocate a data block download task of a corresponding size to each P2P server according to the communication speed information between the P2P client and the plurality of P2P servers, and perform data block according to the allocated download task. download.
  12. 根据权利要求7所述装置,其特征在于,所述方法还包括:The device according to claim 7, wherein the method further comprises:
    编码单元,用于对视频进行编码,由编码器将采集的视频数据编码为H.264格式的视频,将采集音频数据编码为ACC格式的音频;a coding unit, configured to encode the video, and encode the collected video data into a video of H.264 format, and encode the collected audio data into audio of ACC format;
    封闭单元,用于将编码后的视频和音频封装为MPEG格式的流媒体文件。A closed unit for encapsulating the encoded video and audio into a streaming media file in MPEG format.
  13. 一种流媒体文件的播放校验系统,其特征在于,所述播放校验系统包括:A playback verification system for streaming media files, characterized in that the playback verification system comprises:
    P2P 服务器,所述P2P服务器用于存放切割后的数据块,所述数据块中包括数据块对应的序号,其中待切割的文件为流媒体文件进行分割后的分片以及所述分片对应的索引文件合并后的文件,所述索引文件中包含所述分片的偏移量以及指向所述分片的指针;P2P a server, the P2P server is configured to store the cut data block, where the data block includes a sequence number corresponding to the data block, where the file to be cut is a segment after the segmentation of the streaming media file and an index corresponding to the segment a file after the file is merged, the index file includes an offset of the slice and a pointer to the slice;
    校验服务器,所述校验服务器中存放流媒体文件切割后的所有数据块,所述数据块中包括数据块对应的序号,其中待切割的文件为流媒体文件进行分割后的分片以及所述分片对应的索引文件合并后的文件,所述索引文件中包含所述分片的偏移量以及指向所述分片的指针;a verification server, wherein the verification server stores all the data blocks after the stream media file is cut, and the data block includes a sequence number corresponding to the data block, wherein the file to be cut is a segmentation of the stream media file and the segmentation a merged file of the index file corresponding to the fragment, where the index file includes an offset of the fragment and a pointer to the fragment;
    P2PP2P
    客户端,所述P2P客户端用于从一个或者多个P2P服务器中获取数据块,对获取的数据块计算校验值,判断计算的校验值是否与数据块中存储的校验信息相符,如果所述校验值与数据块中存储的校验信息不相符,则向所述校验服务器下载校验信息不相符的数据块,根据下载的校验后的数据块的序号得到索引文件,解析所述索引文件,得到需要播放的流媒体文件的分片的大小以及需要读取的数据块,并将下载校验后的数据块构成分片发送至播放器进行播放。The client, the P2P client is configured to obtain a data block from one or more P2P servers, calculate a check value for the obtained data block, and determine whether the calculated check value matches the check information stored in the data block. If the check value does not match the verification information stored in the data block, downloading a data block whose verification information does not match to the verification server, and obtaining an index file according to the serial number of the downloaded verified data block, The index file is parsed to obtain the size of the fragment of the streaming media file to be played and the data block to be read, and the downloaded data block is sent to the player for playback.
PCT/CN2015/088765 2015-09-01 2015-09-01 Method, device, and system for playing and checking streaming media file WO2017035786A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/088765 WO2017035786A1 (en) 2015-09-01 2015-09-01 Method, device, and system for playing and checking streaming media file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/088765 WO2017035786A1 (en) 2015-09-01 2015-09-01 Method, device, and system for playing and checking streaming media file

Publications (1)

Publication Number Publication Date
WO2017035786A1 true WO2017035786A1 (en) 2017-03-09

Family

ID=58186600

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/088765 WO2017035786A1 (en) 2015-09-01 2015-09-01 Method, device, and system for playing and checking streaming media file

Country Status (1)

Country Link
WO (1) WO2017035786A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597153A (en) * 2020-05-13 2020-08-28 湖南国科微电子股份有限公司 HLS-based file management method and device, electronic equipment and storage medium
CN112822260A (en) * 2020-12-31 2021-05-18 北京天融信网络安全技术有限公司 File transmission method and device, electronic equipment and storage medium
CN113438513A (en) * 2021-06-25 2021-09-24 深圳Tcl新技术有限公司 Video resolution switching method, device, equipment and storage medium
CN113556583A (en) * 2021-07-19 2021-10-26 杭州国芯科技股份有限公司 Set top box starting advertisement playing method
CN114363321A (en) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 File transmission method, equipment and system
CN116208783A (en) * 2023-01-30 2023-06-02 浪潮云信息技术股份公司 Audio and video storage and on-demand method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100332621A1 (en) * 2008-02-22 2010-12-30 Telefonaktiebolaget Lm Ericsson (Publ) Method and Apparatus for Obtaining Media Over a Communications Network
CN102255695A (en) * 2011-07-22 2011-11-23 乐视网信息技术(北京)股份有限公司 Data check method and system applied to peer-to-peer (p2p) network delivery system
CN102546731A (en) * 2010-12-30 2012-07-04 中国移动通信集团公司 Subchunk integrity checking method and system of peer-to-peer streaming media system
CN103079116A (en) * 2012-12-31 2013-05-01 乐视网信息技术(北京)股份有限公司 Data passive checking system and passive checking method applied to peer-to-peer network
CN104796796A (en) * 2015-04-21 2015-07-22 范文鲜 Method for improving fault tolerance of HLS (hyper text transport protocol live streaming) player of Android platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100332621A1 (en) * 2008-02-22 2010-12-30 Telefonaktiebolaget Lm Ericsson (Publ) Method and Apparatus for Obtaining Media Over a Communications Network
CN102546731A (en) * 2010-12-30 2012-07-04 中国移动通信集团公司 Subchunk integrity checking method and system of peer-to-peer streaming media system
CN102255695A (en) * 2011-07-22 2011-11-23 乐视网信息技术(北京)股份有限公司 Data check method and system applied to peer-to-peer (p2p) network delivery system
CN103079116A (en) * 2012-12-31 2013-05-01 乐视网信息技术(北京)股份有限公司 Data passive checking system and passive checking method applied to peer-to-peer network
CN104796796A (en) * 2015-04-21 2015-07-22 范文鲜 Method for improving fault tolerance of HLS (hyper text transport protocol live streaming) player of Android platform

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597153A (en) * 2020-05-13 2020-08-28 湖南国科微电子股份有限公司 HLS-based file management method and device, electronic equipment and storage medium
CN112822260A (en) * 2020-12-31 2021-05-18 北京天融信网络安全技术有限公司 File transmission method and device, electronic equipment and storage medium
CN112822260B (en) * 2020-12-31 2023-06-09 北京天融信网络安全技术有限公司 File transmission method and device, electronic equipment and storage medium
CN113438513A (en) * 2021-06-25 2021-09-24 深圳Tcl新技术有限公司 Video resolution switching method, device, equipment and storage medium
CN113438513B (en) * 2021-06-25 2023-05-02 深圳Tcl新技术有限公司 Video resolution switching method, device, equipment and storage medium
CN113556583A (en) * 2021-07-19 2021-10-26 杭州国芯科技股份有限公司 Set top box starting advertisement playing method
CN114363321A (en) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 File transmission method, equipment and system
CN116208783A (en) * 2023-01-30 2023-06-02 浪潮云信息技术股份公司 Audio and video storage and on-demand method and device

Similar Documents

Publication Publication Date Title
WO2017035786A1 (en) Method, device, and system for playing and checking streaming media file
WO2017035787A1 (en) Method, device, and system for storing streaming media file
WO2011059272A2 (en) Method and apparatus for providing trick play service
WO2012011724A2 (en) Method for transceiving media files and device for transmitting/receiving using same
WO2015012605A1 (en) Method and apparatus for encoding three-dimensional content
WO2012030178A2 (en) Method and device for providing streaming content
WO2015012565A1 (en) Transmitting apparatus, receiving apparatus and signal processing method thereof
WO2012047028A2 (en) Apparatus and method for providing streaming content
WO2016129974A1 (en) Transmitting apparatus and receiving apparatus and controlling method thereof
WO2015034245A1 (en) Transmitting apparatus, receiving apparatus, and signal processing method thereof
WO2013162312A1 (en) Method and apparatus for transceiving data for multimedia transmission system
WO2013089437A1 (en) Device and method for receiving media content
WO2011071290A2 (en) Streaming method and apparatus operating by inserting other content into main content
WO2013141666A1 (en) Hybrid delivery method and reception method for mmt packaged svc video contents
WO2011059273A2 (en) Method and apparatus for adaptive streaming using segmentation
WO2011059291A2 (en) Method and apparatus for transmitting and receiving data
WO2011155776A2 (en) Method for providing fragment-based multimedia streaming service and device for same, and method for receiving fragment-based multimedia streaming service and device for same
WO2020076058A1 (en) Method and apparatus for generating media file comprising 3-dimensional video content, and method and apparatus for replaying 3-dimensional video content
EP3017395A1 (en) Method and apparatus of data authentication
WO2017084311A1 (en) Method and device for accelerating playing of single-fragment video
WO2016175564A1 (en) Audio content recognition method and device
WO2017035783A1 (en) Streaming media transmission and play method, and transmission and play device
WO2016111560A1 (en) Transmitting apparatus and receiving apparatus and signal processing method thereof
EP2596629A2 (en) Method and apparatus for transmitting and receiving adaptive streaming mechanism-based content
WO2013112027A1 (en) Method for estimating network jitter in apparatus for transmitting coded media data

Legal Events

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

Ref document number: 15902593

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15902593

Country of ref document: EP

Kind code of ref document: A1