CN103391467A - Method for achieving synchronization of decoding and displaying of audio and video of network set-top box - Google Patents

Method for achieving synchronization of decoding and displaying of audio and video of network set-top box Download PDF

Info

Publication number
CN103391467A
CN103391467A CN2013102960383A CN201310296038A CN103391467A CN 103391467 A CN103391467 A CN 103391467A CN 2013102960383 A CN2013102960383 A CN 2013102960383A CN 201310296038 A CN201310296038 A CN 201310296038A CN 103391467 A CN103391467 A CN 103391467A
Authority
CN
China
Prior art keywords
video
decoding
buffer
play
audio
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN2013102960383A
Other languages
Chinese (zh)
Inventor
雷勇
王举
帅娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SICHUAN DITEL ELECTRONICS CO Ltd
Original Assignee
SICHUAN DITEL ELECTRONICS CO Ltd
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 SICHUAN DITEL ELECTRONICS CO Ltd filed Critical SICHUAN DITEL ELECTRONICS CO Ltd
Priority to CN2013102960383A priority Critical patent/CN103391467A/en
Publication of CN103391467A publication Critical patent/CN103391467A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a method for achieving synchronization of decoding and displaying of audio and video of a network set-top box. The method comprises step 1, synchronization of the decoding and displaying, wherein the synchronization of the decoding and displaying is achieved through control on flag bits of buffers, the change conditions of corresponding buffer states are continuously detected in the integral decoding and displaying process, and meanwhile the facts that the decoding is always prior to the displaying by several frames and the prior frames are not more than the number of the buffers are ensured and step 2, synchronization of displaying of the audio and video, wherein the video displaying is controlled though time parameters of the audio displaying and the video displaying and frame skipping are not performed during dispatching. The method for achieving the synchronization of the decoding and displaying of the audio and video of the network set-top box has the advantages of achieving the synchronization of the decoding and displaying of the audio and video through the control on the flag bits of the buffers, ensuring the correctness of buffer data, being capable of effectively avoiding the conditions that read data are invalid, a decoding program covers buffers which are not displayed yet, and the like and capable of effectively overcoming the defect that the video displaying is too rapid or too slow, enabling the effect of real-time synchronous displaying of audio and video files to be good and guaranteeing the finally presented effect of a decoder.

Description

Network machine top box audio/video decoding and broadcast synchronization realizing method
Technical field
The present invention relates to a kind of network machine top box audio/video decoding and play synchronization realizing method.
Background technology
The decoding of MPEG-4 software decoder is not only the inverse process of coding, it also comprises the module of many processing special events, such as the data that medium sends are carried out type judgement, error correction, decompressed data bag, audio/video decoding, audio-visual synchronization broadcast etc., wherein audio/video decoding directly affects with synchronizeing of broadcast the effect that decoder finally presents.For this reason,, except control video by audio frequency when playing, when realizing that audio-visual synchronization is play, also carry out decoding work in system, by the relation between them, adjusting separately speed, the effect of playing to reach the audio-video document real-time synchronization.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, provide a kind of control by the Buffer flag bit to realize good audio/video decoding and the network machine top box audio/video decoding of playing synchronous effect and broadcast synchronization realizing method, guarantee the correctness of Buffer data, can effectively avoid the generation that the data that read are invalid, decoding program covers the situations such as Buffer of not yet playing, and can effectively overcome the too fast or excessively slow situation of video playback, it is effective that the audio-video document real-time synchronization is play, and guaranteed the effect that decoder finally presents.
The objective of the invention is to be achieved through the following technical solutions: network machine top box audio/video decoding and broadcast synchronization realizing method, it comprises an audio decoder and plays synchronizing step, a video decode and play synchronizing step and an audio frequency and video broadcast synchronizing step:
(1) audio decoder and broadcast synchronizing step, video decode and broadcast synchronizing step: by the control to the Buffer flag bit, realize decoding and synchronizeing of playing, constantly detect corresponding Buffer state variation situation in whole decoding and playing process, guarantee that simultaneously decoding has precedence over the several frames of broadcast all the time, and preferential frame number is no more than the number of Buffer;
(2) audio frequency and video are play synchronizing step: control the broadcast of video with the time parameter that audio frequency is play, it comprises following two kinds of situations:
1. video is faster than audio frequency, by the frame number that audio frequency has been play, controls the frame number that the video permission is play, and namely the sampling parameter by audio frequency calculates the time that current audio frequency has been play, then by the frame per second of video, calculates the frame number that video should be play; If the frame number of current actual play is more than or equal to the frame number that should play, do not carry out the broadcast of video when scheduling, be continued until when audio frequency has been play enough frame numbers, when having been produced new the requirement, video playback just continues to play;
2. video is slower than audio frequency, when the video frame number that the frame number of playing when needs has been play greater than reality and video Buffer number, directly decoded result is abandoned after decoded, before deal with data, and the sign of current decoding Buffer is set to Skipping, the decoding pointer moves backward; When playing program detects Skipping, directly the Buffer flag bit is made as Freeing, playing pointer is moved backward, the frame number calculation flag of actual play also adds one simultaneously, realizes the frame-skipping action.
The control method of Buffer flag bit of the present invention comprises the following steps:
S101: each Buffer in the audio-video document decode procedure is arranged a sign of flag, and initial value is Freeing;
S102: the Buffer flag bit that the decoding pointed detected when decoding program is Freeing time operation decoding program, if the Buffer of decoding pointed is that other states are not carried out decoding;
S103: after decoded data write Buffer, the sign of this Buffer is made as Waiting, the pointer of decoding simultaneously is toward moving to right;
S104: when playing program detects the flag bit Waiting of Buffer, start playing program, and the flag bit of Buffer is made as Busying; , if the Buffer flag bit of Buffer pointed is not Waiting, do not carry out this broadcast;
S105:, finishing to be write the flag bit of Buffer as Freeing after broadcast, simultaneously playing pointer is moved backward.
The Freeing of writing of the present invention and pointer mobile process backward are placed on DMA and handle in the interruption that data produce and carry out.
Sampling parameter of the present invention comprises the sample rate of audio frequency and the number of samples that every frame comprises.
The invention has the beneficial effects as follows: the control by the Buffer flag bit realizes that audio/video decoding synchronizes with playing, guarantee the correctness of Buffer data, can effectively avoid the generation that the data that read are invalid, decoding program covers the situations such as Buffer of not yet playing, and can effectively overcome the too fast or excessively slow situation of video playback, it is effective that the audio-video document real-time synchronization is play, and guaranteed the effect that decoder finally presents.
Description of drawings
Fig. 1 is handling process schematic diagram of the present invention.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is described in further detail, but protection scope of the present invention is not limited to the following stated.
, in order to guarantee the real-time of playing, when playing, audio frequency and video carry out decoding work.The several frames of general leading broadcast of decoding, write the output Buffer of decoded result during decoding and while playing input Buffer be same Buffer(buffer register), therefore Buffer has been carried out strict control, to guarantee the correctness of Buffer data.
As shown in Figure 1, network machine top box audio/video decoding and broadcast synchronization realizing method, it comprises an audio decoder and plays synchronizing step, a video decode and play synchronizing step and an audio frequency and video broadcast synchronizing step:
(1) audio decoder and broadcast synchronizing step, video decode and broadcast synchronizing step:
In decode procedure, decoder, player, three entities of buffer memory Buffer are arranged, the purpose of buffer memory Buffer is to regulate the speed between decoding and broadcast, and the process of playing when minibreak appears in decoding also can have enough data to play.This Buffer is equivalent to a circulation array, playing pointer can not surpass decoding pointer (cause the data that read invalid), and the decoding pointer can not move too fast causing and surpass playing pointer (causing decoding program will cover the not yet Buffer of broadcast) after a mobile circle.
Realize decoding and synchronizeing of playing by the control to the Buffer flag bit, constantly detect corresponding Buffer state variation situation in whole decoding and playing process, guarantee that simultaneously decoding has precedence over the several frames of broadcast all the time, and preferential frame number is no more than the number of Buffer;
(2) audio frequency and video are play synchronizing step: in the file playing process, the speed of audio frequency is certain, controls the broadcast of video with the time parameter that audio frequency is play, therefore when audio frequency Buffer is in the state of Freeing, unconditionally carry out the audio decoder program.
Except the audio frequency and video normal play, need to process following two kinds of situations:
1. video is faster than audio frequency, adjusts video playout speed.Video decode and the synchronous key of broadcast remain the state of the Buffer flag bit of correspondence: Freeing is corresponding to decode, and the corresponding broadcast of Waiting, therefore control decoding and broadcast can be controlled the decoding speed of whole video.Control by the frame number that audio frequency has been play the frame number that the video permission is play, namely the calculation of parameter such as number of samples that comprise of sample rate and the every frame by audio frequency go out the time that current audio frequency has been play, then by the frame per second of video, calculate the frame number that video should be play; If the frame number of current actual play is more than or equal to the frame number that should play, do not carry out the broadcast of video when scheduling, this process is continued until when audio frequency has been play enough frame numbers, when having been produced new the requirement, video playback just continues to play, overcome the too fast situation of video, thereby controlled the broadcasting speed of video;
2. video is slower than audio frequency, adjusts video playout speed.When the broadcast of video is slower than audio frequency, can catch up with audio frequency for making video, can abandon some frame of video, i.e. frame-skipping.A frame-skipping just frame is set to invalidly, and this frame equally is stored in whole video Buffer sequence with the normal frame of playing, therefore can not have influence on Audio and Video synchronously.When specific practice is the video frame number play greater than reality when the frame number of need playing and video Buffer number, think the video frame number that system can't be decoded enough, directly decoded result is abandoned after decoded, before deal with data, and the sign of current decoding Buffer is set to Skipping, and the decoding pointer moves backward; When playing program detects Skipping, directly the Buffer flag bit is made as Freeing, playing pointer is moved backward, the frame number calculation flag of actual play also adds one simultaneously, realizes the frame-skipping action.
Further, the control method of described Buffer flag bit comprises the following steps:
S101: each Buffer in the audio-video document decode procedure is arranged a sign of flag, and initial value is Freeing;
S102: the Buffer flag bit that the decoding pointed detected when decoding program is Freeing time operation decoding program, if the Buffer of decoding pointed is that other states are not carried out decoding;
S103: after decoded data write Buffer, the sign of this Buffer is made as Waiting, the pointer of decoding simultaneously is toward moving to right;
S104: when playing program detects the flag bit Waiting of Buffer, start playing program, and the flag bit of Buffer is made as Busying; , if the Buffer flag bit of Buffer pointed is not Waiting, do not carry out this broadcast;
S105:, finishing to be write the flag bit of Buffer as Freeing after broadcast, simultaneously playing pointer is moved backward.
Playing program starts in normal codes, and write Freeing and pointer backward mobile process be placed on DMA and handle in the interruption that data produce and carry out.Therefore, the control of Buffer flag bit is to realize audio/video decoding and play synchronous key, constantly detect the state variation situation of corresponding Buffer in whole decoding and playing process, guarantee that simultaneously decoding is all the time prior to playing, and preferential frame number can not surpass the number of Buffer, otherwise with cover part or whole data of not playing.

Claims (4)

  1. The network machine top box audio/video decoding with play synchronization realizing method, it is characterized in that: it comprises an audio decoder and plays synchronizing step, video decode and play synchronizing step and audio frequency and video are play synchronizing step:
    (1) audio decoder and broadcast synchronizing step, video decode and broadcast synchronizing step: by the control to the Buffer flag bit, realize decoding and synchronizeing of playing, constantly detect corresponding Buffer state variation situation in whole decoding and playing process, guarantee that simultaneously decoding has precedence over the several frames of broadcast all the time, and preferential frame number is no more than the number of Buffer;
    (2) audio frequency and video are play synchronizing step: control the broadcast of video with the time parameter that audio frequency is play, it comprises following two kinds of situations:
    1. video is faster than audio frequency, by the frame number that audio frequency has been play, controls the frame number that the video permission is play, and namely the sampling parameter by audio frequency calculates the time that current audio frequency has been play, then by the frame per second of video, calculates the frame number that video should be play; If the frame number of current actual play is more than or equal to the frame number that should play, do not carry out the broadcast of video when scheduling, be continued until when audio frequency has been play enough frame numbers, when having been produced new the requirement, video playback just continues to play;
    2. video is slower than audio frequency, when the video frame number that the frame number of playing when needs has been play greater than reality and video Buffer number, directly decoded result is abandoned after decoded, before deal with data, and the sign of current decoding Buffer is set to Skipping, the decoding pointer moves backward; When playing program detects Skipping, directly the Buffer flag bit is made as Freeing, playing pointer is moved backward, the frame number calculation flag of actual play also adds one simultaneously, realizes the frame-skipping action.
  2. Network machine top box audio/video decoding according to claim 1 with play synchronization realizing method, it is characterized in that: the control method of described Buffer flag bit comprises the following steps:
    S101: each Buffer in the audio-video document decode procedure is arranged a sign of flag, and initial value is Freeing;
    S102: the Buffer flag bit that the decoding pointed detected when decoding program is Freeing time operation decoding program, if the Buffer of decoding pointed is that other states are not carried out decoding;
    S103: after decoded data write Buffer, the sign of this Buffer is made as Waiting, the pointer of decoding simultaneously is toward moving to right;
    S104: when playing program detects the flag bit Waiting of Buffer, start playing program, and the flag bit of Buffer is made as Busying; , if the Buffer flag bit of Buffer pointed is not Waiting, do not carry out this broadcast;
    S105:, finishing to be write the flag bit of Buffer as Freeing after broadcast, simultaneously playing pointer is moved backward.
  3. Network machine top box audio/video decoding according to claim 2 with play synchronization realizing method, it is characterized in that: the described Freeing of writing and pointer mobile process backward are placed on DMA and handle in the interruption that data produce and carry out.
  4. Network machine top box audio/video decoding according to claim 1 with play synchronization realizing method, it is characterized in that: described sampling parameter comprises the sample rate of audio frequency and the number of samples that every frame comprises.
CN2013102960383A 2013-07-16 2013-07-16 Method for achieving synchronization of decoding and displaying of audio and video of network set-top box Pending CN103391467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013102960383A CN103391467A (en) 2013-07-16 2013-07-16 Method for achieving synchronization of decoding and displaying of audio and video of network set-top box

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013102960383A CN103391467A (en) 2013-07-16 2013-07-16 Method for achieving synchronization of decoding and displaying of audio and video of network set-top box

Publications (1)

Publication Number Publication Date
CN103391467A true CN103391467A (en) 2013-11-13

Family

ID=49535610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013102960383A Pending CN103391467A (en) 2013-07-16 2013-07-16 Method for achieving synchronization of decoding and displaying of audio and video of network set-top box

Country Status (1)

Country Link
CN (1) CN103391467A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092920A (en) * 2014-07-16 2014-10-08 浙江航天长峰科技发展有限公司 Audio and video synchronizing method
CN107770597A (en) * 2017-09-28 2018-03-06 北京小鸟科技股份有限公司 Audio and video synchronization method and device
CN108377415A (en) * 2018-02-11 2018-08-07 浙江大华技术股份有限公司 A kind of determination method and device of video frame rate
CN109218795A (en) * 2018-11-29 2019-01-15 青岛海信电器股份有限公司 A kind of more device plays progress synchronous method, device and terminal device
CN111372138A (en) * 2018-12-26 2020-07-03 杭州登虹科技有限公司 Live broadcast low-delay technical scheme of player end
CN113141525A (en) * 2021-03-16 2021-07-20 福建星网智慧科技有限公司 Online video cut-off continuous playing method and system
CN114501095A (en) * 2022-02-11 2022-05-13 广州市保伦电子有限公司 Audio and video synchronous recording method based on recording terminal

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262612A (en) * 2008-03-27 2008-09-10 凌阳科技股份有限公司 A system and method for synchronous playing of multimedia file audio and video
CN101877791A (en) * 2010-06-04 2010-11-03 浙江工业大学 MPEG4-based audio/video synchronization control method in video network transmission

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262612A (en) * 2008-03-27 2008-09-10 凌阳科技股份有限公司 A system and method for synchronous playing of multimedia file audio and video
CN101877791A (en) * 2010-06-04 2010-11-03 浙江工业大学 MPEG4-based audio/video synchronization control method in video network transmission

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092920A (en) * 2014-07-16 2014-10-08 浙江航天长峰科技发展有限公司 Audio and video synchronizing method
CN107770597A (en) * 2017-09-28 2018-03-06 北京小鸟科技股份有限公司 Audio and video synchronization method and device
CN108377415A (en) * 2018-02-11 2018-08-07 浙江大华技术股份有限公司 A kind of determination method and device of video frame rate
CN109218795A (en) * 2018-11-29 2019-01-15 青岛海信电器股份有限公司 A kind of more device plays progress synchronous method, device and terminal device
CN109218795B (en) * 2018-11-29 2021-09-24 海信视像科技股份有限公司 Multi-device playing progress synchronization method and device and terminal device
CN111372138A (en) * 2018-12-26 2020-07-03 杭州登虹科技有限公司 Live broadcast low-delay technical scheme of player end
CN113141525A (en) * 2021-03-16 2021-07-20 福建星网智慧科技有限公司 Online video cut-off continuous playing method and system
CN113141525B (en) * 2021-03-16 2022-05-17 福建星网智慧科技有限公司 Online video cut-off continuous playing method and system
CN114501095A (en) * 2022-02-11 2022-05-13 广州市保伦电子有限公司 Audio and video synchronous recording method based on recording terminal

Similar Documents

Publication Publication Date Title
CN103391467A (en) Method for achieving synchronization of decoding and displaying of audio and video of network set-top box
US9154834B2 (en) Fast switching of synchronized media using time-stamp management
CN103747317B (en) A kind of smooth playing control method of broadcasting storehouse under unstable network
CN106612452B (en) method and device for synchronizing audio and video of set top box
CN105979347A (en) Video play method and device
CN103475927B (en) Online-video real-time speed change play method and system thereof
CN101710992B (en) Pre-decoding high definition player and playing method
CN104020986B (en) A kind of screen recording method and device
CN103458271A (en) Audio-video file splicing method and audio-video file splicing device
CN1980390A (en) Audio-video frequency media data organization realizing method of supporting precision positioning
CN101442675A (en) Multimedia play terminal and play method
CN104410930A (en) A method and device for controlling playing speed of transport stream TS media file
CN105227884A (en) Realize method that video file puts upside down and device thereof
CN103491430A (en) Streaming media data processing method and electronic device
CN103581730A (en) Method for achieving synchronization of audio and video on digital set top box
CN1717733A (en) Be used to guarantee the seamless-reproduced method and apparatus of a plurality of data stream
CN103067792A (en) Media data playing device and playback method thereof
CN106331820A (en) Synchronous audio and video processing method and device
CN101833935B (en) Multi-machine video synchronous playing method based on display card refresh rate
CN100530356C (en) Digital information reproducing apparatus and method
CN104768052A (en) Method and device for extracting voice frequency and subtitles according to language
CN104168504B (en) A kind of method and device of switching programme of digital type TV
CN104185028A (en) Video playing method and terminal thereof
CN104796732A (en) Audio and video editing method and device
US8213778B2 (en) Recording device, reproducing device, recording medium, recording method, and LSI

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20131113

RJ01 Rejection of invention patent application after publication