WO2013053259A1 - 流媒体数据的处理方法、播放方法以及装置 - Google Patents

流媒体数据的处理方法、播放方法以及装置 Download PDF

Info

Publication number
WO2013053259A1
WO2013053259A1 PCT/CN2012/079615 CN2012079615W WO2013053259A1 WO 2013053259 A1 WO2013053259 A1 WO 2013053259A1 CN 2012079615 W CN2012079615 W CN 2012079615W WO 2013053259 A1 WO2013053259 A1 WO 2013053259A1
Authority
WO
WIPO (PCT)
Prior art keywords
container file
streaming media
original
media data
file
Prior art date
Application number
PCT/CN2012/079615
Other languages
English (en)
French (fr)
Inventor
杜春华
周剑辉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2013053259A1 publication Critical patent/WO2013053259A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/85406Content authoring involving a specific file format, e.g. MP4 format
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream

Definitions

  • the present invention is entitled to the priority of the Chinese Patent Application, the entire disclosure of which is hereby incorporated by reference.
  • the present invention relates to the field of multimedia technologies, and in particular, to a method for processing streaming media data, a method for playing streaming media data, a method for downloading streaming media data, a processing device for streaming media data, and a stream A device for downloading media data.
  • a container is a file format proposed for the convenience of storing video data and audio data, such as a common audio video interleaved format (AVI, Audio Video Interleaved), MP4 (MPEG-4 Part 14), MKV (Matroska), REAL. VIDEO and so on.
  • a container is compatible with video data streams and audio data streams in a variety of different data formats.
  • the container file carries the container source information and the media stream management information in addition to the video data stream and the audio data stream, wherein the container source information is the description information of the container file, that is, the metadata of the container file. For example, the size, format, generation time, and the like of the container file; the media stream management information is description information of the video and/or audio data stream contained in the container file, that is, metadata of the media data stream in the container file, For example, the data format of a video or audio data stream.
  • video sites or video library servers require the processing of input raw container files and media data streams in raw container files into a unified format container file and media data stream.
  • the existing processing flow is: receiving the input original container file; The data format of the video or audio data stream in the original container file, which decodes the video or audio data; re-encodes the decoded data into a video or audio data stream according to a predetermined unified video or audio data format; The encoded video or audio data stream is then encapsulated into a container file of a predetermined uniform container format.
  • the embodiment of the present invention provides a method for processing streaming media data, which is used to solve the problem that the prior art converts the input original container file into a new container file in a unified format, which has a complicated processing process and occupies more processing resources.
  • the embodiment of the present invention further provides a method for playing streaming media data, a method for downloading streaming media data, a device for processing streaming media data, a streaming media client, and a streaming media server.
  • a method for processing streaming media data comprising:
  • the original container file includes an original media data stream; parsing each frame of streaming media data from the original container file, and obtaining the frame streaming media data in the original container file Offset position
  • a method for playing streaming media data comprising:
  • the index list including offset positions of the streaming media data of the at least one key frame in the new container file, and original media included in the original container file by each key frame Play time in the data stream;
  • the streaming media data returned by the streaming server is played according to the data format in the file header.
  • a method for playing streaming media data comprising:
  • the data acquisition request carries an offset location
  • the offset location is streaming media data of a key frame determined by the streaming media client according to the index list in the new container file Offset position
  • the streaming media server receives the download request sent by the streaming media client, where the download request carries the identifier of the new container file;
  • the streaming media server writes the frame streaming media data into a file according to the offset position of the streaming media data in the original container file in the new container file corresponding to the identifier of the new container file, thereby generating a restored container.
  • the streaming server sends the restored container file to the streaming client.
  • a method for downloading streaming media data comprising:
  • the streaming media server receives a download request sent by the streaming media client, where the download request carries an identifier of the new container file;
  • the streaming media server writes the frame streaming media data into a file according to the offset position of the streaming media data in the original container file in the new container file corresponding to the identifier of the new container file, thereby generating a restore.
  • Container file send the restored container file to the streaming client.
  • a processing device for streaming media data comprising:
  • a first receiving unit configured to receive an input original container file, where the original container file includes an original media data stream;
  • a parsing unit configured to parse out each frame of streaming media data from the original container file, and obtain an offset position of the frame streaming media data in the original container file
  • a first writing unit configured to write the framed media data and the offset position of the frame streaming media data in the original container file into a payload portion of the new container file
  • a second writing unit configured to write metadata of the new container file in a file header of the new container file, and metadata of the original media data stream in the original container file.
  • a # ⁇ H, ⁇ - a first sending unit, configured to send an online play request to the streaming media server, where the online play request carries an identifier of the new container file;
  • a second receiving unit configured to receive a file header and an index list of the returned new container file, where the index list includes an offset position of the streaming media data of the at least one key frame in the new container file, and each key frame is original The playback time in the original media data stream contained in the container file;
  • a selecting unit configured to select a play time of one of the key frames according to a play time of each key frame in the index list received by the second receiving unit;
  • a searching unit configured to search, from the index list, an offset position of a key frame corresponding to a play time of a key frame selected by the selecting unit in the new container file
  • a second sending unit configured to send a data acquisition request to the streaming media server, where the data acquisition request carries the found offset location, and is used to obtain the streaming media data that is at least one frame starting from the offset location.
  • a playing unit configured to play the streaming media data returned by the streaming media server according to the data format in the file header received by the second receiving unit.
  • a streaming media server comprising:
  • a third receiving unit configured to receive an online play request sent by the streaming media client, where the online play request carries an identifier of the new container file
  • a third sending unit configured to send a file header and an index list of a new container file corresponding to the identifier of the new container file, where the index list includes an offset position of the streaming media data of the key frame in the new container file a playback time of the key frame in the original media data stream included in the original container file;
  • a fourth receiving unit configured to receive a data acquisition request, where the data acquisition request carries an offset location, where the offset location is the flow An offset position of the streaming media data of a key frame determined by the media client according to the index list in the new container file;
  • a fourth sending unit configured to return, to the streaming client, streaming media data that is at least one frame starting from the offset position according to the offset position in the acquiring request.
  • a kind of streaming media ready for H ⁇ - a fifth receiving unit, configured to receive a download request sent by the streaming media client, where the download request carries an identifier of a new container file;
  • a second restoring unit configured to write the stream media data into a file according to an offset position of the streaming media data in the original container file in the new container file corresponding to the identifier of the new container file, thereby Generate a restored container file;
  • a fifth sending unit configured to send the container file restored by the second restoring unit to the streaming media client.
  • a streaming media server comprising:
  • a fifth receiving unit configured to receive a download request sent by the streaming media client, where the download request carries an identifier of the new container file
  • a determining unit configured to determine whether the original container file is included in the new container file corresponding to the new container file identifier received by the fifth receiving unit;
  • a reading unit configured to: when the determining unit determines that the original container file is included, reading the original container file from the new container file, and triggering the fifth sending unit to send the read original container file to the streaming media client;
  • a second restoring unit configured to: when the determining unit determines that the original container file is not included, the offset position of each frame of the streaming media data in the original container file according to the identifier of the new container file The frame streaming media data is written into a file to generate a restored container file; the fifth sending unit is triggered to send the restored container file to the streaming media client.
  • the processing scheme of the streaming media data provided by the embodiment of the present invention writes each frame stream parsed by the code stream analyzer in the new container file in the process of converting the input original container file into a new container file in a unified format.
  • Media data, and the offset position of the frame streaming media data in the original container file can be converted into a new container file without decoding and re-encoding the streaming media data in the original streaming media file. If this conversion is performed on multiple original containers of different formats, they can be converted.
  • FIG. 1 is a schematic diagram of a process flow when a container file is processed into a unified format in the prior art
  • FIG. 2 is a flow chart of a main implementation principle according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for processing streaming media data according to an embodiment of the present invention.
  • FIG. 4a is a schematic diagram of a first format of a new container file according to an embodiment of the present invention.
  • 4b is a schematic diagram of a second format of a new container file according to an embodiment of the present invention.
  • 4c is a schematic diagram of a third format of a new container file according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a method for playing online streaming media data according to an embodiment of the present invention
  • FIG. 6 is a flowchart of another method for playing online streaming data according to an embodiment of the present invention
  • FIG. 7 is a flowchart of a method for downloading streaming media data according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of a device for processing streaming media data according to an embodiment of the present invention. The structural intent of the streaming client;
  • FIG. 10 is a schematic structural diagram of a streaming media server according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a streaming media server according to an embodiment of the present invention.
  • FIG. 1b is another schematic structural diagram of a streaming media server according to an embodiment of the present invention. detailed description
  • FIG. 1 is a schematic diagram of a process flow of streaming media data in a video website or a video library in the prior art. After decoding and encoding two stages, the streaming media data is encapsulated into a container file of a predetermined uniform container format, based on the predetermined unified Container format container file for streaming media online and under Loaded.
  • the prior art processes the original container file and the media data stream in the original container file into a unified format container file and media data stream, it needs to be decoded and encoded in two stages, in addition to occupying a large amount of processing resources of the system.
  • the original container file cannot be restored, and the original container file is required as evidence. The scenario will not meet the requirements.
  • the main implementation principle process of the embodiment of the present invention is as follows:
  • Step 10 Receive an input original container file, where the original container file includes an original media data stream; the original media data stream may be an audio stream, a video stream, or the like.
  • Step 20 Parse each frame of streaming media data from the original streaming media file, and obtain an offset position of the frame streaming media data in the original container file.
  • Step 30 Write each frame of streaming media data and an offset position of the frame streaming media data in the original container file into a payload portion of the new container file;
  • Step 40 Write the metadata of the new container file in the file header of the new container file, and the metadata of the original media data stream in the original container file.
  • this embodiment provides a specific example, and the processing principle of the streaming media data shown in FIG. 2 will be described in detail.
  • the specific example only uses the original video stream in the original container file as an example for description.
  • media streams stored in the form of data frames, such as audio streams similar principles can be applied. Process it.
  • the original container file may be a container file uploaded by a user, or a video file device having a camera function or a container file generated by an audio collection device (such as a camera, a digital video camera, a voice recorder) having a recording function. It can also be a container file generated by the streaming media processing software.
  • the original container file contains the original video stream.
  • Step 302 Trigger to detect a data format of the original video stream in the original container file shown.
  • the code stream analyzer is an existing video analysis software for performing format check on the input data, outputting the offset position of each frame of streaming media data and each frame of streaming media data in the original container file, such as each frame of video. The offset position of the data in the original container file, and the offset position of each frame of audio data in the original container file.
  • the code stream analyzer is composed of a plurality of code stream analysis modules, and each code stream analysis module can analyze data of a corresponding format.
  • Each code stream analysis module in the code stream analyzer can be called in turn to try to parse a small amount of data in the initial part of the original container file, and the analysis result contains the data format.
  • the probe can end when it encounters an identifiable data format in the parsing result of the first stream analyzer.
  • Step 303 Determine, according to the detection result, whether the data format of the original video stream is supported. If yes, go to step 304, otherwise the process ends.
  • parsing result of any one of the stream analysis modules includes an identifiable data format, it indicates that the data format of the original video stream is supported.
  • Step 304 When the data format of the original video stream is supported, invoking a corresponding code stream analysis module, performing data frame parsing on the original container file, parsing each frame of video data, and obtaining the frame video data in the The offset position in the original container file.
  • Step 305 Write each frame of video data and an offset position of the frame video data in the original container file into a new container file.
  • Each frame of video data written in the new container file, and the frame of the video data in the original container ⁇ pieces ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ 1, ⁇ ffl - ⁇ ⁇ ⁇ Streaming Hyun Xuan ⁇ ⁇ ' ⁇ ⁇ ⁇
  • the generated restored container file is provided to the streaming client.
  • Step 306 Write a file header in the new container file to generate a new container file.
  • the metadata of the new container file is written in the file header of the new container file, and the metadata of the original video stream in the original container file.
  • the metadata for the new container file includes the ID of the new container file, and can also contain additional information such as build time, version number, size, and so on.
  • the identifier of the new container file is determined by the streaming media server for the new container file according to a predetermined naming rule. The identifier of each new container file on a streaming media server is unique and can be used to distinguish the same streaming media. Other new container files on the server.
  • the metadata of the original video stream includes the data format of the original video stream, and optionally other information such as provider, video start time, and duration.
  • the format of the new container file is as shown in FIG. 4a, where the file header further includes a media stream offset position.
  • the video stream offset position, and the video stream offset position refers to the entire file.
  • the initial position of the video stream is offset from the initial position of the entire file.
  • the video stream contains each frame of video data (including frame header information) written in step 305, and the offset position of each frame in the original container file.
  • some address space may be reserved in the file header for subsequent expansion.
  • the size of the reserved address space may be set according to experience, such as 12 bytes, 24 bytes, and the like.
  • the original video stream is not decoded and re-encoded, thereby improving the conversion efficiency.
  • the playback process can be dragged and dropped, instead of only passively receiving the video data of each frame sent by the streaming media server in sequence, After performing step 305, the method further includes:
  • Step 307 Record an offset position of the video data of the key frame in the new container file, and obtain a play timestamp of the key frame, where the timestamp refers to a play time of the key frame in the original video stream included in the original container file.
  • the play time of the key frame in the original video stream is obtained by parsing in the code stream parser step 304.
  • a key frame also called an intra picture, refers to the first frame in a group of consecutive pictures (GOP, group of picture).
  • the different data formats of the existing video files are respectively defined for G0P. , no longer detailed here. Keyframes can be used as a reference point for random access after moderate compression.
  • the offset position of the video data of the key frame in the new container file refers to the offset position of the video data of the key frame at the time of writing, based on the starting point of the storage location of the new container file.
  • the playing time of the key frame in the original video stream refers to the time point at which the key frame is played in the case where the frames are sequentially played based on the starting point of the entire original video stream.
  • Step 308 Generate an index list of key frames according to an offset position of the video data of the key frame in the new container file and a play time of the key frame in the original video stream.
  • the index list contains the offset position of the video data of the key frame in the new container file and the corresponding playback time of the key frame in the original video stream.
  • Table 1 is an example of an index list.
  • Step 309 writing the index list into a new container file.
  • the design of the storage structure can be used to the
  • Steps 307 to 309 can be performed in parallel with step 305 without prioritization.
  • the frame data of each frame written in the new container file in the foregoing step 305, and the offset position of the frame video data in the original container file are used for requesting downloading of video at the streaming client.
  • the generated container file is provided to the streaming client (refer to the introduction in the third embodiment for details).
  • some streaming media files of data formats such as private data formats
  • some private format video data is analyzed in the stream analyzer to analyze each frame of video data and the frame is in the original video container.
  • Step 310 According to the new container file, each frame of video data is in the original The offset position in the container file, the frame video data is written into a file until each frame of video data is written, thereby generating a restored container file.
  • Step 311 Obtain a first information digest value that uniquely identifies the restored container file content by an irreversible encryption algorithm.
  • the content of the restored video container file is calculated by using a fifth version of the message digest algorithm (MD5) to obtain a first hash value as the first information digest value; or a secure hash is used.
  • MD5 message digest algorithm
  • SHA The Secure Hash Algorithm
  • Step 312 Obtain, by the irreversible encryption algorithm, a second information digest value that uniquely identifies the content of the original container file.
  • Step 313 Compare whether the first information digest value and the second information digest value are consistent. If they are consistent, the entire processing flow ends. Otherwise, step 314 is performed;
  • Step 314 Write the content of the original container file into the new container file, and simultaneously record the storage location when the original video file is written into the new container file.
  • the contents of the original container file can be written to a third predetermined offset position in the new container file, directly from the third predetermined offset when the original container file is read.
  • the location can be read; the original container file can also be written to any free available location in the new container file, and the offset location written to the original container file is stored in the fourth reservation in the reserved address space.
  • the offset location when reading the original container file, first reading the offset position of the original container file from the field of the fourth predetermined offset position in the reserved address space, and then according to the original container file The offset location reads the original container file from the new container file.
  • the format of the new container file is as shown in Figure 4c.
  • the execution body of FIG. 3 may be a video website server, a video database server or the like in addition to the streaming media server.
  • the "first information digest value” and the “second information digest value” appearing in each step do not indicate the order relationship, but are to distinguish different information digest values, similarly, “first predetermined offset position” and “number”
  • the second predetermined offset position "etc. does not mean a sequential relationship, but to distinguish different offset positions.
  • the first, second, etc. mentioned in the following documents are also for distinguishing between different modules, units, and so on.
  • the processing scheme of the streaming media data provided by the embodiment of the present invention writes each frame stream parsed by the code stream analyzer in the new container file in the process of converting the input original container file into a new container file in a unified format.
  • Media data, and the offset position of the frame streaming media data in the original container file are unified formats.
  • No need to decode and re-encode the streaming media data in the original container file which simplifies the processing complexity in the conversion process, improves conversion efficiency, and is compatible with streaming data in multiple standard or private formats.
  • an online play method for streaming media data is described, which is performed based on a new container file generated by the processing method provided in the first embodiment.
  • FIG. 5 is a flowchart of a method for playing online streaming media data according to an embodiment of the present invention.
  • FIG. 5 is a description of an online playing method by using video data as an example from the perspective of a streaming media client. This method is equally applicable to other types of streaming media data other than video data, such as audio data.
  • Step 501 The streaming media client sends an online play request to the streaming media server, where the online play request carries the identifier of the new container file selected by the user.
  • the user can access the streaming media server through the streaming media client, and obtain the identifier of each container file that the streaming media server can provide through the webpage and the like, and the corresponding content introduction, and select the interested one based on the content.
  • the identifier of the container file is a container file that the streaming media server can provide through the webpage and the like, and the corresponding content introduction, and select the interested one based on the content.
  • Step 502 The streaming media client receives a file header and an index list of the new container file returned by the streaming media server, where the index list includes an offset position of the streaming media data of the at least one key frame in the new container file, And the playback time of each keyframe in the original media stream.
  • Step 503 The streaming media client selects a play time of one of the key frames according to a play time of each key frame in the index list in the original media data stream.
  • the streaming media client can display the playing time of the entire video and the playing time of the key frame in an intuitive manner, such as a progress bar, according to the video duration in the container file header and the playing time of the key frame in the index list.
  • the user according to which the user selects the play time of one of the key frames, inputs to the streaming client. For example, in this embodiment, the play time 00:00:04 of the third key frame in Table 1 is selected.
  • Step 504 The streaming media client searches, from the index list, an offset position of a key frame corresponding to a play time of the selected key frame in the new container file. For example, in step 503, the play time 00:00:04 of the third key frame is selected, and the offset position 2147200 of the third key frame in the new container file can be obtained by looking up the index list.
  • Step 505 The streaming media client sends a data acquisition request to the streaming media server, where the data acquisition request carries the found offset location, and is used to acquire video data of at least 1 frame starting from the offset location.
  • the acquiring request may further carry the offset information, where used to obtain all the streaming media data whose starting point is the starting offset and whose length is the offset, for example, obtaining the selected key frame at a time Streaming data for the last 10 frames.
  • the obtaining request may also request all the streaming media data after the selected key frame, and the manner of obtaining the streaming media data may be flexibly set.
  • Step 506 The streaming media client receives the streaming media data corresponding to the streaming media server, and plays the received streaming media data according to the streaming media data format in the file header.
  • FIG. 6 is a flowchart of a method for playing online streaming media data according to an embodiment of the present invention, and FIG. 6 is a description of an online playing method from the perspective of a streaming media server.
  • Step 601 The streaming media server receives an online play request sent by the streaming media client, where the online play request carries an identifier of the new container file.
  • Step 602 The streaming media server finds a corresponding new container file according to the identifier of the new container file.
  • Step 603 The streaming media server sends a file header and an index list of the new container file, where the index list includes the offset position of the key media stream data in the new container file and the key frame is included in the original container file. Play time in the original media data stream;
  • Step 604 The streaming media server receives a data acquisition request, where the data acquisition request carries an offset location, where the offset location is the streaming media data of a key frame determined by the streaming media client according to the index list. An offset position in the new container file;
  • Step 605 The streaming media server returns, to the streaming client, the streaming media data in the new container file starting from the offset position and at least one frame according to the offset position in the obtaining request.
  • Streaming media to prepare for H can ⁇ ⁇ P m back to the bias W Bu - ⁇ ⁇
  • the streaming media data with the offset position as the starting point and the last 10 frames may be returned, or the offset position may be returned as the starting point, and then all the streaming media data may be specifically obtained according to other information in the obtaining request. determine.
  • the storage format of the new container file can be described with reference to Figure 4a, Figure 4b or Figure 4c.
  • the embodiment of the invention provides an online playing method for streaming media data, which is based on the new container file provided in the first embodiment.
  • the streaming media client requests the streaming media server to download the file header and the index list of the container file, and determines the offset address of the video data to be downloaded in the new container file according to the index list, and determines the offset address.
  • the offset address is sent to the streaming media server, and the streaming media data returned by the streaming media server is played according to the data format in the file header, thereby achieving the effect of flexible dragging when playing the video.
  • FIG. 7a is a flowchart of a method for downloading streaming media data according to an embodiment of the present invention
  • FIG. 7 is a description of a downloading method from the perspective of a streaming media server.
  • Step 701 The streaming media server receives a download request sent by the streaming media client, where the download request carries an identifier of the new container file.
  • Step 702 The streaming media server finds a new container file corresponding to the new container file identifier.
  • Step 703 The streaming media server, according to the offset position of the streaming media data in the original container file in the new container file, The frame streaming media data is written into a file to generate a restored container file;
  • Step 704 The streaming media server sends the restored container file to the streaming media client.
  • the drawing may be The process shown in 7a is improved, and the improved streaming media data download method is The flowchart is as shown in FIG. 7b, wherein steps 711 to 712 are similar to steps 701 to 702 in FIG. 7a:
  • Step 711 The streaming media server receives a download request sent by the streaming media client, where the download request carries an identifier of the new container file.
  • Step 712 the streaming media server finds the new container file corresponding to the new container file identifier;
  • Step 713 the streaming media server determines whether the new container file contains the original container file, if the original container file is included, then proceeds to step 714; If the original container file is not included, then step 715 is entered.
  • the manner in which the streaming server determines whether the original container file is included is related to the manner in which the original container file is stored in the new container file. If the memory is stored in the manner shown in FIG. 4c, the streaming server first reads the content in the field of the fourth predetermined offset position in the reserved address space of the file header, and if the valid original container file can be read. Moving the position, the original container file is read from the new container file payload portion based on the read offset position.
  • the offset position of the original container file is not written at the fourth predetermined offset position, it is set to invalid content, for example, all zeros.
  • Step 714 The streaming media server reads the original container file from the new container file, and sends the read original container file to the streaming media client.
  • the specific reading mode is related to the storage mode of the original container file in the container file. For details, refer to the introduction in step 314 of the first embodiment, which is not repeated here.
  • the read original streaming media file fileFlash.mp4 is sent to the streaming client.
  • Step 715 The streaming media server writes the frame streaming media data into a file according to the offset position of the streaming media data of each frame in the new container file in the original container file, thereby generating a restored container file.
  • the restored container file is reverfile.mp4.
  • streaming media to prepare for n will ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇
  • the restored container file reverfile.mp4 is sent to the streaming client.
  • the embodiment restores the container file according to the offset position of each frame of the video data in the original container file and the video data of each frame, and provides the restored container file to the user. .
  • the embodiment of the present invention further provides a processing device for streaming media data. As shown in FIG. 8, the device includes a first receiving unit 801, a parsing unit 802, a first writing unit 803, and a second writing unit. 804, as follows:
  • a first receiving unit 801 configured to receive an input original container file, where the original container file includes an original media data stream;
  • the parsing unit 802 is configured to parse out each frame of streaming media data from the original container file, and obtain an offset position of the frame streaming media data in the original container file;
  • a first writing unit 803 configured to write the framed media data and the offset position of the frame streaming media data in the original container file into a payload portion of the new container file;
  • the second writing unit 804 is configured to write metadata of the new container file in a file header of the new container file, and metadata of the original media data stream in the original container file.
  • the device in FIG. 8 further includes:
  • the obtaining unit 805 is configured to obtain an index list of key frames, where the index list includes an offset position of the streaming media data of the at least one key frame in the new container file, and a play time of each key frame in the original media data stream.
  • the key frame refers to the first frame of a group of consecutive pictures as a reference point for random access; the play time of the key frame in the original media data is obtained by parsing;
  • the third writing unit 806 is configured to write the index list acquired by the obtaining unit 805 into the new container file.
  • the apparatus in FIG. 8 further includes:
  • the first restoring unit 807 is configured to: after the second writing unit 804 writes, write the frame streaming media data according to an offset position of the streaming media data in the original container file in the new container file. Into a file to generate a restored container file;
  • the digest value generating unit 808 is configured to obtain, by using an irreversible encryption algorithm, a first information digest value that uniquely identifies the restored container file content generated by the first restoring unit 807, and second information that uniquely identifies the original container file content. Summary value
  • the comparing unit 809 is configured to compare whether the first information digest value and the second information digest value are consistent.
  • the fourth writing unit 810 is configured to: when the comparison result of the comparing unit 809 is inconsistent, the content of the original container file Writes a new container file and also records the storage location when the original container file was written to the new container file.
  • an embodiment of the present invention further provides an online playing device for streaming media data, which can be integrated into a streaming media client, including:
  • the first sending unit 901 is configured to send an online play request to the streaming media server, where the online play request carries an identifier of the new container file;
  • a second receiving unit 902 configured to receive a file header and an index list of the returned new container file, where the index list includes an offset position of the streaming media data of the at least one key frame in the new container file, and each key frame is The playback time in the original media data stream contained in the original container file;
  • the selecting unit 903 is configured to select a playing time of one of the key frames according to a playing time of each key frame in the index list received by the second receiving unit 902;
  • the searching unit 904 is configured to search, from the index list, the offset position of the key frame corresponding to the playing time of the key frame selected by the selecting unit 902 in the new container file.
  • the second sending unit 905 is configured to send a data acquisition request to the streaming media server, where the data acquisition request carries the offset location found by the searching unit 904, and is used to obtain the offset location from the H ⁇ - '1 ⁇ ⁇ :
  • the playing unit 906 is configured to play the streaming media data returned by the streaming media server according to the data format in the file header received by the second receiving unit 902.
  • an embodiment of the present invention further provides an online playing device for streaming media data, which can be integrated into a streaming media server, including:
  • the third receiving unit 101 is configured to receive an online play request sent by the streaming media client, where the online play request carries an identifier of the new container file;
  • a third sending unit 102 configured to send a file header and an index list of a new container file corresponding to the identifier of the new container file, where the index list includes an offset position of the streaming media data of the key frame in the new container file And the playback time of the key frame in the original media data stream contained in the original container file;
  • the fourth receiving unit 103 is configured to receive a data acquisition request, where the data acquisition request carries an offset location, where the offset location is a streaming media of a key frame determined by the streaming media client according to the index list. The offset position of the data in the new container file;
  • the fourth sending unit 104 is configured to: return, according to the offset position in the obtaining request, streaming media data that is at least one frame starting from the offset position to the streaming client.
  • an embodiment of the present invention further provides a device for downloading streaming media data, which may be integrated into a streaming media server, and specifically includes a fifth receiving unit 111, a second restoring unit 112, and a fifth sending unit 113. among them:
  • the fifth receiving unit 111 is configured to receive a download request sent by the streaming media client, where the download request carries an identifier of the new container file;
  • a second restoring unit 112 configured to write the stream media data into a file according to an offset position of the streaming media data in the original container file in the new container file corresponding to the identifier of the new container file, Thereby generating a restored container file;
  • the fifth sending unit 113 is configured to send the container file that is restored by the second restoring unit 112 to the streaming media client.
  • Umbrella attached to the cabinet 1 ⁇ ⁇ can jH ⁇ i well, As shown in Figure l ib, it includes:
  • the fifth receiving unit 111 is configured to receive a download request sent by the streaming media client, where the download request carries an identifier of the new container file;
  • the determining unit 114 is configured to determine whether the original container file is included in the new container file corresponding to the new container file identifier received by the fifth receiving unit 111;
  • the reading unit 115 is configured to: when the determining unit 114 determines that the result is that the original container file is included, read the original container file from the new container file; trigger the fifth sending unit 113 to send the read original container file to the streaming media.
  • a second restoring unit 112 configured to determine, when the determining unit 114 does not include the original container file, the offset position of the streaming media data in the original container file in the new container file corresponding to the identifier of the new container file, The frame streaming media data is written into a file to generate a restored container file; the fifth sending unit 113 is triggered to send the restored container file to the streaming media client.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种流媒体数据的处理方法、播放方法以及装置,用以解决现有技术将输入的原始容器文件转换为统一格式的新容器文件的过程中,处理过程复杂,占用处理资源较多的问题。该方法包括:接收输入的原始容器文件,所述原始容器文件中包含原始媒体数据流;从所述原始容器文件中解析出每一帧流媒体数据,并获得该帧流媒体数据在所述原始容器文件中的偏移位置;将所述每一帧流媒体数据、以及该帧流媒体数据在所述原始容器文件中的偏移位置写入新容器文件的载荷部分;在新容器文件的文件头中写入该新容器文件的元数据,以及所述原始容器文件中原始媒体数据流的元数据。简化了转换过程中处理的复杂性,提高了转换效率。

Description

流媒体数据的处理方法、 播放方法以及装置 本申请要求于 2011年 10月 11 日提交中国专利局、 申请号为
201110306400.1、 发明名称为 "流媒体数据的处理方法、 播放方法以及装置" 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及多媒体技术领域, 尤其涉及一种流媒体数据的处理方法、 一 种流媒体数据的播放方法、 一种流媒体数据的下载方法、 一种流媒体数据的处 理装置和一种流媒体数据的下载装置。
背景技术 流媒体数据包括视频数据和音频数据。 为了解决将不同数据格式的媒体数 据流存储在一个文件中, 现有技术提出了容器(Container )的概念。 容器是指 为了便于视频数据和音频数据的存储而提出的一种文件格式, 例如常见的音频 视频交错格式 ( AVI, Audio Video Interleaved )、 MP4 ( MPEG-4 Part 14 )、 MKV ( Matroska ), REAL VIDEO等等。 一个容器可以兼容多种不同数据格式的视 频数据流和音频数据流。
容器文件中除了携带视频数据流和音频数据流之外,还在文件头中携带有 容器源信息和媒体流管理信息, 其中容器源信息是对该容器文件描述信息, 即 该容器文件的元数据, 例如该容器文件的大小、 格式、 生成时间等等; 媒体流 管理信息是对该容器文件所包含的视频和 /或音频数据流的描述信息,即该容器 文件中媒体数据流的元数据, 例如视频或音频数据流的数据格式。
视频网站或者视频库服务器为了减少开发成本、 使用成本和维护成本, 提 出了将输入的原始容器文件、 以及原始容器文件中的媒体数据流处理为统一格 式的容器文件和媒体数据流的要求。
为满足上述要求, 现有的处理流程为: 接收输入的原始容器文件; 根据原 始容器文件中的视频或音频数据流的数据格式,对其中的视频或音频数据进行 解码; 按照预定统一的视频或音频数据格式, 将解码获得的数据重新编码为视 频或音频数据流; 将重新编码获得的视频或音频数据流再封装为预定统一的容 器格式的容器文件。
发明人在实现本发明的过程中, 发现现有技术至少存在以下问题: 在将原 始容器中的视频数据流或音频数据流处理为预定统一的视频或音频数据格式 的过程中, 需要经过解码和编码两个阶段, 而不同格式的视频数据流或音频数 据流解码和播放的处理流程都存在差异,在原始容器文件中的视频数据或音频 数据格式较为复杂的情况下, 上述处理过程将会占用系统大量的处理资源, 并 且处理时间也较长。 发明内容
本发明实施例提供一种流媒体数据的处理方法, 用以解决现有技术将输入 的原始容器文件转换为统一格式的新容器文件的过程中, 处理过程复杂, 占用 处理资源较多的问题。
对应地, 本发明实施例还提供了一种流媒体数据的播放方法、 一种流媒体 数据的下载方法、 一种流媒体数据的处理装置、 一种流媒体客户端和一种流媒 体服务器。
本发明实施例提供的技术方案如下:
一种流媒体数据的处理方法, 包括:
接收输入的原始容器文件, 所述原始容器文件中包含原始媒体数据流; 从所述原始容器文件中解析出每一帧流媒体数据, 并获得该帧流媒体数据 在所述原始容器文件中的偏移位置;
将所述每一帧流媒体数据、 以及该帧流媒体数据在所述原始容器文件中的 偏移位置写入新容器文件的载荷部分;
在新容器文件的文件头中写入该新容器文件的元数据, 以及所述原始容器 文件中原始媒体数据流的元数据。
一种流媒体数据的播放方法, 包括:
向流媒体服务器发送在线播放请求 , 所述在线播放请求中携带新容器文件 的标识;
接收返回的新容器文件的文件头和索引列表, 所述索引列表包含至少一个 关键帧的流媒体数据在所述新容器文件中的偏移位置、各关键帧在原始容器文 件所包含的原始媒体数据流中的播放时间;
根据所述索引列表中各关键帧的播放时间,选择其中一个关键帧的播放时 间;
从所述索引列表中, 查找到选择出的关键帧的播放时间对应的关键帧在所 述新容器文件中的偏移位置;
向所述流媒体服务器发送数据获取请求, 所述数据获取请求携带查找到的 偏移位置, 用于获取以该偏移位置为起始点, 至少 1帧的流媒体数据;
根据所述文件头中的数据格式, 播放流媒体服务器返回的流媒体数据。 一种流媒体数据的播放方法, 包括:
接收流媒体客户端发送的在线播放请求, 所述在线播放请求中携带新容器 文件的标识;
发送所述新容器文件的标识对应的新容器文件的文件头和索引列表, 所述 索引列表包含关键帧的流媒体数据在所述新容器文件中的偏移位置和关键帧 在原始容器文件所包含的原始媒体数据流中的播放时间;
接收数据获取请求, 所述数据获取请求中携带有偏移位置, 该偏移位置是 所述流媒体客户端根据所述索引列表确定出的一个关键帧的流媒体数据在所 述新容器文件中的偏移位置;
根据所述获取请求中的偏移位置, 向流媒体客户端返回新容器文件中以该 偏移位置为起始点, 至少 1帧的流媒体数据。
一种流媒休翁 ό Τ遍.古法, ^ - 流媒体服务器接收流媒体客户端发送的下载请求, 所述下载请求中携带新 容器文件的标识;
流媒体服务器根据所述新容器文件的标识对应的新容器文件中,每帧流媒 体数据在原始容器文件中的偏移位置, 将该帧流媒体数据写入一个文件中, 从 而生成还原的容器文件;
流媒体服务器将所述还原的容器文件发送给所述流媒体客户端。
一种流媒体数据的下载方法, 包括:
流媒体服务器接收流媒体客户端发送的下载请求, 所述下载请求中携带新 容器文件的标识;
判断所述新容器文件标识对应的新容器文件中是否包含原始容器文件; 若是, 从所述新容器文件中读取原始容器文件, 并将所述原始容器文件发 送给流媒体客户端;
否则, 流媒体服务器根据所述新容器文件的标识对应的新容器文件中, 每 帧流媒体数据在原始容器文件中的偏移位置,将该帧流媒体数据写入一个文件 中, 从而生成还原的容器文件; 将所述还原的容器文件发送给所述流媒体客户 端。
一种流媒体数据的处理装置, 包括:
第一接收单元, 用于接收输入的原始容器文件, 所述原始容器文件中包含 原始媒体数据流;
解析单元, 用于从所述原始容器文件中解析出每一帧流媒体数据, 并获得 该帧流媒体数据在所述原始容器文件中的偏移位置;
第一写入单元, 用于将所述每一帧流媒体数据、 以及该帧流媒体数据在所 述原始容器文件中的偏移位置写入新容器文件的载荷部分;
第二写入单元, 用于在新容器文件的文件头中写入该新容器文件的元数 据, 以及所述原始容器文件中原始媒体数据流的元数据。
一#流媒 H , ^ - 第一发送单元, 用于向流媒体服务器发送在线播放请求, 所述在线播放请 求中携带新容器文件的标识;
第二接收单元, 用于接收返回的新容器文件的文件头和索引列表, 所述索 引列表包含至少一个关键帧的流媒体数据在所述新容器文件中的偏移位置、各 关键帧在原始容器文件所包含的原始媒体数据流中的播放时间;
选择单元, 用于根据第二接收单元接收的所述索引列表中各关键帧的播放 时间, 选择其中一个关键帧的播放时间;
查找单元, 用于从所述索引列表中, 查找到选择单元选择出的关键帧的播 放时间对应的关键帧在所述新容器文件中的偏移位置
第二发送单元, 用于向所述流媒体服务器发送数据获取请求, 所述数据获 取请求携带查找到的偏移位置, 用于获取以该偏移位置为起始点, 至少 1帧的 流媒体数据;
播放单元, 用于根据第二接收单元接收到的所述文件头中的数据格式, 播 放流媒体服务器返回的流媒体数据。
一种流媒体服务器, 包括:
第三接收单元, 用于接收流媒体客户端发送的在线播放请求, 所述在线播 放请求中携带新容器文件的标识;
第三发送单元, 用于发送所述新容器文件的标识对应的新容器文件的文件 头和索引列表, 所述索引列表包含关键帧的流媒体数据在所述新容器文件中的 偏移位置和关键帧在原始容器文件所包含的原始媒体数据流中的播放时间; 第四接收单元, 用于接收数据获取请求, 所述数据获取请求中携带有偏移 位置, 该偏移位置是所述流媒体客户端根据所述索引列表确定出的一个关键帧 的流媒体数据在所述新容器文件中的偏移位置;
第四发送单元, 用于根据所述获取请求中的偏移位置, 向流媒体客户端返 回以该偏移位置为起始点, 至少 1帧的流媒体数据。
一种流媒休服备 H, ^ - 第五接收单元, 用于接收流媒体客户端发送的下载请求, 所述下载请求中 携带新容器文件的标识;
第二还原单元, 用于根据所述新容器文件的标识对应的新容器文件中, 每 帧流媒体数据在原始容器文件中的偏移位置,将该帧流媒体数据写入一个文件 中, 从而生成还原的容器文件;
第五发送单元, 用于将所述第二还原单元还原的容器文件发送给所述流媒 体客户端。
一种流媒体服务器, 包括:
第五接收单元, 用于接收流媒体客户端发送的下载请求, 所述下载请求中 携带新容器文件的标识;
判断单元, 用于判断第五接收单元接收到得所述新容器文件标识对应的新 容器文件中是否包含原始容器文件;
读取单元, 用于判断单元判断出包含原始容器文件时, 从所述新容器文件 中读取原始容器文件, 触发第五发送单元将读取的原始容器文件发送给流媒体 客户端;
第二还原单元, 用于判断单元判断出未包含原始容器文件时, 根据所述新 容器文件的标识对应的新容器文件中,每帧流媒体数据在原始容器文件中的偏 移位置, 将该帧流媒体数据写入一个文件中, 从而生成还原的容器文件; 触发 第五发送单元将还原的容器文件发送给所述流媒体客户端。
本发明实施例提供的流媒体数据的处理方案,在将输入的原始容器文件转换 为统一格式的新容器文件的过程中, 在新容器文件中写入码流分析器解析出的 每一帧流媒体数据、 以及该帧流媒体数据在所述原始容器文件中的偏移位置。 从而无需对原始流媒体文件中的流媒体数据进行解码以及重新编码, 就可以将 原始容器文件转换为新的容器文件, 如果对多个不同格式的原始容器进行这种 转换, 就可以将它们转换成统一格式的新容器文件, 简化了转换过程中处理的 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描 述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出 创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为现有技术将容器文件处理为统一格式时的处理流程示意图; 图 2为本发明实施例的主要实现原理流程图;
图 3为本发明实施例提供的流媒体数据处理方法的流程图;
图 4a为本发明实施例提供的新容器文件的第一种格式示意图;
图 4b为本发明实施例提供的新容器文件的第二种格式示意图;
图 4c为本发明实施例提供的新容器文件的第三种格式示意图;
图 5为本发明实施例提供的流媒体数据的在线播放方法的流程图; 图 6为本发明实施例提供的另一种流媒体数据在线播放方法的流程图; 图 7a为本发明实施例提供的流媒体数据的下载方法的流程图;
图 7b为本发明实施例提供的另一种流媒体数据的下载方法的流程图; 图 8为本发明实施例提供的流媒体数据的处理装置的结构示意图; 图 9为本发明实施例提供的流媒体客户端的结构意图;
图 10为本发明实施例提供的流媒体服务器的结构示意图;
图 11a为本发明实施例提供流媒体服务器的一种结构示意图;
图 lib为本发明实施例中提供流媒体服务器的另一种结构示意图。 具体实施方式
附图 1 为现有技术中视频网站或者视频库对流媒体数据的处理流程示意 图, 要经过解码和编码两个阶段, 将流媒体数据封装为预定统一的容器格式的 容器文件后,基于该预定统一的容器格式的容器文件进行流媒体在线播放和下 载。
由于现有技术在将原始容器文件、 以及原始容器文件中的媒体数据流处理 为统一格式的容器文件和媒体数据流的过程中需要经过解码和编码两个阶段, 除了会占用系统大量的处理资源、 延长处理时间之外, 由于重新封装时只保留 了视频数据和音频数据, 丟失了原始容器文件中的媒体流管理信息等其他信 息, 因此无法还原出原始容器文件, 在需要原始容器文件作为证据的场景下将 无法满足要求。
下面结合各个附图对本发明实施例技术方案的主要实现原理、具体实施方 式及其对应能够达到的有益效果进行详细的阐述。
如图 2所示, 本发明实施例的主要实现原理流程如下:
步骤 10,接收输入的原始容器文件, 所述原始容器文件中包含原始媒体数 据流; 原始媒体数据流可以为音频流、 视频流等等。
步骤 20,从所述原始流媒体文件中解析出每一帧流媒体数据,并获得该帧 流媒体数据在所述原始容器文件中的偏移位置;
步骤 30,将所述每一帧流媒体数据、 以及该帧流媒体数据在所述原始容器 文件中的偏移位置写入新容器文件的载荷部分;
步骤 40,在新容器文件的文件头中写入该新容器文件的元数据, 以及所述 原始容器文件中原始媒体数据流的元数据。
下面将依据本发明上述发明原理,详细介绍几个实施例来对本发明方法的 主要实现原理进行详细的阐述和说明。
实施例一
如附图 3所示, 本实施例提供了一个具体实例, 对附图 2所示的流媒体数 据的处理原理进行详细说明。 在本实施例中, 为简明起见, 具体实例仅以原始 容器文件中的原始视频流为例进行说明,对其他类型以数据帧的方式存储的媒 体流, 如音频流等, 可以釆用类似原理进行处理。
H 301, 流媒休服备 H接妆 Mr入^ 1 始 H ±件— 本实施例中原始容器文件可以是用户上传的容器文件、或者是具有摄像功 能的视频釆集设备或 /和具有录音功能的音频釆集设备(如摄像头、数码摄像机、 录音笔)生成的容器文件、 也可以是流媒体处理软件生成的容器文件。 该原始 容器文件中包含原始视频流。
步骤 302, 触发对所示原始容器文件中原始视频流的数据格式进行探测。 码流分析器是一种现有的视频分析软件, 用于对输入的数据进行格式检 查, 输出每帧流媒体数据和每帧流媒体数据在原始容器文件中的偏移位置, 如 每帧视频数据在原始容器文件中的偏移位置、每帧音频数据在原始容器文件中 的偏移位置。 码流分析器由若干码流分析模块组成, 每个码流分析模块可以分 析对应的一种格式的数据。
可以依次调用码流分析器中的各码流分析模块, 尝试解析原始容器文件中 起始部分的少量数据, 解析结果中包含数据格式。 当遇到第一个码流分析器的 解析结果中包含可识别的数据格式时, 探测就可以结束。
步骤 303 , 根据探测结果, 判断是否支持原始视频流的数据格式, 若支持, 则进入步骤 304, 否则处理结束。
若依次调用了所有码流分析模块后,从解析结果中均无法给出可识别的数 据格式时, 说明不支持原始视频流的数据格式。
若任意一个码流分析模块的解析结果中包含可识别的数据格式, 则说明支 持原始视频流的数据格式。
步骤 304, 支持所述原始视频流的数据格式时,调用对应的码流分析模块, 对所述原始容器文件进行数据帧解析, 解析出每一帧视频数据, 并获得该帧视 频数据在所述原始容器文件中的偏移位置。
步骤 305 , 将所述每一帧视频数据、 以及该帧视频数据在所述原始容器文 件中的偏移位置写入一个新容器文件。
在新容器文件中写入的每帧视频数据、 以及该帧视频数据在所述原始容器 ±件 Φ ό ^ ¥ ό 目 ^ 1, ^ ffl -^^^ 流媒休玄 Ρ ^' Ύ ^ ±件日十, 生成还原的容器文件提供给流媒体客户端。
步骤 306 , 写入该新容器文件中的文件头, 从而生成新容器文件。
具体地, 在新容器文件的文件头中写入该新容器文件的元数据, 以及所述 原始容器文件中原始视频流的元数据。新容器文件的元数据包括该新容器文件 的标识, 还可以包含生成时间、 版本号、 大小等其他信息。 新容器文件的标识 是流媒体服务器按照预定的命名规则, 为该新容器文件确定出的, 在一个流媒 体服务器上的每个新容器文件的标识是唯一的, 可以用于区分同一个流媒体服 务器上的其他新容器文件。
原始视频流的元数据包括原始视频流的数据格式, 可选地还可以包含提供 商、 视频开始时间和持续时间等等其他信息。
可选地, 新容器文件的格式如图 4a所示, 其中文件头中还包含媒体流偏 移位置, 在本实施例中为视频流偏移位置, 视频流偏移位置是指在整个文件中 视频流初始的位置相对于整个文件初始位置的偏移量, 视频流中包含步骤 305 写入的每帧视频数据(包含帧头信息)、 每帧在所述原始容器文件中的偏移位 置。 可选地, 文件头中还可以预留一些地址空间, 以便后续扩展使用, 预留地 址空间的大小可以根据经验设定, 如 12字节、 24字节等等。
通过上述步骤, 在由原始容器文件转换为一个统一格式的新容器文件的过 程中, 没有对原始视频流进行解码以及重新编码, 从而提高了转换效率。 可选地, 为了能够便于用户通过流媒体客户端实现线播放功能时, 能够进 行播放进程的拖拽, 而不是只能被动地接收流媒体服务器顺序下发的各帧的视 频数据进行顺序播放, 在执行步骤 305之后, 还包括:
步骤 307 , 记录关键帧的视频数据在新容器文件中的偏移位置, 获得关键 帧的播放时间戳, 该时间戳是指该关键帧在原始容器文件所包含的原始视频流 中的播放时间, 所述关键帧在原始视频流中的播放时间是码流分析器步骤 304 中解析获得的。 关键帧又被称为 I帧(intra picture ), 是指在一组连续的画面(GOP, group of picture ) 中的第一个帧, 现有视频文件的不同数据格式对 G0P分别给出了 定义, 在这里不再详述。 关键帧经过适度压缩后, 可作为随机访问的参考点。
关键帧的视频数据在所述新容器文件中的偏移位置是指, 以新容器文件存 储位置的起始点为基准, 关键帧的视频数据在写入时的偏移位置。
关键帧在原始视频流中的播放时间是指, 以整个原始视频流播放的起始点 为基准, 各帧顺序播放的情况下, 关键帧播放的时间点。
步骤 308 , 根据所述关键帧的视频数据在所述新容器文件中的偏移位置、 关键帧在原始视频流中的播放时间, 生成关键帧的索引列表;
索引列表包含关键帧的视频数据在所述新容器文件中的偏移位置和对应 的该关键帧在原始视频流中的播放时间。 表 1为索引列表的一个实例。
表 1
Figure imgf000013_0001
步骤 309, 将所述索引列表写入新容器文件中。
具体地, 可以有多种写入方式, 例如将索引列表写入新容器文件中第一预 定偏移位置上, 例如写入相对于整个文件初始位置, 偏移量为 1M字节的偏移 位置上, 或写入所述预留地址空间中偏移量为 10字节的偏移位置上等等, 在 读取索引列表时, 从所述第一预定偏移位置上读取即可; 或者将索引列表写入 新容器文件载荷部分中的任意空闲可用位置上, 且将写入索引列表的偏移位置 存储在新容器文件的文件头预留地址空间中的第二预定偏移位置的字段中(即 在第二预定偏移位置的字段中存储指向索引列表的指针),在读取索引列表时, 先从所述文件头预留地址空间中的第二预定偏移位置的字段中读取索引列表 的偏移位置, 再根据索引列表的偏移位置从容器文件中读取索引列表, 釆用该 方案时, 新容器文件的格式如附图 4b所示。 当然存储结构的设计可以灵活多 变, 这里不再——列举。
步骤 307〜步骤 309可以与步骤 305并行执行, 无先后顺序限定。 可选地, 上述步骤 305中在新容器文件中写入的每帧视频数据、 以及该帧 视频数据在所述原始容器文件中的偏移位置的目的是用于在流媒体客户端请 求下载视频文件时, 生成还原的容器文件提供给流媒体客户端(具体请参照实 施例三中的介绍)。 但是由于一些数据格式(如私有数据格式) 的流媒体文件 无法通过该方案得到还原的容器文件, 例如一些私有格式的视频数据在码流分 析器分析出每帧视频数据和该帧在原始视频容器文件中的偏移位置时, 可能会 出现数据丟失和差错,因此在步骤 306生成新容器文件之后,还包括以下步骤: 步骤 310 , 根据所述新容器文件中, 每帧视频数据在所述原始容器文件中 的偏移位置, 将该帧视频数据写入一个文件中, 直到写入每帧视频数据为止, 从而生成还原的容器文件。
步骤 311 , 通过不可逆加密算法, 获得唯一标识所述还原的容器文件内容 的第一信息摘要值。
例如, 釆用第五版消息摘要算法(MD5 , Message Digest Algorithm 5 )对 所述还原的视频容器文件的内容进行计算, 获得第一哈希值作为第一信息摘要 值; 或者釆用安全散列算法(SHA, The Secure Hash Algorithm ), 对所述还原 的视频容器文件的内容进行计算, 获得第一散列值作为第一信息摘要值。
步骤 312 , 通过所述不可逆加密算法, 获得唯一标识所述原始容器文件内 容的第二信息摘要值。 步骤 313 , 比较所述第一信息摘要值和第二信息摘要值是否一致, 若一致 则整个处理流程结束, 否则执行步骤 314;
步骤 314 , 将所述原始容器文件的内容写入新容器文件、 且同时记录所述 原始视频文件写入新容器文件时的存储位置。
与步骤 309中存储索引列表的方式相类似, 可以将原始容器文件的内容写 入新容器文件中第三预定偏移位置上, 在读取原始容器文件时, 直接从所述第 三预定偏移位置上读取即可; 也可以将原始容器文件写入新容器文件中的任意 空闲可用位置上,且将写入原始容器文件的偏移位置存储在所述预留地址空间 中的第四预定偏移位置的字段中, 在读取原始容器文件时, 先从所述预留地址 空间中的第四预定偏移位置的字段中读取原始容器文件的偏移位置, 再根据原 始容器文件的偏移位置从新容器文件中读取原始容器文件, 釆用该方案时, 新 容器文件的格式如附图 4c所示。
需要说明的是, 附图 3的执行主体除了为流媒体服务器之外, 还可以是视 频网站服务器、 或者视频数据库服务器等等。 各步骤中出现的 "第一信息摘要 值"、 "第二信息摘要值" 并不是表示顺序关系, 而是为了区别不同的信息摘要 值, 同理, "第一预定偏移位置" 和 "第二预定偏移位置" 等也不是表示顺序 关系, 而是为了区别不同的偏移位置。 以下文件中提到的第一、 第二等也是为 了区别不同的模块、 单元等。
本发明实施例提供的流媒体数据的处理方案,在将输入的原始容器文件转 换为统一格式的新容器文件的过程中, 在新容器文件中写入码流分析器解析出 的每一帧流媒体数据、 以及该帧流媒体数据在所述原始容器文件中的偏移位 置。 无需对原始容器文件中的流媒体数据进行解码以及重新编码, 简化了转换 过程中处理的复杂性, 提高了转换效率, 并且能兼容多种标准或私有格式的流 媒体数据。
并且按照现有技术, 无法根据处理后统一格式的容器文件还原出原始流媒 休 ±件, 而按照太古奮 供 ό 处 古奮, ^, ^ ^^ ^\ ^^ -^ ^^ 器文件, 还原出原始流媒体文件, 尤其适用于需要原始容器文件作为证据的场 景。 实施例二
在本实施例中将对流媒体数据的在线播放方法进行描述, 该在线播放方法 是基于实施例一所提供的处理方法生成的新容器文件而进行的。
附图 5为本发明实施例提供的流媒体数据在线播放方法的流程图, 附图 5 从流媒体客户端的角度, 以视频数据为例, 对在线播放方法进行描述。 该方法 同样适用于除视频数据之外的其他类型的流媒体数据, 如音频数据。
步骤 501 , 流媒体客户端向流媒体服务器发送在线播放请求, 所述在线播 放请求中携带用户选中的新容器文件的标识。
用户可以通过流媒体客户端访问流媒体服务器, 并获得流媒体服务器通过 网页等多种展示的该流媒体服务器能够提供的各容器文件的标识, 以及对应的 内容介绍, 基于此选择自己感兴趣的容器文件的标识。
步骤 502 , 流媒体客户端接收流媒体服务器返回的所述新容器文件的文件 头和索引列表, 所述索引列表包含至少一个关键帧的流媒体数据在所述新容器 文件中的偏移位置、 和各关键帧在原始媒体数据流中的播放时间。 步骤 503 , 流媒体客户端根据所述索引列表中各关键帧在原始媒体数据流 中的播放时间, 选择其中一个关键帧的播放时间。
可选地, 流媒体客户端可以根据容器文件头中的视频持续时间, 和索引列 表中关键帧的播放时间,将整个视频的播放时间和关键帧的播放时间以进度条 等直观的形式展示给用户, 用户据此选择其中的某个关键帧的播放时间输入给 流媒体客户端。例如,本实施例中选择表 1中第 3个关键帧的播放时间 00:00:04。
步骤 504 , 流媒体客户端从所述索引列表中, 查找到选择出的关键帧的播 放时间对应的关键帧在所述新容器文件中的偏移位置。 例如, 在步骤 503中选择第 3个关键帧的播放时间 00:00:04, 通过查找索 引列表可以获得第 3个关键帧在新容器文件中的偏移位置 2147200。
步骤 505 , 流媒体客户端向所述流媒体服务器发送数据获取请求, 所述数 据获取请求携带查找到的偏移位置, 用于获取以该偏移位置为起始点, 至少 1 帧的视频数据。
可选地, 获取请求中还可以携带偏移量信息, 用于获得以所述查找到的偏 移位置为起始点, 长度为该偏移量的所有流媒体数据, 例如一次获得选择的关 键帧后 10帧的流媒体数据。 当然, 该获取请求还可以请求获得选择的关键帧 后的所有流媒体数据, 流媒体数据的获取方式可以灵活设置。
步骤 506 , 流媒体客户端接收所述流媒体服务器对应返回的流媒体数据, 并根据所述文件头中的流媒体数据格式, 播放接收到的流媒体数据。
附图 6为本发明实施例提供的流媒体数据在线播放方法的流程图, 附图 6 从流媒体服务器的角度对在线播放方法进行描述。
步骤 601 , 流媒体服务器接收流媒体客户端发送的在线播放请求, 所述在 线播放请求中携带新容器文件的标识;
步骤 602 , 流媒体服务器根据所述新容器文件的标识, 查找到对应的新容 器文件;
步骤 603 , 流媒体服务器发送所述新容器文件的文件头和索引列表, 所述 索引列表包含关键帧的流媒体数据在所述新容器文件中的偏移位置和关键帧 在原始容器文件所包含的原始媒体数据流中的播放时间;
步骤 604 , 流媒体服务器接收数据获取请求, 所述数据获取请求中携带有 偏移位置, 该偏移位置是所述流媒体客户端根据所述索引列表确定出的一个关 键帧的流媒体数据在所述新容器文件中的偏移位置;
步骤 605 , 流媒体服务器根据所述获取请求中的偏移位置, 向流媒体客户 端返回新容器文件中以该偏移位置为起始点, 至少 1帧的流媒体数据。
流媒休服备 H可以 ^流媒休玄 P m回该偏 W 卜― ό^ι流媒休翁 据, 也可以返回以该偏移位置为起始点、 之后 10帧的流媒体数据, 或者返回 以该偏移位置为起始点, 之后所有的流媒体数据, 具体可以根据获取请求中的 其他信息来确定。 新容器文件的存储格式可以参照附图 4a、 附图 4b或附图 4c 的描述。
本发明实施例提供了一种流媒体数据的在线播放方法, 该方法基于实施例 一中提供的新容器文件。 用户在请求进行在线视频播放时, 流媒体客户端向流 媒体服务器请求下载容器文件的文件头和索引列表, 并根据索引列表确定待下 载视频数据在新容器文件中的偏移地址,将确定出的偏移地址发送给流媒体服 务器, 根据所述文件头中的数据格式, 播放流媒体服务器返回的流媒体数据, 从而实现播放视频时灵活拖动的效果。 实施例三
本实施例中将对流媒体数据的下载方法进行描述, 该在线播放方法是基于 实施例一所提供的处理方法生成的新容器文件而进行的。
附图 7a为本发明实施例提供的流媒体数据的下载方法的流程图, 附图 7 从流媒体服务器的角度对下载方法进行描述。
步骤 701 , 流媒体服务器接收流媒体客户端发送的下载请求, 所述下载请 求中携带新容器文件的标识;
步骤 702 , 流媒体服务器查找到所述新容器文件标识对应的新容器文件; 步骤 703 , 流媒体服务器根据所述新容器文件中, 每帧流媒体数据在原始 容器文件中的偏移位置, 将该帧流媒体数据写入一个文件中, 从而生成还原的 容器文件;
步骤 704 ,流媒体服务器将所述还原的容器文件发送给所述流媒体客户端。 当个别数据格式的视频文件釆用上述步骤 703的方法无法得到还原的容器 文件, 且容器文件中存储有原始容器文件时(例如, 釆用附图 4c所示的存储 方式), 可以对附图 7a所示的流程进行改进, 改进后的流媒体数据下载方法的 流程图如附图 7b所示, 其中步骤 711〜步骤 712与附图 7a中的步骤 701〜步骤 702类似:
步骤 711 , 流媒体服务器接收流媒体客户端发送的下载请求, 所述下载请 求中携带新容器文件的标识;
步骤 712 , 流媒体服务器查找到所述新容器文件标识对应的新容器文件; 步骤 713 , 流媒体服务器判断所述新容器文件中是否包含原始容器文件, 若包含原始容器文件, 则进入步骤 714 ; 若未包含原始容器文件, 则进入步骤 715。
具体地, 流媒体服务器判断是否包含原始容器文件的方式与原始容器文件 在新容器文件中的存储方式有关。 如果釆用附图 4c所示的方式存储, 则流媒 体服务器先读取文件头预留地址空间中第四预定偏移位置的字段中的内容, 若 能够读取到有效的原始容器文件的偏移位置, 则根据读取到得偏移位置从新容 器文件载荷部分读取原始容器文件。
所述第四预定偏移位置上未写入原始容器文件的偏移位置时,被设置为无 效内容, 例如全零。
步骤 714 , 流媒体服务器从所述新容器文件中读取原始容器文件, 将读取 的原始容器文件发送给所述流媒体客户端。
具体的读取方式与容器文件中原始容器文件的存储方式相关,请参照实施 例一步骤 314中的介绍, 在这里不再重复。
例如, 新容器文件中原始容器文件为 fileFlash.mp4 , 则将读取的原始流媒 体文件 fileFlash.mp4发送给所述流媒体客户端。
步骤 715 , 流媒体服务器根据所述新容器文件中每帧流媒体数据在所述原 始容器文件中的偏移位置, 将该帧流媒体数据写入一个文件中, 从而生成还原 的容器文件。
还原的容器文件为 reverfile.mp4。
H 71 6 ,流媒休服备 n将 τ^Λ^ ^ 件 ^給所 ^流媒休玄 ρ ^ - 例如, 将还原的容器文件 reverfile.mp4发送给所述流媒体客户端。
本发明实施例在用户请求下载视频文件时,根据容器文件中每帧视频数据 在原始容器文件中的偏移位置、 及每帧视频数据, 还原出容器文件, 并将还原 的容器文件提供给用户。 而不是像现有技术一样将统一格式的容器文件提供给 用户。 避免了解码、 及重新编码带来的视频信息损失和误差, 能够实现更佳的 显示效果。 相应地,本发明实施例还提供了一种流媒体数据的处理装置,如图 8所示, 该装置包括第一接收单元 801、 解析单元 802、 第一写入单元 803、 第二写入单 元 804, 具体如下:
第一接收单元 801 , 用于接收输入的原始容器文件, 所述原始容器文件中 包含原始媒体数据流;
解析单元 802, 用于从所述原始容器文件中解析出每一帧流媒体数据, 并 获得该帧流媒体数据在所述原始容器文件中的偏移位置;
第一写入单元 803 , 用于将所述每一帧流媒体数据、 以及该帧流媒体数据 在所述原始容器文件中的偏移位置写入新容器文件的载荷部分;
第二写入单元 804, 用于在新容器文件的文件头中写入该新容器文件的元 数据, 以及所述原始容器文件中原始媒体数据流的元数据。
可选地, 为了能够实现在线播放时, 播放进程拖曳的功能, 附图 8中的装 置还包括:
获取单元 805 , 用于获得关键帧的索引列表, 所述索引列表包含至少一个 关键帧的流媒体数据在所述新容器文件中的偏移位置、各关键帧在原始媒体数 据流中的播放时间; 所述关键帧是指一组连续画面中的第一个帧, 作为随机访 问的参考点; 所述关键帧在原始媒体数据中的播放时间是解析获得的;
第三写入单元 806 , 用于将获取单元 805获取的索引列表写入新容器文件 中。 可选地, 为了避免个别格式的流媒体数据在还原原始容器文件时出现问 题, 附图 8中的装置还包括:
第一还原单元 807 , 用于在第二写入单元 804写入后, 根据所述新容器文 件中每帧流媒体数据在所述原始容器文件中的偏移位置,将该帧流媒体数据写 入一个文件中, 从而生成还原的容器文件;
摘要值生成单元 808, 用于通过不可逆加密算法, 获得唯一标识第一还原 单元 807生成的所述还原的容器文件内容的第一信息摘要值、 以及唯一标识所 述原始容器文件内容的第二信息摘要值;
比较单元 809,用于比较所述第一信息摘要值和第二信息摘要值是否一致; 第四写入单元 810 , 用于在比较单元 809的比较结果不一致时, 将所述原 始容器文件的内容写入新容器文件、且同时记录所述原始容器文件写入新容器 文件时的存储位置。
请参照附图 9, 本发明实施例还提供了一种流媒体数据的在线播放装置, 可以集成于流媒体客户端中, 包括:
第一发送单元 901 , 用于向流媒体服务器发送在线播放请求, 所述在线播 放请求中携带新容器文件的标识;
第二接收单元 902, 用于接收返回的新容器文件的文件头和索引列表, 所 述索引列表包含至少一个关键帧的流媒体数据在所述新容器文件中的偏移位 置、 各关键帧在原始容器文件所包含的原始媒体数据流中的播放时间;
选择单元 903 , 用于根据第二接收单元 902接收的所述索引列表中各关键 帧的播放时间, 选择其中一个关键帧的播放时间;
查找单元 904, 用于从所述索引列表中, 查找到选择单元 902选择出的关 键帧的播放时间对应的关键帧在所述新容器文件中的偏移位置
第二发送单元 905 , 用于向所述流媒体服务器发送数据获取请求, 所述数 据获取请求携带查找单元 904查找到的偏移位置, 用于获取以该偏移位置为起 H ^- ' 1 ό 流媒休翁 : 播放单元 906, 用于根据第二接收单元 902接收到的所述文件头中的数据 格式, 播放流媒体服务器返回的流媒体数据。
请参照附图 10 , 本发明实施例还提供了另一种流媒体数据的在线播放装 置, 可以集成于流媒体服务器中, 包括:
第三接收单元 101 , 用于接收流媒体客户端发送的在线播放请求, 所述在 线播放请求中携带新容器文件的标识;
第三发送单元 102, 用于发送所述新容器文件的标识对应的新容器文件的 文件头和索引列表, 所述索引列表包含关键帧的流媒体数据在所述新容器文件 中的偏移位置和关键帧在原始容器文件所包含的原始媒体数据流中的播放时 间;
第四接收单元 103 , 用于接收数据获取请求, 所述数据获取请求中携带有 偏移位置, 该偏移位置是所述流媒体客户端根据所述索引列表确定出的一个关 键帧的流媒体数据在所述新容器文件中的偏移位置;
第四发送单元 104, 用于根据所述获取请求中的偏移位置, 向流媒体客户 端返回以该偏移位置为起始点, 至少 1帧的流媒体数据。
请参照附图 11a, 本发明实施例还提供了一种流媒体数据的下载装置, 可 集成于流媒体服务器中, 具体包括第五接收单元 111、 第二还原单元 112、 第 五发送单元 113 , 其中:
第五接收单元 111 , 用于接收流媒体客户端发送的下载请求, 所述下载请 求中携带新容器文件的标识;
第二还原单元 112,用于根据所述新容器文件的标识对应的新容器文件中, 每帧流媒体数据在原始容器文件中的偏移位置, 将该帧流媒体数据写入一个文 件中, 从而生成还原的容器文件;
第五发送单元 113 , 用于将所述第二还原单元 112还原的容器文件发送给 所述流媒体客户端。
可 , 了; 下遍.效傘, 附阁 1 所示 ό ¥可以 jH千丄井一舟 i井, 如附图 l ib所示, 包括:
第五接收单元 111 , 用于接收流媒体客户端发送的下载请求, 所述下载请 求中携带新容器文件的标识;
判断单元 114, 用于判断第五接收单元 111接收到得所述新容器文件标识 对应的新容器文件中是否包含原始容器文件;
读取单元 115, 用于在判断单元 114判断结果为包含原始容器文件时, 从 所述新容器文件中读取原始容器文件; 触发第五发送单元 113将读取的原始容 器文件发送给流媒体客户端;
第二还原单元 112, 用于判断单元 114判断出未包含原始容器文件时, 根 据所述新容器文件的标识对应的新容器文件中,每帧流媒体数据在原始容器文 件中的偏移位置, 将该帧流媒体数据写入一个文件中, 从而生成还原的容器文 件; 触发第五发送单元 113将还原的容器文件发送给所述流媒体客户端。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件来完成, 该程序可以存储于一计算机可读取 存储介质中, 如: ROM/RAM、 磁碟、 光盘等。 本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权 利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在 内。

Claims

权利要求
1、 一种流媒体数据的处理方法, 其特征在于, 包括:
接收输入的原始容器文件, 所述原始容器文件中包含原始媒体数据流; 从所述原始容器文件中解析出每一帧流媒体数据, 并获得该帧流媒体 数据在所述原始容器文件中的偏移位置;
将所述每一帧流媒体数据、 以及该帧流媒体数据在所述原始容器文件 中的偏移位置写入新容器文件的载荷部分;
在新容器文件的文件头中写入该新容器文件的元数据, 以及所述原始 容器文件中原始媒体数据流的元数据。
2、 如权利要求 1所述的方法, 其特征在于, 所述将所述每一帧流媒体 数据、 以及该帧流媒体数据在所述原始容器文件中的偏移位置写入新容器 文件的载荷部分后, 还包括:
获得关键帧的索引列表, 所述索引列表包含至少一个关键帧的流媒体 数据在所述新容器文件中的偏移位置、 各关键帧在原始媒体数据流中的播 放时间; 所述关键帧是指一组连续画面中的第一个帧, 作为随机访问的参 考点; 所述关键帧在原始媒体数据流中的播放时间是解析获得的;
将所述索引列表写入新容器文件中。
3、 如权利要求 2所述的方法, 其特征在于, 所述将所述索引列表写入 新容器文件中, 包括:
将所述索引列表写入新容器文件载荷部分的空闲可用空间中; 将写入索引列表的偏移位置存储在所述新容器文件的文件头预留地址 空间中的预定偏移位置的字段中。
4、 如权利要求 1至 3中任一所述的方法, 其特征在于, 所述在新容器 文件的文件头中写入该新容器文件的元数据, 以及所述原始容器文件中原 始媒休教据流的元教据后, 还 括: 根据所述新容器文件中每帧流媒体数据在所述原始容器文件中的偏移 位置, 将该帧流媒体数据写入一个文件中, 从而生成还原的容器文件; 通过不可逆加密算法, 获得唯一标识所述还原的容器文件内容的第一 信息摘要值、 以及唯一标识所述原始容器文件内容的第二信息摘要值; 比较所述第一信息摘要值和第二信息摘要值是否一致, 若不一致, 则 将所述原始容器文件的内容写入新容器文件、 且同时记录所述原始容器文 件写入新容器文件时的存储位置。
5、 一种流媒体数据的播放方法, 其特征在于, 包括:
向流媒体服务器发送在线播放请求 , 所述在线播放请求中携带新容器 文件的标识;
接收返回的新容器文件的文件头和索引列表, 所述索引列表包含至少 一个关键帧的流媒体数据在所述新容器文件中的偏移位置、 各关键帧在原 始容器文件所包含的原始媒体数据流中的播放时间;
根据所述索引列表中各关键帧的播放时间, 选择其中一个关键帧的播 放时间;
从所述索引列表中, 查找到选择出的关键帧的播放时间对应的关键帧 在所述新容器文件中的偏移位置;
向所述流媒体服务器发送数据获取请求, 所述数据获取请求携带查找 到的偏移位置, 用于获取以该偏移位置为起始点, 至少 1帧的流媒体数据; 根据所述文件头中的数据格式, 播放流媒体服务器返回的流媒体数据。
6、 一种流媒体数据的播放方法, 其特征在于, 包括:
接收流媒体客户端发送的在线播放请求, 所述在线播放请求中携带新 容器文件的标识;
发送所述新容器文件的标识对应的新容器文件的文件头和索引列表, 所述索引列表包含关键帧的流媒体数据在所述新容器文件中的偏移位置和 关键帧在原始容器文件所包含的原始媒体数据流中的播放时间; 接收数据获取请求, 所述数据获取请求中携带有偏移位置, 该偏移位 置是所述流媒体客户端根据所述索引列表确定出的一个关键帧的流媒体数 据在所述新容器文件中的偏移位置;
根据所述获取请求中的偏移位置, 向流媒体客户端返回新容器文件中 以该偏移位置为起始点, 至少 1帧的流媒体数据。
7、 一种流媒体数据的下载方法, 其特征在于, 包括:
流媒体服务器接收流媒体客户端发送的下载请求, 所述下载请求中携 带新容器文件的标识;
流媒体服务器根据所述新容器文件的标识对应的新容器文件中, 每帧 流媒体数据在原始容器文件中的偏移位置, 将该帧流媒体数据写入一个文 件中, 从而生成还原的容器文件;
流媒体服务器将所述还原的容器文件发送给所述流媒体客户端。
8、 一种流媒体数据的下载方法, 其特征在于, 包括:
流媒体服务器接收流媒体客户端发送的下载请求, 所述下载请求中携 带新容器文件的标识;
判断所述新容器文件标识对应的新容器文件中是否包含原始容器文 件;
若是, 从所述新容器文件中读取原始容器文件, 并将所述原始容器文 件发送给流媒体客户端;
否则, 流媒体服务器根据所述新容器文件的标识对应的新容器文件中, 每帧流媒体数据在原始容器文件中的偏移位置, 将该帧流媒体数据写入一 个文件中, 从而生成还原的容器文件; 将所述还原的容器文件发送给所述 流媒体客户端。
9、 一种流媒体数据的处理装置, 其特征在于, 包括:
第一接收单元, 用于接收输入的原始容器文件, 所述原始容器文件中 包含原始媒体数据流; 解析单元, 用于从所述原始容器文件中解析出每一帧流媒体数据, 并 获得该帧流媒体数据在所述原始容器文件中的偏移位置;
第一写入单元, 用于将所述每一帧流媒体数据、 以及该帧流媒体数据 在所述原始容器文件中的偏移位置写入新容器文件的载荷部分;
第二写入单元, 用于在新容器文件的文件头中写入该新容器文件的元 数据, 以及所述原始容器文件中原始媒体数据流的元数据。
10、 如权利要求 9所述的装置, 其特征在于, 还包括:
获取单元, 用于获得关键帧的索引列表, 所述索引列表包含至少一个 关键帧的流媒体数据在所述新容器文件中的偏移位置、 各关键帧在原始媒 体数据流中的播放时间; 所述关键帧是指一组连续画面中的第一个帧, 作 为随机访问的参考点; 所述关键帧在原始媒体数据流中的播放时间是解析 获得的;
第三写入单元, 用于将获取单元获取的索引列表写入新容器文件中。
11、 如权利要求 9或 10所述的装置, 其特征在于, 还包括:
第一还原单元, 用于在第二写入单元写入后, 根据所述新容器文件中 每帧流媒体数据在所述原始容器文件中的偏移位置, 将该帧流媒体数据写 入一个文件中, 从而生成还原的容器文件;
摘要值生成单元, 用于通过不可逆加密算法, 获得唯一标识第一还原 单元生成的所述还原的容器文件内容的第一信息摘要值、 以及唯一标识所 述原始容器文件内容的第二信息摘要值;
比较单元, 用于比较所述第一信息摘要值和第二信息摘要值是否一致; 第四写入单元, 用于在比较单元的比较结果不一致时, 将所述原始流 媒体文件的内容写入新容器文件、 且同时记录所述原始容器文件写入新容 器文件时的存储位置。
12、 一种流媒体客户端, 其特征在于, 包括:
第一发送单元, 用于向流媒体服务器发送在线播放请求, 所述在线播 放请求中携带新容器文件的标识;
第二接收单元, 用于接收返回的新容器文件的文件头和索引列表, 所 述索引列表包含至少一个关键帧的流媒体数据在所述新容器文件中的偏移 位置、 各关键帧在原始容器文件所包含的原始媒体数据流中的播放时间; 选择单元, 用于根据第二接收单元接收的所述索引列表中各关键帧的 播放时间, 选择其中一个关键帧的播放时间;
查找单元, 用于从所述索引列表中, 查找到选择单元选择出的关键帧 的播放时间对应的关键帧在所述新容器文件中的偏移位置
第二发送单元, 用于向所述流媒体服务器发送数据获取请求, 所述数 据获取请求携带查找到的偏移位置, 用于获取以该偏移位置为起始点, 至 少 1帧的流媒体数据;
播放单元, 用于根据第二接收单元接收到的所述文件头中的数据格式, 播放流媒体服务器返回的流媒体数据。
13、 一种流媒体服务器, 其特征在于, 包括:
第三接收单元, 用于接收流媒体客户端发送的在线播放请求, 所述在 线播放请求中携带新容器文件的标识;
第三发送单元, 用于发送所述新容器文件的标识对应的新容器文件的 文件头和索引列表, 所述索引列表包含关键帧的流媒体数据在所述新容器 文件中的偏移位置和关键帧在原始容器文件所包含的原始媒体数据流中的 播放时间;
第四接收单元, 用于接收数据获取请求, 所述数据获取请求中携带有 偏移位置, 该偏移位置是所述流媒体客户端根据所述索引列表确定出的一 个关键帧的流媒体数据在所述新容器文件中的偏移位置;
第四发送单元, 用于根据所述获取请求中的偏移位置, 向流媒体客户 端返回以该偏移位置为起始点, 至少 1帧的流媒体数据。
14、 一种流媒体服务器, 其特征在于, 包括: 第五接收单元, 用于接收流媒体客户端发送的下载请求, 所述下载请 求中携带新容器文件的标识;
第二还原单元, 用于根据所述新容器文件的标识对应的新容器文件中, 每帧流媒体数据在原始容器文件中的偏移位置, 将该帧流媒体数据写入一 个文件中, 从而生成还原的容器文件;
第五发送单元, 用于将所述第二还原单元还原的容器文件发送给所述 流媒体客户端。
15、 一种流媒体服务器, 其特征在于, 包括:
第五接收单元, 用于接收流媒体客户端发送的下载请求, 所述下载请 求中携带新容器文件的标识;
判断单元, 用于判断第五接收单元接收到得所述新容器文件标识对应 的新容器文件中是否包含原始容器文件;
读取单元, 用于判断单元判断出包含原始容器文件时, 从所述新容器 文件中读取原始容器文件, 触发第五发送单元将读取的原始容器文件发送 给流媒体客户端;
第二还原单元, 用于判断单元判断出未包含原始容器文件时, 根据所 述新容器文件的标识对应的新容器文件中, 每帧流媒体数据在原始容器文 件中的偏移位置, 将该帧流媒体数据写入一个文件中, 从而生成还原的容 器文件; 触发第五发送单元将还原的容器文件发送给所述流媒体客户端。
PCT/CN2012/079615 2011-10-11 2012-08-03 流媒体数据的处理方法、播放方法以及装置 WO2013053259A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110306400.1 2011-10-11
CN2011103064001A CN102510519A (zh) 2011-10-11 2011-10-11 流媒体数据的处理方法、播放方法以及装置

Publications (1)

Publication Number Publication Date
WO2013053259A1 true WO2013053259A1 (zh) 2013-04-18

Family

ID=46222568

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/079615 WO2013053259A1 (zh) 2011-10-11 2012-08-03 流媒体数据的处理方法、播放方法以及装置

Country Status (2)

Country Link
CN (1) CN102510519A (zh)
WO (1) WO2013053259A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510519A (zh) * 2011-10-11 2012-06-20 成都市华为赛门铁克科技有限公司 流媒体数据的处理方法、播放方法以及装置
CN102857834B (zh) * 2012-09-17 2016-06-15 四川长虹电器股份有限公司 读取视频进度的方法
CN104023260B (zh) * 2013-02-28 2018-04-27 腾讯科技(深圳)有限公司 硬件解码实现方法、装置及播放器
CN104661086A (zh) * 2013-11-25 2015-05-27 乐视网信息技术(北京)股份有限公司 一种媒体流的编码方法和装置
CN105338417B (zh) * 2015-10-29 2018-09-04 北京威动科技有限公司 文件导航播放方法和装置
CN110545490B (zh) 2018-05-29 2021-03-16 北京字节跳动网络技术有限公司 媒体文件转换方法、装置及存储介质
CN110636368B (zh) * 2018-06-25 2021-12-24 杭州海康威视数字技术股份有限公司 媒体播放方法、系统、装置及存储介质
CN110290396B (zh) * 2019-05-31 2024-04-09 广州市百果园信息技术有限公司 一种视频处理的方法、装置、系统、设备和存储介质
CN112287127B (zh) * 2019-07-23 2022-10-14 上海哔哩哔哩科技有限公司 多媒体文件存储、读取方法
CN113068064B (zh) * 2021-03-18 2023-09-05 深圳市迅雷网络技术有限公司 传输流媒体文件处理方法、装置、计算机设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050099869A1 (en) * 2003-09-07 2005-05-12 Microsoft Corporation Field start code for entry point frames with predicted first field
CN101193289A (zh) * 2006-11-22 2008-06-04 中兴通讯股份有限公司 一种mpeg-4的传输码流到互联网流媒体联盟流的实时转换方法
CN101378356A (zh) * 2008-06-10 2009-03-04 中兴通讯股份有限公司 一种ip实时流媒体的播放方法
CN101459693A (zh) * 2008-12-29 2009-06-17 中兴通讯股份有限公司 一种流媒体下载方法及系统
CN102510519A (zh) * 2011-10-11 2012-06-20 成都市华为赛门铁克科技有限公司 流媒体数据的处理方法、播放方法以及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004057869A1 (ja) * 2002-12-20 2004-07-08 Matsushita Electric Industrial Co., Ltd. データストリームのフォーマット変換方法およびそのための記録方法
CN100527704C (zh) * 2006-01-05 2009-08-12 华为软件技术有限公司 一种流媒体服务器以及流媒体传送和存储方法
US9749713B2 (en) * 2009-10-15 2017-08-29 Citrix Systems, Inc. Budget encoding
CN102131106A (zh) * 2010-12-22 2011-07-20 华为技术有限公司 流媒体内容的播放方法、装置及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050099869A1 (en) * 2003-09-07 2005-05-12 Microsoft Corporation Field start code for entry point frames with predicted first field
CN101193289A (zh) * 2006-11-22 2008-06-04 中兴通讯股份有限公司 一种mpeg-4的传输码流到互联网流媒体联盟流的实时转换方法
CN101378356A (zh) * 2008-06-10 2009-03-04 中兴通讯股份有限公司 一种ip实时流媒体的播放方法
CN101459693A (zh) * 2008-12-29 2009-06-17 中兴通讯股份有限公司 一种流媒体下载方法及系统
CN102510519A (zh) * 2011-10-11 2012-06-20 成都市华为赛门铁克科技有限公司 流媒体数据的处理方法、播放方法以及装置

Also Published As

Publication number Publication date
CN102510519A (zh) 2012-06-20

Similar Documents

Publication Publication Date Title
WO2013053259A1 (zh) 流媒体数据的处理方法、播放方法以及装置
TWI465113B (zh) 內容重製系統、內容重製裝置、程式、內容重製方法、及提供內容伺服器
US8886896B2 (en) Storage format for media streams
US20190069006A1 (en) Seeking in live-transcoded videos
WO2017092336A1 (zh) 一种流媒体的处理方法及装置
RU2551111C2 (ru) Устройство и способ загрузки файла с кинофильмом
US8135761B2 (en) System and method for automatically creating a media archive from content on a recording medium
US8582954B2 (en) System and method for automatically creating a media archive from content on a recording medium
Müller et al. A test-bed for the dynamic adaptive streaming over HTTP featuring session mobility
US8806051B2 (en) Multimedia file sharing method and system thereof
WO2008029640A1 (en) Method and device for playing video data of high bit rate format by player suitable to play video data of low bit rate format
JP2021508995A (ja) メディアファイルのネットワーク再生方法、装置及び記憶媒体
US11818406B2 (en) Data storage server with on-demand media subtitles
US20140036990A1 (en) System and method for optimizing a video stream
WO2012092901A2 (zh) 媒体存储系统及方法
WO2024098836A1 (zh) 视频对齐方法及装置
KR101863598B1 (ko) 스트리밍 서비스를 위한 클라이언트의 동작 방법
US20180020043A1 (en) Method for playing audio/video and display device
JP2016072858A (ja) メディアデータ生成方法、メディアデータ再生方法、メディアデータ生成装置、メディアデータ再生装置、コンピュータ読み取り可能な記録媒体、及びプログラム
CN115250266B (zh) 视频处理方法及装置、流媒体设备及存储点播系统
EP2812813B1 (en) Methods and systems for providing file data for a media file
JP4280701B2 (ja) データファイルの編集方法及び装置及び制御プログラム及び記憶媒体
JP2015510727A (ja) メディアファイル用のファイルデータを提供するための方法およびシステム
US11212573B2 (en) Systems, methods, and devices for managing segmented media content
TWI559753B (zh) 傳輸隨選影音檔案的方法

Legal Events

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

Ref document number: 12839818

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: 12839818

Country of ref document: EP

Kind code of ref document: A1