WO2013082965A1 - 流媒体数据处理方法及装置、流媒体数据再现设备 - Google Patents

流媒体数据处理方法及装置、流媒体数据再现设备 Download PDF

Info

Publication number
WO2013082965A1
WO2013082965A1 PCT/CN2012/081769 CN2012081769W WO2013082965A1 WO 2013082965 A1 WO2013082965 A1 WO 2013082965A1 CN 2012081769 W CN2012081769 W CN 2012081769W WO 2013082965 A1 WO2013082965 A1 WO 2013082965A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
audio
video frame
data
time
Prior art date
Application number
PCT/CN2012/081769
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
Family has litigation
First worldwide family litigation filed litigation Critical https://patents.darts-ip.com/?family=48498846&utm_source=google_patent&utm_medium=platform_link&utm_campaign=public_patent_search&patent=WO2013082965(A1) "Global patent litigation dataset” by Darts-ip is licensed under a Creative Commons Attribution 4.0 International License.
Priority claimed from CN201110400172.4A external-priority patent/CN103139636B/zh
Application filed by 优视科技有限公司, 广州市动景计算机科技有限公司 filed Critical 优视科技有限公司
Priority to US13/977,017 priority Critical patent/US8670072B1/en
Publication of WO2013082965A1 publication Critical patent/WO2013082965A1/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/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/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • H04N21/2368Multiplexing of audio and video streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43072Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of multiple content streams on the same device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/04Synchronising
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4341Demultiplexing of audio and video streams

Definitions

  • the present invention relates to the field of mobile communications, and more particularly to a streaming media data processing method, a streaming media data processing apparatus, and a streaming media data reproducing apparatus having the same. Background technique
  • streaming media refers to the media format that is played on the Internet by streaming.
  • Streaming media is also called streaming media. It refers to a video delivery server that sends a program as a data packet and transmits it to the network. After the user decompresses the data through the decompression device, the program will be displayed as before the transmission.
  • streaming media data includes audio data and video data.
  • the audio data and video data are two separate data streams.
  • the audio data and video data need to be separated to be decoded and presented separately.
  • each frame in the audio data and video data has an explicit decoding time frame, display timestamp.
  • playback callbacks eg, sound card callbacks
  • audio output devices eg, sound cards
  • the playback callback e.g., sound card callback
  • the audio signal playback device e.g., the sound card
  • the timestamp at this time is also referred to as the playback timestamp.
  • the present invention provides a streaming media data processing method in which a system time of a streaming media processing device is updated using a playback callback time stamp of the decoded audio data, and audio data and video data are decoded. After that, the display processing mode of the video frame is determined based on the updated system time.
  • a streaming media data processing method including: separating streaming media data into audio stream data and video stream data according to a stream index in the streaming media data, and respectively buffering the audio stream data queue and a video stream data queue; respectively decoding audio stream data and video stream data buffered in the audio stream data queue and the video stream data queue; playing back callback time stamp based on the decoded audio data and the streaming media reproducing device System time, determining an audio and video synchronization time; and comparing, for each frame in the decoded video stream data, based on a comparison of the timestamp of the video frame with the determined audio and video synchronization time and the video refresh time, The video frame is subjected to display processing in accordance with a predetermined processing manner corresponding to the comparison result.
  • determining that the video frame is a key data frame or a time stamp of the video frame is greater than or equal to the determined audio and video synchronization time and the video frame decoding time And, the video frame is decoded. Further, the video frame is discarded when it is determined that the video frame is not a critical data frame and the time stamp of the video frame is less than the sum of the determined audio and video synchronization time and the video frame decoding time.
  • the audio/video synchronization time is determined as Equal to half of the sum of the playback callback timestamp and the system time.
  • the display of the video frame is awaited; Displaying the video frame when the time stamp of the video frame is equal to the determined sum of the audio and video synchronization time and the video refresh time; or the time stamp of the video frame is smaller than the determined audio and video synchronization time and the When the video is swiped, the video frame is discarded.
  • the audio play module data buffer queue before playing, it is determined whether the audio play module data buffer queue has been filled with audio stream data, wherein the audio play module data buffer queue is already full or all When the audio data is decoded, the audio stream data is played. Otherwise, the audio stream data in the audio stream data buffer queue is continuously decoded.
  • pointer redirection is employed to directly perform a reference operation on the memory in which the video frame is stored.
  • a streaming media data processing apparatus including: a unit, configured to separate the streaming media data into audio stream data and video stream data according to the stream index in the streaming media data, and a buffer unit, configured to cache the separated audio stream data and the video stream data in the audio stream respectively The data queue and the video stream data queue; the audio data decoding unit, configured to decode the audio stream data buffered in the audio stream data queue; the video data decoding unit, configured to cache in the video stream data queue The video stream data is decoded; the audio and video synchronization time determining unit is configured to determine an audio and video synchronization time based on the playback callback timestamp of the decoded audio data and the system time of the streaming media reproduction device; the video frame processing unit is configured to Each frame in the decoded video stream data, based on a comparison result of the time stamp of the video frame and the determined sum of the audio and video synchronization time and the video swipe time, according to a predetermined processing manner corresponding to the comparison result.
  • the update unit when the playback callback timestamp of the decoded audio data does not coincide with the system time of the streaming media reproduction device, the update unit will the audio and video
  • the synchronization time is determined to be equal to half the sum of the playback callback timestamp and the system time.
  • the streaming media data processing apparatus may further include: a time determining unit, configured to determine whether the video frame is a key data before decoding the video frame Whether the time stamp of the frame or the video frame is greater than or equal to the sum of the determined audio and video synchronization time and the video frame decoding time, where the video frame is a key data frame or the time stamp of the video frame is greater than or equal to the determined
  • the video data decoding unit decodes the video frame, and determines that the video frame is not a key data frame and the time stamp of the video frame is smaller than the determined time.
  • the video frame processing unit discards the video frame when the audio and video synchronization time and the video frame decoding time are summed.
  • the video frame processing unit waits when the timestamp of the video frame is greater than the sum of the determined audio and video synchronization time and the video refresh time Displaying the video frame; when the time stamp of the video frame is equal to the sum of the determined audio and video synchronization time and the video refresh time, the video frame processing unit displays the video frame; or at the time of the video frame When the stamp is less than the sum of the determined audio and video synchronization time and the video refresh time, the video frame processing unit discards the video frame.
  • the streaming media data processing apparatus may further include an audio stream data play determining unit, configured to perform audio stream data playback. Before determining, determining whether the audio buffer module data buffer queue has been filled with audio stream data, wherein the audio playback module performs audio stream data when it is determined that the audio play module data buffer queue is full or all audio data is decoded. Playing, otherwise, the audio data decoding unit continues to decode the audio stream data in the audio stream data buffer queue.
  • the streaming media data processing apparatus may further include a memory reference unit, configured to directly point to the storage location by using pointer redirection when displaying the video frame.
  • the memory of the video frame performs a reference operation.
  • a streaming media data reproducing apparatus comprising the streaming media data processing apparatus as described above.
  • FIG. 1 is a flow chart showing a streaming media data processing method according to an embodiment of the present invention
  • FIG. 2 is a block diagram showing a streaming media data processing device according to an embodiment of the present invention
  • FIG. 3 shows a streaming media reproducing apparatus having a streaming media data processing apparatus according to the present invention.
  • FIG. 4 shows a mobile terminal having a streaming media data processing device in accordance with the present invention.
  • FIG. 1 shows a flow diagram showing a streaming media data processing method in accordance with one embodiment of the present invention.
  • the streaming media data playing process when the streaming media data playing process is performed, as shown in FIG. 1, first, in step S110, according to the stream index included in the streaming media data (for example, the stream in the streaming media packet) Index), the streaming media data to be played is separated into audio stream data and video stream data, where the stream index is used to indicate the type of stream data, such as an audio stream or a video stream. Then, the separated audio stream data is buffered in the audio stream data queue (step S115), and the separated video stream data is buffered in the video stream data queue (step S140).
  • the stream index included in the streaming media data for example, the stream in the streaming media packet) Index
  • the streaming media data to be played is separated into audio stream data and video stream data, where the stream index is used to indicate the type of stream data, such as an audio stream or a video stream.
  • the separated audio stream data is buffered in the audio stream data queue (step S115)
  • the separated video stream data is buffered in the video stream data queue (step S140).
  • step S120 it is determined whether the audio decoding condition is satisfied for the audio stream data buffered in the audio stream data queue.
  • the audio decoding condition is, for example, determining whether the audio play module data buffer queue has been filled with the audio stream data before playing.
  • the audio play module may be, for example, a sound card. Whether the audio play module data buffer queue has been filled with the already decoded audio stream data.
  • the sound card data cache queue size is equal to the video frame rate. In this case, before playing, it is first determined whether the sound card (that is, the audio data of Is) is full. If it is not full, it is considered that the audio decoding condition is satisfied, otherwise, it is considered that the audio decoding condition is not satisfied.
  • step S120 When the audio decoding condition is satisfied (for example, when the sound card data buffer queue is not full), that is, if the result of the determination in step S120 is YES, the process proceeds to step S125.
  • step S125 the audio stream data is decoded to output a PCM (Pulse-code Modulation) data stream. Then, the process returns to step S120 to continue waiting until the audio decoding condition is not satisfied. If there is a playback call, it means that the audio data has been played, and the audio data is played, indicating that the data in the audio play module data buffer queue is consumed, thereby indicating that the cache queue is not full, and thus the decoding can be performed again.
  • PCM Packe-code Modulation
  • step 120 essentially re-segmentes the decoded audio stream data according to the frame rate. Use this side , you can make the returned playback callback (for example, sound card callback) more uniform.
  • step S130 the audio play module in the audio playback module is played by the audio playback module in the streaming media reproduction device.
  • the audio stream data is decoded and the playback callback timestamp is returned.
  • the audio play module may be, for example, a sound card device.
  • step S135 the audio/video synchronization time SysTime is determined based on the returned playback timestamp and the system time of the streaming media reproducing device. For example, in one example of the present invention, the playback callback timestamp can be compared to the system time of the streaming media rendering device.
  • the system time of the streaming media reproducing device is determined to be the audiovisual synchronization time SysTime. If the playback callback timestamp does not coincide with the system time of the streaming media reproducing device, the audio/video synchronization time SysTime is determined to be equal to half the sum of the system time and the playback timestamp.
  • the above is only an example of the present invention, how to determine the audio and video synchronization time based on the playback timestamp and the system time of the streaming media reproduction device, and the playback timestamp and the streaming media reproduction device may also be employed.
  • the system time is determined by other function expressions of the parameters.
  • step S145 determining, for each video frame of the video stream data buffered in the video stream data queue, whether the video frame is a key data frame or whether the time stamp VPktTime of the video frame is greater than It is equal to the sum of the determined audio and video synchronization time SysTime and the video frame decoding time DeTime.
  • the key data frame refers to a video I frame
  • the video I frame includes video complete information that can be referenced by a video P frame or a B frame. If the video I frame is lost, the mosaic occurs after the P frame or B frame of the key frame is decoded, so that the displayed image quality is so poor that it is difficult for the user to see the complete picture picture.
  • the video frame decoding time DeTime refers to the time taken to successfully decode the video frame.
  • the video frame is decoded in step S150. If it is determined that the video frame is not a key data frame and the time stamp of the video frame is less than the sum of the determined audio and video synchronization time and the video frame decoding time, then in step S175, the video frame is discarded.
  • step S155 the time stamp VPktTime of the video frame is compared with the determined sum of the audio and video synchronization time SysTime and the video refresh time DrTime.
  • the video refresh time DrTime refers to the time required to perform the swipe operation.
  • the video frame processing unit waits for the display of the video frame; the timestamp of the video frame is equal to the determined.
  • the video frame processing unit displays the video frame when the audio and video synchronization time and the video refresh time are combined; or the time stamp of the video frame is smaller than the determined audio and video synchronization time and the video refresh time And, the video frame processing unit discards the video frame. Thereby, the processing operation of the video frame is completed. After the processing operation on the video frame is completed, the process returns to step S145, and the next video frame is processed in the same manner, and the loop is continued until the end of the playback.
  • the method according to the present invention by updating the system time of the streaming media processing device by using the playback callback time stamp of the decoded audio data, it is possible to avoid the video time and system time due to the audio time and the system time not being matched during the playing process.
  • the audio and video caused by the synchronization are not synchronized, which can greatly reduce the stuttering phenomenon when the user watches the video.
  • the display processing mode of the video frame is determined based on the updated system time, so that the black screen is not displayed when the played video has a very serious jam.
  • the size of the audio play module data buffer queue may be set to a frame rate. In this way, the decoded audio stream data can be re-segmented according to the frame rate. This makes the returned playback callback (for example, the sound card callback) more uniform.
  • the judgment is made based on the sum of the video frame time stamp and the synchronization time and the video frame decoding time. If the video frame is judged to be delayed, it is directly discarded, thereby avoiding the decoding operation for the unsynchronized video frame, thereby reducing the amount of data processing and the data processing time.
  • step S145 of FIG. 1 may be omitted.
  • No judgment process for decoding the decoding of a video frame That is, in this embodiment, all data buffered in the video stream data queue can be decoded, and then the display processing mode determining process is performed based on the determined synchronization time for each frame after decoding.
  • the audio decoding condition determination process in the above step 120 may be omitted.
  • a pointer redirection when displaying the video frame, may also be used to directly perform a reference operation on the memory storing the video frame.
  • a block of memory is allocated to store the decoded data (for example, YUV data), and then, when displayed, the data is copied from the memory for display.
  • the pointer redirection technique is used to perform a reference operation directly on the memory storing the decoded data so that the YUV video queue buffer is not required to be decoded after decoding. As a result, a video memory copy operation can be reduced.
  • the streaming media data processing method according to the present invention is described above with reference to FIG.
  • the above-mentioned streaming media time processing method of the present invention may be implemented by software, hardware implementation, or a combination of software and hardware.
  • FIG. 2 shows a block schematic diagram of a streaming media data processing device 200 in accordance with the present invention.
  • the streaming media data processing apparatus 200 includes a separating unit 210, a buffer unit 220, an audio data decoding unit 230, an audio/video synchronization time determining unit 240, a video data decoding unit 250, and a video frame processing unit 260.
  • the separating unit 210 is configured to separate the streaming media data into audio stream data and video stream data according to a stream index in the streaming media data. Then, the buffer unit 220 caches the separated audio stream data and video stream data in the audio stream data queue and the video stream data queue, respectively.
  • the audio data decoding unit 230 decodes the audio stream data buffered in the audio stream data queue.
  • the video data decoding unit 250 decodes the video stream data buffered in the video stream data queue.
  • the audio stream data decoded by the audio data decoding unit 230 is transmitted to the audio reproduction module of the streaming media data reproducing device for playback, and the playback callback time stamp is returned from the audio reproduction module.
  • the audio and video synchronization time determining unit 240 determines the audio and video synchronization time based on the playback callback timestamp of the decoded audio data and the system time of the streaming media reproducing device.
  • the audio/video synchronization time determining unit 240 determines the audio/video synchronization time to be equal to the sum of the playback callback timestamp and the system time. Half of it.
  • the audio-video synchronization time determination unit determines the system time of the streaming media reproduction device as the audio-video synchronization time when the playback callback timestamp coincides with the system time of the streaming media reproduction device.
  • the video frame processing unit 260 After determining the audio and video synchronization time, for each frame in the decoded video stream data, the video frame processing unit 260 compares the time stamp of the video frame with the determined audio and video synchronization time and the video screen time. As a result of the comparison, the video frame is subjected to display processing in accordance with a predetermined processing manner corresponding to the comparison result.
  • the predetermined processing manner includes: when the time stamp of the video frame is greater than a sum of the determined audio and video synchronization time and the video refresh time, the video The frame processing unit waits for display of the video frame; when the time stamp of the video frame is equal to the sum of the determined audio and video synchronization time and the video refresh time, the video frame processing unit displays the video frame; or When the time stamp of the video frame is less than the sum of the determined audio and video synchronization time and the video refresh time, the video frame processing unit discards the video frame.
  • the predetermined processing manner can also be modified according to a specific situation.
  • the streaming media data processing apparatus may further include a time judging unit (not shown) for judging the video frame before decoding the video frame. Whether it is a key data frame or whether the time stamp of the video frame is greater than or equal to the sum of the determined audio and video synchronization time and the video frame decoding time.
  • the video data decoding unit decodes the video frame if the video frame is a key data frame or a time stamp of the video frame is greater than or equal to a sum of the determined audio and video synchronization time and the video frame decoding time. If the video frame is not a critical data frame and the time stamp of the video frame is less than the sum of the determined audio and video synchronization time and the video frame decoding time, the video frame processing unit discards the video frame.
  • the streaming media data processing apparatus may further include an audio stream data playback determining unit (not shown) for determining before performing audio stream data playback. Determining whether the audio buffer module data buffer queue has been filled with audio stream data, wherein the audio playback module performs audio stream data playback when it is determined that the audio play module data buffer queue is full, otherwise, the audio data decoding unit The audio stream data in the audio stream data buffer queue continues to be decoded.
  • the streaming media data may further include a memory reference unit (not shown) for performing a reference operation on the memory storing the video frame by using pointer redirection when displaying the video frame.
  • a memory reference unit (not shown) for performing a reference operation on the memory storing the video frame by using pointer redirection when displaying the video frame.
  • FIG 3 shows a block schematic diagram of a streaming media data reproduction device 10 having a streaming media data processing device 200 in accordance with the present invention.
  • the streaming media data reproducing device 10 may be a mobile terminal
  • Fig. 4 shows a mobile terminal having the streaming media data processing device 200 according to the present invention.
  • the streaming media data processing device may also be located in a browser of the mobile terminal.
  • the mobile terminal of the present invention can be a variety of handheld terminal devices, such as mobile phones, personal digital assistants (PDAs), etc., and thus the scope of protection of the present invention should not be limited to a particular type of mobile terminal.
  • PDAs personal digital assistants
  • the method according to the invention can also be implemented as a computer program executed by a CPU.
  • the computer program is executed by the CPU, the above-described functions defined in the method of the present invention are performed.
  • controller e.g., a processor
  • computer readable storage device for storing a computer program that causes the controller to implement the steps or unit functions described above.
  • the present invention by updating the system time of the streaming media processing device by using the playback callback time stamp of the decoded audio data, it is possible to avoid the video time and the system time not corresponding to the video time during playback.
  • the audio and video caused by the system time synchronization are not synchronized, which can greatly reduce the jamming phenomenon when the user watches the video.
  • the display processing manner of the video frame is determined based on the updated system time, thereby avoiding the occurrence of a very serious card in the played video. suddenly, no black screen will be displayed.
  • the determination is made based on the sum of the video frame time stamp and the synchronization time and the video frame decoding time. If it is judged that the video frame is delayed, it is directly discarded, thereby avoiding the decoding operation for the unsynchronized video frame, thereby reducing the amount of data processing and the data processing time.
  • the decoded audio stream data may be re-segmented according to a frame rate.
  • the returned playback callback for example, sound card callback
  • a pointer redirection when displaying the video frame, a pointer redirection may also be adopted to directly perform a reference operation on a memory storing the video frame.
  • the reference operation of the memory storing the decoded data can be directly performed, so that the YUV video queue buffer does not have to be performed after the decoding. Thereby, one video memory copy operation can be reduced.
  • non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • flash flash.
  • Volatile memory can include random access memory (RAM), which can act as external cache memory.
  • RAM can be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Storage devices of the disclosed aspects of synchronous link DRAM (SLDRAM) and direct Rambus RAM (DRRAM) o are intended to include, but are not limited to, these and other suitable types of memory.
  • DRAM synchronous RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous link DRAM
  • DRRAM direct Rambus RAM
  • DSP digital signal processor
  • ASIC dedicated An integrated circuit
  • FPGA field programmable gate array
  • a general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller or state machine.
  • the processor can also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
  • the steps of a method or algorithm described in connection with the disclosure herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two.
  • Software modules can reside in RAM storage , flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor, such that the processor can read information from or write information to the storage medium.
  • the storage medium can be integrated with a processor.
  • the processor and the storage medium can reside in an ASIC.
  • the ASIC can reside in the user terminal.
  • the processor and the storage medium may reside as a discrete component in the user terminal.
  • the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted as one or more instructions or code on a computer readable medium.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a general purpose or special purpose computer.
  • the computer readable medium may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage device, disk storage device or other magnetic storage device, or may be used for carrying or storing a form of instructions Or the required program code of the data structure and any other medium that can be accessed by a general purpose or special purpose computer or a general purpose or special purpose processor. Also, any connection is properly termed a computer-readable medium.
  • a magnetic disk and an optical disk include a compact disk (CD), a laser disk, an optical disk, a digital versatile disk (DVD), a floppy disk, a Blu-ray disk, in which a disk generally reproduces data magnetically, and an optical disk optically reproduces data using a laser. . Combinations of the above should also be included in the scope of computer readable media.

Abstract

本发明提供了一种流媒体数据处理方法,在该方法中,根据流媒体数据中的流索引,将流媒体数据分离为音频流数据和视频流数据并进行解码;基于解码后的音频数据的播放时间以及流媒体再现设备的系统时间,确定视频帧的处理方式并按照所确定的处理方式进行显示处理。利用该方法,可以大大减少用户观看视频时的卡顿现象。

Description

流媒体数据处理方法及装置、 流媒体数据再现设备
技术领域
本发明涉及移动通信领域, 更为具体地, 涉及一种流媒体数据处理方法、 流媒体数据处理装置以及具有该装置的流媒体数据再现设备。 背景技术
目前, 流媒体的应用越来越广泛。 所谓流媒体是指采用流式传输的方式 在互联网上播放的媒体格式。 流媒体又叫流式媒体, 它是指商家用一个视频 传送服务器把节目当成数据包发出, 传送到网络上。 用户通过解压设备对这 些数据进行解压后, 节目就会像发送前那样显示出来。
通常, 流媒体数据包括音频数据和视频数据。 所述音频数据和视频数据 是两条独立的数据流。 在进行流媒体数据播放时, 需要将音频数据和视频数 据分离开来分别进行解码并呈现。 在进行解码和呈现时, 音频数据和视频数 据中的每帧都具有明确的解码时间帧、 显示时间戳。 然而, 由于存在播放系 统中的音频输出设备 (例如, 声卡) 的播放回调 (例如, 声卡回调) 不及时, 音频帧和视频帧的解码时间消耗不均匀以及由 I帧解码时间长等引起的视频 显示卡顿现象, 从而会导致音频数据和视频数据不同步, 由此使得用户观看 流媒体数据时的体验不佳。 这里, 所述播放回调 (例如, 声卡回调) 指的是 音频信号播放设备 (例如, 声卡) 被设置为每隔一定时间, 就回调一次, 以 指示已经播放完一小段音频数据。 此时的时间戳也被称为播放回调时间戳。 发明内容
鉴于上述, 本发明提供了一种流媒体数据处理方法, 在该方法中, 利用 解码后的音频数据的播放回调时间戳来更新流媒体处理设备的系统时间, 并 且在进行音频数据和视频数据解码后, 基于更新后的系统时间来确定视频帧 的显示处理方式。 利用该方法, 可以避免在播放过程中由于音频时间和系统 时间不对应但视频时间和系统时间同步而造成的音视频不同步, 从而可以大 大减少用户观看视频时的卡顿现象。 此外, 由于在解码后再进行音视频同步, 从而可以避免在播放的视频出现非常严重的卡顿时, 不会显示黑屏。
根据本发明的一个方面, 提供了一种流媒体数据处理方法, 包括: 根据 流媒体数据中的流索引, 将流媒体数据分离为音频流数据和视频流数据并分 别缓存在音频流数据队列和视频流数据队列中; 分别对缓存在所述音频流数 据队列和视频流数据队列中的音频流数据和视频流数据进行解码; 基于解码 后的音频数据的播放回调时间戳以及流媒体再现设备的系统时间, 确定音视 频同步时间; 以及对于解码后的视频流数据中的每一帧, 基于该视频帧的时 间戳与所确定出的音视频同步时间和视频刷屏时间之和的比较结果, 按照与 所述比较结果对应的预定处理方式对该视频帧进行显示处理。
此外, 在本发明的上述实施例的一个或多个示例中, 在确定该视频帧是 关键数据帧或者该视频帧的时间戳大于等于所确定出的音视频同步时间和该 视频帧解码时间之和时, 对该视频帧进行解码。 此外, 在确定该视频帧不是 关键数据帧且该视频帧的时间戳小于所确定出的音视频同步时间和该视频帧 解码时间之和时, 丢弃该视频帧。
此外, 在本发明的上述实施例的一个或多个示例中, 当所述解码后的音 频数据的播放回调时间戳与流媒体再现设备的系统时间不一致时, 所述音视 频同步时间被确定为等于所述播放回调时间戳与所述系统时间之和的一半。
此外, 在本发明的上述实施例的一个或多个示例中, 在该视频帧的时间 戳大于所确定出的音视频同步时间和该视频刷屏时间之和时, 等待该视频帧 的显示; 在该视频帧的时间戳等于所确定出的音视频同步时间和该视频刷屏 时间之和时, 显示该视频帧; 或者在该视频帧的时间戳小于所确定出的音视 频同步时间和该视频刷屏时间之和时, 丢弃该视频帧。
此外, 在本发明的上述实施例的一个或多个示例中, 在进行播放之前, 判断音频播放模块数据缓存队列是否已经写满音频流数据, 其中在音频播放 模块数据缓存队列已经写满或者所有音频数据都完成解码时, 进行音频流数 据播放, 否则, 继续对音频流数据缓存队列中的音频流数据进行解码。
此外, 在本发明的上述实施例的一个或多个示例中, 在显示所述视频帧 时, 采用指针重指向来直接对存储所述视频帧的内存执行引用操作。
根据本发明的另一方面, 提供了一种流媒体数据处理装置, 包括: 分离 单元, 用于根据流媒体数据中的流索引, 将流媒体数据分离为音频流数据和 视频流数据; 缓存单元, 用于将所述分离出的音频流数据和视频流数据分别 缓存在音频流数据队列和视频流数据队列中; 音频数据解码单元, 用于对缓 存在所述音频流数据队列中的音频流数据进行解码; 视频数据解码单元, 用 于对缓存在所述视频流数据队列中的视频流数据进行解码; 音视频同步时间 确定单元, 用于基于解码后的音频数据的播放回调时间戳以及流媒体再现设 备的系统时间, 确定音视频同步时间; 视频帧处理单元, 用于对于解码后的 视频流数据中的每一帧, 基于该视频帧的时间戳与所确定出的音视频同步时 间和视频刷屏时间之和的比较结果, 按照与所述比较结果对应的预定处理方 式对该视频帧进行显示处理。
此外, 在本发明的上述实施例的一个或多个示例中, 当所述解码后的音 频数据的播放回调时间戳与流媒体再现设备的系统时间不一致时, 所述更新 单元将所述音视频同步时间确定为等于所述播放回调时间戳与所述系统时间 之和的一半。
此外, 在本发明的上述实施例的一个或多个示例中, 所述流媒体数据处 理装置还可以包括: 时间判断单元, 用于在对视频帧进行解码之前, 判断该 视频帧是否是关键数据帧或者该视频帧的时间戳是否大于等于所确定出的音 视频同步时间和该视频帧解码时间之和, 其中, 在该视频帧是关键数据帧或 者该视频帧的时间戳大于等于所确定出的音视频同步时间和该视频帧解码时 间之和时, 所述视频数据解码单元对该视频帧进行解码, 以及在判断该视频 帧不是关键数据帧且该视频帧的时间戳小于所确定出的音视频同步时间和该 视频帧解码时间之和时, 所述视频帧处理单元丢弃该视频帧。
此外, 在本发明的上述实施例的一个或多个示例中, 在该视频帧的时间 戳大于所确定出的音视频同步时间和该视频刷屏时间之和时, 所述视频帧处 理单元等待该视频帧的显示; 在该视频帧的时间戳等于所确定出的音视频同 步时间和该视频刷屏时间之和时, 所述视频帧处理单元显示该视频帧; 或者 在该视频帧的时间戳小于所确定出的音视频同步时间和该视频刷屏时间之和 时, 所述视频帧处理单元丢弃该视频帧。
此外, 在本发明的上述实施例的一个或多个示例中, 所述流媒体数据处 理装置还可以包括音频流数据播放判断单元, 用于在进行音频流数据播放之 前, 判断判断音频播放模块数据缓存队列是否已经写满音频流数据, 其中, 在判断为音频播放模块数据缓存队列已经写满或者所有音频数据都完成解码 时, 所述音频播放模块进行音频流数据播放, 否则, 所述音频数据解码单元 继续对音频流数据缓存队列中的音频流数据进行解码。
此外, 在本发明的上述实施例的一个或多个示例中, 所述流媒体数据处 理装置还可以包括内存引用单元, 用于在显示所述视频帧时, 采用指针重指 向来直接对存储所述视频帧的内存执行引用操作。
根据本发明的另一方面, 提供了一种流媒体数据再现设备, 包括如上所 述的流媒体数据处理装置。
为了实现上述以及相关目的, 本发明的一个或多个方面包括后面将详细 说明并在权利要求中特别指出的特征。 下面的说明以及附图详细说明了本发 明的某些示例性方面。 然而, 这些方面指示的仅仅是可使用本发明的原理的 各种方式中的一些方式。 此外, 本发明旨在包括所有这些方面以及它们的等 同物。 附图说明
根据下述参照附图进行的详细描述, 本发明的上述和其他目的、 特征和 优点将变得更加显而易见。 在附图中:
图 1示出了根据本发明的一个实施例的流媒体数据处理方法的流程图; 图 2示出了根据本发明的一个实施例的流媒体数据处理装置的方框示意 图;
图 3 示出了具有根据本发明的流媒体数据处理装置的流媒体再现设备; 和
图 4示出了具有根据本发明的流媒体数据处理装置的移动终端。
在所有附图中相同的标号指示相似或相应的特征或功能。 具体实施方式
下面描述本公开的各个方面。 应该明白的是, 本文的教导可以以多种多 样形式具体体现, 并且在本文中公开的任何具体结构、 功能或两者仅仅是代 表性的。 基于本文的教导, 本领域技术人员应该明白的是, 本文所公开的一 个方面可以独立于任何其它方面实现, 并且这些方面中的两个或多个方面可 以按照各种方式组合。 例如, 可以使用本文所阐述的任何数目的方面, 实现 装置或实践方法。 另外, 可以使用其它结构、 功能、 或除了本文所阐述的一 个或多个方面之外或不是本文所阐述的一个或多个方面的结构和功能, 实现 这种装置或实践这种方法。 此外, 本文所描述的任何方面可以包括权利要求 的至少一个元素。
下面将参照附图描述本发明的各个实施例。
图 1 示出了示出了根据本发明的一个实施例的流媒体数据处理方法的流 程图。
根据本发明的一个实施例, 在进行流媒体数据播放处理时, 如图 1所示, 首先, 在步骤 S110中, 根据流媒体数据中包含的流索引 (例如, 流媒体数据 包 packet中的 stream index) , 将要播放的流媒体数据分离为音频流数据和视 频流数据, 这里, 所述流索引用于指示流数据的类型, 例如音频流或视频流。 然后, 将分离出的音频流数据缓存在音频流数据队列中 (步骤 S115 ) , 以及将 分离出的视频流数据缓存在视频流数据队列中 (步骤 S140)。
然后, 在步骤 S120中, 针对缓存在音频流数据队列中的音频流数据, 判 断是否满足音频解码条件。 所述音频解码条件例如是在进行播放之前, 判断 音频播放模块数据缓存队列是否已经写满音频流数据。 这里, 所述音频播放 模块例如可以是声卡。 所述音频播放模块数据缓存队列是否已经写满已经解 码的音频流数据。 所述声卡数据缓存队列大小等于视频帧率。 在这种情况下, 在进行播放之前, 首先判断声卡(即是 Is的音频数据)是否已经写满。 如果没 有写满, 则认为满足音频解码条件, 否则, 认为不满足音频解码条件。 当满 足音频解码条件 (例如, 当声卡数据缓存队列没有写满) 时, 即步骤 S120的 判断结果为是时,进行到步骤 S125。在步骤 S125中,对音频流数据进行解码, 以输出 PCM (Pulse-code modulation, 脉冲编码调制) 数据流。 然后, 返回到 步骤 S120继续等待, 直到不满足音频解码条件。 如果存在播放回调, 就说明 已经进行了音频数据播放, 而进行音频数据播放, 就说明音频播放模块数据 缓存队列中的数据被消耗, 从而说明该缓存队列不满, 由此可以重新进行解 码。 从这点上看, 如果存在播放回调, 就说明可以进行解码。 这里, 步骤 120 中的过程实质是根据帧率对解码后的音频流数据进行重新分割。 利用这种方 式, 可以使得返回的播放回调 (例如, 声卡回调) 更均匀。
在步骤 120 中的判断结果为否时, 即不满足音频解码条件时, 流程进行 到步骤 S130,在步骤 S130中,通过流媒体再现设备中的音频播放模块播放音 频播放模块数据缓存队列中的已解码音频流数据, 并且返回播放回调时间戳。 这里, 所述音频播放模块可以例如是声卡设备。 然后, 在步骤 S135中, 基于 所返回的播放回调时间戳与流媒体再现设备的系统时间, 确定音视频同步时 间 SysTime。例如, 在本发明的一个示例中, 可以将所述播放回调时间戳与流 媒体再现设备的系统时间进行比较。 如果所述播放回调时间戳与流媒体再现 设备的系统时间一致, 则将所述流媒体再现设备的系统时间确定为音视频同 步时间 SysTime。如果所述播放回调时间戳与流媒体再现设备的系统时间不一 致, 将所述音视频同步时间 SysTime确定为等于所述系统时间与所述播放回 调时间戳之和的一半。 显然, 上述仅仅是本发明的一个示例, 如何基于所述 播放回调时间戳以及流媒体再现设备的系统时间来确定音视频同步时间, 还 可以采用以所述播放回调时间戳以及流媒体再现设备的系统时间为参数的其 它函数表达式来进行确定。
在确定出音视频同步时间后, 在步骤 S145, 针对缓存在视频流数据队列 中的视频流数据的每一视频帧, 判断该视频帧是否是关键数据帧或者该视频 帧的时间戳 VPktTime是否大于等于所确定出的音视频同步时间 SysTime和该 视频帧解码时间 DeTime之和。 这里, 所述关键数据帧指视频 I帧, 该视频 I 帧包含有可被视频 P帧或 B帧参考的视频完整信息。 如果丢失视频 I帧, 则 依赖该关键帧的 P帧或 B帧解码之后都出现马赛克, 从而使得所显示的图像 质量非常差, 以至于用户难以看到完整的图片画面。 所述视频帧解码时间 DeTime是指用于对该视频帧成功进行解码所消耗的时间。
如果该视频帧是关键数据帧或者该视频帧的时间戳大于等于所确定出的 音视频同步时间和该视频帧解码时间之和, 则在步骤 S150, 对该视频帧进行 解码。 如果判断该视频帧不是关键数据帧且该视频帧的时间戳小于所确定出 的音视频同步时间和该视频帧解码时间之和, 则在步骤 S175中, 丢弃该视频 帧。
在对该视频帧进行解码后, 在步骤 S155 , 将该视频帧的时间戳 VPktTime 与所确定出的音视频同步时间 SysTime和视频刷屏时间 DrTime之和进行比 较。 这里, 所述视频刷屏时间 DrTime是指进行刷屏操作所需要的时间。
在该视频帧的时间戳大于所确定出的音视频同步时间和该视频刷屏时间 之和时, 所述视频帧处理单元等待该视频帧的显示; 在该视频帧的时间戳等 于所确定出的音视频同步时间和该视频刷屏时间之和时, 所述视频帧处理单 元显示该视频帧; 或者在该视频帧的时间戳小于所确定出的音视频同步时间 和该视频刷屏时间之和时, 所述视频帧处理单元丢弃该视频帧。 由此, 完成 对该视频帧的处理操作。在完成对该视频帧的处理操作后,返回到步骤 S145, 按照相同的方式, 针对下一视频帧进行处理, 如此循环直到播放结束。
在根据本发明的方法中, 通过利用解码后的音频数据的播放回调时间戳 来更新流媒体处理设备的系统时间, 可以避免在播放过程中由于音频时间和 系统时间不对应但视频时间和系统时间同步而造成的音视频不同步, 从而可 以大大减少用户观看视频时的卡顿现象。
此外, 通过在进行音频数据和视频数据解码后, 基于更新后的系统时间 来确定视频帧的显示处理方式, 从而可以避免在播放的视频出现非常严重的 卡顿时, 不会显示黑屏。
此外, 通过在进行音频流数据解码之前, 判断是否满足音频解码条件, 例如, 在进行播放之前, 判断音频播放模块数据缓存队列是否已经写满音频 流数据。 如果没有写满, 则认为满足音频解码条件, 从而进行音频流数据解 码。 如果已经写满, 则认为不满足音频解码条件, 从而允许音频播放设备进 行音频数据播放。 这里, 所述音频播放模块数据缓存队列的大小可以被设置 为帧率。 利用这种方式, 可以根据帧率对解码后的音频流数据进行重新分割。 从而使得返回的播放回调 (例如, 声卡回调) 更均匀。
此外, 在上述实施例中, 由于在进行视频数据解码之前, 先根据视频帧 时间戳与同步时间和视频帧解码时间之和进行一次判断。 如果判断视频帧延 迟, 则直接丢弃, 从而避免针对该不同步的视频帧进行解码操作, 由此可以 减少数据处理量以及数据处理时间。
以上参照图 1 对根据本发明的流媒体数据处理方法进行了说明, 但是本 领域技术人员要理解的是, 上述仅仅是示例。 本领域技术人员还可以在不背 离本发明的范围的情况下, 对上述实施例进行各种修改。
例如, 在本发明的另一实施例中, 可以省略图 1的步骤 S145中的关于是 否对视频帧的解码进行解码的判断过程。 也就是说, 在该实施例中, 可以对 缓存在视频流数据队列中的所有数据都进行解码, 然后针对解码后的每一帧, 基于所确定出的同步时间来执行显示处理方式确定过程。
此外, 在本发明的另一实施例中, 也可以省略上述步骤 120 中的音频解 码条件判断过程。
此外, 在本发明的另一实施例中, 在显示所述视频帧时, 还可以采用指 针重指向来直接对存储所述视频帧的内存执行引用操作。 通常, 在解码器内 部解码之后会分配一块内存存放解码后的数据 (例如, YUV 数据), 然后在 显示时, 从该内存中拷贝出该数据来进行显示。 在该另一实施例中, 在显示 时, 采用指针重指向技术, 直接对存储解码数据的内存执行引用操作, 从而 使得在解码之后, 不必再进行 YUV视频队列缓存。 由此, 可以减少一次视频 内存拷贝操作。
如上参照图 1 描述了根据本发明的流媒体数据处理方法。 本发明的上述 流媒体时间处理方法, 可以采用软件实现, 也可以采用硬件实现, 或采用软 件和硬件组合的方式实现。
图 2示出了根据本发明的流媒体数据处理装置 200的方框示意图。
如图 2所示, 所述流媒体数据处理装置 200包括分离单元 210、缓存单元 220、 音频数据解码单元 230、 音视频同步时间确定单元 240、 视频数据解码 单元 250以及视频帧处理单元 260。
所述分离单元 210用于根据流媒体数据中的流索引, 将流媒体数据分离 为音频流数据和视频流数据。 然后, 缓存单元 220将所述分离出的音频流数 据和视频流数据分别缓存在音频流数据队列和视频流数据队列中。
音频数据解码单元 230对缓存在所述音频流数据队列中的音频流数据进 行解码。 视频数据解码单元 250对缓存在所述视频流数据队列中的视频流数 据进行解码。
音频数据解码单元 230所解码出的音频流数据被发送给流媒体数据再现 设备的音频再现模块进行播放, 并从该音频再现模块返回播放回调时间戳。 在接收到播放回调时间戳后, 音视频同步时间确定单元 240基于解码后的音 频数据的播放回调时间戳以及流媒体再现设备的系统时间, 确定音视频同步 时间。 例如, 在本发明的上述实施例的一个或多个示例中, 当所述解码后的 音频数据的播放回调时间戳与流媒体再现设备的系统时间不一致时, 所述音 视频同步时间确定单元 240将所述音视频同步时间确定为等于所述播放回调 时间戳与所述系统时间之和的一半。 在所述播放回调时间戳与流媒体再现设 备的系统时间一致时, 所述音视频同步时间确定单元将所述流媒体再现设备 的系统时间确定为音视频同步时间。
在确定出音视频同步时间后, 对于解码后的视频流数据中的每一帧, 视 频帧处理单元 260基于该视频帧的时间戳与所确定出的音视频同步时间和视 频刷屏时间之和的比较结果, 按照与所述比较结果对应的预定处理方式对该 视频帧进行显示处理。 例如, 在本发明的一个或多个实施例中, 所述预定处 理方式包括: 在该视频帧的时间戳大于所确定出的音视频同步时间和该视频 刷屏时间之和时, 所述视频帧处理单元等待该视频帧的显示; 在该视频帧的 时间戳等于所确定出的音视频同步时间和该视频刷屏时间之和时, 所述视频 帧处理单元显示该视频帧; 或者在该视频帧的时间戳小于所确定出的音视频 同步时间和该视频刷屏时间之和时, 所述视频帧处理单元丢弃该视频帧。 很 显然, 这里, 所述预定处理方式也可以根据具体情形进行修改。
此外, 在本发明的上述实施例的一个或多个示例中, 所述流媒体数据处 理装置还可以包括时间判断单元 (未示出), 用于在对视频帧进行解码之前, 判断该视频帧是否是关键数据帧或者该视频帧的时间戳是否大于等于所确定 出的音视频同步时间和该视频帧解码时间之和。 如果该视频帧是关键数据帧 或者该视频帧的时间戳大于等于所确定出的音视频同步时间和该视频帧解码 时间之和, 则所述视频数据解码单元对该视频帧进行解码。 如果该视频帧不 是关键数据帧且该视频帧的时间戳小于所确定出的音视频同步时间和该视频 帧解码时间之和, 则所述视频帧处理单元丢弃该视频帧。
此外, 在本发明的上述实施例的一个或多个示例中, 所述流媒体数据处 理装置还可以包括音频流数据播放判断单元 (未示出), 用于在进行音频流数 据播放之前, 判断判断音频播放模块数据缓存队列是否已经写满音频流数据, 其中, 在判断为音频播放模块数据缓存队列已经写满时, 所述音频播放模块 进行音频流数据播放, 否则, 所述音频数据解码单元继续对音频流数据缓存 队列中的音频流数据进行解码。
此外, 在本发明的上述实施例的一个或多个示例中, 所述流媒体数据处 理装置还可以包括内存引用单元 (未示出), 用于在显示所述视频帧时, 采用 指针重指向来直接对存储所述视频帧的内存执行引用操作。
图 3示出了具有根据本发明的流媒体数据处理装置 200的流媒体数据再 现设备 10的方框示意图。所述流媒体数据再现设备 10可以是移动终端, 图 4 示出了具有根据本发明的流媒体数据处理装置 200 的移动终端。 此外, 在本 发明的一个示例中, 该流媒体数据处理装置也可以位于移动终端的浏览器中。
此外, 典型地, 本发明所述的移动终端可为各种手持终端设备, 例如手 机、 个人数字助理 (PDA) 等, 因此本发明的保护范围不应限定为某种特定 类型的移动终端。
此外, 根据本发明的方法还可以被实现为由 CPU执行的计算机程序。 在 该计算机程序被 CPU执行时, 执行本发明的方法中限定的上述功能。
此外, 上述方法步骤以及系统单元也可以利用控制器 (例如, 处理器) 以及用于存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可 读存储设备实现。
在根据本发明的一个实施例中, 通过利用解码后的音频数据的播放回调 时间戳来更新流媒体处理设备的系统时间, 可以避免在播放过程中由于音频 时间和系统时间不对应但视频时间和系统时间同步而造成的音视频不同步, 从而可以大大减少用户观看视频时的卡顿现象。
此外, 在根据本发明的一个实施例中, 通过在进行音频数据和视频数据 解码后, 基于更新后的系统时间来确定视频帧的显示处理方式, 从而可以避 免在播放的视频出现非常严重的卡顿时, 不会显示黑屏。
此外, 在根据本发明的一个实施例中, 由于在进行视频数据解码之前, 先根据视频帧时间戳与同步时间和视频帧解码时间之和进行一次判断。 如果 判断视频帧延迟, 则直接丢弃, 从而避免针对该不同步的视频帧进行解码操 作, 由此可以减少数据处理量以及数据处理时间。
此外, 在本发明的另一实施例中, 在对音频流数据解码后, 还可以根据 帧率对解码后的音频流数据进行重新分割。 利用这种方式, 可以使得返回的 播放回调 (例如, 声卡回调) 更均匀。
此外, 在本发明的另一实施例中, 在显示所述视频帧时, 还可以采用指 针重指向来直接对存储所述视频帧的内存执行引用操作。 利用这种方式, 在 显示时, 可以直接对存储解码数据的内存执行引用操作, 从而使得在解码之 后,不必再进行 YUV视频队列缓存。由此,可以减少一次视频内存拷贝操作。
此外, 应该明白的是, 本文所述的计算机可读存储设备 (例如, 存储器) 可以是易失性存储器或非易失性存储器, 或者可以包括易失性存储器和非易 失性存储器两者。 作为例子而非限制性的, 非易失性存储器可以包括只读存 储器 (ROM)、 可编程 ROM (PROM), 电可编程 ROM (EPROM)、 电可擦 写可编程 ROM (EEPROM)或快闪存储器。 易失性存储器可以包括随机存取 存储器 (RAM), 该 RAM可以充当外部高速缓存存储器。 作为例子而非限制 性的, RAM 可以以多种形式获得, 比如同步 RAM (DRAM), 动态 RAM (DRAM), 同步 DRAM (SDRAM), 双数据速率 SDRAM (DDR SDRAM )、 增强 SDRAM (ESDRAM)、 同步链路 DRAM (SLDRAM) 以及直接 Rambus RAM (DRRAM)o 所公开的方面的存储设备意在包括但不限于这些和其它合 适类型的存储器。
本领域技术人员还将明白的是, 结合这里的公开所描述的各种示例性逻 辑块、 模块、 电路和算法步骤可以被实现为电子硬件、 计算机软件或两者的 组合。 为了清楚地说明硬件和软件的这种可互换性, 已经就各种示意性组件、 方块、 模块、 电路和步骤的功能对其进行了一般性的描述。 这种功能是被实 现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约 束。 本领域技术人员可以针对每种具体应用以各种方式来实现所述的功能, 但是这种实现决定不应被解释为导致脱离本发明的范围。
结合这里的公开所描述的各种示例性逻辑块、 模块和电路可以利用被设 计成用于执行这里所述功能的下列部件来实现或执行: 通用处理器、 数字信 号处理器 (DSP)、 专用集成电路 (ASIC)、 现场可编程门阵列 (FPGA) 或其 它可编程逻辑器件、 分立门或晶体管逻辑、 分立的硬件组件或者这些部件的 任何组合。 通用处理器可以是微处理器, 但是可替换地, 处理器可以是任何 传统处理器、 控制器、 微控制器或状态机。 处理器也可以被实现为计算设备 的组合, 例如, DSP 和微处理器的组合、 多个微处理器、 一个或多个微处理 器结合 DSP核、 或任何其它这种配置。
结合这里的公开所描述的方法或算法的步骤可以直接包含在硬件中、 由 处理器执行的软件模块中或这两者的组合中。软件模块可以驻留在 RAM存储 器、 快闪存储器、 ROM存储器、 EPROM存储器、 EEPROM存储器、 寄存器、 硬盘、 可移动盘、 CD-ROM、 或本领域已知的任何其它形式的存储介质中。 示例性的存储介质被耦合到处理器, 使得处理器能够从该存储介质中读取信 息或向该存储介质写入信息。 在一个替换方案中, 所述存储介质可以与处理 器集成在一起。 处理器和存储介质可以驻留在 ASIC中。 ASIC可以驻留在用 户终端中。 在一个替换方案中, 处理器和存储介质可以作为分立组件驻留在 用户终端中。
在一个或多个示例性设计中, 所述功能可以在硬件、 软件、 固件或其任 意组合中实现。 如果在软件中实现, 则可以将所述功能作为一个或多个指令 或代码存储在计算机可读介质上或通过计算机可读介质来传送。 计算机可读 介质包括计算机存储介质和通信介质, 该通信介质包括有助于将计算机程序 从一个位置传送到另一个位置的任何介质。 存储介质可以是能够被通用或专 用计算机访问的任何可用介质。 作为例子而非限制性的, 该计算机可读介质 可以包括 RAM、 ROM, EEPROM, CD-ROM或其它光盘存储设备、 磁盘存 储设备或其它磁性存储设备, 或者是可以用于携带或存储形式为指令或数据 结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处理器访 问的任何其它介质。 此外, 任何连接都可以适当地称为计算机可读介质。 例 如, 如果使用同轴线缆、 光纤线缆、 双绞线、 数字用户线路(DSL)或诸如红 外线、 无线电和微波的无线技术来从网站、 服务器或其它远程源发送软件, 则上述同轴线缆、 光纤线缆、 双绞线、 DSL或诸如红外先、 无线电和微波的 无线技术均包括在介质的定义。 如这里所使用的, 磁盘和光盘包括压缩盘 (CD), 激光盘、 光盘、 数字多功能盘 (DVD)、 软盘、 蓝光盘, 其中磁盘通 常磁性地再现数据, 而光盘利用激光光学地再现数据。 上述内容的组合也应 当包括在计算机可读介质的范围内。
尽管前面公开的内容示出了本发明的示例性实施例, 但是应当注意, 在 不背离权利要求限定的本发明的范围的前提下, 可以进行多种改变和修改。 根据这里描述的发明实施例的方法权利要求的功能、 步骤和 /或动作不需以任 何特定顺序执行。 此外, 尽管本发明的元素可以以个体形式描述或要求, 但 是也可以设想多个, 除非明确限制为单数。
虽然如上参照图描述了根据本发明的各个实施例进行了描述, 但是本领 域技术人员应当理解, 对上述本发明所提出的各个实施例, 还可以在不脱离 本发明内容的基础上做出各种改进。 因此, 本发明的保护范围应当由所附的 权利要求书的内容确定。

Claims

权 利 要 求 书
1、 一种流媒体数据处理方法, 包括:
根据流媒体数据中的流索引, 将流媒体数据分离为音频流数据和视频流 数据并分别缓存在音频流数据队列和视频流数据队列中;
分别对缓存在所述音频流数据队列和视频流数据队列中的音频流数据和 视频流数据进行解码;
基于解码后的音频数据的播放回调时间戳以及流媒体再现设备的系统时 间, 确定音视频同步时间; 以及
对于解码后的视频流数据中的每一帧, 基于该视频帧的时间戳与所确定 出的音视频同步时间和视频刷屏时间之和的比较结果, 按照与所述比较结果 对应的预定处理方式对该视频帧进行显示处理。
2、 如权利要求 1所述的流媒体数据处理方法, 其中, 在对所述视频流数 据队列中的视频流数据进行解码的步骤包括:
在确定该视频帧是关键数据帧或者该视频帧的时间戳大于或等于所确定 出的音视频同步时间和该视频帧解码时间之和时, 对该视频帧进行解码; 以 及
在确定该视频帧不是关键数据帧且该视频帧的时间戳小于所确定的音视 频同步时间和该视频帧解码时间之和时, 丢弃该视频帧。
3、 如权利要求 1或 2所述的流媒体数据处理方法, 其中, 当所述解码后 的音频数据的播放回调时间戳与流媒体再现设备的系统时间不一致时, 所述 音视频同步时间被确定为等于所述播放回调时间戳与所述系统时间之和的一 半。
4、 如权利要求 1或 2所述的流媒体数据处理方法, 其中, 基于该视频帧 的时间戳与所确定出的音视频同步时间和该视频刷屏时间之和的比较结果, 按照与所述比较结果对应的预定处理方式对该视频帧进行显示处理包括: 在该视频帧的时间戳大于所确定出的音视频同步时间和该视频刷屏时间 之和时, 等待该视频帧的显示;
在该视频帧的时间戳等于所确定出的音视频同步时间和该视频刷屏时间 之和时, 显示该视频帧; 或者 在该视频帧的时间戳小于所确定出的音视频同步时间和该视频刷屏时间 之和时, 丢弃该视频帧。
5、 如权利要求 1或 2所述的流媒体数据处理方法, 还包括:
在进行音频数据解码之前, 判断音频播放模块数据缓存队列是否已经写 满音频流数据,
在音频播放模块数据缓存队列已经写满或者所有音频数据都完成解码 时, 进行音频流数据播放,
否则, 继续对音频流数据缓存队列中的音频流数据进行解码。
6、 如权利要求 4所述的流媒体数据处理方法, 其中, 在显示所述视频帧 时, 采用指针重指向来直接对存储所述视频帧的内存执行引用操作。
7、 一种流媒体数据处理装置, 包括:
分离单元, 用于根据流媒体数据中的流索引, 将流媒体数据分离为音频 流数据和视频流数据;
缓存单元, 用于将所述分离出的音频流数据和视频流数据分别缓存在音 频流数据队列和视频流数据队列中;
音频数据解码单元, 用于对缓存在所述音频流数据队列中的音频流数据 进行解码;
视频数据解码单元, 用于对缓存在所述视频流数据队列中的视频流数据 进行解码;
音视频同步时间确定单元, 用于基于解码后的音频数据的播放回调时间 戳以及流媒体再现设备的系统时间, 确定音视频同步时间;
视频帧处理单元, 用于对于解码后的视频流数据中的每一帧, 基于该视 频帧的时间戳与所确定出的音视频同步时间和视频刷屏时间之和的比较结 果, 按照与所述比较结果对应的预定处理方式对该视频帧进行显示处理。
8、 如权利要求 7所述的流媒体数据处理装置, 其中, 当所述解码后的音 频数据的播放回调时间戳与流媒体再现设备的系统时间不一致时, 所述音视 频同步时间确定单元将所述音视频同步时间确定为等于所述播放回调时间戳 与所述系统时间之和的一半。
9、 如权利要求 7所述的流媒体数据处理装置, 还包括:
时间判断单元, 用于在对视频帧进行解码之前, 判断该视频帧是否是关 键数据帧或者该视频帧的时间戳是否大于等于所确定出的音视频同步时间和 该视频帧解码时间之和,
其中, 在该视频帧是关键数据帧或者该视频帧的时间戳大于等于所确定 出的音视频同步时间和该视频帧解码时间之和时, 所述视频数据解码单元对 该视频帧进行解码, 以及
所述视频帧处理单元还用于在判断该视频帧不是关键数据帧且该视频帧 的时间戳小于所确定出的音视频同步时间和该视频帧解码时间之和时, 丢弃 该视频帧。
10、 如权利要求 7或 9所述的流媒体数据处理装置, 其中, 按照与所述 比较结果对应的预定处理方式对该视频帧进行显示处理包括:
在该视频帧的时间戳大于所确定出的音视频同步时间和该视频刷屏时间 之和时, 所述视频帧处理单元等待该视频帧的显示;
在该视频帧的时间戳等于所确定出的音视频同步时间和该视频刷屏时间 之和时, 所述视频帧处理单元显示该视频帧; 或者
在该视频帧的时间戳小于所确定出的音视频同步时间和该视频刷屏时间 之和时, 所述视频帧处理单元丢弃该视频帧。
11、 如权利要求 7所述的流媒体数据处理装置, 还包括:
音频流数据播放判断单元, 用于在进行音频流数据播放之前, 判断判断 音频播放模块数据缓存队列是否已经写满音频流数据,
其中, 在音频播放模块数据缓存队列已经写满或者所有音频数据都完成 解码时, 所述音频播放模块进行音频流数据播放,
否则, 所述音频数据解码单元继续对音频流数据缓存队列中的音频流数 据进行解码。
12、 如权利要求 10所述的流媒体数据处理装置, 还包括:
内存引用单元, 用于在显示所述视频帧时, 采用指针重指向来直接对存 储所述视频帧的内存执行引用操作。
13、 一种流媒体数据再现设备, 包括如权利要求 7到 12中任何一个所述 的流媒体数据处理装置。
PCT/CN2012/081769 2011-12-05 2012-09-21 流媒体数据处理方法及装置、流媒体数据再现设备 WO2013082965A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/977,017 US8670072B1 (en) 2011-12-05 2012-09-21 Method and apparatus for streaming media data processing, and streaming media playback equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110400172.4 2011-12-05
CN201110400172.4A CN103139636B (zh) 2011-12-05 流媒体数据处理方法及装置、流媒体数据再现设备

Publications (1)

Publication Number Publication Date
WO2013082965A1 true WO2013082965A1 (zh) 2013-06-13

Family

ID=48498846

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/081769 WO2013082965A1 (zh) 2011-12-05 2012-09-21 流媒体数据处理方法及装置、流媒体数据再现设备

Country Status (2)

Country Link
US (1) US8670072B1 (zh)
WO (1) WO2013082965A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038813A (zh) * 2014-06-20 2014-09-10 深圳市九洲电器有限公司 一种多屏互动方法及系统
CN112788366A (zh) * 2020-12-28 2021-05-11 杭州海康威视系统技术有限公司 视频处理的方法和装置
CN114268830A (zh) * 2021-12-06 2022-04-01 咪咕文化科技有限公司 云导播同步方法、装置、设备及存储介质
CN114979718A (zh) * 2022-04-14 2022-08-30 海南车智易通信息技术有限公司 音视频同步续播的方法、装置、电子设备及存储介质
CN115484407A (zh) * 2022-08-25 2022-12-16 奥比中光科技集团股份有限公司 一种多路采集数据的同步输出方法、系统及rgbd相机

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227994B (zh) * 2014-06-26 2019-03-12 Tcl通力电子(惠州)有限公司 增强播放器音视频信号输出的方法及装置
CN105744344B (zh) * 2014-12-11 2019-10-01 深圳Tcl数字技术有限公司 播放控制方法及系统
US9838571B2 (en) 2015-04-10 2017-12-05 Gvbb Holdings S.A.R.L. Precision timing for broadcast network
CN104869341A (zh) * 2015-05-25 2015-08-26 上海琨视电子科技有限公司 一种实现庭审文本与庭审音像同步回放的方法及系统
US10021438B2 (en) 2015-12-09 2018-07-10 Comcast Cable Communications, Llc Synchronizing playback of segmented video content across multiple video playback devices
CN105323260A (zh) * 2015-12-10 2016-02-10 康佳集团股份有限公司 基于p2p流媒体系统的数据调度优化方法及播放系统
CN105635797A (zh) * 2015-12-25 2016-06-01 深圳市路通网络技术有限公司 一种视频播控方法、中间件及系统
US10432988B2 (en) * 2016-04-15 2019-10-01 Ati Technologies Ulc Low latency wireless virtual reality systems and methods
CN106231363A (zh) * 2016-08-08 2016-12-14 上海幻电信息科技有限公司 一种弹幕视频流传输方法及其设备
CN108616776B (zh) * 2018-05-03 2021-05-14 广州酷狗计算机科技有限公司 直播分析数据获取方法及装置
WO2020060551A1 (en) * 2018-09-20 2020-03-26 Oohms Ny Llc Method and system for synchronization of audio content for a remotely displayed video
US20200296462A1 (en) 2019-03-11 2020-09-17 Wci One, Llc Media content presentation
CN110855645B (zh) * 2019-11-01 2021-10-22 腾讯科技(深圳)有限公司 流媒体数据播放方法、装置
CN114071224B (zh) * 2020-07-31 2023-08-25 腾讯科技(深圳)有限公司 视频数据处理方法、装置、计算机设备及存储介质
CN112235597B (zh) * 2020-09-17 2022-07-29 深圳市捷视飞通科技股份有限公司 流媒体直播音视频同步保护方法、装置、计算机设备
CN112637663B (zh) * 2021-01-28 2023-02-28 广州敏视数码科技有限公司 一种车载dvr数据同步播放的方法
CN112911377B (zh) * 2021-02-01 2022-10-21 华录智达科技股份有限公司 一种视频播放和缓存间适配系统及算法
CN113132672B (zh) * 2021-03-24 2022-07-26 联想(北京)有限公司 一种数据处理方法以及视频会议设备
CN114257771B (zh) * 2021-12-21 2023-12-01 杭州海康威视数字技术股份有限公司 一种多路音视频的录像回放方法、装置、存储介质和电子设备
CN114339353B (zh) * 2021-12-31 2023-09-29 晶晨半导体科技(北京)有限公司 音视频同步方法和装置及电子设备和计算机可读存储介质
CN114666516A (zh) * 2022-02-17 2022-06-24 海信视像科技股份有限公司 显示设备及流媒体文件合成方法
CN114554269A (zh) * 2022-02-25 2022-05-27 深圳Tcl新技术有限公司 数据处理方法、电子设备及计算机可读存储介质
CN114630170B (zh) * 2022-03-24 2023-10-31 抖音视界有限公司 一种音视频同步方法、装置、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1767601A (zh) * 2005-10-21 2006-05-03 西安交通大学 一种支持多源流媒体的同步播放控制方法
CN1917652A (zh) * 2006-09-07 2007-02-21 四川长虹电器股份有限公司 Ip网络流媒体音视频同步播放方法
CN101127917A (zh) * 2007-09-06 2008-02-20 中兴通讯股份有限公司 一种互联网流媒体格式音视频同步的方法及其系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7961792B2 (en) * 2006-05-16 2011-06-14 Lsi Corporation Robust system for maintaining audio/video synchronization during playback of multimedia streams with no embedded time stamps

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1767601A (zh) * 2005-10-21 2006-05-03 西安交通大学 一种支持多源流媒体的同步播放控制方法
CN1917652A (zh) * 2006-09-07 2007-02-21 四川长虹电器股份有限公司 Ip网络流媒体音视频同步播放方法
CN101127917A (zh) * 2007-09-06 2008-02-20 中兴通讯股份有限公司 一种互联网流媒体格式音视频同步的方法及其系统

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038813A (zh) * 2014-06-20 2014-09-10 深圳市九洲电器有限公司 一种多屏互动方法及系统
CN104038813B (zh) * 2014-06-20 2017-09-26 深圳市九洲电器有限公司 一种多屏互动方法及系统
CN112788366A (zh) * 2020-12-28 2021-05-11 杭州海康威视系统技术有限公司 视频处理的方法和装置
CN114268830A (zh) * 2021-12-06 2022-04-01 咪咕文化科技有限公司 云导播同步方法、装置、设备及存储介质
CN114979718A (zh) * 2022-04-14 2022-08-30 海南车智易通信息技术有限公司 音视频同步续播的方法、装置、电子设备及存储介质
CN114979718B (zh) * 2022-04-14 2023-09-19 海南车智易通信息技术有限公司 音视频同步续播的方法、装置、电子设备及存储介质
CN115484407A (zh) * 2022-08-25 2022-12-16 奥比中光科技集团股份有限公司 一种多路采集数据的同步输出方法、系统及rgbd相机
CN115484407B (zh) * 2022-08-25 2023-07-04 奥比中光科技集团股份有限公司 一种多路采集数据的同步输出方法、系统及rgbd相机

Also Published As

Publication number Publication date
US20140049689A1 (en) 2014-02-20
CN103139636A (zh) 2013-06-05
US8670072B1 (en) 2014-03-11

Similar Documents

Publication Publication Date Title
WO2013082965A1 (zh) 流媒体数据处理方法及装置、流媒体数据再现设备
TWI502977B (zh) 影音播放裝置、影音處理裝置、系統以及方法
US8238420B1 (en) Video content transcoding for mobile devices
WO2020248909A1 (zh) 视频解码方法、装置、计算机设备及存储介质
WO2020029935A1 (zh) 视频直播处理方法、装置及终端
EP2023627A2 (en) Content playback device, content playback method, computer-readable storage medium, and content playback system
WO2021159782A1 (zh) 数据传输方法、装置、终端、存储介质和系统
CN103200461A (zh) 一种多台播放终端同步播放系统及播放方法
WO2019101089A1 (zh) 视频发送、接收方法和装置及终端
US11356739B2 (en) Video playback method, terminal apparatus, and storage medium
WO2019170073A1 (zh) 媒体播放
WO2020155964A1 (zh) 音视频的切换方法、装置、计算机设备及可读存储介质
WO2018086303A1 (zh) 一种广告插播方法、装置及可读存储介质
CN106792154B (zh) 视频播放器的跳帧同步系统及其控制方法
CN104053002A (zh) 视频解码方法和视频解码装置
JP4511952B2 (ja) メディア再生装置
US11818189B2 (en) Method and apparatus for media streaming
KR100651566B1 (ko) 이동통신 단말기에서 출력 버퍼링을 이용한 멀티미디어재생 장치 및 그 제어 방법
US20150189365A1 (en) Method and apparatus for generating a recording index
US20210400334A1 (en) Method and apparatus for loop-playing video content
US20140198839A1 (en) Low latency sub-frame level video decoding
TWI643488B (zh) 具有初始化片段之視訊及音訊之寫碼
JP4579877B2 (ja) 再生装置及び再生方法
CN103139636B (zh) 流媒体数据处理方法及装置、流媒体数据再现设备
JP2003018567A (ja) データ再生装置及びデータ送信装置

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 13977017

Country of ref document: US

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

Ref document number: 12855879

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 26-09-2014)

122 Ep: pct application non-entry in european phase

Ref document number: 12855879

Country of ref document: EP

Kind code of ref document: A1