WO2018120557A1 - 一种音视频同步处理的方法和装置、存储介质 - Google Patents

一种音视频同步处理的方法和装置、存储介质 Download PDF

Info

Publication number
WO2018120557A1
WO2018120557A1 PCT/CN2017/082622 CN2017082622W WO2018120557A1 WO 2018120557 A1 WO2018120557 A1 WO 2018120557A1 CN 2017082622 W CN2017082622 W CN 2017082622W WO 2018120557 A1 WO2018120557 A1 WO 2018120557A1
Authority
WO
WIPO (PCT)
Prior art keywords
system clock
value
video
current
audio
Prior art date
Application number
PCT/CN2017/082622
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 WO2018120557A1 publication Critical patent/WO2018120557A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/242Synchronization processes, e.g. processing of PCR [Program Clock References]
    • 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
    • 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/4305Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
    • 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
    • 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/8547Content authoring involving timestamps for synchronizing content

Definitions

  • the present invention relates to digital television technology, and in particular, to a method and apparatus for audio and video synchronization processing, and a storage medium.
  • the encoder has a system clock (STC) with a frequency of 27 megahertz (MHz), which is used to generate the correct display time stamp (PTS, Presentation Time Stamp) and decoding time stamp (DTS, for audio and video, Decode Time Stamp) can also be used to indicate the instantaneous sample value of the system clock itself.
  • STC system clock
  • PTS Display Time Stamp
  • DTS decoding time stamp
  • the transmitting end inserts the instantaneous sample value of the system clock into the Moving Picture Experts Group (MPEG) Transport Stream (TS, Transport Stream, at the time when the Program Clock Reference field (PCR) field leaves the multiplexer.
  • MPEG Moving Picture Experts Group
  • TS Moving Picture Experts Group
  • Transport Stream Transport Stream
  • the receiver can recover the 27 MHz system clock synchronized with the encoder by extracting the PCR field, and then use the displayed timestamp (PTS) in the packetized elementary stream (PES, Packet Elementary Stream) stream. , Presentation Time Stamp) to achieve audio and video synchronization.
  • PTS displayed timestamp
  • PES packetized elementary stream
  • Packet Elementary Stream Packet Elementary Stream
  • the length of the PCR value in the MPEG-TS stream is 42 bits, including the 33-bit system clock basis (PCR_base) value and the 9-bit system clock extension value (PCR_extension).
  • PCR_base is sampled by a 90KHz clock, and its function is to The initial value for the local STC count, so that the PCR value has the same time starting point as the PTS and DTS.
  • the PCR_extension is sampled by a 27MHz clock, which is used to correct the decoder's system clock through the phase-locked loop of the receiving end, thereby obtaining a 27MHz system clock consistent with the encoder.
  • an embodiment of the present invention is to provide a method and apparatus for audio and video synchronization processing, and a storage medium, which can accurately reconstruct a system clock consistent with an encoding end at a decoding end, thereby providing accurate synchronization of audio and video. Clock reference.
  • an embodiment of the present invention provides a method for audio and video synchronization processing, where the method includes:
  • the system clock is reconstructed by adjusting a counting step of the system clock
  • comparing the clock reference value of the current program with the current system clock value to obtain a first comparison result including:
  • the system clock frequency is N times of a coding system clock frequency, and N is an integer greater than or equal to 1;
  • the system clock is reconstructed by adjusting the counting step of the system clock, including:
  • the system clock count step size is decreased.
  • the method further includes:
  • the adjusting the playback speed of the video according to the second comparison result includes:
  • the video decoding speed is adjusted, including:
  • I Intra-Prediction
  • B bi-directional interpolated prediction
  • P Prediction
  • the video decoding speed is greater than a preset normal speed when the display timestamp minus the system clock base value is greater than or equal to the preset time interval, and suspending decoding of the current video frame and repeating The previous video frame is displayed until the system clock base value is the same as the display time stamp, and the current video frame is continuously decoded and the corresponding image is displayed.
  • the performing the corresponding synchronization adjustment according to the structure of the video frame includes:
  • the current video frame is discarded, the next video frame is decoded, and the previous video frame is displayed at the same time;
  • the previous video frame is frozen and decoding is stopped, waiting for the next I frame or video sequence.
  • the adjusting the playing speed of the audio according to the second comparison result includes:
  • the audio decoding speed is adjusted.
  • the audio decoding speed is adjusted, including:
  • the audio decoding speed is greater than a preset normal speed, and the last sampling point is repeated.
  • an embodiment of the present invention provides an apparatus for audio and video synchronization processing, where the apparatus includes: a comparison module and an adjustment module;
  • the comparing module is configured to compare a clock reference value of the current program with a current system clock value to obtain a first comparison result
  • the adjusting module when the first comparison result does not satisfy the preset determination condition, reconstructing the system clock by adjusting a counting step of the system clock;
  • the comparison module is further configured to compare the absolute value of the difference between the system clock base value and the display time stamp in the reconstructed system clock, and the preset time interval, to obtain a second comparison result;
  • the preset time interval is M times the time between audio or video frames, and M is greater than 0 and less than 1;
  • the adjustment module is further configured to adjust a playback speed of the audio or video according to the second comparison result.
  • the device further includes: a loading module, a counting module, a reading module, and a computing module; wherein
  • the loading module is configured to load a clock reference value of the first program or a clock reference value of the reloaded program as a count initial value into the system clock counter;
  • the counting module is configured to drive the system clock counter by using a system clock frequency to increment the system clock; wherein the system clock frequency is N times the encoding system clock frequency, and N is an integer greater than or equal to 1. ;
  • the reading module is configured to, when detecting a program clock reference interrupt, read a clock reference value of the current program, and read a current system clock value from the system clock counter;
  • the calculating module calculates an absolute value of a difference between a clock reference value of the current program and the current system clock value, and determines the absolute value of the difference as the first comparison result.
  • the comparing module is configured to compare the first comparison result with a preset determining condition
  • the adjusting module is configured to compare a clock reference value of the current program with the current system clock value when the first comparison result does not satisfy a preset determination condition
  • the device further includes: a holding module; wherein
  • the holding module is configured to keep the counting step of the system clock unchanged when the absolute value of the difference between the clock reference value of the current program and the current system clock value satisfies a preset determination condition.
  • the adjusting module is configured to perform corresponding adjustment on a decoding speed of the video by using the second comparison result
  • the video decoding speed is adjusted.
  • the adjusting module is configured to determine that the video decoding speed is less than the pre-determined when the difference between the system clock base value minus the display timestamp is greater than or equal to the preset time interval.
  • the normal speed is set, and the corresponding synchronization adjustment is performed according to the structure of the video frame; wherein the structure of the video frame is: a B frame, an I frame, and a P frame;
  • the adjusting module is configured to discard the current video frame, decode the next video frame, and display the previous video frame when the video frame is a B frame;
  • the previous video frame is frozen and the decoding is stopped, waiting for the next I frame or video sequence.
  • the adjusting module is configured to perform corresponding adjustment on a decoding speed of the audio by using the second comparison result
  • the audio decoding speed is adjusted.
  • the adjusting module is configured to determine that the audio decoding speed is less than when the difference between the system clock system base value minus the display time stamp is greater than or equal to the preset time interval. Preset normal speed, skip one sample point;
  • the audio decoding speed is greater than a preset normal speed, and the last sampling point is repeated.
  • an embodiment of the present invention provides an apparatus for audio and video synchronization processing, including:
  • a memory configured to store an executable program
  • the processor is configured to implement the method for synchronizing audio and video provided by the embodiment of the present invention when the executable program is executed.
  • an embodiment of the present invention provides a storage medium, where an executable program is stored, and the executable program is executed by a processor to implement a method for synchronizing audio and video provided by the embodiment of the present invention.
  • the counting step of the current system clock is adjusted to reconstruct the system clock, and then according to the reconstructed system clock.
  • the comparison between the absolute value of the difference between the system clock base value and the display timestamp and the preset time interval adjusts the audio/video playback speed, and accurately reconstructs the system clock consistent with the encoding end at the decoding end, thereby synchronizing the audio and video.
  • FIG. 1 is a schematic diagram of an apparatus for reconstructing a local system clock and audio and video synchronization processing according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart 1 of an audio and video synchronization processing method according to an embodiment of the present invention
  • FIG. 3 is a second schematic flowchart of an audio and video synchronization processing method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart 3 of a method for processing audio and video synchronization according to an embodiment of the present invention
  • FIG. 5 is a flowchart of performing system clock reconstruction by using a PCR and a local STC counter according to an embodiment of the present invention
  • FIG. 6 is a schematic flowchart 4 of an audio and video synchronization processing method according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart 5 of an audio and video synchronization processing method according to an embodiment of the present disclosure
  • FIG. 8 is a flowchart of synchronizing audio and video by using STC_base and PTS according to an embodiment of the present invention
  • FIG. 9 is a schematic structural diagram 1 of an audio and video synchronization processing apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram 2 of an audio and video synchronization processing apparatus according to an embodiment of the present disclosure.
  • FIG. 11 is a block diagram of an audio and video synchronization processing hardware module according to an embodiment of the present invention.
  • the reconstruction of the system clock is inaccurate, which causes an error in audio and video synchronization.
  • the audio and video synchronization process is performed on the basis of reconstructing the local system clock by reconstructing the local system clock.
  • FIG. 1 it is a schematic diagram of an apparatus for reconstructing a local system clock and audio and video synchronization processing according to an embodiment of the present invention.
  • the device needs to establish an STC counter locally.
  • the current PCR value is loaded into the STC counter.
  • the STC counter is driven by the 108 MHz clock, after detecting the PCR interrupt.
  • the read STC counter value is compared with the current PCR value. If the deviation is within an acceptable range, the adjustment is not performed. Otherwise, the software needs to adjust the STC count step size to adjust the STC counter, thereby correcting the system clock.
  • the low-pass filter is used to lock the phase with the voltage-controlled oscillator to avoid large deviations caused by transmission errors.
  • the clock selected to drive the local STC counter in the device is 108 MHz, and the encoding clock is 27 MHz, which is 4 times that of the encoder clock.
  • the frequency is increased here to improve the accuracy of the counter, and also avoids the problem that the reconstructed system clock is not accurate due to inaccurate odd frequency division.
  • the PCR in the device is extracted from the adjustment field (adaption_field) of the MPEG-TS stream by a demultiplexer (that is, a transport stream demultiplexer), and the extraction process of the PCR is implemented by hardware.
  • a demultiplexer that is, a transport stream demultiplexer
  • the hardware gives a PCR interrupt and updates the current PCR and STC counters to registers for software reading.
  • the PTS/DTS in the device is also extracted by the demultiplexer and sent to the decoder.
  • the PTS/DTS is used as the elementary stream (ES) in the input buffer that is then sent to the decoder.
  • ES elementary stream
  • Elementary Stream The display/decoding time of the data, but the ES sent to the buffer at this time The data is not necessarily decoded immediately. Therefore, the decoder must store the PTS/DTS in the FIFO (First Input First Output) and record the position of the code stream corresponding to the PTS/DTS, which facilitates subsequent decoding. Synchronize with the display.
  • FIFO First Input First Output
  • the system clock can be accurately reconstructed at the decoding end, and when the system clock is deviated, it can be adjusted by software in a short time, so that the system clock is consistent with the encoding end, thereby providing an accurate reference for audio and video synchronization. clock.
  • FIG. 2 a method for audio and video synchronization processing according to an embodiment of the present invention is shown, where the method includes:
  • step S101 includes steps S1011 to S1014:
  • the current PCR value is loaded into the local STC counter as the initial value of the count.
  • the local STC counter is also counted separately by STC_base and STC_extension;
  • STC_base is the base value of the STC, which is the initial value of the high 33-bit field of the STC, PCR_base, and then counted up by the 90 kHz clock, mainly used for PTS and DTS comparison, thereby adjusting audio and video decoding and display speed;
  • STC_extension is the extended value of STC, which is the initial value of STC's low 9-bit field is PCR_extension, and then counts up under the driving of 27MHz clock, mainly used for system clock recovery.
  • the local STC counter is driven by the local system clock frequency to count the STC.
  • the local system clock frequency is N times the encoding system clock frequency, and N is an integer greater than or equal to 1.
  • the local STC counter is driven by a local 108 MHz clock. Count down.
  • the encoding system clock is 27MHz.
  • the 108MHz local clock is used here to improve the accuracy of the counter, making it more precise to adjust the phase-locked loop through software.
  • STC_base adds 1 every 1200 clock cycles, and STC_extension adds 1 every 4 clock cycles.
  • the hardware extracts the current STC value and PCR value into the register for software query, and gives a PCR interrupt.
  • the software detects the interrupt, the current STC and PCR values can be read.
  • step S102 includes steps S1021 through S1024:
  • the ⁇ PCR is divided into two parts: ⁇ PCR_base and ⁇ PCR_extension.
  • the current PCR value is compared with the current STC value, and the STC counting speed is determined according to the comparison result between the current PCR value and the current STC value, thereby correspondingly adjusting the STC counting step size.
  • the initial value of the STC count step is 2 30 .
  • the method further includes:
  • the counting step size of the STC is kept unchanged.
  • the demultiplexer performs header analysis of the MPEG-2 TS packet
  • the PCR information is extracted and sent to the system clock recovery circuit.
  • each new PCR arrives, it is compared with the local STC counter to recover and lock the system clock. In this way, if the local system clock is deviated from the encoding system clock during the program playing, it can be corrected after the next PCR, providing an accurate system clock reference for the audio and video synchronization processing.
  • the above process is a process of reconstructing the system clock, see Figure 5, which shows a flow chart for system clock reconstruction using PCR and local STC counters.
  • the audio and video synchronization process can be performed on the basis of reconstructing the system clock, and the audio and video synchronization process is performed. as follows:
  • the software calculates the absolute value of the difference between the STC_base value and the PTS, that is, the value of
  • the audio/video interframe time is ⁇ PTS
  • the preset time interval refers to M times the ⁇ PTS, where M is greater than 0 and less than 1.
  • the M value is set to 0.5, so 0.5 times the interframe time is ⁇ PTS/2. Comparing the absolute value of the STC_base value of the audio/video with the PTS and the inter-frame time, that is,
  • the step S104 is divided into two cases of decoding video and decoding audio, and S104A1 to S104A3 are adjustment processes of the video decoding speed when the video is decoded, and S104B1 to S104B3 are adjustment processes of the audio decoding speed when the audio is decoded.
  • the specific process includes steps S104A1 to S104A3:
  • S104A1 Perform corresponding adjustment on the decoding speed of the video by using the second comparison result.
  • the playback speed of the video can be adjusted by performing corresponding adjustment on the decoding speed of the video according to the second comparison result.
  • the process of determining and adjusting the video decoding speed specifically includes the following two processes:
  • the video decoding speed is less than a preset normal speed, and corresponding according to the structure of the video frame. Synchronization adjustment; wherein the structure of the video frame is: a bidirectional prediction frame B frame, an intra prediction frame I frame, and a unidirectional prediction frame P frame.
  • the video decoding speed is synchronously adjusted accordingly. Therefore, the foregoing process specifically includes:
  • the current frame is discarded, the next frame is decoded, and the previous frame is displayed at the same time;
  • the previous frame image is frozen and decoding is stopped, waiting for the next I frame or video sequence.
  • the video decoding speed is greater than a preset normal speed, and the previous video frame is repeatedly displayed, and the video decoding is suspended.
  • the STC_base value is the same as the PTS, the current image is displayed.
  • the specific process includes steps S104B1 to S104B3:
  • S104B1 Perform a corresponding adjustment on the decoding speed of the audio by using the second comparison result.
  • the playback speed of the audio can be adjusted by performing corresponding adjustment on the decoding speed of the audio according to the second comparison result.
  • the process of determining and adjusting the audio decoding speed specifically includes:
  • the audio decoding speed is less than a preset normal speed, and one sampling point is skipped;
  • the audio decoding speed is greater than a preset normal speed, and the last sampling point is repeated.
  • the above process is a process of synchronizing audio and video on the basis of reconstructing the system clock.
  • Fig. 8 there is shown a flow chart for synchronizing audio and video with STC_base and PTS.
  • the embodiment of the present invention provides a method for synchronizing audio and video.
  • the current STC count step size reconstruction system clock STC is adjusted, and then according to the reconstructed.
  • the comparison between the absolute value of the difference between the STC_base value and the display timestamp PTS in the system clock STC and the preset time interval adjusts the audio/video playback speed, and accurately reconstructs the system clock consistent with the encoding end at the decoding end, thereby
  • the synchronization of audio and video provides an accurate clock reference, which solves the problem of lip-synchronization during video playback.
  • an apparatus 9 for audio and video synchronization processing according to an embodiment of the present invention is shown, where the apparatus includes: a comparison module 901 and an adjustment module 902;
  • the comparing module 901 is configured to compare a clock reference value of the current program with a current system clock value to obtain a first comparison result
  • the adjusting module 902 is configured to: when the first comparison result does not satisfy the preset determining condition, reconfigure the system clock by adjusting a counting step of the system clock;
  • the comparison module 901 is further configured to compare the absolute value of the difference between the system clock base value and the display time stamp in the reconstructed system clock with a preset time interval to obtain a second comparison result;
  • the preset time interval is M times the time between audio or video frames. And M is greater than 0 and less than 1;
  • the adjustment module 902 is further configured to adjust a playback speed of the audio or video according to the second comparison result.
  • the apparatus further includes: a loading module 903, a counting module 904, a reading module 905, and a computing module 906;
  • the loading module 903 is configured to load a clock reference value of the first program or a clock reference value of the reloaded program as a count initial value into the system clock counter;
  • the counting module 904 is configured to drive the system clock counter by using a system clock frequency to increment the system clock.
  • the system clock frequency is N times the encoding system clock frequency, and N is greater than or equal to 1.
  • the reading module 905 is configured to, when detecting a program clock reference interrupt, read a clock reference value of the current program, and read a current system clock value from the system clock counter;
  • the calculating module 906 is configured to calculate an absolute value of a difference between a clock reference value of the current program and the current system clock value, and determine the absolute value of the difference as the first comparison result.
  • the comparison module 901 is configured to compare the first comparison result with a preset determination condition
  • the adjusting module 902 is configured to compare a clock reference value of the current program with the current system clock value when the first comparison result does not satisfy a preset determination condition;
  • the device further includes: a holding module 907;
  • the holding module 907 is configured to: when a clock reference value of the current program is related to the current system When the absolute value of the difference of the system clock values satisfies the preset determination condition, the counting step length of the system clock is kept unchanged.
  • the adjusting module 902 is configured to perform corresponding adjustment on a decoding speed of the video by using the second comparison result
  • the video decoding speed is adjusted.
  • the adjusting module 902 is configured to: when the difference between the STC_base value minus the PTS is greater than or equal to the preset time interval, the video decoding speed is less than a preset.
  • the normal speed is set, and the corresponding synchronization adjustment is performed according to the structure of the video frame; wherein the structure of the video frame is: a B frame, an I frame, and a P frame;
  • the adjusting module 902 is configured to: when the video frame is a B frame, discard the current video frame, decode the next video frame, and display the previous video frame;
  • the previous video frame is frozen and the decoding is stopped, waiting for the next I frame or video sequence.
  • the adjusting module 902 is configured to perform corresponding adjustment on a decoding speed of the audio by using the second comparison result
  • the adjusting module 902 is configured to determine, when the difference between the system clock system base value and the display time stamp is greater than or equal to the preset time interval.
  • the audio decoding speed is less than the preset normal speed, and one sampling point is skipped;
  • the audio decoding speed is greater than a preset normal speed, and the last sampling point is repeated.
  • the embodiment of the present invention provides an apparatus for synchronizing audio and video.
  • the current STC count step size reconstruction system clock STC is adjusted, and then according to the reconstructed.
  • the comparison between the absolute value of the difference between the STC_base value and the display timestamp PTS in the system clock STC and the preset time interval adjusts the audio/video playback speed, and accurately reconstructs the system clock consistent with the encoding end at the decoding end, thereby
  • the synchronization of audio and video provides an accurate clock reference, which solves the problem of lip-synchronization during video playback.
  • FIG. 11 shows a hardware implementation device involved in the reconstruction of the system clock and the audio and video synchronization processing according to the embodiment of the present invention.
  • the hardware implementation device may specifically include three parts: CPU, demultiplexer (denoted as demux) and decoder (denoted as decoder).
  • the demultiplexer is divided into a packet header parsing (denoted as ts_ph_get) module and a PRC rebuild (PCR_recovery) module, wherein the ts_ph_get module performs packet header parsing, extracts PCR_flag and PCR value in the adjustment field of the MPEG2-TS stream, and sends the PCR_recovery
  • the module performs a system clock reconstruction.
  • the PCR_recovery module saves the PCR value.
  • the STC step can be adjusted by the CPU to adjust the STC counter to be consistent with the current PCR.
  • the PCR_recovery module sends a pcr_interrupt signal to the CPU, and the pcr_interrupt signal indicates that the PCR_recovery module extracts the PCR interrupt to the After receiving the interrupt, the CPU queries stc_regs/pcrregs, and the software calculates the difference between the STC and the PCR, and then adjusts the STC count step according to the difference, and feeds back to the PCR_recovery module.
  • the decoder is divided into a FIFO module, an ES data buffer, a decoding module, and a display module.
  • the demultiplexer When the demultiplexer starts a new frame image, the PTS/DTS corresponding to the frame image is written into the FIFO module, and each time a frame image is decoded, the corresponding DTS is read from the FIFO and compared with the STC. When the two are equal, decoding can be started in the decoding module. At the same time, the demultiplexer demux writes the ES data into the ES data buffer, and the ES data buffer sends the ES data to the decoding module for decoding. Before each display unit starts to display, it is compared with the STC by its corresponding PTS. When the two are equal, the display can be started in the display module.
  • the ES data is a continuous stream of video, audio or data of the basic stream.
  • one PES packet may have multiple frames of images, only the first frame image has PTS, and the other image frames in the PES packet have no PTS. If there is no PTS in one frame of image, an increment can be added to the previous PTS to obtain a PTS corresponding to the frame image, which is sent to the FIFO for management, and the audio and video synchronization processing is performed according to the above method.
  • the PES is a packetized basic code stream, and the basic code stream ES stream is divided into data packets of different lengths according to requirements, and the packet header is formed to form a packaged basic code stream PES stream.
  • the embodiment of the invention provides a hardware implementation device for an audio and video synchronization processing device, including:
  • a memory configured to store an executable program
  • the processor is configured to implement the method for synchronizing audio and video provided by the foregoing embodiments of the present invention when the executable program is executed, and the method for synchronizing audio and video as shown in any of FIGS. 2 to 8 , for example, at present
  • the current STC count step size reconstruction system clock STC is adjusted, and then the absolute value of the difference between the STC_base value and the display time stamp PTS in the reconstructed system clock STC is determined.
  • the sound/video playback speed is adjusted, and the system clock consistent with the encoding end is accurately reconstructed at the decoding end, thereby providing an accurate clock reference for the synchronization of the audio and video, and solving the video broadcast.
  • the lip tone is not synchronized during the release process.
  • the embodiment of the invention provides a readable storage medium, which can be a random access memory (RAM), a read only memory (ROM), an electrically erasable programmable read only memory ( Electrically Erasable Programmable Read-Only Memory), flash or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage device, cassette, tape, disk storage or other magnetic storage device.
  • the readable storage medium stores an executable program, and the executable program is executed by the processor to implement the audio and video synchronization processing method provided by the embodiment of the present invention, and the audio and video synchronization processing shown in any of the figures of FIG. 2 to FIG. Methods.
  • the counting step of the current system clock is adjusted to reconstruct the system clock, and then according to the reconstructed system clock.
  • the comparison between the absolute value of the difference between the system clock base value and the display timestamp and the preset time interval adjusts the audio/video playback speed, and accurately reconstructs the system clock consistent with the encoding end at the decoding end, thereby synchronizing the audio and video.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明实施例公开了一种音视频同步处理的方法,所述方法包括:将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果;当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟;将所述重建的系统时钟中的系统时钟基础数值与显示时间戳之间的差值绝对值、与预设的时间间隔进行比较,获得第二比较结果;其中,所述预设的时间间隔是音频或视频帧间时间的M倍,且M大于0小于1;根据所述第二比较结果调整所述音频或视频的播放速度。本发明实施例同时还公开了一种音视频同步处理的装置、存储介质。

Description

一种音视频同步处理的方法和装置、存储介质
相关申请的交叉引用
本申请基于申请号为201611225383.8、申请日为2016年12月26日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的内容在此引入本申请作为参考。
技术领域
本发明涉及数字电视技术,尤其涉及一种音视频同步处理的方法和装置、存储介质。
背景技术
编码器中有一个频率为27兆赫兹(MHz)的系统时钟(STC,System Time Clock),此时钟用来产生音视频的正确显示时间戳(PTS,Presentation Time Stamp)和解码时间戳(DTS,Decode Time Stamp),同时也可用来指示系统时钟本身的瞬时采样值。发送端在节目时钟参考(PCR,Program Clock Reference)字段离开复用器的时刻,将系统时钟的瞬时采样值插入到动态图像专家组(MPEG,Moving Picture Experts Group)传输流(TS,Transport Stream,传输流)流的PCR域中,接收端可以通过提取PCR字段来恢复与编码器同步的27MHz系统时钟,再利用打包的基本码流(PES,Packet Elementary Stream)流中的、显示时间戳(PTS,Presentation Time Stamp)来实现音频和视频的同步。
MPEG-TS流中的PCR值的长度为42比特(bit),包括33bit的系统时钟基础(PCR_base)数值和9bit的系统时钟延伸数值(PCR_extension)。其中PCR_base是以90KHz时钟进行采样的,其作用是在切换节目时,提 供本地STC计数的初始值,使得PCR值与PTS、DTS尽可能的有相同的时间起点。PCR_extension是以27MHz时钟进行采样的,其作用是通过接收端的锁相环修正解码器的系统时钟,从而获得与编码器一致的27MHz系统时钟。
然而,在一个音视频实时播放的系统中,唇音不同步的现象时有发生,主要就是由于重建的系统时钟不精准导致的。
发明内容
为解决上述技术问题,本发明实施例期望提供一种音视频同步处理的方法和装置、存储介质,能在解码端精准地重建与编码端一致的系统时钟,从而为音视频的同步提供准确的时钟参考。
本发明实施例的技术方案是这样实现的:
第一方面,本发明实施例提供了一种音视频同步处理的方法,所述方法包括:
将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果;
当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟;
将所述重建的系统时钟中的系统时钟基础数值与显示时间戳之间的差值绝对值、与预设的时间间隔进行比较,获得第二比较结果;其中,所述预设的时间间隔是音频或视频帧间时间的M倍,且M大于0小于1;
根据所述第二比较结果调整所述音频或视频的播放速度。。
在上述方案中,所述将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果,包括:
将第一个节目的时钟参考值或重新加载的节目的时钟参考值作为计数初值载入系统时钟计数器;
利用系统时钟频率驱动所述系统时钟计数器,对所述系统时钟进行递增计数;其中,所述系统时钟频率为编码系统时钟频率的N倍,N为大于等于1的整数;
当检测到节目时钟参考中断时,读取所述当前节目的时钟参考值,从所述系统时钟计数器中读取当前系统时钟值;
计算所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值,将所述差值绝对值确定为所述第一比较结果。
在上述方案中,所述当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟,包括:
将所述第一比较结果与预设的判断条件进行比较;
当所述第一比较结果不满足预设的判断条件时,将所述当前节目的时钟参考值与所述当前系统时钟值进行比较;
若所述当前节目的时钟参考值大于所述当前系统时钟值,则增大所述系统时钟的计数步长;
若所述当前节目时钟参考值小于所述当前系统时钟值,则减小所述系统时钟计数步长。
在上述方案中,所述方法还包括:
当所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值满足预设的判断条件时,保持所述系统时钟的计数步长不变。
在上述方案中,当解码视频时,所述根据所述第二比较结果调整所述视频的播放速度,包括:
利用所述第二比较结果对所述视频的解码速度进行对应的调整;
当所述系统时钟基础数值与所述显示时间戳的差值绝对值小于所述预设的时间间隔时,保持视频解码速度;
当所述系统时钟基础数值与所述显示时间戳的差值绝对值大于等于所 述预设的时间间隔时,对视频解码速度进行调整。
在上述方案中,所述当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对视频解码速度进行调整,包括:
当所述系统时钟基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度小于预设的正常速度,根据所述视频帧的结构进行相应的同步调整;其中,所述视频帧的结构分别为:帧内预测(I,Intra-Prediction)帧、双向预测内插编码帧(B,Bi-directional interpolated prediction)帧和单向预测(P,Prediction)帧;
当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度大于预设的正常速度,暂停解码当前视频帧并重复显示上一个视频帧,直至所述系统时钟基础数值与所述显示时间戳相同时,继续解码当前视频帧并显示对应的图像。
在上述方案中,所述根据所述视频帧的结构进行相应的同步调整,包括:
当所述视频帧为B帧时,丢弃当前视频帧,解码下一视频帧,同时显示前一视频帧;
当所述视频帧为I帧或P帧时,冻结前一视频帧并停止解码,等待下一个I帧或视频序列。
在上述方案中,所述根据所述第二比较结果调整所述音频的播放速度,包括:
利用所述第二比较结果对所述音频的解码速度进行对应的调整;
当所述系统时钟基础数值与显示时间戳的差值绝对值小于所述预设的时间间隔时,保持音频解码速度;
当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对所述音频解码速度进行调整。
在上述方案中,所述当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对所述音频解码速度进行调整,包括:
当所述系统时钟系基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述音频解码速度小于预设的正常速度,跳过一个采样点;
当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,所述音频解码速度大于预设的正常速度,重复上一个采样点。
第二方面,本发明实施例提供了一种音视频同步处理的装置,所述装置包括:比较模块和调整模块;其中,
所述比较模块,配置为将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果;
所述调整模块,当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟;
所述比较模块,还配置为将所述重建的系统时钟中的系统时钟基础数值与显示时间戳之间的差值绝对值、与预设的时间间隔进行比较,获得第二比较结果;其中,所述预设的时间间隔是音频或视频帧间时间的M倍,且M大于0小于1;
所述调整模块,还配置为根据所述第二比较结果调整所述音频或视频的播放速度。
在上述方案中,所述装置还包括:加载模块、计数模块、读取模块和计算模块;其中,
所述加载模块,配置为将第一个节目的时钟参考值或重新加载的节目的时钟参考值作为计数初值载入系统时钟计数器;
所述计数模块,配置为利用系统时钟频率驱动所述系统时钟计数器,对所述系统时钟进行递增计数;其中,所述系统时钟频率为编码系统时钟频率的N倍,N为大于等于1的整数;
所述读取模块,配置为当检测到节目时钟参考中断时,读取所述当前节目的时钟参考值,从所述系统时钟计数器中读取当前系统时钟值;
所述计算模块,计算所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值,将所述差值绝对值确定为所述第一比较结果。
在上述方案中,所述比较模块,配置为将所述第一比较结果与预设的判断条件进行比较;
所述调整模块,配置为当所述第一比较结果不满足预设的判断条件时,将所述当前节目的时钟参考值与所述当前系统时钟值进行比较;
以及,若所述当前节目的时钟参考值大于所述当前系统时钟值,则增大所述系统时钟的计数步长;
以及,若所述当前节目时钟参考值小于所述当前系统时钟值,则减小所述系统时钟计数步长。
在上述方案中,所述装置还包括:保持模块;其中,
所述保持模块,配置为当所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值满足预设的判断条件时,保持所述系统时钟的计数步长不变。
在上述方案中,所述调整模块,配置为利用所述第二比较结果对所述视频的解码速度进行对应的调整;
以及,当所述系统时钟基础数值与所述显示时间戳的差值绝对值小于所述预设的时间间隔时,保持视频解码速度;
以及,当所述系统时钟基础数值与所述显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对视频解码速度进行调整。
在上述方案中,所述调整模块,配置为当所述系统时钟基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度小于预设的正常速度,根据所述视频帧的结构进行相应的同步调整;其中,所述视频帧的结构分别为:B帧、I帧和P帧;
以及,当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度大于预设的正常速度,暂停解码当前视频帧并重复显示上一个视频帧,直至所述系统时钟基础数值与所述显示时间戳相同时,继续解码当前视频帧并显示对应的图像。
在上述方案中,所述调整模块,配置为当所述视频帧为B帧时,丢弃当前视频帧,解码下一视频帧,同时显示前一视频帧;
以及,当所述视频帧为I帧或P帧时,冻结前一视频帧并停止解码,等待下一个I帧或视频序列。
在上述方案中,所述调整模块,配置为利用所述第二比较结果对所述音频的解码速度进行对应的调整;
以及,当所述系统时钟基础数值与显示时间戳的差值绝对值小于所述预设的时间间隔时,保持音频解码速度;
以及,当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对所述音频解码速度进行调整。
在上述方案中,所述调整模块,配置为当所述系统时钟系基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述音频解码速度小于预设的正常速度,跳过一个采样点;
以及,当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,所述音频解码速度大于预设的正常速度,重复上一个采样点。
第三方面,本发明实施例提供了一种音视频同步处理的装置,包括:
存储器,配置为存储可执行程序;
处理器,配置为运行所述可执行程序时实现本发明实施例提供的音视频同步处理的方法。
第四方面,本发明实施例提供了一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时实现本发明实施例提供的音视频同步处理的方法。
本发明实施例中,在当前节目的时钟参考值与当前系统时钟值的比较结果不满足预设的判断条件时,调整当前系统时钟的计数步长重建系统时钟,然后根据重建的系统时钟中的系统时钟基础数值与显示时间戳的差值绝对值与预设的时间间隔的比较结果,调整音/视频播放速度,在解码端精准地重建与编码端一致的系统时钟,从而为音视频的同步提供准确的时钟参考,解决了视频播放过程中的唇音不同步问题。
附图说明
图1为本发明实施例提供的重建本地系统时钟与音视频同步处理的装置示意图;
图2为本发明实施例提供的音视频同步处理方法流程示意图一;
图3为本发明实施例提供的音视频同步处理方法流程示意图二;
图4为本发明实施例提供的音视频同步处理方法流程示意图三;
图5为本发明实施例提供的利用PCR和本地STC计数器进行系统时钟重建的流程图;
图6为本发明实施例提供的音视频同步处理方法流程示意图四;
图7为本发明实施例提供的音视频同步处理方法流程示意图五;
图8为本发明实施例提供的利用STC_base与PTS进行音视频同步的流程图;
图9为本发明实施例提供的音视频同步处理装置结构示意图一;
图10为本发明实施例提供的音视频同步处理装置结构示意图二;
图11为本发明实施例提供的音视频同步处理硬件模块图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
本发明实施例中,在实时工作的多媒体系统中,系统时钟的重建不精准导致音视频同步存在误差的问题。通过重建本地系统时钟,在重建本地系统时钟的基础上进行音视频同步处理。
参见图1,其示出了本发明实施例提供的重建本地系统时钟与音视频同步处理的装置示意图。该装置需要在本地建立一个STC计数器,当第一个PCR到来或需要重新载入PCR时,将当前PCR值载入STC计数器,STC计数器在108MHz时钟的驱动下进行计数,在检测到PCR中断后,读取STC计数器值与当前PCR值进行比较,偏差在可接受的范围内,则不调整,否则软件需要调整STC计数步长,来调整STC计数器,进而修正系统时钟。利用低通滤波器与压控振荡器进行锁相,避免因传输误码引入的较大偏差。
该装置中选择的驱动本地STC计数器的时钟为108MHz,而编码时钟为27MHz,是编码端时钟的4倍。此处提高频率是为了提高计数器的精度,同时也避免了奇数分频不准确导致重建的系统时钟不精准的问题。
装置中PCR是通过解复用器(也就是传输流解复用器)从MPEG-TS流的调整字段(adaption_field)中提取的,PCR的提取过程由硬件实现。当第二个PCR到来时,硬件给出PCR中断,并将当前PCR和STC计数器更新到寄存器中供软件读取。
装置中PTS/DTS也是通过解复用器提取并给到解码器的,每解到一个PTS/DTS,该PTS/DTS就作为其后送入解码器的输入缓冲器中的基本码流(ES,Elementary Stream)数据的显示/解码时间,但此时送入缓冲器的ES 数据并不一定立即被解码,因此,解码器必须将PTS/DTS存入先进先出队列(FIFO,First Input First Output)中,并记录该PTS/DTS所对应码流的位置,利于后续的解码和显示的同步。
采用上述的装置,可以在解码端精准地重建系统时钟,且在系统时钟出现偏差时,可以在较短时间内通过软件调整,使得系统时钟与编码端一致,进而为音视频同步提供准确的参考时钟。
参见图2,其示出了本发明实施例提供的一种音视频同步处理的方法,所述方法包括:
S101、将当前节目的PCR值与当前STC值进行比较,获得第一比较结果。
参见图3,例如,步骤S101包括步骤S1011至S1014:
S1011、将第一个PCR值或重新加载的PCR值作为计数初值载入本地STC计数器。
需要说明的是,第一个PCR到来或需要重新载入PCR时,将当前PCR值载入本地STC计数器,作为计数初值。本地STC计数器同样也分STC_base和STC_extension分别计数;其中,STC_base为STC的基础数值,是STC的高33bit字段的初始值为PCR_base,后在90kHz时钟的驱动下进行递增计数,主要用于与PTS和DTS比较,从而调整音视频解码和显示速度;STC_extension为STC的扩展数值,是STC的低9bit字段的初始值为PCR_extension,后在27MHz时钟的驱动下进行递增计数,主要用于系统时钟的恢复。
S1012、利用本地系统时钟频率驱动所述本地STC计数器,对STC进行递增计数;其中,所述本地系统时钟频率为编码系统时钟频率的N倍,N为大于等于1的整数。
在一个可选的实施例中,本地STC计数器在本地108MHz时钟的驱动 下进行计数。编码端系统时钟为27MHz,此处采用108MHz本地时钟是为了提高计数器的精度,使得通过软件调整锁相环更加精准。STC_base每1200个时钟周期加1,STC_extension每4个时钟周期加1。
S1013、当检测到PCR中断时,读取所述本地STC计数器中的当前STC值和所述当前PCR值。
例如,当下一个PCR到来时,硬件提取当前的STC值和PCR值到寄存器中供软件查询,同时给出PCR中断,软件检测到中断,即可读取当前的STC和PCR值。
S1014、计算所述当前PCR值与所述本地STC计数器中的当前STC值的差值绝对值;其中,所述当前PCR值与所述本地STC计数器中的当前STC值的差值绝对值为所述第一比较结果。
例如,通过软件计算当前PCR值与当前STC值的差值绝对值,其计算表达式为:ΔPCR=|PCR-STC|。软件计算出当前PCR值与当前STC值的差值绝对值后,清除PCR中断。
S102、当所述第一比较结果不满足预设的判断条件时,通过调整当前STC计数步长来重建系统时钟STC。
例如,参见图4,步骤S102包括步骤S1021至S1024:
S1021、将所述第一比较结果与预设的判断条件进行比较。
需要说明的是,第一比较结果为ΔPCR=|PCR-STC|,将ΔPCR分为ΔPCR_base与ΔPCR_extension两部分。将ΔPCR_base与ΔPCR_extension的值分别预设一个取值范围作为预设的判断条件,在一个可选的实施例中,当ΔPCR_base==0且ΔPCR_extension≤162时设定为满足预设的判断条件。
S1022、当所述第一比较结果不满足预设的判断条件时,将所述当前PCR值与所述当前STC值进行比较。
若不满足条件ΔPCR_base==0且ΔPCR_extension≤162,将当前PCR 值与当前STC值进行比较,根据当前PCR值与当前STC值的比较结果判断STC计数速度的快慢,从而对应的调整STC计数步长,其中,STC计数步长初始值为230
S1023、若所述当前PCR值大于所述当前STC值,则增大当前STC的计数步长。
可以理解地,若PCR>STC,则说明STC计数过慢,需要增大STC计数步长,对STC系统时钟进行相应的调整。
S1024、若所述当前PCR值小于所述当前STC值,则减小当前STC的计数步长。
可以理解地,若PCR<STC,则说明STC计数过快,需要减小STC计数步长,对STC系统时钟进行相应的调整。
例如,所述方法还包括:
当所述当前PCR值与所述当前STC值的差值绝对值满足预设的判断条件时,保持STC的计数步长不变。
可以理解地,若满足条件ΔPCR_base==0且ΔPCR_extension≤162,则判断为系统时钟STC正常,不需要重建系统时钟,因此无需调整STC计数步长。
还需要说明的是,解复用器在进行MPEG-2TS包的包头解析时,提取出PCR信息,并送入系统时钟恢复电路。每个新的PCR到来时,都会与本地STC计数器比较,进行系统时钟的恢复和锁相。这样在节目播放过程中,如果本地系统时钟与编码端系统时钟比较出现了偏差,也能在下一次PCR到来后得到校正,为音视频的同步处理提供精准的系统时钟参考。
上述过程为重建系统时钟的过程,参见图5,其示出了利用PCR和本地STC计数器进行系统时钟重建的流程图。在重建系统时钟后,就可以在重建系统时钟的基础上进行音视频同步的处理过程,音视频同步处理过程 如下:
S103、将所述重建的系统时钟STC中的STC基础数值STC_base数值与PTS之间的差值绝对值和预设的时间间隔进行比较,获得第二比较结果;其中,所述预设的时间间隔是音频或视频帧间时间的M倍,且M大于0小于1。
需要说明的是,音视频中新的一帧到来后,软件计算STC_base数值与PTS的差值绝对值,即|STC_base-PTS|的值。音/视频帧间时间是ΔPTS,预设的时间间隔是指ΔPTS的M倍,这里M大于0小于1。
在一个可选的实施例中,设定M值为0.5,因此0.5倍帧间时间为ΔPTS/2。将音/视频的STC_base数值与PTS的差值绝对值与0.5帧间时间进行比较,即|STC_base-PTS|与ΔPTS/2进行比较,|STC_base-PTS|与ΔPTS/2的比较结果即为第二比较结果。
S104、根据所述第二比较结果调整所述音频或视频播放速度。
需要说明的是,对音频和视频解码快慢程度的判断以及调整过程是不同的,对视频解码速度的调整需要根据视频的结构做出相应的同步调整,而音频则只需要根据解码快慢程度跳过一个采样点或者重复上一个采样点就可以对音频解码的速度进行调整。因此,将步骤S104分为解码视频和解码音频两种情况,S104A1至S104A3为解码视频时,对视频解码速度的调整过程,S104B1至S104B3为解码音频时,对音频解码速度的调整过程。
参见图6,例如,当解码视频,对视频解码速度进行调整时,具体过程包括步骤S104A1至S104A3:
S104A1、利用所述第二比较结果对所述视频的解码速度进行相对应的调整。
可以理解地,根据第二比较结果对视频的解码速度进行相对应的调整就可以调整视频的播放速度。
S104A2、当所述STC_base的数值与PTS的差值绝对值小于所述预设的时间间隔时,不对所述视频解码速度进行调整。
可以理解地,若|STC_base-PTS|<ΔPTS/2,则说明视频解码正常,不需要对视频解码速度进行调整。
S104A3、当所述STC_base的数值与PTS的差值绝对值大于等于所述预设的时间间隔时,对所述视频解码速度进行调整。
可以理解地,|STC_base-PTS|≥ΔPTS/2,则可以获知此时视频解码速度是不正常的,需要对视频解码速度进行调整。由于是根据STC_base数值与PTS的差值绝对值与ΔPTS/2进行的判断,不能获知视频解码速度的具体情况,不能确定视频解码速度是快还是慢,因此,去掉绝对值,判断是STC_base减去PTS的值大于等于ΔPTS/2,或者是PTS减去STC_base数值的值大于等于ΔPTS/2,对视频解码速度进行进一步判断。
针对步骤S104A3,对视频解码速度的判断并进行调整的过程具体包括以下两种过程:
一、当所述STC_base数值减去所述PTS所获得的差值大于等于所述预设的时间间隔时,所述视频解码速度小于预设的正常速度,根据所述视频帧的结构进行相应的同步调整;其中,所述视频帧的结构分别为:双向预测帧B帧、帧内预测帧I帧和单向预测帧P帧。
可以理解地,若STC_base-PTS≥ΔPTS/2,则说明视频解码稍慢,解码器处于失步状态,应根据该帧的结构作出相应的同步调整。
根据不同的视频帧结构对视频解码速度进行相应的同步调整,因此,上述过程具体包括:
当所述视频帧为B帧时,丢弃当前帧,解码下一帧,同时显示前一帧;
当所述视频帧为I帧或P帧时,冻结前一帧图像并停止解码,等待下一个I帧或视频序列。
需要说明的是,在视频压缩编码中,所有的帧被分成了三个种类:I帧、B帧和P帧。
二、当所述PTS减去所述STC_base数值所获得的差值大于等于所述预设的时间间隔时,所述视频解码速度大于预设的正常速度,重复显示上一个视频帧,视频解码暂停,待所述STC_base数值与所述PTS相同时,显示当前图像。
可以理解地,若PTS-STC_base≥ΔPTS/2,则说明视频解码稍快,那么可以暂停视频解码,将已经显示过的上一帧图像进行重复的显示,通过这种方法可以放缓视频的解码速度,等到STC_base与PTS相同时,再显示当前帧图像。
参见图7,例如,当解码音频,对音频解码速度进行调整时,具体过程包括步骤S104B1至S104B3:
S104B1、利用所述第二比较结果对所述音频的解码速度进行相对应的调整。
可以理解地,根据第二比较结果对音频的解码速度进行相对应的调整就可以调整音频的播放速度。
S104B2、当所述STC_base数值与PTS的差值绝对值小于所述预设的时间间隔时,不对所述音频解码速度进行调整。
可以理解地,若|STC_base-PTS|<ΔPTS/2,则说明音频解码正常,不需要对音频的解码速度进行调整。
S104B3、当所述STC_base数值与PTS的差值绝对值大于等于所述预设的时间间隔时,对所述音频解码速度进行调整。
可以理解地,若|STC_base-PTS|≥ΔPTS/2,则可以获知此时音频解码速度是不正常的,需要对音频解码速度进行调整。由于是根据STC_base数值与PTS的差值绝对值与ΔPTS/2进行的判断,不能获知音频解码速度的 具体情况,不能确定音频解码速度是快还是慢,因此,去掉绝对值,判断是STC_base减去PTS的值大于等于ΔPTS/2,或者是PTS减去STC_base的值大于等于ΔPTS/2,对音频解码速度进行进一步判断。
针对步骤S104B3,对音频解码速度的判断并进行调整的过程具体包括:
当所述STC_base数值减去所述PTS所获得的差值大于等于所述预设的时间间隔时,所述音频解码速度小于预设的正常速度,跳过一个采样点;
当所述PTS减去所述STC_base数值所获得的差值大于等于所述预设的时间间隔时,所述音频解码速度大于预设的正常速度,重复上一个采样点。
上述过程为在重建系统时钟的基础上进行音视频同步的过程,参见图8,其示出了利用STC_base与PTS进行音视频同步的流程图。
本发明实施例提供了一种音视频同步处理的方法,在当前PCR值与当前STC值的比较结果不满足预设的判断条件时,调整当前STC计数步长重建系统时钟STC,然后根据重建的系统时钟STC中的STC_base数值与显示时间戳PTS的差值绝对值与预设的时间间隔的比较结果,调整音/视频播放速度,在解码端精准地重建与编码端一致的系统时钟,从而为音视频的同步提供准确的时钟参考,解决了视频播放过程中的唇音不同步问题。
参见图9,其示出了本发明实施例提供的一种音视频同步处理的装置9,所述装置包括:比较模块901和调整模块902;其中,
所述比较模块901,配置为将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果;
所述调整模块902,配置为当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟;
所述比较模块901,还配置为将所述重建的系统时钟中的系统时钟基础数值与显示时间戳之间的差值绝对值、与预设的时间间隔进行比较,获得第二比较结果;其中,所述预设的时间间隔是音频或视频帧间时间的M倍, 且M大于0小于1;
所述调整模块902,还还配置为根据所述第二比较结果调整所述音频或视频的播放速度。
在一个可选的实施例中,参见图10,所述装置还包括:加载模块903、计数模块904、读取模块905和计算模块906;其中,
所述加载模块903,配置为将第一个节目的时钟参考值或重新加载的节目的时钟参考值作为计数初值载入系统时钟计数器;
所述计数模块904,配置为利用系统时钟频率驱动所述系统时钟计数器,对所述系统时钟进行递增计数;其中,所述系统时钟频率为编码系统时钟频率的N倍,N为大于等于1的整数;
所述读取模块905,配置为当检测到节目时钟参考中断时,读取所述当前节目的时钟参考值,从所述系统时钟计数器中读取当前系统时钟值;
所述计算模块906,配置为计算所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值,将所述差值绝对值确定为所述第一比较结果。
在一个可选的实施例中,所述比较模块901,用于将所述第一比较结果与预设的判断条件进行比较;
所述调整模块902,配置为当所述第一比较结果不满足预设的判断条件时,将所述当前节目的时钟参考值与所述当前系统时钟值进行比较;
以及,若所述当前节目的时钟参考值大于所述当前系统时钟值,则增大所述系统时钟的计数步长;
以及,若所述当前节目时钟参考值小于所述当前系统时钟值,则减小所述系统时钟计数步长。
在一个可选的实施例中,参见图10,所述装置还包括:保持模块907;其中,
所述保持模块907,配置为当所述当前节目的时钟参考值与所述当前系 统时钟值的差值绝对值满足预设的判断条件时,保持所述系统时钟的计数步长不变。
在一个可选的实施例中,所述调整模块902,配置为利用所述第二比较结果对所述视频的解码速度进行对应的调整;
以及,当所述系统时钟基础数值与所述显示时间戳的差值绝对值小于所述预设的时间间隔时,保持视频解码速度;
以及,当所述系统时钟基础数值与所述显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对视频解码速度进行调整。
在一个可选的实施例中,所述调整模块902,用于当所述STC_base数值减去所述PTS所获得的差值大于等于所述预设的时间间隔时,所述视频解码速度小于预设的正常速度,根据所述视频帧的结构进行相应的同步调整;其中,所述视频帧的结构分别为:B帧、I帧和P帧;
以及,当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度大于预设的正常速度,暂停解码当前视频帧并重复显示上一个视频帧,直至所述系统时钟基础数值与所述显示时间戳相同时,继续解码当前视频帧并显示对应的图像。
在一个可选的实施例中,所述调整模块902,配置为当所述视频帧为B帧时,丢弃当前视频帧,解码下一视频帧,同时显示前一视频帧;
以及,当所述视频帧为I帧或P帧时,冻结前一视频帧并停止解码,等待下一个I帧或视频序列。
在一个可选的实施例中,所述调整模块902,配置为利用所述第二比较结果对所述音频的解码速度进行对应的调整;
以及,当所述系统时钟基础数值与显示时间戳的差值绝对值小于所述预设的时间间隔时,保持音频解码速度;
以及,当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于 所述预设的时间间隔时,对所述音频解码速度进行调整。
在一个可选的实施例中,所述调整模块902,配置为当所述系统时钟系基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述音频解码速度小于预设的正常速度,跳过一个采样点;
以及,当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,所述音频解码速度大于预设的正常速度,重复上一个采样点。
本发明实施例提供了一种音视频同步处理的装置,在当前PCR值与当前STC值的比较结果不满足预设的判断条件时,调整当前STC计数步长重建系统时钟STC,然后根据重建的系统时钟STC中的STC_base数值与显示时间戳PTS的差值绝对值与预设的时间间隔的比较结果,调整音/视频播放速度,在解码端精准地重建与编码端一致的系统时钟,从而为音视频的同步提供准确的时钟参考,解决了视频播放过程中的唇音不同步问题。
针对图9所示的装置,参见图11,其示出了本发明实施例提供的系统时钟的重建及音视频同步处理所涉及的硬件实现装置,所述硬件实现装置具体可以包括3大部分:CPU、解复用器(记为demux)和解码器(记为decoder)。
所述解复用器分为包头解析(记为ts_ph_get)模块与PRC重建(PCR_recovery)模块,其中ts_ph_get模块进行包头解析,在MPEG2-TS流的调整字段中提取出PCR_flag和PCR值,送入PCR_recovery模块进行系统时钟的重建。
PCR_recovery模块保存PCR值,具体实现本地的STC计数器在本地系统时钟出现偏差时,可通过CPU调整STC步长来调整STC计数器,使其与当前PCR基本一致。PCR_recovery模块发送pcr_中断(interrupt)信号至CPU,pcr_interrupt信号表示PCR_recovery模块提取出PCR中断发送至 CPU,CPU接收到中断后,查询stc_regs/pcrregs,软件计算STC和PCR的差值后,再根据差值来调整STC计数步长,并反馈给PCR_recovery模块。
所述解码器分为FIFO模块、ES数据缓冲器、解码模块和显示模块。
解复用器在开始新的一帧图像时,将该帧图像对应的PTS/DTS写入FIFO模块,每解码到一帧图像时,就从FIFO中读出对应的DTS与STC进行比较,当两者相等时,则可以在解码模块中开始解码。同时,解复用器demux将ES data写入ES数据缓存器中,ES数据缓存器将ES data发送至解码模块进行解码。每一显示单元开始显示前,用其对应的PTS与STC进行比较,当两者相等时,则可以在显示模块中开始显示。其中,ES data为基本码流包含视频、音频或数据的连续码流。
还需要说明的是,并不是每一帧图像都有PTS和DTS,一个PES包可能会有多帧图像,只有第一帧图像有PTS,而PES包里的其他图像帧均没有PTS。若一帧图像没有PTS,可以在前一PTS的基础上加一增量得到对应该帧图像的PTS,送入FIFO中进行管理,并根据上述的方法进行音视频的同步处理。其中PES为打包的基本码流,是将基本的码流ES流根据需要分成长度不等的数据包,并加上包头就形成了打包的基本码流PES流。
本发明实施例提供了一种音视频同步处理装置的硬件实现装置,包括:
存储器,配置为存储可执行程序;
处理器,配置为运行所述可执行程序时实现本发明实施例前述提供的音视频同步处理的方法,如图2至图8任意附图示出的音视频同步处理的方法,例如:在当前PCR值与当前STC值的比较结果不满足预设的判断条件时,调整当前STC计数步长重建系统时钟STC,然后根据重建的系统时钟STC中的STC_base数值与显示时间戳PTS的差值绝对值与预设的时间间隔的比较结果,调整音/视频播放速度,在解码端精准地重建与编码端一致的系统时钟,从而为音视频的同步提供准确的时钟参考,解决了视频播 放过程中的唇音不同步问题。
本发明实施例提供了一种可读存储介质,可读存储介质可以随机存取器(RAM,Random Access Memory)、只读存储器(ROM,Read Only Memory)、电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory)、闪存或其他存储器技术、CD-ROM、数字通用盘(DVD)或其他光存储装置、盒式磁带、磁带、磁盘存储装置或其他磁存储设备。可读存储介质存储有可执行程序,所述可执行程序被处理器执行时实现本发明实施例提供的音视频同步处理的方法,如图2至图8任意附图示出的音视频同步处理的方法。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。
工业实用性
本发明实施例中,在当前节目的时钟参考值与当前系统时钟值的比较结果不满足预设的判断条件时,调整当前系统时钟的计数步长重建系统时钟,然后根据重建的系统时钟中的系统时钟基础数值与显示时间戳的差值绝对值与预设的时间间隔的比较结果,调整音/视频播放速度,在解码端精准地重建与编码端一致的系统时钟,从而为音视频的同步提供准确的时钟参考,解决了视频播放过程中的唇音不同步问题。

Claims (20)

  1. 一种音视频同步处理的方法,所述方法包括:
    将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果;
    当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟;
    将所述重建的系统时钟中的系统时钟基础数值与显示时间戳之间的差值绝对值、与预设的时间间隔进行比较,获得第二比较结果;其中,所述预设的时间间隔是音频或视频帧间时间的M倍,且M大于0小于1;
    根据所述第二比较结果调整所述音频或视频的播放速度。
  2. 根据权利要求1所述的方法,其特征在于,所述将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果,包括:
    将第一个节目的时钟参考值或重新加载的节目的时钟参考值作为计数初值载入系统时钟计数器;
    利用系统时钟频率驱动所述系统时钟计数器,对所述系统时钟进行递增计数;其中,所述系统时钟频率为编码系统时钟频率的N倍,N为大于等于1的整数;
    当检测到节目时钟参考中断时,读取所述当前节目的时钟参考值,从所述系统时钟计数器中读取当前系统时钟值;
    计算所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值,将所述差值绝对值确定为所述第一比较结果。
  3. 根据权利要求2所述的方法,其特征在于,所述当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟,包括:
    将所述第一比较结果与预设的判断条件进行比较;
    当所述第一比较结果不满足预设的判断条件时,将所述当前节目的时钟参考值与所述当前系统时钟值进行比较;
    若所述当前节目的时钟参考值大于所述当前系统时钟值,则增大所述系统时钟的计数步长;
    若所述当前节目时钟参考值小于所述当前系统时钟值,则减小所述系统时钟计数步长。
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值满足预设的判断条件时,保持所述系统时钟的计数步长不变。
  5. 根据权利要求1所述的方法,其特征在于,当解码视频时,所述根据所述第二比较结果调整所述视频的播放速度,包括:
    利用所述第二比较结果对所述视频的解码速度进行对应的调整;
    当所述系统时钟基础数值与所述显示时间戳值的差值绝对值小于所述预设的时间间隔时,保持视频解码速度;
    当所述系统时钟基础数值与所述显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对视频解码速度进行调整。
  6. 根据权利要求5所述的方法,其特征在于,所述当所述系统时钟基础数值与显示时间戳值的差值绝对值大于等于所述预设的时间间隔时,对视频解码速度进行调整,包括:
    当所述系统时钟基础数值减去所述显示时间戳值所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度小于预设的正常速度,根据所述视频帧的结构进行相应的同步调整;其中,所述视频帧的结构分别为:双向预测内插编码帧、帧内预测帧和单向预测帧;
    当所述显示时间戳值减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度大于预设的正常速度, 暂停解码当前视频帧并重复显示上一个视频帧,直至所述系统时钟基础数值与所述显示时间戳相同时,继续解码当前视频帧并显示对应的图像。
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述视频帧的结构进行相应的同步调整,包括:
    当所述视频帧为双向预测内插编码帧时,丢弃当前视频帧,解码下一视频帧,同时显示前一视频帧;
    当所述视频帧为帧内预测帧或单向预测帧时,冻结前一视频帧并停止解码,等待下一个帧内预测帧或视频序列。
  8. 根据权利要求1所述的方法,其特征在于,所述根据所述第二比较结果调整所述音频的播放速度,包括:
    利用所述第二比较结果对所述音频的解码速度进行对应的调整;
    当所述系统时钟基础数值与显示时间戳的差值绝对值小于所述预设的时间间隔时,保持音频解码速度;
    当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对所述音频解码速度进行调整。
  9. 根据权利要求8所述的方法,其特征在于,所述当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对所述音频解码速度进行调整,包括:
    当所述系统时钟系基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述音频解码速度小于预设的正常速度,跳过一个采样点;
    当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,所述音频解码速度大于预设的正常速度,重复上一个采样点。
  10. 一种音视频同步处理的装置,所述装置包括:比较模块和调整模 块;其中,
    所述比较模块,配置为将当前节目的时钟参考值与当前系统时钟值进行比较,获得第一比较结果;
    所述调整模块,当所述第一比较结果不满足预设的判断条件时,通过调整系统时钟的计数步长来重建所述系统时钟;
    所述比较模块,还配置为将所述重建的系统时钟中的系统时钟基础数值与显示时间戳之间的差值绝对值、与预设的时间间隔进行比较,获得第二比较结果;其中,所述预设的时间间隔是音频或视频帧间时间的M倍,且M大于0小于1;
    所述调整模块,还配置为根据所述第二比较结果调整所述音频或视频的播放速度。
  11. 根据权利要求10所述的装置,其特征在于,所述装置还包括:加载模块、计数模块、读取模块和计算模块;其中,
    所述加载模块,配置为将第一个节目的时钟参考值或重新加载的节目的时钟参考值作为计数初值载入系统时钟计数器;
    所述计数模块,配置为利用系统时钟频率驱动所述系统时钟计数器,对所述系统时钟进行递增计数;其中,所述系统时钟频率为编码系统时钟频率的N倍,N为大于等于1的整数;
    所述读取模块,配置为当检测到节目时钟参考中断时,读取所述当前节目的时钟参考值,从所述系统时钟计数器中读取当前系统时钟值;
    所述计算模块,配置为计算所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值,将所述差值绝对值确定为所述第一比较结果。
  12. 根据权利要求11所述的装置,其特征在于,
    所述比较模块,配置为将所述第一比较结果与预设的判断条件进行比较;
    所述调整模块,配置为当所述第一比较结果不满足预设的判断条件时,将所述当前节目的时钟参考值与所述当前系统时钟值进行比较;
    以及,若所述当前节目的时钟参考值大于所述当前系统时钟值,则增大所述系统时钟的计数步长;
    以及,若所述当前节目时钟参考值小于所述当前系统时钟值,则减小所述系统时钟计数步长。
  13. 根据权利要求10所述的装置,其特征在于,所述装置还包括:保持模块;其中,
    所述保持模块,配置为当所述当前节目的时钟参考值与所述当前系统时钟值的差值绝对值满足预设的判断条件时,保持所述系统时钟的计数步长不变。
  14. 根据权利要求10所述的装置,其特征在于,
    所述调整模块,配置为利用所述第二比较结果对所述视频的解码速度进行对应的调整;
    以及,当所述系统时钟基础数值与所述显示时间戳的差值绝对值小于所述预设的时间间隔时,保持视频解码速度;
    以及,当所述系统时钟基础数值与所述显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对视频解码速度进行调整。
  15. 根据权利要求14所述的装置,其特征在于,
    所述调整模块,配置为当所述系统时钟基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度小于预设的正常速度,根据所述视频帧的结构进行相应的同步调整;其中,所述视频帧的结构分别为:双向预测帧帧、帧内预测帧和单向预测帧;
    以及,当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,确定所述视频解码速度大于预设的正常速 度,暂停解码当前视频帧并重复显示上一个视频帧,直至所述系统时钟基础数值与所述显示时间戳相同时,继续解码当前视频帧并显示对应的图像。
  16. 根据权利要求15所述的装置,其特征在于,
    所述调整模块,配置为当所述视频帧为双向预测内插编码帧时,丢弃当前视频帧,解码下一视频帧,同时显示前一视频帧;
    以及,当所述视频帧为帧内预测帧或单向预测帧时,冻结前一视频帧并停止解码,等待下一个帧内预测帧或视频序列。
  17. 根据权利要求10所述的装置,其特征在于,
    所述调整模块,配置为利用所述第二比较结果对所述音频的解码速度进行对应的调整;
    以及,当所述系统时钟基础数值与显示时间戳的差值绝对值小于所述预设的时间间隔时,保持音频解码速度;
    以及,当所述系统时钟基础数值与显示时间戳的差值绝对值大于等于所述预设的时间间隔时,对所述音频解码速度进行调整。
  18. 根据权利要求17所述的装置,其特征在于,
    所述调整模块,配置为当所述系统时钟系基础数值减去所述显示时间戳所获得的差值大于等于所述预设的时间间隔时,确定所述音频解码速度小于预设的正常速度,跳过一个采样点;
    以及,当所述显示时间戳减去所述系统时钟基础数值所获得的差值大于等于所述预设的时间间隔时,所述音频解码速度大于预设的正常速度,重复上一个采样点。
  19. 一种音视频同步处理的装置,包括:
    存储器,配置为存储可执行程序;
    处理器,配置为运行所述可执行程序时实现权利要求1至9所述的音视频同步处理的方法。
  20. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时实现权利要求1至9所述的音视频同步处理的方法。
PCT/CN2017/082622 2016-12-26 2017-04-28 一种音视频同步处理的方法和装置、存储介质 WO2018120557A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611225383.8 2016-12-26
CN201611225383.8A CN108243350B (zh) 2016-12-26 2016-12-26 一种音视频同步处理的方法和装置

Publications (1)

Publication Number Publication Date
WO2018120557A1 true WO2018120557A1 (zh) 2018-07-05

Family

ID=62701656

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/082622 WO2018120557A1 (zh) 2016-12-26 2017-04-28 一种音视频同步处理的方法和装置、存储介质

Country Status (2)

Country Link
CN (1) CN108243350B (zh)
WO (1) WO2018120557A1 (zh)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478914A (zh) * 2020-04-14 2020-07-31 广州酷狗计算机科技有限公司 时间戳处理方法、装置、终端及存储介质
CN112153446A (zh) * 2020-09-27 2020-12-29 海信视像科技股份有限公司 一种显示设备及流媒体视频音画同步方法
CN112153443A (zh) * 2020-09-01 2020-12-29 青岛海信传媒网络技术有限公司 Pts获取方法和显示设备
CN112243145A (zh) * 2019-07-18 2021-01-19 瑞昱半导体股份有限公司 音频与视频同步方法和音频与视频处理装置
CN113382300A (zh) * 2021-06-08 2021-09-10 三星电子(中国)研发中心 一种音视频播放方法和装置
CN114143486A (zh) * 2021-09-16 2022-03-04 浙江大华技术股份有限公司 视频流同步方法、装置、计算机设备和存储介质
CN114257857A (zh) * 2022-01-04 2022-03-29 海信视像科技股份有限公司 显示设备及视频倍速播放方法
CN114339348A (zh) * 2021-11-23 2022-04-12 伟乐视讯科技股份有限公司 一种基于频差检测和补偿的pcr校正方法和系统
CN115474082A (zh) * 2022-10-13 2022-12-13 闪耀现实(无锡)科技有限公司 播放媒体数据的方法和装置、系统、车辆、设备和介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113225598B (zh) * 2021-05-07 2023-01-20 上海一谈网络科技有限公司 移动端音视频同步的方法、装置、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003259312A (ja) * 2002-02-28 2003-09-12 Lsi Japan Kk 字幕番組データ変換装置
CN1722776A (zh) * 2004-07-16 2006-01-18 上海乐金广电电子有限公司 数码广播接收器中的时钟恢复装置
CN101710997A (zh) * 2009-11-04 2010-05-19 中兴通讯股份有限公司 基于mpeg-2系统实现视、音频同步的方法及系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1436001A (zh) * 2002-01-28 2003-08-13 北京华诺信息技术有限公司 解码系统中实现视频与音频同步的方法
US7006152B2 (en) * 2002-03-01 2006-02-28 Broadcom Corporation System and method for providing picture-in-picture timebase management
JP4609449B2 (ja) * 2007-04-16 2011-01-12 ソニー株式会社 データ処理装置及びデータ処理方法
CN102547299A (zh) * 2010-12-30 2012-07-04 福建星网视易信息系统有限公司 基于mpeg-2视频流的音视频同步控制方法
CN102075806B (zh) * 2011-01-26 2012-12-05 四川长虹电器股份有限公司 一种数字电视音视频同步方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003259312A (ja) * 2002-02-28 2003-09-12 Lsi Japan Kk 字幕番組データ変換装置
CN1722776A (zh) * 2004-07-16 2006-01-18 上海乐金广电电子有限公司 数码广播接收器中的时钟恢复装置
CN101710997A (zh) * 2009-11-04 2010-05-19 中兴通讯股份有限公司 基于mpeg-2系统实现视、音频同步的方法及系统

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112243145A (zh) * 2019-07-18 2021-01-19 瑞昱半导体股份有限公司 音频与视频同步方法和音频与视频处理装置
CN111478914B (zh) * 2020-04-14 2022-08-16 广州酷狗计算机科技有限公司 时间戳处理方法、装置、终端及存储介质
CN111478914A (zh) * 2020-04-14 2020-07-31 广州酷狗计算机科技有限公司 时间戳处理方法、装置、终端及存储介质
CN112153443B (zh) * 2020-09-01 2022-02-22 青岛海信传媒网络技术有限公司 Pts获取方法和显示设备
CN112153443A (zh) * 2020-09-01 2020-12-29 青岛海信传媒网络技术有限公司 Pts获取方法和显示设备
CN112153446B (zh) * 2020-09-27 2022-07-26 海信视像科技股份有限公司 一种显示设备及流媒体视频音画同步方法
CN112153446A (zh) * 2020-09-27 2020-12-29 海信视像科技股份有限公司 一种显示设备及流媒体视频音画同步方法
CN113382300A (zh) * 2021-06-08 2021-09-10 三星电子(中国)研发中心 一种音视频播放方法和装置
CN114143486A (zh) * 2021-09-16 2022-03-04 浙江大华技术股份有限公司 视频流同步方法、装置、计算机设备和存储介质
CN114339348A (zh) * 2021-11-23 2022-04-12 伟乐视讯科技股份有限公司 一种基于频差检测和补偿的pcr校正方法和系统
CN114339348B (zh) * 2021-11-23 2024-02-06 伟乐视讯科技股份有限公司 一种基于频差检测和补偿的pcr校正方法和系统
CN114257857A (zh) * 2022-01-04 2022-03-29 海信视像科技股份有限公司 显示设备及视频倍速播放方法
CN114257857B (zh) * 2022-01-04 2024-05-24 海信视像科技股份有限公司 显示设备及视频倍速播放方法
CN115474082A (zh) * 2022-10-13 2022-12-13 闪耀现实(无锡)科技有限公司 播放媒体数据的方法和装置、系统、车辆、设备和介质

Also Published As

Publication number Publication date
CN108243350A (zh) 2018-07-03
CN108243350B (zh) 2020-05-05

Similar Documents

Publication Publication Date Title
WO2018120557A1 (zh) 一种音视频同步处理的方法和装置、存储介质
US9489980B2 (en) Video/audio synchronization apparatus and video/audio synchronization method
WO2017067489A1 (zh) 机顶盒音视频同步的方法及装置、存储介质
US11849166B2 (en) Transmitting method, receiving method, transmitting device, and receiving device
US8526501B2 (en) Decoder and decoding method based on video and audio time information
JP4793247B2 (ja) 記録装置、記録方法、再生装置及び再生方法
JPH09121322A (ja) ビット流の処理方法、ビデオ再生方法、データパケットの記録方法、トリックプレーデータの記録方法およびビデオ再生装置
JP5720051B2 (ja) デジタル・ストリーム内の遅延変動測定方法及び装置
JP2013192148A (ja) 受信装置、クロック復元方法及びプログラム
US20030165323A1 (en) System and method of manipulating a system time clock in an audio/video decoding system
KR20060099687A (ko) 타임스탬프를 이용한 비디오 동기화 장치 및 방법
JP4987034B2 (ja) 映像表示装置
US20240064359A1 (en) Transmitting method, receiving method, transmitting device, and receiving device
US20070223536A1 (en) Stream reproducing method and device
JP6279146B2 (ja) データ処理装置及びデータ処理方法及びデータ処理プログラム
JP5020422B2 (ja) 映像表示装置
US8213778B2 (en) Recording device, reproducing device, recording medium, recording method, and LSI
JP2823806B2 (ja) 画像復号装置
WO2004006576A1 (ja) 画像データ処理装置及び方法
JP2002281498A (ja) 受信再生装置
JP3671969B2 (ja) データ多重方法及び多重データ復号方法
JPH099215A (ja) データ多重方法、データ伝送方法、及び多重データ復号方法、多重データ復号装置
JP2004248104A (ja) 情報処理装置及び情報処理方法
JPH11252058A (ja) 多重化装置及び方法
JPH09270994A (ja) ストリーム制御方式

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

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

Country of ref document: EP

Kind code of ref document: A1