Audio and video synchronization method, device, electronic device and storage medium

By obtaining the audio and video synchronization parameters of the target audio output device and automatically adjusting the audio and video synchronization, it solves the problem of cumbersome manual adjustment of parameters by users, and realizes the automation of audio and video synchronization and improves the user experience.

CN117915137BActive Publication Date: 2024-10-08SHENZHEN SKYWORTH INT TRADE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202311831661.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2024-10-08
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

In the existing technology, users need to manually adjust audio and video synchronization parameters, which is cumbersome and not intelligent enough, making it difficult to achieve audio and video synchronization.

Method used

By obtaining the audio and video synchronization parameters of the target audio output device, the synchronization of the display device and the audio output device is automatically adjusted, and the database is used to store historical parameters and default parameters to achieve automatic audio and video synchronization.

Benefits of technology

There is no need for the user to manually adjust parameters, which reduces the complexity of the operation, improves the user experience, and realizes the automation of audio and video synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117915137B_ABST
    Figure CN117915137B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for synchronizing audio and video. The present application obtains the audio and video synchronization parameters corresponding to the target audio output device when the audio output device connected to the display device is switched from the current audio output device to the target audio output device; obtains the audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data; based on the audio and video synchronization parameters, controls the display device to play the picture data, and controls the target audio output device to play the audio data, so that the picture data presented by the display device is synchronized with the audio data played by the target audio output device. This reduces the complexity of user operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for synchronizing audio and video. Background Art

[0002] With the development of technology and the improvement of people's requirements for audio-visual experience, various types of audio output devices have appeared on the market, such as wired headphones, Bluetooth headphones, Bluetooth speakers, HDMI ARC devices, SPDIF output devices, USB speakers, and so on. When people watch audio and video works through display devices such as TVs, tablets, and mobile phones, they can meet their audio-visual experience needs by connecting various external audio output devices. In actual applications, when playing audio through an external audio output device, there is often a problem that the picture played by the display device is not synchronized with the audio played by the external audio output device. In response to the above problem of audio and video being out of sync, the current solution is mostly for users to manually adjust parameters through the "Audio and Video Synchronization" option in the menu to achieve the effect of audio and video synchronization.

[0003] However, this method of manually adjusting parameters by the user to achieve audio and video synchronization may require the user to make multiple attempts during the parameter adjustment process, and the operation is complicated and not smart enough. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for synchronizing audio and video, so as to solve the problem that the method of manually adjusting parameters by users to achieve audio and video synchronization is not intelligent enough. The specific technical solution is as follows:

[0005] In a first aspect, the present application provides a method for synchronizing audio and video, comprising:

[0006] When the audio output device connected to the display device is switched from the current audio output device to the target audio output device, obtaining an audio-visual synchronization parameter corresponding to the target audio output device, wherein the current audio output device is connected to the display device through a first connection mode, the target audio output device is connected to the display device through a second connection mode, and the first connection mode is different from the second connection mode;

[0007] Acquire audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data;

[0008] Based on the audio-visual synchronization parameter, the display device is controlled to play the image data, and the target audio output device is controlled to play the audio data, so that the image data presented by the display device is synchronized with the audio data played by the target audio output device.

[0009] In a possible implementation, obtaining the audio and video synchronization parameter corresponding to the target audio output device includes:

[0010] Obtaining the device type and target device identifier corresponding to the target audio output device;

[0011] Determine that a database corresponding to the device type is a target database, wherein the target database stores at least one device identifier and a historical parameter corresponding to the device identifier;

[0012] In a case where the target database contains the target device identifier, determining the historical parameter corresponding to the target device identifier as the audio and video synchronization parameter;

[0013] When the target database does not contain the target device identifier, a default parameter corresponding to the device type is determined as the audio and video synchronization parameter.

[0014] In a possible implementation, the method further includes:

[0015] In a case where the target database does not contain the target device identifier, determining the number of device identifiers contained in the target database;

[0016] When the number of the identifications is greater than or equal to a preset threshold, determining an identification to be deleted from at least one of the device identifications;

[0017] Deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier in the target database;

[0018] After deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier, the target device identifier and the audio-visual synchronization parameters corresponding to the target device identifier are associated and stored in the target database.

[0019] In a possible implementation manner, determining the to-be-deleted identifier in at least one of the device identifiers includes:

[0020] Determine the storage time corresponding to each device identification;

[0021] The device identifier corresponding to the earliest storage time is determined as the identifier to be deleted.

[0022] In a possible implementation manner, determining the to-be-deleted identifier in at least one of the device identifiers includes:

[0023] For each device identification, generating a corresponding identification option based on the device identification;

[0024] Display the identification options corresponding to each device identification through visual components;

[0025] In case of receiving option information input based on the visualization component, determining the identification option indicated by the option information as the target option;

[0026] The device identifier corresponding to the target option is determined as the identifier to be deleted.

[0027] In a possible implementation, the method further includes:

[0028] Display the audio and video synchronization parameters through a visual component;

[0029] In case of receiving adjustment data input based on the visualization component, determining a target audio-visual synchronization parameter based on the audio-visual synchronization parameter and the adjustment data;

[0030] Based on the target audio-visual synchronization parameter, the display device is controlled to play the image data, and the target audio output device is controlled to play the audio data.

[0031] In a possible implementation manner, before acquiring the audio and video synchronization parameter corresponding to the target audio output device, the method further includes:

[0032] When the display device is turned on, determining the audio output device most recently used by the display device;

[0033] Determining a connection status between the audio output device and the display device;

[0034] When the connection state is connected, determining the audio output device as the target audio output device;

[0035] When the connection state is unconnected, determining at least one audio output device currently connected to the display device and a priority corresponding to each audio output device, and determining the audio output device with the highest corresponding priority as the target audio output device;

[0036] The audio output device connected to the display device is switched from the current audio output device to the target audio output device.

[0037] In a second aspect, the present application provides an audio-video synchronization device, comprising:

[0038] a parameter acquisition module, configured to acquire, when the audio output device connected to the display device is switched from a current audio output device to a target audio output device, an audio-visual synchronization parameter corresponding to the target audio output device, wherein the current audio output device is connected to the display device via a first connection mode, the target audio output device is connected to the display device via a second connection mode, and the first connection mode is different from the second connection mode;

[0039] A data acquisition module, used to acquire audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data;

[0040] The playback control module is used to control the display device to play the picture data based on the audio-visual synchronization parameter, and control the target audio output device to play the audio data, so that the picture data presented by the display device is synchronized with the audio data played by the target audio output device.

[0041] In a possible implementation, the parameter acquisition module is further used to:

[0042] Obtaining the device type and target device identifier corresponding to the target audio output device;

[0043] Determine that a database corresponding to the device type is a target database, wherein the target database stores at least one device identifier and a historical parameter corresponding to the device identifier;

[0044] In a case where the target database contains the target device identifier, determining the historical parameter corresponding to the target device identifier as the audio and video synchronization parameter;

[0045] When the target database does not contain the target device identifier, a default parameter corresponding to the device type is determined as the audio and video synchronization parameter.

[0046] In a possible implementation manner, the device further includes a storage module, configured to:

[0047] In a case where the target database does not contain the target device identifier, determining the number of device identifiers contained in the target database;

[0048] When the number of the identifications is greater than or equal to a preset threshold, determining an identification to be deleted from at least one of the device identifications;

[0049] Deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier in the target database;

[0050] After deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier, the target device identifier and the audio-visual synchronization parameters corresponding to the target device identifier are associated and stored in the target database.

[0051] In a possible implementation manner, the storage module is further used to:

[0052] Determine the storage time corresponding to each device identification;

[0053] The device identifier corresponding to the earliest storage time is determined as the identifier to be deleted.

[0054] In a possible implementation manner, the storage module is further used for:

[0055] For each device identification, generating a corresponding identification option based on the device identification;

[0056] Display the identification options corresponding to each device identification through visual components;

[0057] In case of receiving option information input based on the visualization component, determining the identification option indicated by the option information as the target option;

[0058] The device identifier corresponding to the target option is determined as the identifier to be deleted.

[0059] In a possible implementation, the device further includes a parameter display module, which is used to:

[0060] Display the audio and video synchronization parameters through a visual component;

[0061] In case of receiving adjustment data input based on the visualization component, determining a target audio-visual synchronization parameter based on the audio-visual synchronization parameter and the adjustment data;

[0062] Based on the target audio-visual synchronization parameter, the display device is controlled to play the image data, and the target audio output device is controlled to play the audio data.

[0063] In a possible implementation, the apparatus further includes a device switching module, configured to:

[0064] When the display device is turned on, determining the audio output device most recently used by the display device;

[0065] Determining a connection status between the audio output device and the display device;

[0066] When the connection state is connected, determining the audio output device as the target audio output device;

[0067] When the connection state is unconnected, determining at least one audio output device currently connected to the display device and a priority corresponding to each audio output device, and determining the audio output device with the highest corresponding priority as the target audio output device;

[0068] The audio output device connected to the display device is switched from the current audio output device to the target audio output device.

[0069] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0070] Memory, used to store computer programs;

[0071] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.

[0072] In a fourth aspect, a computer-readable storage medium is provided, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0073] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned audio and video synchronization methods.

[0074] Beneficial effects of the embodiments of the present application:

[0075] The embodiments of the present application provide a method, device, electronic device and storage medium for synchronizing audio and video. In the embodiments of the present application, when the audio output device connected to the display device is switched from the current audio output device to the target audio output device, the audio and video synchronization parameters corresponding to the target audio output device can be automatically obtained, and the audio and video synchronization between the display device and the audio output device can be achieved through the audio and video synchronization parameters. In this way, in the process of achieving audio and video synchronization, the user does not need to manually adjust the parameters, thereby reducing the user's operation complexity and improving the user experience.

[0076] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0078] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0079] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0080] Figure 1 A flowchart of a method for synchronizing audio and video provided in an embodiment of the present application;

[0081] Figure 2 A schematic diagram of a scenario in which a display device is connected to multiple audio output devices according to an embodiment of the present application;

[0082] Figure 3 A flowchart of another audio and video synchronization method provided in an embodiment of the present application;

[0083] Figure 4 A flowchart of another audio and video synchronization method provided in an embodiment of the present application;

[0084] Figure 5 A flowchart of another audio and video synchronization method provided in an embodiment of the present application;

[0085] Figure 6 A schematic diagram of the structure of an audio and video synchronization device provided in an embodiment of the present application;

[0086] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0087] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0088] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0089] Figure 1 A flow chart of a method for synchronizing audio and video provided in an embodiment of the present application. This method can be applied to one or more electronic devices such as display devices, smart phones, laptops, desktop computers, portable computers, servers, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0090] like Figure 1 As shown, the method specifically includes:

[0091] S101, when an audio output device connected to a display device is switched from a current audio output device to a target audio output device, obtaining an audio-visual synchronization parameter corresponding to the target audio output device, wherein the current audio output device is connected to the display device via a first connection method, the target audio output device is connected to the display device via a second connection method, and the first connection method is different from the second connection method.

[0092] Display device refers to a device with image display function, such as a TV, computer, display screen, etc. The display device can be connected to a variety of audio output devices.

[0093] Audio output devices refer to devices with audio playback capabilities, such as wired headphones, Bluetooth headphones, Bluetooth speakers, HDMI ARC devices, SPDIF output devices, USB speakers, etc.

[0094] Figure 2 A schematic diagram of a scenario where a display device is connected to multiple audio output devices, such as Figure 2As shown, the display device can be connected to multiple audio output devices from device 1 to device 13, wherein the display device is a TV (television), devices 1 to device 5 are Bluetooth headsets, devices 6 to device 10 are Bluetooth speakers, and devices 11 to device 13 can be HDMI ARC devices or SPDIF output devices.

[0095] The audio and video synchronization parameter is used to characterize the output delay of the audio output device outputting audio data.

[0096] In the application, the current audio output device can be the speaker of the display device. At this time, the actual scenario corresponding to the audio output device connected to the display device switching from the current audio output device (i.e. the speaker of the display device) to the target audio output device is to connect to an external audio output device. In other words, the first connection method is the local speaker, and the second connection method is external (for example, Bluetooth connection, wired connection, etc.).

[0097] In addition, the current audio output device may also be an external audio output device. In this case, the actual scenario corresponding to the audio output device connected to the display device switching from the current audio output device to the target audio output device is switching from one external audio output device to another external audio output device, and the connection modes between the two external audio output devices and the display device are different. For example, the connection mode between the current audio output device and the display device is Bluetooth connection, and the connection mode between the target audio output device and the display device is wired connection.

[0098] In the embodiment of the present application, audio and video synchronization parameters corresponding to different audio output devices can be preset. Based on this, when the audio output device connected to the display device is switched from the current audio output device to the target audio output device (i.e., when the display device is connected to the target audio output device, or, is switched from another audio output device to the target audio output device), the audio and video synchronization parameters corresponding to the target audio output device can be determined according to the corresponding relationship between the audio output device and the audio and video synchronization parameters.

[0099] As for how to obtain the audio and video synchronization parameters corresponding to the target audio output device, it will be explained in detail through the embodiments below and will not be described in detail here.

[0100] S102, obtaining audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data.

[0101] The audio and video data to be played includes the picture data to be played through the display device, and the audio data corresponding to the picture data to be played through the target audio output device. In the application, the audio and video data to be played can be a movie, a TV series, a video clip, etc.

[0102] In one embodiment, the specific implementation of obtaining the audio and video data to be played may include: receiving the audio and video data input by the user through the display device, and determining the audio and video data as the audio and video data to be played. In this way, the user can input the audio and video data to be played according to actual needs.

[0103] In another embodiment, the specific implementation of obtaining the audio and video data to be played may further include: receiving the audio and video data sent by the data distribution server through the display device, and determining the audio and video data as the audio and video data to be played. The data distribution server is used to send the audio and video data to the display device. Through this solution, the audio and video data sent by the data distribution server can be directly used as the audio and video data to be played for subsequent playback without the user manually selecting the data.

[0104] S103, based on the audio-visual synchronization parameter, controlling the display device to play the image data, and controlling the target audio output device to play the audio data, so that the image data presented by the display device is synchronized with the audio data played by the target audio output device.

[0105] In an embodiment of the present application, first, the output delay of the target audio output device can be determined according to the audio and video synchronization parameters, and then the display device is controlled to play the picture data according to the output delay, and the target audio output device is controlled to play the audio data.

[0106] For example, if the output delay of the target audio output device is 0.5 seconds, after controlling the target audio output device to play the audio data, the delay is 0.5 seconds, and then the display device is controlled to play the picture data, so that the picture data presented by the display device is synchronized with the audio data played by the target audio output device.

[0107] In addition, in order to avoid the situation where the audio and video synchronization parameters determined by S101 are inconsistent with the actual needs of the user, in another embodiment of the present application, the method may also include the following steps: displaying the audio and video synchronization parameters through a visualization component, and upon receiving adjustment data based on the input of the visualization component, determining the target audio and video synchronization parameters based on the audio and video synchronization parameters and the adjustment data, and based on the target audio and video synchronization parameters, controlling the display device to play the picture data, and controlling the target audio output device to play the audio data.

[0108] Adjustment data is used to adjust the delay time based on the audio and video synchronization parameters.

[0109] In the embodiment of the present application, the final target audio and video synchronization parameters can be determined through the audio and video synchronization parameters and the adjustment data input by the user for the audio and video synchronization parameters.

[0110] For example, if the audio-visual synchronization parameter is 0.5 seconds, and the adjustment data entered by the user is "add 0.1 seconds to the audio-visual synchronization parameter", the target audio-visual synchronization parameter is 0.5+0.1=0.6 seconds; for another example, if the audio-visual synchronization parameter is 0.9 seconds, and the adjustment data entered by the user is "subtract 0.2 seconds from the audio-visual synchronization parameter", the target audio-visual synchronization parameter is 0.9-0.2=0.7 seconds. In this way, the user can adjust the determined audio-visual synchronization parameter according to the actual usage situation to obtain the target audio-visual synchronization parameter that meets the user's needs.

[0111] In an embodiment of the present application, when the audio output device connected to the display device is switched from the current audio output device to the target audio output device, the audio and video synchronization parameters corresponding to the target audio output device can be automatically obtained, and the audio and video synchronization between the display device and the audio output device can be achieved through the audio and video synchronization parameters. In this way, in the process of achieving audio and video synchronization, the user does not need to manually adjust the parameters, thereby reducing the user's operation complexity and improving the user experience.

[0112] See also Figure 3 , is a flow chart of another embodiment of a method for synchronizing audio and video provided in an embodiment of the present application. Figure 3 The process shown in the above Figure 1 Based on the process shown in FIG. 1 , the following describes how to obtain the audio and video synchronization parameters corresponding to the target audio output device. Figure 3 As shown, the process may include the following steps:

[0113] S301: Obtain a device type and a target device identifier corresponding to the target audio output device.

[0114] Device type, used to characterize the type of the target audio output device, for example, Bluetooth output device, HDMI ARC device, SPDIF output device, wired headphone device.

[0115] In the application, the display device can be connected to various types of audio output devices. Taking the TV as an example, the current TV can be connected to Bluetooth output devices (such as Bluetooth speakers, Bluetooth headphones, etc.), and the TV generally supports multiple Bluetooth output devices; it can also be connected to HDMI ARC devices, and the TV generally supports 3 HDMI ports, so 3 HDMIARC devices can be connected at the same time; it can also be connected to SPDIF output devices, and the TV generally supports 1 SPDIF port, which can connect 1 SPDIF output device; it can also be connected to wired headphone devices, and the TV generally retains a wired headphone port, which can connect 1 wired headphone device.

[0116] In one embodiment, the corresponding device type can be determined by the connection mode between the current target audio output device and the display device. For example, if the target audio output device is connected to the display device via an HDMI interface, the target audio output device is an HDMI ARC device. For another example, if the target audio output device is connected to the display device via Bluetooth, the target audio output device is a Bluetooth output device.

[0117] Target device identifier, used to uniquely identify the target audio output device, for example, the Mac address of a Bluetooth output device.

[0118] S302: Determine that the database corresponding to the device type is a target database, wherein the target database stores at least one device identification and historical parameters corresponding to the device identification.

[0119] The target database is used to store device identifiers of audio output devices of corresponding device types that have been historically applied and corresponding historical parameters (ie, audio and video synchronization parameters that have been historically applied to the audio output device).

[0120] For example, the target database for Bluetooth output devices stores: Bluetooth output device 1: parameter 1 (which means: the user has connected Bluetooth output device 1 to the display device, and the audio and video synchronization parameter applied is parameter 1); Bluetooth output device 2: parameter 2 (which means: the user has connected Bluetooth output device 2 to the display device, and the audio and video synchronization parameter applied is parameter 2); Bluetooth output device 3: parameter 3 (which means: the user has connected Bluetooth output device 3 to the display device, and the audio and video synchronization parameter applied is parameter 3).

[0121] For another example, the target database for SPDIF output devices stores: SPDIF output device 1: parameter a (which means: the user has connected SPDIF output device 1 to the display device, and the applied audio and video synchronization parameter is parameter a); SPDIF output device 2: parameter b (which means: the user has connected SPDIF output device 2 to the display device, and the applied audio and video synchronization parameter is parameter b).

[0122] S303: When the target database contains the target device identifier, determine the historical parameter corresponding to the target device identifier as the audio and video synchronization parameter.

[0123] In an embodiment of the present application, first, a target device identifier is searched in a target database corresponding to the target audio output device. If the target device identifier is found, it means that the user has used the target audio output device, and the target database records historical parameters applied by the user when using the target audio output device. Therefore, the historical parameters corresponding to the target device identifier can be determined as audio and video synchronization parameters.

[0124] Through this solution, the historical parameters used by the user for the target audio output device can be used as audio and video synchronization parameters, so that the determined audio and video synchronization parameters can meet the user's usage habits.

[0125] S304: When the target database does not contain the target device identifier, determine the default parameter corresponding to the device type as the audio and video synchronization parameter.

[0126] Default parameters refer to the parameters that are pre-set according to the device type and are used to adjust the synchronization of audio and video. They can be set by the user based on experience or according to the information provided by the device manufacturer.

[0127] In an embodiment of the present application, if the target device identifier is not found in the target database, it means that the historical usage of the target audio output device is not recorded in the target database. In practical applications, it generally corresponds to the situation that the user has not used the target audio output device, or the user has not used the target audio output device in a short period of time. At this time, the default parameters corresponding to the device type of the target audio output device can be used as the audio and video synchronization parameters. In this way, the automatic acquisition of the audio and video synchronization parameters is achieved.

[0128] In actual applications, each device type corresponds to multiple device brands. Accordingly, the default parameters include brand parameters corresponding to each device brand. Based on this, in another embodiment of the present application, the following steps may also be included: determining the default parameters based on the device type, wherein the default parameters include multiple brand parameters, determining the device brand of the target audio output device, determining the target parameters corresponding to the device brand from the multiple brand parameters, and determining the target parameters as the audio-visual synchronization parameters. In this way, the audio-visual synchronization parameters can be automatically acquired based on the device type and device brand.

[0129] pass Figure 3 The process shown can realize automatic acquisition of audio and video synchronization parameters based on the device type of the target audio output device, thereby eliminating the need for users to manually set parameters and reducing the complexity of user operations.

[0130] See also Figure 4 , is a flow chart of another embodiment of the audio and video synchronization method provided in the embodiment of the present application. Figure 4 As shown, the process may include the following steps:

[0131] S401, when the target database does not contain the target device identifier, determining the number of device identifiers contained in the target database;

[0132] S402, when the number of the identifications is greater than or equal to a preset threshold, determining an identification to be deleted from at least one of the device identifications;

[0133] S403, deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier in the target database;

[0134] S404: After deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier, the target device identifier and the audio-visual synchronization parameters corresponding to the target device identifier are associated and stored in the target database.

[0135] The following is a unified description of S401-S404:

[0136] In the application, a storage upper limit (ie, a preset threshold) of the target database is preset to limit the amount of data stored in the target database.

[0137] Based on this, in an embodiment of the present application, when the target database does not contain the target device identifier, first, the number of device identifiers contained in the target database is determined. When the number of identifiers is greater than or equal to the preset threshold, it means that the amount of data stored in the target database has reached the storage limit. At this time, the identifier to be deleted is determined in at least one device identifier, and the identifier to be deleted and the historical parameters corresponding to the identifier to be deleted are deleted in the target database to save storage space, which is used to associate the target device identifier and the audio and video synchronization parameters corresponding to the target device identifier and store them in the target database.

[0138] As a possible implementation manner, determining the identification to be deleted from at least one of the device identifications may include the following steps: determining the storage time corresponding to each device identification, and determining the device identification with the earliest corresponding storage time as the identification to be deleted.

[0139] In this way, the target database can always store some device identifiers with the most recent application time and the corresponding audio and video synchronization parameters.

[0140] As another possible implementation method, determining the identification to be deleted in at least one of the device identifications may include the following steps: for each device identification, generating a corresponding identification option based on the device identification, displaying the identification option corresponding to each device identification through a visual component, and upon receiving option information input based on the visual component, determining the identification option indicated by the option information as the target option, and determining the device identification corresponding to the target option as the identification to be deleted.

[0141] For example, if the target database includes device identification 1 and device identification 2, option 1 corresponding to device identification 1 and option 2 corresponding to device identification 2 can be displayed through the visualization component. If the user selects option 1, device identification 1 is determined to be the identification to be deleted. In this way, the user can flexibly set the device identification to be deleted according to actual needs.

[0142] When the number of identifications is less than the preset threshold, it means that the amount of data stored in the target database has not reached the storage limit, and the target device identification and the audio and video synchronization parameters corresponding to the target device identification can be directly associated and stored in the target database.

[0143] pass Figure 4 The process shown can associate and store the target device identification and the audio and video synchronization parameters corresponding to the target device identification in the target database, so as to facilitate the understanding of the user's historical usage of the audio output device during subsequent use. Moreover, before storing the target device identification and the audio and video synchronization parameters corresponding to the target device identification, it is determined whether the data storage capacity of the target database has reached the storage upper limit to determine whether some device identifications and corresponding historical parameters need to be deleted, so as to avoid the data storage capacity of the target database exceeding the storage upper limit, thereby avoiding excessive occupation of the system's storage resources.

[0144] See also Figure 5 , is a flow chart of another embodiment of the audio and video synchronization method provided in the embodiment of the present application. Figure 5 As shown, the process may include the following steps:

[0145] S501, when the display device is turned on, determining the audio output device most recently used by the display device;

[0146] S502, determining a connection status between the audio output device and the display device;

[0147] S503, when the connection state is connected, determining the audio output device as the target audio output device;

[0148] S504, when the connection state is not connected, determining at least one audio output device currently connected to the display device and a priority corresponding to each audio output device, and determining the audio output device with the highest corresponding priority as the target audio output device;

[0149] S505: Switch the audio output device connected to the display device from the current audio output device to the target audio output device.

[0150] The following is a unified description of S501-S505:

[0151] In the application, before the display device is shut down each time, the audio output device last used before shutdown can be recorded.

[0152] Based on this, in the embodiment of the present application, when the display device is turned on, the audio output device used by the display device last time can be determined through the content recorded before the shutdown, and then the connection status between the audio output device and the display device is determined. When the connection status between the two is connected, the audio output device can be directly determined as the target audio output device. In this way, when the display device is turned on, the audio output device used by the user last time can be determined as the target audio output device.

[0153] When the connection status between the two is not connected, at least one audio output device currently connected to the display device can be determined first, and then the priorities corresponding to these audio output devices can be determined (for example, the priority ranking can be: wired headphones>Bluetooth output device>HDMI ARC / SPDIF device>this device), and finally, the audio output device with the highest corresponding priority is determined as the target audio output device.

[0154] Furthermore, the priority can be set by the user according to actual needs, or according to the user's usage frequency (i.e., the higher the usage frequency, the higher the corresponding priority), or according to the audio output quality (i.e., the higher the audio output quality, the higher the corresponding priority), and so on.

[0155] In addition, in the application, when the connection status is not connected, you can also directly determine this machine as the target audio output device.

[0156] Next, the audio output device corresponding to the display device and used to output audio data is switched to the target audio output device for subsequent output of audio data.

[0157] pass Figure 5 In the process shown, when the display device is turned on, the target audio output device can be automatically determined based on the user's historical usage of the audio output device and the priority of the audio output device. There is no need for the user to manually select, which reduces the complexity of user operations.

[0158] Based on the same technical concept, the embodiment of the present application also provides a device for synchronizing audio and video. Figure 6 As shown, the device comprises:

[0159] A parameter acquisition module 601 is used to acquire the audio-visual synchronization parameter corresponding to the target audio output device when the audio output device connected to the display device is switched from the current audio output device to the target audio output device, wherein the current audio output device is connected to the display device through a first connection mode, the target audio output device is connected to the display device through a second connection mode, and the first connection mode is different from the second connection mode;

[0160] The data acquisition module 602 is used to acquire audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data;

[0161] The playback control module 603 is used to control the display device to play the picture data based on the audio-visual synchronization parameters, and control the target audio output device to play the audio data, so that the picture data presented by the display device is synchronized with the audio data played by the target audio output device.

[0162] In a possible implementation, the parameter acquisition module is further used to:

[0163] Obtaining the device type and target device identifier corresponding to the target audio output device;

[0164] Determine that a database corresponding to the device type is a target database, wherein the target database stores at least one device identifier and a historical parameter corresponding to the device identifier;

[0165] In a case where the target database contains the target device identifier, determining the historical parameter corresponding to the target device identifier as the audio and video synchronization parameter;

[0166] When the target database does not contain the target device identifier, a default parameter corresponding to the device type is determined as the audio and video synchronization parameter.

[0167] In a possible implementation manner, the device further includes a storage module, configured to:

[0168] In a case where the target database does not contain the target device identifier, determining the number of device identifiers contained in the target database;

[0169] When the number of the identifications is greater than or equal to a preset threshold, determining an identification to be deleted from at least one of the device identifications;

[0170] Deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier in the target database;

[0171] After deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier, the target device identifier and the audio-visual synchronization parameters corresponding to the target device identifier are associated and stored in the target database.

[0172] In a possible implementation manner, the storage module is further used to:

[0173] Determine the storage time corresponding to each device identification;

[0174] The device identifier corresponding to the earliest storage time is determined as the identifier to be deleted.

[0175] In a possible implementation manner, the storage module is further used for:

[0176] For each device identification, generating a corresponding identification option based on the device identification;

[0177] Display the identification options corresponding to each device identification through visual components;

[0178] In case of receiving option information input based on the visualization component, determining the identification option indicated by the option information as the target option;

[0179] The device identifier corresponding to the target option is determined as the identifier to be deleted.

[0180] In a possible implementation, the device further includes a parameter display module, which is used to:

[0181] Display the audio and video synchronization parameters through a visual component;

[0182] In case of receiving adjustment data input based on the visualization component, determining a target audio-visual synchronization parameter based on the audio-visual synchronization parameter and the adjustment data;

[0183] Based on the target audio-visual synchronization parameter, the display device is controlled to play the image data, and the target audio output device is controlled to play the audio data.

[0184] In a possible implementation, the apparatus further includes a device switching module, configured to:

[0185] When the display device is turned on, determining the audio output device most recently used by the display device;

[0186] Determining a connection status between the audio output device and the display device;

[0187] When the connection state is connected, determining the audio output device as the target audio output device;

[0188] When the connection state is unconnected, determining at least one audio output device currently connected to the display device and a priority corresponding to each audio output device, and determining the audio output device with the highest corresponding priority as the target audio output device;

[0189] The audio output device connected to the display device is switched from the current audio output device to the target audio output device.

[0190] In an embodiment of the present application, when the audio output device connected to the display device is switched from the current audio output device to the target audio output device, the audio and video synchronization parameters corresponding to the target audio output device can be automatically obtained, and the audio and video synchronization between the display device and the audio output device can be achieved through the audio and video synchronization parameters. In this way, in the process of achieving audio and video synchronization, the user does not need to manually adjust the parameters, thereby reducing the user's operation complexity and improving the user experience.

[0191] Based on the same technical concept, the embodiment of the present application also provides an electronic device, such as Figure 7 As shown, it includes a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0192] Memory 113, used for storing computer programs;

[0193] The processor 111 is used to execute the program stored in the memory 113 to implement the following steps:

[0194] When the audio output device connected to the display device is switched from the current audio output device to the target audio output device, obtaining an audio-visual synchronization parameter corresponding to the target audio output device, wherein the current audio output device is connected to the display device through a first connection mode, the target audio output device is connected to the display device through a second connection mode, and the first connection mode is different from the second connection mode;

[0195] Acquire audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data;

[0196] Based on the audio-visual synchronization parameter, the display device is controlled to play the image data, and the target audio output device is controlled to play the audio data, so that the image data presented by the display device is synchronized with the audio data played by the target audio output device.

[0197] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0198] The communication interface is used for communication between the above electronic device and other devices.

[0199] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0200] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0201] In another embodiment provided by the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned audio and video synchronization methods are implemented.

[0202] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the audio and video synchronization methods in the above embodiments.

[0203] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0204] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0205] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0206] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for synchronizing audio and video, characterized in that: The method comprises: In a case where the audio output device connected to the display device is switched from the current audio output device to the target audio output device, obtaining audio and video synchronization parameters corresponding to the target audio output device, wherein the current audio output device is connected to the display device via a first connection method, and the target audio output device is connected to the display device via a second connection method, and the first connection method is different from the second connection method; the obtaining audio and video synchronization parameters corresponding to the target audio output device includes: obtaining a device type and a target device identifier corresponding to the target audio output device; determining a database corresponding to the device type as a target database, wherein at least one device identifier and historical parameters corresponding to the device identifier are stored in the target database; in a case where the target database contains the target device identifier, determining the historical parameters corresponding to the target device identifier as the audio and video synchronization parameters; in a case where the target database does not contain the target device identifier, determining the default parameters corresponding to the device type as the audio and video synchronization parameters; Acquire audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data; Based on the audio-visual synchronization parameter, the display device is controlled to play the image data, and the target audio output device is controlled to play the audio data, so that the image data presented by the display device is synchronized with the audio data played by the target audio output device.

2. The method according to claim 1, characterized in that The method further comprises: In a case where the target database does not contain the target device identifier, determining the number of device identifiers contained in the target database; When the number of the identifications is greater than or equal to a preset threshold, determining an identification to be deleted from at least one of the device identifications; Deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier in the target database; After deleting the to-be-deleted identifier and the historical parameters corresponding to the to-be-deleted identifier, the target device identifier and the audio-visual synchronization parameters corresponding to the target device identifier are associated and stored in the target database.

3. The method according to claim 2, characterized in that The step of determining the identification to be deleted from at least one of the device identifications includes: Determine the storage time corresponding to each device identification; The device identifier corresponding to the earliest storage time is determined as the identifier to be deleted.

4. The method according to claim 2, characterized in that: The step of determining the identification to be deleted from at least one of the device identifications includes: For each device identification, generating a corresponding identification option based on the device identification; Display the identification options corresponding to each device identification through visual components; In case of receiving option information input based on the visualization component, determining the identification option indicated by the option information as the target option; The device identifier corresponding to the target option is determined as the identifier to be deleted.

5. The method according to claim 1, characterized in that The method further comprises: Display the audio and video synchronization parameters through a visual component; In case of receiving adjustment data input based on the visualization component, determining a target audio-visual synchronization parameter based on the audio-visual synchronization parameter and the adjustment data; Based on the target audio-visual synchronization parameter, the display device is controlled to play the image data, and the target audio output device is controlled to play the audio data.

6. The method according to claim 1, characterized in that Before obtaining the audio and video synchronization parameters corresponding to the target audio output device, the method further includes: When the display device is turned on, determining the audio output device most recently used by the display device; Determining a connection status between the audio output device and the display device; When the connection state is connected, determining the audio output device as the target audio output device; When the connection state is unconnected, determining at least one audio output device currently connected to the display device and a priority corresponding to each audio output device, and determining the audio output device with the highest corresponding priority as the target audio output device; The audio output device connected to the display device is switched from the current audio output device to the target audio output device.

7. An audio and video synchronization device, characterized in that: The device comprises: a parameter acquisition module, configured to acquire, when the audio output device connected to the display device is switched from a current audio output device to a target audio output device, an audio-visual synchronization parameter corresponding to the target audio output device, wherein the current audio output device is connected to the display device via a first connection mode, the target audio output device is connected to the display device via a second connection mode, and the first connection mode is different from the second connection mode; A data acquisition module, used to acquire audio and video data to be played, wherein the audio and video data to be played includes picture data and audio data corresponding to the picture data; The playback control module is used to control the display device to play the picture data based on the audio-visual synchronization parameter, and control the target audio output device to play the audio data, so that the picture data presented by the display device is synchronized with the audio data played by the target audio output device.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Terminal equipment audio and picture synchronization method and device

    CN106454471A

  • Audio-image synchronizing method, equipment and devices

    CN109525881A

  • Display device and sound and picture synchronization method

    CN113132769A

  • Page display method and device, electronic device and readable storage medium

    CN114143589A

  • Audio processing method and device, equipment and medium

    CN115623278A