CN112291607B - Video and audio data synchronous output method and system thereof - Google Patents

Video and audio data synchronous output method and system thereof Download PDF

Info

Publication number
CN112291607B
CN112291607B CN202011178370.6A CN202011178370A CN112291607B CN 112291607 B CN112291607 B CN 112291607B CN 202011178370 A CN202011178370 A CN 202011178370A CN 112291607 B CN112291607 B CN 112291607B
Authority
CN
China
Prior art keywords
delay amount
audio
value
unit
late
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.)
Active
Application number
CN202011178370.6A
Other languages
Chinese (zh)
Other versions
CN112291607A (en
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.)
Chengdu Jimi Technology Co Ltd
Original Assignee
Chengdu Jimi Technology 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 Chengdu Jimi Technology Co Ltd filed Critical Chengdu Jimi Technology Co Ltd
Priority to CN202011178370.6A priority Critical patent/CN112291607B/en
Publication of CN112291607A publication Critical patent/CN112291607A/en
Application granted granted Critical
Publication of CN112291607B publication Critical patent/CN112291607B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/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/439Processing of audio elementary 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a video and audio data synchronous output method and a system thereof, comprising the following steps: acquiring a video output delay amount and a first audio output delay amount of a video playing unit, and configuring the video output delay amount of the video playing unit to be the same as the first audio output delay amount, wherein the first audio output delay amount comprises a BSP delay amount and a first ALSA delay amount; acquiring a second audio output delay amount formed by a second ALSA delay amount of the external audio playing unit; obtaining a delay amount difference value of the first audio output delay amount and the second audio output delay amount by using a formula t _ d _ value = t _ bsp + t _ spread _ late-t _ usb _ late; when the delay difference value belongs to the threshold interval, if t _ d _ value is greater than 0, updating the second audio output delay amount by using a formula t _ usb _ late = t _ usb _ late + t _ d _ value, if t _ d _ value is less than 0, updating the video output delay amount by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and updating the first audio output delay amount by using a formula t _ maker _ late = t _ spaker _ late + | t _ d _ value |.

Description

Video and audio data synchronous output method and system thereof
Technical Field
The invention relates to the field of video and audio data processing, in particular to a video and audio data synchronous output method and a system thereof.
Background
Currently, a built-in audio player collocated with a video playing device such as a projection device, a television device, etc. includes: the machine is provided with a loudspeaker, and the problems of insufficient bass and insufficient whole sound effect rendering and the like generally exist. Therefore, a user generally needs to use an external audio playing device to connect with a video playing device, so as to improve the sound experience when the video playing device is used. Under the condition that a user uses the external audio playing device, the internal audio player of the video playing device is matched with the external sound box to make sound at the same time, so that the overall audio-visual experience of the user can be improved at a lower cost.
The currently common external audio playing device in the market is mainly a sound box using a usb interface. The built-in audio player of the video playing device is matched with the external usb interface sound box, so that the sound effect is improved, and better sound experience is brought. However, compared with the audio output of a built-in audio player of a video playing device, the audio output of the existing USB interface sound box has a delay condition, and when the video playing device is used in cooperation with the external USB interface sound box, the problem that video and audio cannot be synchronized exists.
Disclosure of Invention
In view of this, the present application provides a video and audio data synchronous output method and system, which solve the problem that video and audio cannot be synchronized when the conventional video playing device is used in cooperation with an external usb interface sound box by improving video and audio output control methods of a video playing unit and an external audio playing unit.
In order to solve the technical problems, the invention provides the following technical scheme: a video and audio data synchronous output method comprises the following steps: s1: acquiring a video output delay amount and a first audio output delay amount of a video playing unit, and configuring the video output delay amount of the video playing unit to be the same as the first audio output delay amount, wherein the first audio output delay amount comprises a BSP delay amount and a first ALSA delay amount; s2: acquiring a second audio output delay amount formed by a second ALSA delay amount of an external audio playing unit using a usb interface; s3: obtaining a delay amount difference value between the first audio output delay amount and the second audio output delay amount by using a formula t _ d _ value = t _ BSP + t _ spread _ late-t _ usb _ late, wherein t _ d _ value is the delay amount difference value, t _ BSP is the BSP delay amount, t _ spread _ late is the first ALSA delay amount, and t _ usb _ late is the second audio output delay amount; s4: when the delay amount difference value belongs to the threshold interval, if t _ d _ value > 0, updating the second audio output delay amount by using a formula t _ usb _ late = t _ usb _ late + t _ d _ value, if t _ d _ value < 0, updating the video output delay amount by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and updating the first audio output delay amount by using a formula t _ distributor _ late = t _ distributor _ late + | t _ d _ value |.
Further, the S4 further includes: when the delay amount difference does not belong to the threshold interval, if t _ d _ value is greater than 0, and audio data are input into a cache unit of the external audio playing unit, after the output of the audio data is delayed by t _ d _ value by a second ALSA architecture unit of the external audio playing unit, the audio data are transmitted to a second driving unit of the external audio playing unit.
Further, the S4 further includes: when the delay amount difference does not belong to the threshold interval, if t _ d _ value is less than 0, updating the video output delay amount by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and updating the BSP delay amount by using a formula t _ BSP = | t _ d _ value |.
Further, updating the second audio output delay amount using the formula t _ usb _ late = t _ usb _ late + t _ d _ value includes: gradually increasing, by the second ALSA architecture unit, a second run buffer of the second drive unit, and a numerical amount of the audio data read by the second drive unit from the second run buffer decreases; when the second running buffer increases until t _ usb _ late = t _ usb _ late + t _ d _ value, the second running buffer remains unchanged, and the second driving unit restores the numerical amount of the audio data read by the second running buffer to an initial value.
Further, updating the first audio output delay amount using the formula t _ divider _ late = t _ divider _ late + | t _ d _ value | includes: gradually increasing, by a first ALSA architecture unit of the video playback unit, a first running buffer of a first drive unit of the video playback unit, and decreasing a numerical amount of the audio data read by the first drive unit from the first running buffer; when the first running buffer increases until t _ spreader _ late = t _ spreader _ late + | t _ d _ value |, the first running buffer remains unchanged, and the first driving unit restores an initial value from the numerical amount of the audio data read by the first running buffer.
Accordingly, the present invention provides a system for synchronously outputting audio and video data, comprising: a video playing unit for outputting a video and a first audio; the external audio playing unit is used for outputting second audio; a management unit of the video playing unit, configured to obtain a video output delay amount and a first audio output delay amount of the video playing unit, configure that the video output delay amount of the video playing unit is the same as the first audio output delay amount, where the first audio output delay amount includes a BSP delay amount and a first ALSA delay amount, and obtain a second audio output delay amount configured by a second ALSA delay amount of the external audio playing unit, and obtain a delay amount difference between the first audio output delay amount and the second audio output delay amount by using a formula t _ d _ value = t _ BSP + t _ spreader _ late-t _ usb _ late, t _ d _ value is the delay amount difference, t _ BSP is the BSP delay amount, t _ distributor _ late is the first ALSA delay amount, and t _ usb _ late is the second audio output delay amount, wherein when the delay amount difference is within a threshold interval, if t _ d _ value > 0, the second audio output delay amount is updated using a formula t _ usb _ late = t _ usb _ late + t _ d _ value, if t _ d _ value < 0, the video output delay amount is updated using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and the first audio output delay amount is updated using a formula t _ distributor _ late = t _ distributor _ late + | t _ d _ value |.
Further, the external audio playing unit includes a second ALSA framework unit, where when the delay amount difference does not belong to the threshold interval, if t _ d _ value is greater than 0, the management unit delays the output of the audio data of the second ALSA framework unit, and after the second ALSA framework unit delays the output of the audio data by t _ d _ value, the audio data is transmitted to a second driving unit of the external audio playing unit.
Further, when the delay amount difference does not belong to the threshold interval, if t _ d _ value < 0, the management unit updates the BSP delay amount using a formula t _ BSP = | t _ d _ value |.
Further, the second driving unit includes a second running buffer, and the management unit updates the second audio output delay amount by dynamically adjusting a size of the second running buffer, wherein the management unit gradually increases the second running buffer by the second ALSA architecture unit, and a numerical amount of the audio data read by the second running buffer by the second driving unit decreases, and when the second running buffer increases until t _ usb _ late = t _ usb _ late + t _ d _ value, the management unit controls the second running buffer to remain unchanged, and the numerical amount of the audio data read by the second driving unit by the second running buffer restores an initial value.
Further, the video playing unit further includes a first ALSA architecture unit and a first driving unit having a first running buffer, and the management unit updates the first audio output delay amount by dynamically adjusting the size of the first running buffer, wherein the management unit gradually increases the first running buffer of the first driving unit through the first ALSA architecture unit, and the first driving unit decreases the amount of the audio data read by the first running buffer; when the first running buffer increases until t _ spreader _ late = t _ spreader _ late + | t _ d _ value |, the first running buffer remains unchanged, and the first driving unit restores an initial value from the numerical amount of the audio data read by the first running buffer.
The video and audio data synchronous output method and the system thereof flexibly call a plurality of control strategies by judging the audio output asynchronous types of the video playing unit and the external audio playing unit, and dynamically adjust the size of the buffer area to eliminate the delay difference when the audio output asynchronous degree is small, thereby solving the problem that the video and audio cannot be synchronous when the traditional video playing equipment is matched with an external usb interface sound box for use, and effectively avoiding the phenomena of audio playing jam and the like caused by eliminating the delay difference.
Drawings
FIG. 1 is a flowchart illustrating a method for synchronously outputting audio and video data according to the present invention;
fig. 2 is a block diagram of a video and audio data synchronous output system according to the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the present invention is further described in detail with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, the present embodiment provides a method for synchronously outputting audio and video data, including: s1: acquiring a video output delay amount and a first audio output delay amount of a video playing unit, and configuring that the video output delay amount of the video playing unit is the same as the first audio output delay amount, wherein the first audio output delay amount comprises a BSP delay amount and a first ALSA delay amount; s2: acquiring a second audio output delay amount formed by a second ALSA delay amount of an external audio playing unit using a usb interface; s3: acquiring a delay difference value between the first audio output delay amount and the second audio output delay amount by using a formula t _ d _ value = t _ BSP + t _ spread _ late-t _ usb _ late, wherein t _ d _ value is the delay difference value, t _ BSP is the BSP delay amount, t _ spread _ late is the first ALSA delay amount, and t _ usb _ late is the second audio output delay amount; s4: when the delay difference value belongs to the threshold interval, if t _ d _ value is greater than 0, updating the second audio output delay amount by using a formula t _ usb _ late = t _ usb _ late + t _ d _ value, if t _ d _ value is less than 0, updating the video output delay amount by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and updating the first audio output delay amount by using a formula t _ maker _ late = t _ spaker _ late + | t _ d _ value |. The video output delay amount is controlled by an audio hal layer, namely a management unit, of the video playing unit; the BSP delay is the audio output delay of the board-level support cladding, and the scenes influencing the BSP delay comprise: playing videos through a network, playing the videos after trapezoidal correction, playing the videos after adjusting different image qualities, and the like; the first ALSA delay amount is the buffering delay of a first driving unit of the video playing unit and is controlled by a first ALSA framework unit; the second ALSA delay is a buffering delay of a second driving unit of the external audio playing unit and is controlled by the second ALSA framework unit.
It should be noted that the threshold interval may be (-15 ms, +15 ms), (-30 ms, +30 ms), (-50 ms, +50 ms), and the like, and the present invention does not specifically limit the threshold interval. Specifically, according to the principle of the hass effect: if two sound sources with the same loudness in the sound field emit the same audio signals, if the time difference between the two sounds transmitted to the human ears is equal to or more than 50ms, the human ears can clearly distinguish the two sounds from different directions; when the time difference of the two sounds transmitted into the ears is within 50ms, the ears cannot obviously distinguish the directions of the two sound sources; when the time difference of two sounds transmitted into the human ear is within 17ms, the human ear will feel as if the sounds only come from the undelayed sound source, and will not feel as if the delayed sound source exists. Therefore, the inventor sets the threshold interval to (-50 ms, +50 ms) at the initial stage of design, and then finds out through a plurality of experiments that when the types/models of the video playing unit and the external audio playing unit are different, the hardware parameters used for constructing the sound field are different, and the software control logic for controlling the audio output strategy is different, and when the threshold interval is not greater than (-50 ms, +50 ms), the different types of video playing units and external audio playing units have different optimal threshold intervals so as to present the optimal audio playing effect. Therefore, the present invention does not specifically limit the threshold interval.
When the video and audio output is asynchronous, the size of the buffer area is dynamically adjusted to eliminate the delay difference, so that the problem that the video and audio cannot be synchronized when the traditional video playing equipment is matched with an external usb interface sound box for use is solved, and the phenomena of audio playing blockage and the like caused by the elimination of the delay difference are effectively avoided. Meanwhile, considering that the initial first audio output delay amount is the same as the initial video output delay amount, in order to avoid the problem of audio and video asynchronization caused by updating the first audio output delay amount, the invention updates the video output delay amount before updating the first audio output delay amount so as to ensure the synchronism of the video and audio output.
Further, updating the second audio output delay amount by using a formula t _ usb _ late = t _ usb _ late + t _ d _ value includes: gradually increasing, by the second ALSA architecture unit, a second running buffer of the second drive unit, and a numerical amount of the audio data read by the second drive unit from the second running buffer decreases; when the second running buffer increases until t _ usb _ late = t _ usb _ late + t _ d _ value, the second running buffer remains unchanged, and the second driving unit restores the numerical amount of the audio data read by the second running buffer to an initial value.
Further, updating the first audio output delay amount using the formula t _ divider _ late = t _ divider _ late + | t _ d _ value | includes: gradually increasing, by a first ALSA architecture unit of the video playback unit, a first running buffer of a first drive unit of the video playback unit, and decreasing a numerical amount of the audio data read by the first drive unit from the first running buffer; when the first running buffer increases until t _ spreader _ late = t _ spreader _ late + | t _ d _ value |, the first running buffer remains unchanged, and the first driving unit restores an initial value from the numerical amount of the audio data read by the first running buffer.
Specifically, the calculation formula of the run buffer size is as follows: run buffer size = period _ size ×. Period _ count, where period _ size refers to the minimum amount of data read from the audio drive at each time in the buffer, and period _ count refers to how many period _ sizes are in the buffer, i.e., the present invention dynamically adjusts the size of the running buffer by dynamically adjusting period _ size and period _ count.
Because the user can hear that two sound sources exist in the sound field when the delay amount difference does not belong to the threshold interval, the user has a poor listening effect, therefore, the setting of S4 in the present invention further includes: and when the delay difference does not belong to the threshold interval, if t _ d _ value is greater than 0, and audio data are input into a cache unit of the external audio playing unit, transmitting the audio data to a second driving unit of the external audio playing unit after a second ALSA framework unit of the external audio playing unit delays the output of the audio data by t _ d _ value. And when the delay amount difference does not belong to the threshold interval, if t _ d _ value is less than 0, updating the video output delay amount by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and updating the BSP delay amount by using a formula t _ BSP = | t _ d _ value |. Therefore, when the user has poor listening effect due to overlarge delay quantity difference, the audio output can be instantly adjusted to eliminate the delay quantity difference, and meanwhile, the problem that sound and picture are not synchronous due to updating of the first audio output delay quantity is solved by considering that the initial first audio output delay quantity is the same as the initial video output delay quantity.
Accordingly, the present invention provides, as shown in fig. 2, a video and audio data synchronous output system, including: a video playing unit for outputting a video and a first audio; the external audio playing unit is used for outputting second audio; a management unit of the video playing unit, configured to obtain a video output delay amount and a first audio output delay amount of the video playing unit, configure the video output delay amount of the video playing unit to be the same as the first audio output delay amount, where the first audio output delay amount includes a BSP delay amount and a first ALSA delay amount, and obtain a second audio output delay amount formed by a second ALSA delay amount of the external audio playing unit, and obtain a delay amount difference between the first audio output delay amount and the second audio output delay amount by using a formula t _ d _ value = t _ BSP + t _ spaker _ late-t _ usb _ late, t _ d _ value is the delay amount difference, t _ BSP is the BSP delay amount, t _ distributor _ late is the first ALSA delay amount, and t _ usb _ late is the second audio output delay amount, wherein when the delay amount difference is within a threshold interval, if t _ d _ value > 0, the second audio output delay amount is updated using a formula t _ usb _ late = t _ usb _ late + t _ d _ value, if t _ d _ value < 0, the video output delay amount is updated using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and the first audio output delay amount is updated using a formula t _ distributor _ late = t _ distributor _ late + | t _ d _ value |. The video playing unit can be a video playing device with a built-in audio player, such as a projector and a television; the external audio playing unit can be an external audio playing device using a USB interface; and the management unit of the video playing unit is an audio hal layer. Specifically, when the delay amount difference does not belong to the threshold interval, if t _ d _ value is less than 0, the management unit updates the video output delay amount by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and updates the BSP delay amount by using a formula t _ BSP = | t _ d _ value |.
Further, the external audio playing unit is provided with a second ALSA framework unit and a second driving unit, when the delay amount difference does not belong to the threshold interval, if t _ d _ value is greater than 0, the management unit delays the output of the audio data of the second ALSA framework unit, and after the second ALSA framework unit delays the output of the audio data by t _ d _ value, the audio data is transmitted to the second driving unit of the external audio playing unit.
Further, the second driving unit includes a second execution buffer, and the management unit updates the second audio output delay amount by dynamically adjusting a size of the second execution buffer, wherein the management unit gradually increases the second execution buffer through the second ALSA architecture unit, and a numerical amount of the audio data read by the second driving unit from the second execution buffer decreases, the management unit controls the second execution buffer to remain unchanged when the second execution buffer increases until t _ usb _ late = t _ usb _ late + t _ d _ value, and the numerical amount of the audio data read by the second driving unit from the second execution buffer restores to an initial value.
Furthermore, the video playing unit further includes a first ALSA framework unit and a first driving unit having a first running buffer, and the management unit updates the first audio output delay amount by dynamically adjusting the size of the first running buffer, wherein the management unit gradually increases the first running buffer of the first driving unit through the first ALSA framework unit, and the first driving unit decreases the amount of the audio data read by the first running buffer; when the first running buffer increases until t _ spreader _ late = t _ spreader _ late + | t _ d _ value |, the first running buffer remains unchanged, and the first driving unit restores an initial value from the numerical amount of the audio data read by the first running buffer.
The above are only preferred embodiments of the present invention, and it should be noted that the above preferred embodiments should not be considered as limiting the present invention, and the protection scope of the present invention should be subject to the scope defined by the claims. It will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the spirit and scope of the invention, and should be considered to be within the scope of the invention.

Claims (4)

1. A video and audio data synchronous output method is characterized by comprising the following steps:
s1: acquiring a video output delay amount and a first audio output delay amount of a video playing unit, and configuring the video output delay amount t _ hal _ late of the video playing unit to be the same as the first audio output delay amount, wherein the first audio output delay amount comprises a BSP delay amount t _ BSP and a first ALSA delay amount t _ spreader _ late;
s2: acquiring a second audio output delay t _ usb _ late formed by a second ALSA delay of the external audio playing unit;
s3: calculating a delay amount difference value t _ d _ value of the first audio output delay amount compared with the second audio output delay amount;
s4: when the delay amount difference value belongs to a threshold interval, if t _ d _ value > 0, gradually increasing a second running buffer of a second driving unit of the external audio playing unit through a second ALSA architecture unit of the external audio playing unit, wherein the numerical amount of the audio data read by the second running buffer by the second driving unit is reduced, the second running buffer is kept unchanged when the second running buffer is increased until the increase of a second audio output delay amount t _ usb _ late is equal to t _ d _ value, and the second driving unit restores the initial value of the numerical amount of the audio data read by the second running buffer, and if t _ d _ value < 0, updates the video output delay amount to make the video output delay amount the same as the second audio output delay amount, and dynamically increases the first ALSA delay amount until the first audio output delay amount is the same as the second audio output delay amount; when the delay difference does not belong to the threshold interval, if t _ d _ value > 0, when audio data is input to the buffer unit of the external audio playing unit, after the second ALSA framework unit of the external audio playing unit delays the output of the audio data by t _ d _ value, the audio data is transmitted to the second driving unit of the external audio playing unit, and if t _ d _ value < 0, the video output delay is updated by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and the BSP delay is updated by using a formula t _ BSP = | t _ d _ value |.
2. The method of claim 1, wherein dynamically increasing the first ALSA delay amount until the first audio output delay amount is the same as the second audio output delay amount comprises:
gradually increasing a first running buffer of a first driving unit of the video playing unit through a first ALSA architecture unit of the video playing unit, and reducing the numerical quantity of the audio data read by the first running buffer by the first driving unit;
when the first running buffer increases until the increase of the first ALSA delay amount t _ spaker _ late is equal to | t _ d _ value |, the first running buffer remains unchanged, and the first driving unit restores the initial value from the numerical amount of the audio data read by the first running buffer.
3. A video-audio data synchronous output system, comprising:
a video playing unit for outputting a video and a first audio;
the external audio playing unit is used for outputting second audio;
a management unit of the video playing unit, configured to obtain a video output delay amount and a first audio output delay amount of the video playing unit, configure the video output delay amount of the video playing unit to be the same as the first audio output delay amount, where the first audio output delay amount includes a BSP delay amount and a first ALSA delay amount, and obtain a second audio output delay amount configured by a second ALSA delay amount of the external audio playing unit, and obtain a delay amount difference between the first audio output delay amount and the second audio output delay amount by using a formula t _ d _ value = t _ BSP + t _ spread _ late-t _ usb _ late, where t _ d _ value is the delay amount difference, t _ BSP is the BSP delay amount, t _ spread _ late is the first audio output delay amount, t _ use _ late is the second audio output delay amount, when the delay amount difference is greater than a threshold value, t _ spread _ late is the first audio output delay amount, t _ use _ late is the second audio output delay amount, and when the second audio output delay amount is greater than the second audio output delay amount, the buffer size is gradually increased by the management unit, and the management unit reads the second audio output buffer size is not updated by reading the second audio output buffer size of the external audio output buffer, and the second audio buffer size, where the second audio buffer size is gradually increased by the management unit, and the second audio output buffer size is not read and the second audio buffer size is increased by the external audio buffer size, and the management unit, the video output delay amount is made the same as the second audio output delay amount, and the first ALSA delay amount is dynamically increased until the first audio output delay amount is the same as the second audio output delay amount,
when the delay amount difference does not belong to the threshold interval, if t _ d _ value is less than 0, the management unit updates the video output delay amount by using a formula t _ hal _ late = t _ hal _ late + | t _ d _ value | and updates the BSP delay amount by using a formula t _ BSP = | t _ d _ value |, and when the delay amount difference does not belong to the threshold interval, if t _ d _ value is greater than 0, the management unit delays the output of the audio data of the second ALSA framework unit, and transmits the audio data to the second driving unit of the external audio playing unit after the second ALSA framework unit delays the output of the audio data by t _ d _ value.
4. The video and audio data synchronous output system according to claim 3, wherein the video playing unit further comprises a first ALSA framework unit and a first driving unit having a first running buffer, the management unit updates the first audio output delay amount by dynamically adjusting a size of the first running buffer, wherein,
the management unit gradually increases a first running buffer of the first driving unit through the first ALSA architecture unit, and the numerical quantity of the audio data read by the first running buffer of the first driving unit is reduced;
when the first running buffer increases until the increase of the first ALSA delay amount t _ spread _ late is equal to | t _ d _ value |, the first running buffer remains unchanged, and the first driving unit restores the initial value from the numerical amount of the audio data read by the first running buffer.
CN202011178370.6A 2020-10-29 2020-10-29 Video and audio data synchronous output method and system thereof Active CN112291607B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011178370.6A CN112291607B (en) 2020-10-29 2020-10-29 Video and audio data synchronous output method and system thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011178370.6A CN112291607B (en) 2020-10-29 2020-10-29 Video and audio data synchronous output method and system thereof

Publications (2)

Publication Number Publication Date
CN112291607A CN112291607A (en) 2021-01-29
CN112291607B true CN112291607B (en) 2022-11-29

Family

ID=74373850

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011178370.6A Active CN112291607B (en) 2020-10-29 2020-10-29 Video and audio data synchronous output method and system thereof

Country Status (1)

Country Link
CN (1) CN112291607B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102256183A (en) * 2010-05-21 2011-11-23 上海捷骐数码科技有限公司 Mobile-communication-network-based audio and video signal real-time transmission method
CN102868908A (en) * 2011-07-04 2013-01-09 哈尔滨融智达网络科技有限公司 High-efficiency streaming media playing method and device
CN103078701A (en) * 2012-10-17 2013-05-01 大唐移动通信设备有限公司 Uplink voice data transmission method and device
CN106162335A (en) * 2015-03-23 2016-11-23 青岛海信电器股份有限公司 Player methods based on multichannel television audio data, Apparatus and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888813A (en) * 2012-12-21 2014-06-25 北京计算机技术及应用研究所 Audio and video synchronization realization method and system
JP6275506B2 (en) * 2014-02-21 2018-02-07 ルネサスエレクトロニクス株式会社 Content output device
CN103795950B (en) * 2014-02-21 2017-07-28 深圳创维-Rgb电子有限公司 Television audio signals processing unit
US10061499B2 (en) * 2014-11-14 2018-08-28 Facebook, Inc. Systems and methods for providing interactive time-lapse selection for captured media content
CN108170398B (en) * 2016-12-07 2021-05-18 博通集成电路(上海)股份有限公司 Apparatus and method for synchronizing speakers
CN108012177A (en) * 2017-12-01 2018-05-08 晨星半导体股份有限公司 The playback method of audio-video frequency playing system and the voice data being applied thereon

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102256183A (en) * 2010-05-21 2011-11-23 上海捷骐数码科技有限公司 Mobile-communication-network-based audio and video signal real-time transmission method
CN102868908A (en) * 2011-07-04 2013-01-09 哈尔滨融智达网络科技有限公司 High-efficiency streaming media playing method and device
CN103078701A (en) * 2012-10-17 2013-05-01 大唐移动通信设备有限公司 Uplink voice data transmission method and device
CN106162335A (en) * 2015-03-23 2016-11-23 青岛海信电器股份有限公司 Player methods based on multichannel television audio data, Apparatus and system

Also Published As

Publication number Publication date
CN112291607A (en) 2021-01-29

Similar Documents

Publication Publication Date Title
JP5957760B2 (en) Video / audio processor
US10992451B2 (en) Audio and video playback system and method for playing audio data applied thereto
US8750536B2 (en) Output control apparatus, output controlling method, program, and output control system
CN104967960A (en) Voice data processing method, and voice data processing method and system in game live broadcasting
JP2015534315A (en) Audio transfer device and corresponding method
CN109165005B (en) Sound effect enhancement method and device, electronic equipment and storage medium
CN109379613A (en) Audio-visual synchronization method of adjustment, TV, computer readable storage medium and system
WO2020038344A1 (en) Method and device for audio and video synchronization, and display apparatus
US20230197115A1 (en) Video Processing Method and Electronic Device
US10318234B2 (en) Display apparatus and controlling method thereof
US12020719B2 (en) Method, a system, and a program for playing back audio/video signals with automatic adjustment of latency
US20170118571A1 (en) Electronic apparatus and sound signal adjustment method thereof
JP6720566B2 (en) Audio equipment
CN112291607B (en) Video and audio data synchronous output method and system thereof
CN112423074B (en) Audio and video synchronization processing method and device, electronic equipment and storage medium
CN112866970A (en) Communication connection method and device, electronic equipment and wireless transmission system
CN108616767B (en) Audio data transmission method and device
CN115767158A (en) Synchronous playing method, terminal equipment and storage medium
CN101180887B (en) Equipment for audio-video processing system
CN115802087A (en) Sound and picture synchronous processing method and related equipment thereof
CN113301410A (en) Audio picture synchronization method, device and system and transmission controller
CN111654745B (en) Multi-channel signal processing method and display device
CN107357547B (en) Audio control method, audio control device and audio equipment
TW201830229A (en) Calibration method and computer readable recording medium
CN108924618A (en) A kind of determination method and device of audio-video delay

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant