Audio and video processing method, device, equipment and medium suitable for embedded devices

Through ring queue caching and streaming noise reduction model processing, the problem of low fluency and low quality of audio and video recording and playback on embedded devices is solved, efficient audio and video processing is achieved, and resource consumption is reduced.

CN114915840BActive Publication Date: 2024-10-29GUANGZHOU H & F ELECTRONICS TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210494322.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2024-10-29
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

During the audio and video recording and broadcasting process, embedded devices have poor signal reception continuity and limited computing and storage resources, resulting in low fluency and low quality of recording and broadcasting.

Method used

A circular queue is used to cache audio and video data segments, and audio noise reduction processing is performed through a streaming noise reduction model, which reduces the amount of data processed each time, reduces computing resource consumption, and improves audio and video quality.

Benefits of technology

It improves the fluency and quality of audio and video, reduces the consumption of storage resources, and enhances the smoothness of the connection between target data segments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114915840B_ABST
    Figure CN114915840B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses an audio and video processing method, device, equipment and medium suitable for embedded devices, wherein the method comprises: obtaining an audio and video data segment from a preset first circular queue as an audio and video data segment to be processed; inputting the audio and video data segment to be processed into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment; using the timestamp range corresponding to the audio and video data segment to be processed, extracting a data segment from the noise-reduced data segment to obtain a target data segment; adding the target data segment to the tail of a preset second circular queue; if the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second circular queue; if the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second circular queue. Thereby, the quality of audio and video is improved, and the fluency of audio and video is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of audio and video technology, and in particular to an audio and video processing method, device, equipment and medium suitable for embedded devices. Background Art

[0002] With the development of technology, the use of embedded devices to connect computers or TVs for audio and video recording and broadcasting has been widely used, but this application method can only be applied to specific places. In order to solve this problem, the inventors found that the audio and video recorded and broadcasted by the embedded device is not smooth and of low quality due to the poor continuity of the signal reception of the embedded device and the limited computing and storage resources of the embedded device. Summary of the invention

[0003] Based on this, it is necessary to propose an audio and video processing method, device, equipment and medium suitable for embedded devices to address the above problems.

[0004] An audio and video processing method applicable to an embedded device, the method comprising:

[0005] Acquire the audio and video data segment from the preset first ring queue as the audio and video data segment to be processed;

[0006] Inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment;

[0007] Using the timestamp range corresponding to the audio and video data segment to be processed, extracting the data segment from the noise-reduced data segment to obtain the target data segment;

[0008] Adding the target data segment to the tail of a preset second circular queue;

[0009] If the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second ring queue;

[0010] If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue.

[0011] An audio and video processing device suitable for embedded devices, the device comprising:

[0012] A module for determining audio and video data segments to be processed, used for obtaining audio and video data segments from a preset first circular queue as audio and video data segments to be processed;

[0013] A noise reduction data segment determination module is used to input the audio and video data segment to be processed into a preset streaming noise reduction model for noise reduction processing to obtain a noise reduction data segment;

[0014] A target data segment determination module, configured to extract a data segment from the noise-reduced data segment using a timestamp range corresponding to the audio and video data segment to be processed, to obtain a target data segment;

[0015] A second circular queue updating module, used for adding the target data segment to the tail of a preset second circular queue;

[0016] an audio and video playing module, configured to play the audio and video according to the second ring queue if the preset recording and broadcasting configuration data includes playing;

[0017] An audio and video storage module is used to store audio and video according to the second ring queue if the recording and broadcasting configuration data includes recording.

[0018] An embedded device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0019] Acquire the audio and video data segment from the preset first ring queue as the audio and video data segment to be processed;

[0020] Inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment;

[0021] Using the timestamp range corresponding to the audio and video data segment to be processed, extracting the data segment from the noise-reduced data segment to obtain the target data segment;

[0022] Adding the target data segment to the tail of a preset second circular queue;

[0023] If the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second ring queue;

[0024] If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue.

[0025] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:

[0026] Acquire the audio and video data segment from the preset first ring queue as the audio and video data segment to be processed;

[0027] Inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment;

[0028] Using the timestamp range corresponding to the audio and video data segment to be processed, extracting the data segment from the noise-reduced data segment to obtain the target data segment;

[0029] Adding the target data segment to the tail of a preset second circular queue;

[0030] If the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second ring queue;

[0031] If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue.

[0032] The audio and video processing method of the present application is applicable to embedded devices. By adopting a first circular queue to cache audio and video data segments, and adopting a second circular queue to cache target data segments, audio and video recording and broadcasting are performed based on the cache, thereby improving the fluency of audio and video, and the circular queue is conducive to reducing the consumption of storage resources; by performing audio noise reduction processing on the audio and video data segments, segmented processing of audio and video is realized, the amount of data for each audio noise reduction processing is reduced, the consumption of computing resources for each audio noise reduction processing is reduced, and the quality of audio and video is improved; by adopting the timestamp range corresponding to the audio and video data segments to be processed, a data segment is extracted from the noise-reduced data segment as a target data segment, and by performing audio noise reduction processing based on the audio and video data segments larger than the timestamp range, audio noise reduction processing is realized based on the above content and the current content, thereby further improving the quality of audio and video, and being conducive to improving the fluency of the connection between each target data segment. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] 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, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] in:

[0035] Figure 1 is a flowchart of an audio and video processing method applicable to an embedded device in an embodiment;

[0036] Figure 2 A structural block diagram of an audio and video processing device suitable for embedded devices in one embodiment;

[0037] Figure 3 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] like Figure 1 As shown, in one embodiment, an audio and video processing method applicable to an embedded device is provided. The method can be applied to a terminal of an embedded device, and this embodiment is illustrated by applying to a terminal. Embedded devices include but are not limited to: audio and video recorders, mobile phones, tablet computers, and wearable devices.

[0040] When the present application is applied to an audio and video recording and broadcasting machine, the audio and video recording and broadcasting machine includes: a CPU (central processing unit), a memory, a USB (Universal Serial Bus) protocol conversion module, an HDMI (High Definition Multimedia Interface) protocol conversion module, a video analog-to-digital conversion module, an audio analog-to-digital conversion module, a CVBS (composite synchronous video broadcast signal or composite video blanking and synchronization) output module, an HDMI output module, a TF (TransFLash) card, a U disk (universal serial bus), power amplifier module, display screen, power module, the power amplifier module includes a digital-to-analog conversion unit, a power amplifier unit, a speaker and a headphone interface; the CPU is electrically connected to the memory, USB protocol conversion module, HDMI protocol conversion module, video analog-to-digital conversion module, audio analog-to-digital conversion module, CVBS output module, HDMI output module, TF card, U disk, power amplifier module, and display screen respectively; the power module is used to provide power to various components or modules of the audio and video recorder; the audio analog-to-digital conversion module receives audio signals and / or microphone signals, the video analog-to-digital conversion module receives CVBS signals, the HDMI protocol conversion module receives HDMI signals, the USB protocol conversion module receives computer data, the CVBS output module is connected to a television, and the HDMI output module is used to connect to a high-definition television.

[0041] The audio and video processing method applicable to embedded devices of the present application specifically includes the following steps:

[0042] S102: Acquire audio and video data segments from a preset first ring queue as audio and video data segments to be processed;

[0043] The first circular queue is a circular queue, wherein data is input from the tail of the first circular queue and data is taken out from the head of the first circular queue.

[0044] Specifically, an audio and video data segment is obtained from the head of the preset first ring queue, and the obtained audio and video data segment is used as the audio and video data segment to be processed.

[0045] The audio and video data segment to be processed is a data segment of a preset duration.

[0046] It can be understood that the audio and video data segments in the first circular queue are stored in the order of the audio and video time. That is, the start time of the audio and video data segment obtained from the first circular queue for the i-th time is later than the start time of the audio and video data segment obtained from the first circular queue for the k-th time, where k is less than i, and i and k are both integers greater than 0. This achieves the ordering of the audio and video data segments in the first circular queue by start time.

[0047] S104: Inputting the audio and video data segment to be processed into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment;

[0048] Specifically, the audio and video data segment to be processed is input into a preset streaming noise reduction model for audio noise reduction processing, and the audio and video data segment to be processed after the audio noise reduction processing is completed is used as the noise-reduced data segment. Thereby, the quality of the audio in the noise-reduced data segment is improved. In other words, the streaming noise reduction model can be used for audio noise reduction processing, can also be used for image stream noise reduction processing, and can also be used for audio noise reduction processing and image stream noise reduction processing.

[0049] Image stream denoising processing is to perform denoising processing on each frame of the image stream.

[0050] The streaming denoising model is suitable for denoising streaming audio and / or streaming images in application scenarios with limited computing resources.

[0051] When the streaming denoising model is used for streaming audio denoising processing, the streaming denoising model includes: an encoder, a frequency domain denoising unit, a time domain denoising unit, and a decoder. The encoder is used for feature extraction. The frequency domain denoising unit is used to perform denoising in the frequency domain. The time domain denoising unit is used to perform denoising in the time domain. The decoder is used for decoding. The frequency domain denoising unit is a unit obtained based on a multi-head self-attention mechanism. The time domain denoising unit is a unit obtained based on a long short-term memory artificial neural network.

[0052] S106: extracting a data segment from the noise-reduced data segment using a timestamp range corresponding to the audio and video data segment to be processed, to obtain a target data segment;

[0053] Specifically, a data segment is extracted from the noise-reduced data segment, the time range corresponding to the extracted data segment is the same as the time stamp range corresponding to the audio and video data segment to be processed, and the extracted data segment is used as the target data segment.

[0054] Optionally, the timestamp range corresponding to the audio and video data segment to be processed is used to extract a data segment from the tail of the denoised data segment, and the extracted data segment is used as the target data segment. This removes the head of the audio and video data segment to be processed, and performs audio denoising based on the audio and video data segment larger than the timestamp range, thereby achieving audio denoising based on the previous content and the current content, further improving the quality of audio and video, and facilitating improving the smoothness of the connection between each target data segment.

[0055] Optionally, the timestamp range corresponding to the audio and video data segment to be processed is used to extract a data segment from the middle of the noise-reduced data segment, and the extracted data segment is used as the target data segment, thereby removing the head and tail of the audio and video data segment to be processed, further improving the smoothness of the connection between each target data segment.

[0056] S108: Add the target data segment to the tail of a preset second ring queue;

[0057] The first circular queue is a circular queue, wherein data is input from the tail of the first circular queue and data is taken out from the head of the first circular queue.

[0058] Specifically, the target data segment is added to the tail of the preset second circular queue, which provides a cache basis for playback and / or storage based on the target data segment.

[0059] It is understandable that the target data segments in the second circular queue are stored in the time sequence of the audio and video, thereby achieving the goal of sorting the target data segments in the second circular queue according to the start time.

[0060] S110: If the preset recording and broadcasting configuration data includes playing, playing the audio and video according to the second ring queue;

[0061] Optionally, the recording and broadcasting configuration data includes: playback.

[0062] Optionally, the recording and broadcasting configuration data includes: recording.

[0063] Optionally, the recording and broadcasting configuration data includes: playback and recording.

[0064] Specifically, if the preset recording and broadcasting configuration data includes playback, it means that audio and video playback is required, therefore, the target data segment is taken out from the head of the second ring queue, and audio and video playback is performed according to the taken out target data segment.

[0065] It can be understood that the target data segment can be taken out from the head of the second ring queue at fixed time intervals.

[0066] S112: If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue.

[0067] Specifically, if the recording and broadcasting configuration data includes recording, it means that audio and video storage is required, therefore, the target data segment is taken out from the head of the second ring queue, and audio and video storage is performed according to the taken out target data segment.

[0068] The audio and video are stored according to the second ring queue, which can be stored in a local storage space or a network storage space.

[0069] When the present application is applied to an audio and video recorder, the audio and video recorder converts the received signal (e.g., ultra-high-definition signal) into audio and video data segments, uses a TF card or a USB flash drive to store the audio and video, uses a display screen to play the audio and video, and outputs the audio and video to a high-definition TV or other device through an HDMI video interface or a video interface. Moreover, the user can operate the audio and video in the TF card or USB flash drive through the USB interface of the audio and video recorder.

[0070] This embodiment uses a first circular queue to cache audio and video data segments, and uses a second circular queue to cache target data segments, and performs audio and video recording and broadcasting based on the cache, thereby improving the fluency of audio and video. The circular queue is beneficial to reducing the consumption of storage resources; by performing audio noise reduction processing on the audio and video data segments, segmented processing of audio and video is achieved, the amount of data for each audio noise reduction processing is reduced, the consumption of computing resources for each audio noise reduction processing is reduced, and the quality of audio and video is improved; using the timestamp range corresponding to the audio and video data segment to be processed, a data segment is extracted from the noise-reduced data segment as the target data segment, and by performing audio noise reduction processing based on the audio and video data segment larger than the timestamp range, audio noise reduction processing is achieved based on the previous content and the current content, further improving the quality of audio and video, and helping to improve the fluency of the connection between each target data segment.

[0071] In one embodiment, the step of obtaining the audio and video data segments from the preset first ring queue as the audio and video data segments to be processed includes:

[0072] S202: Acquire audio and video signals;

[0073] Specifically, the audio and video signals can be obtained from the signal channel, through the wireless network, and through the wired network.

[0074] Audio and video signals are signals that contain audio and / or image streams.

[0075] S204: Storing the audio and video signals in a local cache;

[0076] Specifically, storing the audio and video signals in a local cache provides a basis for extracting signal segments based on the local cache.

[0077] S206: Determine each timestamp range according to a preset first interval duration and a start time of the audio and video signal;

[0078] The first interval duration is a duration greater than 0.

[0079] Specifically, the start time of the audio and video signal is taken as the start time of the first timestamp range, and the end time of the first timestamp range is determined according to the first interval duration; the end time of the n-1th timestamp range is taken as the start time of the nth timestamp range, where n is an integer greater than 1; the duration corresponding to each timestamp range is equal to the first interval duration.

[0080] S208: multiplying the first interval duration by a preset first advance ratio to obtain a first advance duration;

[0081] Specifically, the first interval duration is multiplied by a preset first advance ratio, and the multiplied data is used as the first advance duration.

[0082] S210: Subtract the first advance time from the start time of the timestamp range to obtain a first adjustment start time;

[0083] Specifically, the first advance time is subtracted from the start time of the timestamp range, and the adjusted start time is used as the first adjusted start time.

[0084] S212: taking the time range between the first adjustment start time and the end time corresponding to the same timestamp range as the first time range;

[0085] Specifically, the time range between the first adjustment start time and the end time corresponding to the same timestamp range is taken as the first time range. The first time range corresponds to the timestamp range one by one.

[0086] S214: extracting a signal segment from the audio and video signal in the local cache according to the first time range as a target signal segment;

[0087] Specifically, a signal segment is extracted from the audio and video signal in the local cache, the time range corresponding to the extracted signal segment is within the first time range, and the extracted signal segment is used as the target signal segment.

[0088] S216: performing the audio and video data segment conversion on the target signal segment, and adding the converted audio and video data segment to the tail of the first circular queue;

[0089] Specifically, the target signal segment is converted into audio and video to serve as the audio and video data segment, and the converted audio and video data segment is added to the tail of the first circular queue, thereby achieving limited caching and automatic sorting of the audio and video data segments.

[0090] S218: Obtain the audio and video data segment from the head of the first ring queue as the audio and video data segment to be processed.

[0091] Specifically, an audio and video data segment is obtained from the head of the preset first ring queue, and the obtained audio and video data segment is used as the audio and video data segment to be processed.

[0092] This embodiment uses the time range between the first adjustment start time and the end time corresponding to the same timestamp range as the first time range, so that according to the first time range, the beginning of the signal segment extracted from the audio and video signal in the local cache contains redundant data, which provides a basis for performing audio noise reduction processing based on an audio and video data segment larger than the timestamp range, and provides a basis for extracting a data segment from the tail of the noise-reduced data segment using the timestamp range corresponding to the audio and video data segment to be processed as the target data segment.

[0093] In one embodiment, the step of obtaining the audio and video data segments from the preset first ring queue as the audio and video data segments to be processed further includes:

[0094] S302: Acquire a first signal sent by a preset first channel, set a device timestamp for the first signal as a first signal to be processed, and store the first signal to be processed in a local cache;

[0095] The first channel is the signal channel.

[0096] Specifically, a signal sent by a preset first channel is obtained as the first signal; a device timestamp is set for the first signal, and the first signal with the device timestamp is used as the first signal to be processed; the first signal to be processed is stored in a local cache, which provides a basis for signal processing based on the local cache.

[0097] S304: Acquire a second signal sent by a preset second channel, set the device timestamp for the second signal as a second signal to be processed, and store the second signal to be processed in the local cache;

[0098] The second channel is the signal channel.

[0099] Optionally, the first channel and the second channel are signal channels of different modes. For example, the first channel is a signal channel of a microphone, and the second channel is an HDMI signal channel or a CVBS signal channel.

[0100] Optionally, the first channel and the second channel are signal channels of the same mode.

[0101] Specifically, a signal sent by a preset second channel is obtained as the second signal; a device timestamp is set for the second signal, and the second signal with the device timestamp is used as the second signal to be processed; the second signal to be processed is stored in a local cache, providing a basis for signal processing based on the local cache.

[0102] S306: Taking the earliest start time in the device timestamps corresponding to the first signal to be processed and the second signal to be processed as the target start time;

[0103] Specifically, the earliest start time in the device timestamp corresponding to the first signal to be processed and the second signal to be processed is the start time of the fused audio and video. Therefore, the earliest start time in the device timestamp corresponding to the first signal to be processed and the second signal to be processed is used as the target start time, which provides a basis for dividing the timestamp range.

[0104] S308: Determine the timestamp range according to the preset second interval duration and the target start time;

[0105] Specifically, the target start time is taken as the start time of the first timestamp range, and the end time of the first timestamp range is determined according to the second interval duration; the end time of the p-1th timestamp range is taken as the start time of the pth timestamp range, where p is an integer greater than 1; the duration corresponding to each timestamp range is equal to the second interval duration.

[0106] It is understandable that the first interval length and the second interval length may be the same or different.

[0107] S310: multiplying the second interval duration by a preset second advance ratio to obtain a second advance duration;

[0108] Specifically, the second interval duration is multiplied by a preset second advance ratio, and the multiplied data is used as the second advance duration.

[0109] S312: subtract the second advance time from the start time of the timestamp range to obtain a second adjustment start time;

[0110] Specifically, the second advance time is subtracted from the start time of the timestamp range, and the adjusted start time is used as the second adjusted start time.

[0111] S314: taking the time range between the second adjustment start time and the end time corresponding to the same timestamp range as the second time range;

[0112] Specifically, the time range between the second adjustment start time and the end time corresponding to the same timestamp range is used as the second time range. The second time range corresponds to the timestamp range one by one.

[0113] S316: Acquire a signal segment whose device timestamp is within the second time range from the locally cached first signal to be processed as a first signal segment, and acquire a signal segment whose device timestamp is within the second time range from the locally cached second signal to be processed as a second signal segment;

[0114] Specifically, a signal segment with the device timestamp within the second time range is obtained from the first signal to be processed in the local cache, and the obtained signal segment is used as the first signal segment, and a signal segment with the device timestamp within the second time range is obtained from the second signal to be processed in the local cache, and the obtained signal segment is used as the second signal segment.

[0115] It can be understood that the two second time ranges in step S316 are the same time range.

[0116] S318: performing mode conversion on the first signal segment to obtain a first data segment, and performing mode conversion on the second signal segment to obtain a second data segment;

[0117] Specifically, the mode conversion method corresponding to the first signal is used to perform format conversion on the first signal segment to obtain a first data segment; and the mode conversion method corresponding to the second signal is used to perform format conversion on the second signal segment to obtain a second data segment.

[0118] That is to say, the first data segment can be any one of audio, image stream, audio and video.

[0119] That is to say, the second data segment can be any one of audio, image stream, audio and video.

[0120] S320: Merge the first data segment and the second data segment into the audio and video data segment, and add the merged audio and video data segment to the tail of the first ring queue;

[0121] Specifically, the first data segment and the second data segment are merged into a segment of audio and video, and the merged audio and video is used as the audio and video data segment.

[0122] S322: Obtain the audio and video data segment from the head of the first ring queue as the audio and video data segment to be processed.

[0123] This embodiment sets a device timestamp for the first signal and sets the device timestamp for the second signal. The device timestamps based on the two signals are conducive to accurately aligning the data of the two channels, thereby improving the quality of audio and video. The time range between the second adjustment start time and the end time corresponding to the same timestamp range is used as the second time range, so that the beginning of the signal segment extracted from the local cache according to the second time range contains redundant data, which provides a basis for performing audio noise reduction processing based on an audio and video data segment larger than the timestamp range, and provides a basis for extracting a data segment from the tail of the noise-reduced data segment using the timestamp range corresponding to the audio and video data segment to be processed as the target data segment.

[0124] In one embodiment, the step of merging the first data segment and the second data segment into the audio and video data segment includes:

[0125] S402: Using a single-mode denoising model corresponding to the first data segment, denoising the first data segment to obtain a first denoised data segment;

[0126] Specifically, the first data segment is denoised using a single-mode denoising model corresponding to a signal mode corresponding to the first data segment, and the denoised data is used as a first denoised data segment.

[0127] S404: Using the single-mode noise reduction model corresponding to the second data segment, noise reduction is performed on the second data segment to obtain a second noise reduction data segment;

[0128] Specifically, the second data segment is denoised using a single-mode denoising model corresponding to a signal mode corresponding to the second data segment, and the denoised data is used as a second denoised data segment.

[0129] S406: Fusing the first noise reduction data segment and the second noise reduction data segment to obtain the audio and video data segment.

[0130] Specifically, the start time of the first noise reduction data segment and the start time of the second noise reduction data segment are aligned, and then the aligned first noise reduction data segment and the second noise reduction data segment are fused into a segment of audio and video, and the fused audio and video is used as the audio and video data segment.

[0131] This embodiment uses a single-mode noise reduction model corresponding to the first data segment to perform noise reduction on the first data segment, and uses a single-mode noise reduction model corresponding to the second data segment to perform noise reduction on the second data segment, which is beneficial to improving the quality of audio and video. In addition, the first data segment and the second data segment are shorter data segments, which reduces the amount of data for each noise reduction processing and reduces the consumption of computing resources for each noise reduction processing.

[0132] In one embodiment, the step of playing audio and video according to the second ring queue includes:

[0133] S502: extracting the target data segment from the head of the second ring queue as a data segment to be processed;

[0134] Specifically, the target data segment is extracted from the head of the second ring queue, and the extracted target data segment is used as the data segment to be processed.

[0135] S504: performing enhancement processing on the head of the data segment to be processed within a preset first smoothing duration, and performing suppression processing on the tail of the data segment to be processed within a preset second smoothing duration, to obtain the data segment to be played;

[0136] Specifically, the head of the data segment to be processed is subjected to image enhancement processing and / or audio enhancement processing within a preset first smoothing time length, and the tail of the data segment to be processed is subjected to image suppression processing and / or audio suppression processing within a preset second smoothing time length, and the processed data segment to be processed is used as the data segment to be played.

[0137] Image enhancement processing includes but is not limited to: image contrast enhancement and image brightness enhancement.

[0138] Audio enhancement processing includes but is not limited to: volume increase.

[0139] Image suppression processing includes, but is not limited to: reducing image contrast and reducing image brightness.

[0140] Audio suppression processing includes, but is not limited to: volume reduction.

[0141] It is understandable that the first smoothing duration and the second smoothing duration are both numerical values. The first smoothing duration and the second smoothing duration may be the same or different.

[0142] The sum of the first smoothing duration and the second smoothing duration is less than or equal to the total duration of the data segment to be processed.

[0143] S506: Play the audio and video of the data segment to be played.

[0144] Specifically, the audio and video of the data segment to be played are played according to a preset playing mode.

[0145] The playback mode is to play at a preset speed. The value range of the preset speed includes: normal speed, a first preset coefficient multiplied by the normal speed, and a second preset coefficient multiplied by the normal speed, wherein the first preset coefficient is greater than 1 and the second preset coefficient is less than 1. This can avoid the situation where the current data segment to be played is played but the next data segment to be played is not ready, thereby improving the fluency of audio and video.

[0146] It can be understood that by repeatedly executing steps S502 to S506, multiple target data segments can be played continuously based on the second ring queue.

[0147] This embodiment performs enhancement processing on the head of the data segment to be processed within a preset first smoothing duration, and suppresses processing on the tail of the data segment to be processed within a preset second smoothing duration, thereby achieving a smooth transition at the connection between two consecutive data segments to be played, thereby improving the fluency of audio and video playback; audio and video playback based on the second ring queue can achieve quasi-real-time audio and video playback.

[0148] In one embodiment, the step of storing audio and video according to the second ring queue includes:

[0149] S602: extracting the target data segment from the head of the second ring queue as the data segment to be analyzed;

[0150] Specifically, the target data segment is extracted from the head of the second ring queue, and the extracted target data segment is used as the data segment to be analyzed.

[0151] S604: performing enhancement processing on the head of the data segment to be analyzed within a preset third smoothing time length, and performing suppression processing on the tail of the data segment to be analyzed within a preset fourth smoothing time length, to obtain a data segment to be compressed;

[0152] Specifically, the head of the data segment to be analyzed is subjected to image enhancement processing and / or audio enhancement processing within a preset third smoothing time length, and the tail of the data segment to be analyzed is subjected to image suppression processing and / or audio suppression processing within a preset fourth smoothing time length, and the processed data segment to be analyzed is used as the data segment to be compressed.

[0153] The sum of the third smoothing duration and the fourth smoothing duration is less than or equal to the total duration of the data segment to be processed.

[0154] The third smoothing time length and the fourth smoothing time length may be the same or different.

[0155] The first smoothing time length, the second smoothing time length, the third smoothing time length and the fourth smoothing time length may be the same or different.

[0156] S606: Storing the data segment to be compressed in a local cache;

[0157] S608: Generate a sequence for each audio frame in the to-be-compressed data segment in the local cache as an audio auxiliary initial sequence;

[0158] The audio auxiliary initial sequence includes: a time position and an audio frame identifier. The audio frame identifier can be data that uniquely identifies an audio frame, such as an audio frame name and an audio frame ID. The time position is the playback time in the data segment to be compressed. It can be understood that the data in the audio auxiliary initial sequence is sorted in order according to the time position.

[0159] Specifically, a sequence is generated according to the time position and audio frame identifier corresponding to each audio frame in the data segment to be compressed in the local cache, and the sequence is used as an audio auxiliary initial sequence.

[0160] S610: searching for consecutive identical audio frames for each of the audio frames in the data segment to be compressed in the local cache to obtain a homogeneous audio frame sequence set, and using each of the audio frames in the data segment to be compressed in the local cache other than the homogeneous audio frame sequence set as a single-quality audio frame set;

[0161] Specifically, continuous identical audio frames are searched for each audio frame in the to-be-compressed data segment in the local cache, and each group of continuous identical audio frames found is regarded as a homogeneous audio frame sequence set. That is, each audio frame in the homogeneous audio frame sequence set is the same.

[0162] The audio frames outside the homogeneous audio frame sequence set in the audio frames in the data segment to be compressed in the local cache are found to find independent audio frames, and the found audio frames are used as a homogeneous audio frame set.

[0163] It can be understood that each audio frame in the single-quality audio frame set exists independently, that is, the audio frame is different from the previous audio frame and different from the next audio frame.

[0164] S612: extracting the first audio frame from each of the homogeneous audio frame sequence sets to obtain a compressed homogeneous audio frame;

[0165] Specifically, the first audio frame is extracted from each of the homogeneous audio frame sequence sets, thereby finding the audio frame that needs to be retained, and the extracted first audio frame is used as the compressed homogeneous audio frame.

[0166] S614: Acquire any one of the homogeneous audio frame sequence sets from the homogeneous audio frame sequence sets as a target homogeneous audio frame sequence set;

[0167] S616: According to the compressed homogeneous audio frame corresponding to the target homogeneous audio frame sequence set, replace the data corresponding to the target homogeneous audio frame sequence set in the audio auxiliary initial sequence;

[0168] Specifically, according to the audio frame identifier corresponding to the compressed homogeneous audio frame corresponding to the target homogeneous audio frame sequence set, each audio frame identifier corresponding to the target homogeneous audio frame sequence set in the audio auxiliary initial sequence is replaced.

[0169] S618: Repeat the step of acquiring any one of the homogeneous audio frame sequence sets from the homogeneous audio frame sequence sets as the target homogeneous audio frame sequence set until the acquisition of the homogeneous audio frame sequence set is completed, and use the audio auxiliary initial sequence as the audio auxiliary sequence;

[0170] Specifically, the step of obtaining any one of the homogeneous audio frame sequence sets from each of the homogeneous audio frame sequence sets as the target homogeneous audio frame sequence set is repeatedly performed, that is, steps S614 to S618 are repeatedly performed until the acquisition of the homogeneous audio frame sequence set is completed; when the acquisition of the homogeneous audio frame sequence set is completed, it means that the replacement of each audio frame identifier corresponding to each of the homogeneous audio frame sequence sets in the audio auxiliary initial sequence has been completed. At this time, it is necessary to stop repeating steps S614 to S618 and use the audio auxiliary initial sequence as the audio auxiliary sequence.

[0171] S620: Generate a sequence for each image frame in the to-be-compressed data segment in the local cache as an image auxiliary initial sequence;

[0172] The image-assisted initial sequence includes: time position and image frame identifier. The image frame identifier can be data that uniquely identifies an image frame, such as an image frame name and an image frame ID. It can be understood that the data in the image-assisted initial sequence is sorted in order according to the time position.

[0173] An image frame is a frame of image.

[0174] Specifically, a sequence is generated according to the time position and image frame identifier corresponding to each image frame in the data segment to be compressed in the local cache, and the sequence is used as an image auxiliary initial sequence.

[0175] S622: searching for consecutive identical image frames for each of the image frames in the data segment to be compressed in the local cache to obtain a homogeneous image frame sequence set, and taking each of the image frames in the data segment to be compressed in the local cache other than the homogeneous image frame sequence set as a single-quality image frame set;

[0176] Specifically, continuous identical image frames are searched for each image frame in the to-be-compressed data segment in the local cache, and each group of continuous identical image frames found is regarded as a homogeneous image frame sequence set. That is, each image frame in the homogeneous image frame sequence set is identical.

[0177] The image frames outside the homogeneous image frame sequence set in the image frames in the to-be-compressed data segment in the local cache are removed, thereby finding independently existing image frames, and the found image frames are used as a homogeneous image frame set.

[0178] That is to say, each image frame in the single-quality image frame set exists independently, that is, the image frame is different from the previous image frame and the next image frame.

[0179] S624: extracting the first image frame from each of the homogeneous image frame sequence sets to obtain a compressed homogeneous image frame;

[0180] Specifically, the first image frame is extracted from each of the homogeneous image frame sequence sets, thereby finding the image frame that needs to be retained, and the extracted first image frame is used as the compressed homogeneous image frame.

[0181] S626: Acquire any one of the homogeneous image frame sequence sets from the homogeneous image frame sequence sets as a target homogeneous image frame sequence set;

[0182] S628: replacing data corresponding to the target homogeneous image frame sequence set in the image-assisted initial sequence according to the compressed homogeneous image frame corresponding to the target homogeneous image frame sequence set;

[0183] Specifically, according to the image frame identifiers corresponding to the compressed homogeneous image frames corresponding to the target homogeneous image frame sequence set, each image frame identifier corresponding to the target homogeneous image frame sequence set in the image auxiliary initial sequence is replaced.

[0184] S630: Repeat the step of acquiring any one of the homogeneous image frame sequence sets as a target homogeneous image frame sequence set from the homogeneous image frame sequence sets until the acquisition from the homogeneous image frame sequence sets is completed, and the image auxiliary initial sequence is used as an image auxiliary sequence;

[0185] Specifically, the step of acquiring any one of the homogeneous image frame sequence sets as the target homogeneous image frame sequence set is repeatedly executed, that is, steps S626 to S630 are repeatedly executed until the acquisition from the homogeneous image frame sequence sets is completed; when the acquisition from the homogeneous image frame sequence sets is completed, it means that the replacement of each image frame identifier corresponding to each homogeneous image frame sequence set in the image auxiliary initial sequence has been completed, and at this time, it is necessary to stop repeatedly executing steps S626 to S630 and use the image auxiliary initial sequence as the image auxiliary sequence.

[0186] S632: Store each of the compressed homogeneous audio frames, the monochromatic audio frame set, the audio auxiliary sequence, each of the compressed homogeneous image frames, the monochromatic image frame set and the image auxiliary sequence in a storage space corresponding to a preset storage address.

[0187] Specifically, each of the compressed homogeneous audio frames, the single-quality audio frame set, the audio auxiliary sequence, each of the compressed homogeneous image frames, the single-quality image frame set and the image auxiliary sequence are stored in a storage space corresponding to a preset storage address, thereby retaining only the first audio frame of consecutive identical audio frames and retaining only the first image frame of consecutive identical image frames.

[0188] This embodiment retains only the first audio frame of consecutive identical audio frames and only the first image frame of consecutive identical image frames, thereby reducing the consumption of storage resources; accurately restores audio and video through audio auxiliary sequences and image auxiliary sequences, thereby reducing the consumption of storage resources without affecting the restoration quality of audio and video.

[0189] In one embodiment, the step of inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment includes:

[0190] S702: extracting a frequency spectrogram from the audio in the audio and video data segment to be processed to obtain a frequency spectrogram to be processed;

[0191] Specifically, the audio in the audio and video data segment to be processed is subjected to a short-time Fourier transform to obtain an initial spectrogram, and then the DC component of the initial spectrogram is removed to form a spectrogram to be processed. The DC component has little effect on the reconstruction of the spectrum, and the initial spectrogram without the DC component is used as the spectrogram to be processed, which reduces the consumption of computing resources and does not reduce the noise reduction effect.

[0192] S704: Inputting the to-be-processed spectrogram into the encoder of the streaming denoising model for feature extraction to obtain single-layer features corresponding to each encoding layer of the encoder;

[0193] The encoder includes at least 3 encoding layers. All encoding layers in the encoder are linearly connected.

[0194] S706: Inputting the single-layer feature corresponding to the last coding layer of the encoder into the frequency domain denoising unit of the streaming denoising model to perform frequency domain denoising to obtain a first denoised feature;

[0195] Specifically, the single-layer features corresponding to the last encoding layer of the encoder are input into the frequency domain denoising unit of the streaming denoising model, and the frequency domain dimension is denoised through the multi-head self-attention mechanism of the frequency domain denoising unit, and the features obtained by frequency domain denoising are used as the first denoised features.

[0196] S708: Fusing the single-layer feature corresponding to the last encoding layer of the encoder with the first noise-reduced feature to obtain a first fused feature;

[0197] Specifically, the single-layer feature corresponding to the last encoding layer of the encoder is spliced ​​with the first denoised feature, thereby realizing residual connection, and the spliced ​​feature is used as the first fusion feature.

[0198] S710: Inputting the first fusion feature into the time domain denoising unit of the streaming denoising model to perform time domain denoising to obtain a second denoised feature;

[0199] Specifically, the first fusion feature is input into the time domain denoising unit of the streaming denoising model, denoising is performed in the time domain dimension by the time domain denoising unit, and the feature obtained by the time domain denoising is used as the second denoised feature.

[0200] S712: Fusing the first fused feature and the second denoised feature to obtain a second fused feature;

[0201] Specifically, the first fused feature and the second denoised feature are spliced ​​to achieve residual connection, and the spliced ​​feature is used as the second fused feature.

[0202] S714: Inputting the second fusion feature and each of the single-layer features into the decoder of the streaming denoising model for decoding to obtain a target spectrogram;

[0203] The decoder includes a plurality of decoding layers, and the number of the decoding layers in the decoder is the same as the number of the encoding layers of the encoder.

[0204] Specifically, the output feature of the m-1th decoding layer and the n+1-mth single-layer feature are vector-connected to obtain the mth feature to be decoded, and the mth feature to be decoded is used as the input feature of the mth decoding layer, wherein m is an integer greater than 0, and m is less than or equal to n, and n is the number of encoding layers in the encoder; when m is equal to 1, the second fusion feature is used as the output feature of the m-1th decoding layer.

[0205] S716: reconstructing audio and video according to the target spectrogram to obtain a noise-reduced audio segment;

[0206] Specifically, the target spectrum graph is masked and suppressed, and the spectrum graph after masked enhancement and suppression is subjected to short-time inverse Fourier transform to obtain time domain data; the Overlapadd method is used to reconstruct the speech signal of the time domain data, and the reconstructed speech is used as the denoised audio segment.

[0207] Overlapadd, also written as Overlap-add, means overlapping addition.

[0208] Mask enhancement and suppression, that is, using the CRM Mask method as a noise reduction filter function to enhance the data corresponding to the desired speech and suppress the data corresponding to the unwanted speech in the spectrum diagram.

[0209] S718: Using the noise-reduced data segment, replace the audio in the audio and video data segment to be processed to obtain the noise-reduced data segment.

[0210] Specifically, the denoised data segment is used to replace the audio in the to-be-processed audio and video data segment, and the replaced audio and video data segment to be processed is used as the denoised data segment.

[0211] This embodiment uses an encoder for feature extraction, a frequency domain noise reduction unit to perform noise reduction in the frequency domain, a time domain noise reduction unit to perform noise reduction in the time domain, and a decoder to decode, thereby achieving noise reduction for audio and improving the quality of audio and video.

[0212] like Figure 2 As shown, an audio and video processing device suitable for embedded devices, the device comprising:

[0213] The to-be-processed audio and video data segment determination module 802 is used to obtain the audio and video data segment from the preset first ring queue as the to-be-processed audio and video data segment;

[0214] A noise reduction data segment determination module 804 is used to input the audio and video data segment to be processed into a preset streaming noise reduction model for noise reduction processing to obtain a noise reduction data segment;

[0215] A target data segment determination module 806 is used to extract a data segment from the noise-reduced data segment using a timestamp range corresponding to the audio and video data segment to be processed to obtain a target data segment;

[0216] A second ring queue updating module 808, configured to add the target data segment to the tail of a preset second ring queue;

[0217] The audio and video playing module 810 is used to play the audio and video according to the second ring queue if the preset recording and broadcasting configuration data includes playing;

[0218] The audio and video storage module 812 is used to store the audio and video according to the second ring queue if the recording and broadcasting configuration data includes recording.

[0219] This embodiment uses a first circular queue to cache audio and video data segments, and uses a second circular queue to cache target data segments, and performs audio and video recording and broadcasting based on the cache, thereby improving the fluency of audio and video. The circular queue is beneficial to reducing the consumption of storage resources; by performing audio noise reduction processing on the audio and video data segments, segmented processing of audio and video is achieved, the amount of data for each audio noise reduction processing is reduced, the consumption of computing resources for each audio noise reduction processing is reduced, and the quality of audio and video is improved; using the timestamp range corresponding to the audio and video data segment to be processed, a data segment is extracted from the noise-reduced data segment as the target data segment, and by performing audio noise reduction processing based on the audio and video data segment larger than the timestamp range, audio noise reduction processing is achieved based on the previous content and the current content, further improving the quality of audio and video, and helping to improve the fluency of the connection between each target data segment.

[0220] Figure 3 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server. Figure 3 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor may implement an audio and video processing method suitable for an embedded device. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor may implement an audio and video processing method suitable for an embedded device. Those skilled in the art will appreciate that Figure 3The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0221] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0222] Acquire the audio and video data segment from the preset first ring queue as the audio and video data segment to be processed;

[0223] Inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment;

[0224] Using the timestamp range corresponding to the audio and video data segment to be processed, extracting the data segment from the noise-reduced data segment to obtain the target data segment;

[0225] Adding the target data segment to the tail of a preset second circular queue;

[0226] If the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second ring queue;

[0227] If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue.

[0228] This embodiment uses a first circular queue to cache audio and video data segments, and uses a second circular queue to cache target data segments, and performs audio and video recording and broadcasting based on the cache, thereby improving the fluency of audio and video. The circular queue is beneficial to reducing the consumption of storage resources; by performing audio noise reduction processing on the audio and video data segments, segmented processing of audio and video is achieved, the amount of data for each audio noise reduction processing is reduced, the consumption of computing resources for each audio noise reduction processing is reduced, and the quality of audio and video is improved; using the timestamp range corresponding to the audio and video data segment to be processed, a data segment is extracted from the noise-reduced data segment as the target data segment, and by performing audio noise reduction processing based on the audio and video data segment larger than the timestamp range, audio noise reduction processing is achieved based on the previous content and the current content, further improving the quality of audio and video, and helping to improve the fluency of the connection between each target data segment.

[0229] In one embodiment, an embedded device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0230] Acquire the audio and video data segment from the preset first ring queue as the audio and video data segment to be processed;

[0231] Inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment;

[0232] Using the timestamp range corresponding to the audio and video data segment to be processed, extracting the data segment from the noise-reduced data segment to obtain the target data segment;

[0233] Adding the target data segment to the tail of a preset second circular queue;

[0234] If the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second ring queue;

[0235] If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue.

[0236] This embodiment uses a first circular queue to cache audio and video data segments, and uses a second circular queue to cache target data segments, and performs audio and video recording and broadcasting based on the cache, thereby improving the fluency of audio and video. The circular queue is beneficial to reducing the consumption of storage resources; by performing audio noise reduction processing on the audio and video data segments, segmented processing of audio and video is achieved, the amount of data for each audio noise reduction processing is reduced, the consumption of computing resources for each audio noise reduction processing is reduced, and the quality of audio and video is improved; using the timestamp range corresponding to the audio and video data segment to be processed, a data segment is extracted from the noise-reduced data segment as the target data segment, and by performing audio noise reduction processing based on the audio and video data segment larger than the timestamp range, audio noise reduction processing is achieved based on the previous content and the current content, further improving the quality of audio and video, and helping to improve the fluency of the connection between each target data segment.

[0237] In one embodiment, a computer-readable storage medium is provided, storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:

[0238] Acquire the audio and video data segment from the preset first ring queue as the audio and video data segment to be processed;

[0239] Inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment;

[0240] Using the timestamp range corresponding to the audio and video data segment to be processed, extracting the data segment from the noise-reduced data segment to obtain the target data segment;

[0241] Adding the target data segment to the tail of a preset second circular queue;

[0242] If the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second ring queue;

[0243] If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue.

[0244] This embodiment uses a first circular queue to cache audio and video data segments, and uses a second circular queue to cache target data segments, and performs audio and video recording and broadcasting based on the cache, thereby improving the fluency of audio and video. The circular queue is beneficial to reducing the consumption of storage resources; by performing audio noise reduction processing on the audio and video data segments, segmented processing of audio and video is achieved, the amount of data for each audio noise reduction processing is reduced, the consumption of computing resources for each audio noise reduction processing is reduced, and the quality of audio and video is improved; using the timestamp range corresponding to the audio and video data segment to be processed, a data segment is extracted from the noise-reduced data segment as the target data segment, and by performing audio noise reduction processing based on the audio and video data segment larger than the timestamp range, audio noise reduction processing is achieved based on the previous content and the current content, further improving the quality of audio and video, and helping to improve the fluency of the connection between each target data segment.

[0245] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0246] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0247] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims. Please enter the specific implementation content part.

Claims

1. An audio and video processing method applicable to an embedded device, the method comprising: Acquire the audio and video data segment from the preset first ring queue as the audio and video data segment to be processed; Inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment; Using the timestamp range corresponding to the audio and video data segment to be processed, extracting the data segment from the noise-reduced data segment to obtain the target data segment; Adding the target data segment to the tail of a preset second circular queue; If the preset recording and broadcasting configuration data includes playback, audio and video playback is performed according to the second ring queue; If the recording and broadcasting configuration data includes recording, audio and video storage is performed according to the second ring queue; The step of obtaining the audio and video data segments from the preset first ring queue as the audio and video data segments to be processed also includes: Acquire a first signal sent by a preset first channel, set a device timestamp for the first signal as a first signal to be processed, and store the first signal to be processed in a local cache; Acquire a second signal sent by a preset second channel, set the device timestamp for the second signal as a second signal to be processed, and store the second signal to be processed in the local cache; The earliest start time among the device timestamps corresponding to the first signal to be processed and the second signal to be processed is used as the target start time; Determining the timestamp range according to a preset second interval duration and the target start time; Multiplying the second interval duration by a preset second advance ratio to obtain a second advance duration; Subtract the second advance time from the start time of the timestamp range to obtain the second adjusted start time; Taking the time range between the second adjustment start time and the end time corresponding to the same timestamp range as the second time range; Acquire a signal segment whose device timestamp is within the second time range from the locally cached first signal to be processed as a first signal segment, and acquire a signal segment whose device timestamp is within the second time range from the locally cached second signal to be processed as a second signal segment; Performing mode conversion on the first signal segment to obtain a first data segment, and performing mode conversion on the second signal segment to obtain a second data segment; Merging the first data segment and the second data segment into the audio and video data segment, and adding the merged audio and video data segment to the tail of the first circular queue; Acquire the audio and video data segment from the head of the first circular queue as the audio and video data segment to be processed; The step of extracting a data segment from the noise-reduced data segment using a timestamp range corresponding to the audio and video data segment to be processed to obtain a target data segment comprises: The timestamp range corresponding to the audio and video data segment to be processed is used to extract a data segment from the tail of the noise-reduced data segment, and the extracted data segment is used as the target data segment.

2. The audio and video processing method suitable for embedded devices according to claim 1, characterized in that: The step of merging the first data segment and the second data segment into the audio and video data segment comprises: Using the single-mode denoising model corresponding to the first data segment, denoising the first data segment to obtain a first denoised data segment; Using the single-mode denoising model corresponding to the second data segment, denoising the second data segment to obtain a second denoised data segment; The first noise reduction data segment and the second noise reduction data segment are fused to obtain the audio and video data segment.

3. The audio and video processing method suitable for embedded devices according to claim 1, characterized in that: The step of playing audio and video according to the second ring queue includes: Extracting the target data segment from the head of the second circular queue as the data segment to be processed; Performing enhancement processing on the head of the data segment to be processed within a preset first smoothing duration, and performing suppression processing on the tail of the data segment to be processed within a preset second smoothing duration, to obtain the data segment to be played; Perform audio and video playback on the data segment to be played.

4. The audio and video processing method applicable to embedded devices according to claim 1, characterized in that: The step of storing audio and video according to the second ring queue includes: Extracting the target data segment from the head of the second circular queue as the data segment to be analyzed; Performing enhancement processing on the head of the data segment to be analyzed within a preset third smoothing time length, and performing suppression processing on the tail of the data segment to be analyzed within a preset fourth smoothing time length, to obtain a data segment to be compressed; Storing the data segment to be compressed in a local cache; Generating a sequence for each audio frame in the to-be-compressed data segment in the local cache as an audio auxiliary initial sequence; Searching for consecutive identical audio frames for each of the audio frames in the data segment to be compressed in the local cache to obtain a homogeneous audio frame sequence set, and taking each of the audio frames in the data segment to be compressed in the local cache other than the homogeneous audio frame sequence set as a single-quality audio frame set; Extracting the first audio frame from each of the homogeneous audio frame sequence sets to obtain a compressed homogeneous audio frame; Acquire any one of the homogeneous audio frame sequence sets from each of the homogeneous audio frame sequence sets as a target homogeneous audio frame sequence set; According to the compressed homogeneous audio frame corresponding to the target homogeneous audio frame sequence set, replacing data corresponding to the target homogeneous audio frame sequence set in the audio auxiliary initial sequence; Repeat the step of acquiring any one of the homogeneous audio frame sequence sets from the homogeneous audio frame sequence sets as the target homogeneous audio frame sequence set until the acquisition of the homogeneous audio frame sequence set is completed, and use the audio auxiliary initial sequence as the audio auxiliary sequence; Generating a sequence for each image frame in the data segment to be compressed in the local cache as an image auxiliary initial sequence; Searching for consecutive identical image frames for each of the image frames in the data segment to be compressed in the local cache to obtain a homogeneous image frame sequence set, and taking each of the image frames in the data segment to be compressed in the local cache other than the homogeneous image frame sequence set as a single-quality image frame set; Extracting the first image frame from each of the homogeneous image frame sequence sets to obtain a compressed homogeneous image frame; Acquire any one of the homogeneous image frame sequence sets from each of the homogeneous image frame sequence sets as a target homogeneous image frame sequence set; According to the compressed homogeneous image frame corresponding to the target homogeneous image frame sequence set, replacing the data corresponding to the target homogeneous image frame sequence set in the image auxiliary initial sequence; Repeating the step of acquiring any one of the homogeneous image frame sequence sets as a target homogeneous image frame sequence set from each of the homogeneous image frame sequence sets until the acquisition from each of the homogeneous image frame sequence sets is completed, and taking the image auxiliary initial sequence as an image auxiliary sequence; Each of the compressed homogeneous audio frames, the monochromatic audio frame set, the audio auxiliary sequence, each of the compressed homogeneous image frames, the monochromatic image frame set and the image auxiliary sequence is stored in a storage space corresponding to a preset storage address.

5. The audio and video processing method applicable to embedded devices according to claim 1, characterized in that: The step of inputting the to-be-processed audio and video data segment into a preset streaming noise reduction model for noise reduction processing to obtain a noise-reduced data segment comprises: Extracting a spectrogram from the audio in the audio and video data segment to be processed to obtain a spectrogram to be processed; Inputting the to-be-processed spectrogram into the encoder of the streaming denoising model for feature extraction to obtain single-layer features corresponding to each encoding layer of the encoder; Inputting the single-layer feature corresponding to the last encoding layer of the encoder into the frequency domain denoising unit of the streaming denoising model to perform frequency domain denoising to obtain a first denoised feature; Fusing the single-layer feature corresponding to the last encoding layer of the encoder with the first denoised feature to obtain a first fused feature; Inputting the first fusion feature into the time domain denoising unit of the streaming denoising model to perform time domain denoising to obtain a second denoised feature; Fusing the first fused feature and the second denoised feature to obtain a second fused feature; Inputting the second fusion feature and each of the single-layer features into the decoder of the streaming denoising model for decoding to obtain a target spectrogram; Reconstructing audio and video according to the target spectrogram to obtain a noise-reduced audio segment; The denoised data segment is used to replace the audio in the to-be-processed audio and video data segment to obtain the denoised data segment.

6. An audio and video processing device suitable for embedded devices, characterized in that: The device comprises: A module for determining audio and video data segments to be processed, used for obtaining audio and video data segments from a preset first circular queue as audio and video data segments to be processed; A noise reduction data segment determination module is used to input the audio and video data segment to be processed into a preset streaming noise reduction model for noise reduction processing to obtain a noise reduction data segment; A target data segment determination module, configured to extract a data segment from the noise-reduced data segment using a timestamp range corresponding to the audio and video data segment to be processed, to obtain a target data segment; A second circular queue updating module, used for adding the target data segment to the tail of a preset second circular queue; an audio and video playing module, configured to play the audio and video according to the second ring queue if the preset recording and broadcasting configuration data includes playing; an audio and video storage module, configured to store audio and video according to the second ring queue if the recording and broadcasting configuration data includes recording; The step of obtaining the audio and video data segments from the preset first ring queue as the audio and video data segments to be processed also includes: Acquire a first signal sent by a preset first channel, set a device timestamp for the first signal as a first signal to be processed, and store the first signal to be processed in a local cache; Acquire a second signal sent by a preset second channel, set the device timestamp for the second signal as a second signal to be processed, and store the second signal to be processed in the local cache; The earliest start time among the device timestamps corresponding to the first signal to be processed and the second signal to be processed is used as the target start time; Determining the timestamp range according to a preset second interval duration and the target start time; Multiplying the second interval duration by a preset second advance ratio to obtain a second advance duration; Subtract the second advance time from the start time of the timestamp range to obtain the second adjusted start time; Taking the time range between the second adjustment start time and the end time corresponding to the same timestamp range as the second time range; Acquire a signal segment whose device timestamp is within the second time range from the locally cached first signal to be processed as a first signal segment, and acquire a signal segment whose device timestamp is within the second time range from the locally cached second signal to be processed as a second signal segment; Performing mode conversion on the first signal segment to obtain a first data segment, and performing mode conversion on the second signal segment to obtain a second data segment; Merging the first data segment and the second data segment into the audio and video data segment, and adding the merged audio and video data segment to the tail of the first circular queue; Acquire the audio and video data segment from the head of the first circular queue as the audio and video data segment to be processed; The step of extracting a data segment from the noise-reduced data segment using a timestamp range corresponding to the audio and video data segment to be processed to obtain a target data segment comprises: The timestamp range corresponding to the audio and video data segment to be processed is used to extract a data segment from the tail of the noise-reduced data segment, and the extracted data segment is used as the target data segment.

7. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 5.

8. An embedded device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Synchronous playing method of multi-path IP (Internet Protocol) audio-video stream

    CN102547482A

  • Method and system for synchronously playing audio and video

    CN105245976A

  • Audio data synchronization method and device

    CN110519627A

  • Real-time audio signal processing method for sound amplification system

    CN111526466A

  • Video denoising method and device, storage medium and electronic equipment

    CN113034401A