Method, device and storage medium for processing audio of barrier-free movies for the blind
Through voice activity detection and volume adaptive adjustment technology, the auditory masking problem caused by the mismatch in the dynamic range of the movie original soundtrack and the AD audio track is solved, and the clear playback of the AD audio track in the high dynamic range movie original soundtrack is achieved, improving the performance of the blind people. An accessible movie viewing experience.
Patent Information
- Application Number
- CN202211385507.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-11-07
AI Technical Summary
When playing a barrier-free movie for the blind with an AD audio track, due to the mismatch in dynamic range between the original film soundtrack and the AD audio track, auditory masking occurs and affects the viewing experience. It is difficult for existing technology to effectively solve this problem.
Using voice activity detection (VAD) and volume adaptive adjustment technology, it obtains and parses the media data streams of the movie original soundtrack and AD audio track, performs timeline synchronization, and adjusts the volume of both based on the voice activity status to ensure AD The audio track plays clearly against high dynamic range movie soundtracks.
It effectively overcomes the auditory masking effect, allowing AD audio track content to be played clearly in the original movie soundtrack, improving the barrier-free movie viewing experience for blind people and making up for the shortcomings of external AD audio track playback.
Smart Images

Figure CN115695902B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio processing, and in particular to a method, device and storage medium for processing audio of barrier-free movies for the blind. Background Art
[0002] Accessible movies are processed movies specially made for the convenience of disabled people to watch. They are divided into two versions: for the blind and for the deaf. For blind audiences, while retaining the original soundtrack and dialogue, some explanations and descriptions of the movie content will be inserted at the right time.
[0003] At first, these tasks were performed manually at the movie screening site, and volunteers had to hold the microphone and repeat the work over and over again. As more and more social forces joined in, professionally produced barrier-free versions of movies were born. Most of these movies were distributed in the form of CDs, which not only reduced the repetitive work of volunteers, but also allowed the blind to easily enjoy the fun of movies at home.
[0004] With the popularity of Internet videos, more and more barrier-free movies can be watched online, and a new form has been born: adding an external commentary track to ordinary movie versions to achieve barrier-free movies for the blind. This track is called AD track (Audio Description Track), or AD track for short, and its duration is the same as that of the main movie. This form eliminates the need for the reproduction of film media and reduces production costs.
[0005] During the playback of accessible movies using AD tracks, two audio tracks will be played simultaneously, namely, one movie audio track and one commentary audio track. When recording and producing the commentary audio track in the early stages, the narration will, in principle, avoid the dialogue sections of the characters in the movie, and choose quieter sections to intersperse the commentary. However, in addition to the dialogues of the characters, there are often background music and environmental sounds in the movie to create an atmosphere. These will inevitably overlap with the content of the commentary on the timeline, causing auditory masking, making it difficult for the audience to hear the commentary clearly, affecting the viewing experience.
[0006] In this regard, general players will support independent control of the volume of the AD track and the movie volume, so that users who accompany the viewing can make manual adjustments. For films with a narrow dynamic range of the original soundtrack, such as documentaries and art films, by appropriately increasing the volume of the AD track or reducing the volume of the original soundtrack, the audience can basically hear the commentary clearly without affecting the playback effect of the movie itself. However, for most films, the dynamic range of the original soundtrack is very wide, and its time axis waveform presents an undulating "mountain range shape". The AD track is pure voice, and the dynamic range is generally narrow, and the time axis waveform presents a flat "sausage shape". At this time, it is quite difficult to obtain a comfortable listening experience throughout the whole process through manual adjustment: due to the mismatch of the dynamic range of the two tracks, if the volume of the AD track is increased, it is impossible to guarantee that the commentary content can be heard clearly throughout the whole process, and it may even damage hearing. However, if the volume of the movie original soundtrack is reduced, the wide dynamic effect of the original soundtrack will be greatly reduced.
[0007] In summary, the existing technology still has the problem of poor playback experience when playing barrier-free movies for the blind with AD soundtracks, so it is necessary to make improvements. Summary of the invention
[0008] The purpose of the present invention is to provide an audio processing method, device and storage medium for blind barrier-free movie based on external AD sound track. Based on the existing barrier-free movie playback function for the blind, combined with voice activity detection (VAD) and volume adaptive adjustment technology, the auditory masking effect of the movie sound track on the AD sound track is overcome, so that the explanation content can be interspersed in the high dynamic range movie soundtrack for playback, which makes up for the shortcomings of the external AD sound track as a form of barrier-free movie playback for the blind, and improves the viewing experience of barrier-free movies for the blind.
[0009] The purpose of the present invention can be achieved by the following technical solutions:
[0010] A method for processing audio for blind accessible movies based on an external AD audio track, comprising:
[0011] Get the media data stream of the main film and the media data stream of the external AD audio track;
[0012] Based on the analysis and separation of the media data stream of the main film, the main film video frame queue Q is obtained videoES , Main audio frame queue Q audioES , and based on the media data stream analysis and separation of the external AD audio track, obtain the AD track audio frame queue Q audioESAD , and complete the positive video frame queue Q videoES , Main audio frame queue Q audioES and AD track audio frame queue Q audioESAD Timeline synchronization;
[0013] Based on the main audio frame queue Q audioESExtract the PCM data frame sequence of the positive film processing segment and queue Q based on the AD track audio frame audioESAD Extract the AD track processing segment PCM data frame sequence;
[0014] Performing voice activity detection on the PCM data frame sequence of the AD track processing segment to obtain a voice activity state of each frame, wherein the voice activity state is active or inactive;
[0015] The volume of each frame of the PCM data frame sequence of the positive film processing segment is calculated to obtain a positive film volume sequence, and the moving average of the elements in the positive film volume sequence is calculated one by one to obtain a positive film average volume sequence;
[0016] Modify the frames with inactive voice activity status in the PCM data frame sequence of the AD track processing segment to a silent value, and calculate the moving average value of the remaining frames one by one to obtain the AD track average volume sequence;
[0017] Adjust the average volume sequence of the main film and the average volume sequence of the AD track frame by frame based on the voice activity detection result;
[0018] The audio to be played is generated based on the processed positive film average volume sequence and AD track average volume sequence.
[0019] The step of adjusting the average volume sequence of the main film and the average volume sequence of the AD track frame by frame based on the voice activity detection result specifically includes:
[0020] Initial adjustment value generation step: determining the relative adjustment amplitude of each frame volume in the positive film average volume sequence and the AD track average volume sequence frame by frame, and obtaining the positive film relative adjustment value sequence and the AD track relative adjustment value sequence;
[0021] Volume adjustment step: adjusting the positive film average volume sequence and the AD track average volume sequence according to the positive film relative adjustment value sequence and the AD track relative adjustment value sequence.
[0022] The process of determining the adjustment value of any frame in the positive film relative adjustment value sequence and the AD track relative adjustment value sequence is as follows:
[0023] When the voice activity state of the frame is inactive, the positive film relative adjustment value and the AD track relative adjustment value are both 0;
[0024] When the voice activity status of the frame is active, the difference between the average volume of the positive film and the average volume of the AD track of the frame is calculated:
[0025] If the difference between the average volume of the main film and the average volume of the AD track in this frame is less than -10, the relative adjustment value of the main film and the relative adjustment value of the AD track are both 0;
[0026] If the difference between the average volume of the main film and the average volume of the AD track in this frame is less than -10 to 0, the relative adjustment value of the AD track is 0, and the relative adjustment value of the main film is D movie =L AD '(t)-L movie '(t)-10, where D movie is the relative adjustment value of the positive film, L AD '(t) is the average volume of the AD track, L movie '(t) is the average volume of the positive film;
[0027] If the difference between the average volume of the main film and the average volume of the AD track of the frame is less than 0 to 10, the relative adjustment value of the main film is -10, and the relative adjustment value of the AD track is D AD (t) = L movie '(t)-L AD '(t)-10;
[0028] If the difference between the average volume of the main film and the average volume of the AD track in this frame is greater than 10, the relative adjustment value of the main film is -10, and the relative adjustment value of the AD track is 10.
[0029] The method further comprises: adjusting the average volume sequence of the main film and the average volume sequence of the AD track frame by frame based on the voice activity detection result;
[0030] Adjustment value optimization step: smoothing the positive film relative adjustment value sequence and the AD track relative adjustment value sequence obtained in the initial adjustment value generation step;
[0031] The volume adjustment step specifically uses the result obtained in the adjustment value optimization step to adjust the volume.
[0032] The specific process of the smoothing process is as follows:
[0033]
[0034] Where: D movie is the relative adjustment value of the positive film before smoothing, D movie ' is the relative adjustment value of the positive film after smoothing, D AD is the relative adjustment value of the AD track before smoothing, D AD ' is the relative adjustment value of the AD track after smoothing, n is the step size, and i is the sequence number of the relative adjustment value of the positive film.
[0035] The step size is determined by the fade window length.
[0036] A plurality of PCM data frame sequences of the positive film processing segment and a plurality of PCM data frame sequences of the AD track processing segment are extracted.
[0037] The lengths of all PCM data frame sequences and the AD track processing segment PCM data frame sequence are equal.
[0038] A barrier-free movie audio processing device for the blind based on an external AD audio track comprises a memory, a processor, and a program stored in the memory. When the processor executes the program, the method described above is implemented.
[0039] A storage medium stores a program, which implements the above method when executed.
[0040] Compared with the prior art, the present invention has the following beneficial effects: based on the existing barrier-free movie playback function for the blind, combined with voice activity detection (VAD) and volume adaptive adjustment technology, it overcomes the auditory masking effect of the movie soundtrack on the AD soundtrack, so that the explanation content can be interspersed in the high dynamic range movie soundtrack for playback, making up for the shortcomings of the blind barrier-free movie playback form of the external AD soundtrack, and improving the blind barrier-free movie viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flow chart of a method for barrier-free movie playback for the blind based on an external AD audio track provided by an embodiment of the present invention;
[0042] Figure 2 The present invention Figure 1 Sub-flow chart of step S5;
[0043] Figure 3 is a flow chart of a voice activity detection (VAD) algorithm provided by an embodiment of the present invention;
[0044] Figure 4 is a graph showing the relationship between the adjustment values and the relative volumes of the two audio tracks, the main track and the AD track, when VAD(t)=1 in step S504 of the present invention;
[0045] Figure 5 This is an architecture diagram of a barrier-free movie playback system for the blind based on an external AD audio track provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0047] like Figure 1 As shown, the audio processing method for barrier-free movies for the blind based on an external AD audio track provided by the present invention can be used to play barrier-free movies for the blind, and comprises the following steps:
[0048] Step S1, obtaining the media data stream of the main program and the media data stream of the external AD audio track, parsing the encapsulation format and encoding type of the two data streams; the media data stream types supported by the present invention include but are not limited to HLS, DASH, MP4, RTSP, and RTMP;
[0049] Step S2, separating the video frame and the audio frame from the media data stream of the main program, and adding the video frame to the main program video frame queue Q videoES , add the audio frame to the main audio frame queue Q audioES , until the duration of the audio and video frame queue exceeds the pre-buffer setting value prebuff_duration, and at the same time extract the audio frame from the media data stream of the external AD audio track, and add the audio frame to the AD track audio frame queue Q ADEs , until the AD track audio frame queue duration exceeds the pre-buffer setting value prebuff_duration;
[0050] Step S3, start the playback clock and cyclically update it, the initial value of the clock start is queue Q audioES The timestamp of the first data frame in;
[0051] Step S4, in the clock processing cycle, from the above queue Q audioES The audio frames are taken out one by one for decoding, and the decoded positive film binary PCM data is added to the positive film PCM data queue Q pcm1 , and from the above queue Q ADEs The audio frames are taken out one by one for decoding, and the decoded AD track binary PCM data is added to the AD track PCM data queue Q pcm2 , until queue Q pcm1 and queue Q pcm2 The data within the audio processing interval length W pcm Then, enter the audio processing step S5;
[0052] Step S5, from the positive film PCM data queue Q pcm1 And AD track PCM data queue Q pcm2 Take out the length W pcm The audio data is processed so that the relative volume of the main film in the explanation section of the AD track does not exceed -10dB;
[0053] like Figure 2 As shown, step S5 further comprises the following steps:
[0054] Step S501, divide the PCM data into frames, the frame length is Wl, and the number of frames n=W pcm / W l , specifically, for Q pcm1Frame division is performed to obtain the PCM data frame sequence F of the positive film processing segment pcm1 (t0,t1,...t n-1 ), for Q pcm2 Frame division to obtain the AD track processing segment PCM data frame sequence F pcm2 (t0,t1,...t n-1 );
[0055] Step S502: Detect the above F using a voice activity detection (VAD) algorithm. pcm2 The voice activity state of each frame is obtained by calculating the voice activity state sequence VAD (t0, t1, ... t n-1 );
[0056] In this embodiment, two waveform features, namely, zero-crossing rate and average amplitude, are used as reference indicators for detecting voice activity. The zero-crossing rate refers to the number of times a PCM data sampling point crosses the horizontal axis (zero level) per second, and the average amplitude refers to the average value of the PCM data sample amplitude.
[0057] Specifically, the voice activity detection algorithm in this embodiment can be performed according to the following steps:
[0058] (a) Zero crossing rate and average amplitude calculation steps: Calculate the zero crossing rate ZCR(t) and the average amplitude A frame by frame avg (t);
[0059] (b) Speech state identification step, such as Figure 3 As shown, according to the zero crossing rate threshold ZCR voice , speech amplitude threshold A voice , silence amplitude threshold A mute , judge the speech state VAD(t i ), the specific judgment method is as follows:
[0060] If A avg (t) greater than A voice , and ZCR(t) is lower than ZCR voice , the current state is speech state, VAD(t)=1, that is, F pcm2 (t) is a speech frame;
[0061] If A avg (t) lower than A mute , or ZCR(t) is higher than ZCR voice , the current state is mute, VAD(t)=0, that is, F pcm2 (t) is a silent frame;
[0062] In other cases, VAD(t) maintains the speech state of the previous frame;
[0063] Step S503: pcm1 The volume is calculated for each frame to obtain the volume value sequence L of the current positive film processing segment movie (t0, t1, ... tn-1), and calculate the moving average of the elements of the sequence one by one to obtain the average volume value sequence L of the current positive film processing segment movie '(t0,t1,...t n-1 ), and at the same time for the above F pcm2 The volume of the speech frames with VAD(t)=1 in (t) is calculated, and the volume of the other frames with VAD(t)=0 is recorded as the mute value -90dB, and the volume value sequence L of the current AD track processing segment is obtained. AD (t0,t1,...t n-1 ), and for the above volume value sequence L AD The non-silent elements in the _A_ track are calculated one by one by calculating the moving average, and the average volume value sequence L of the current AD track processing segment is obtained. AD '(t0,t1,...t n-1 );
[0064] The calculation formula for the volume L(t) of each frame of PCM data is as follows:
[0065] L(t)=20*log(Sample max / 32767);
[0066] Sample max The maximum sample amplitude in the current frame data. The amplitude refers to the absolute value of the PCM sample value. When the sample is multi-channel sampling, the sample amplitude is the average of the absolute values of each channel;
[0067] In the present invention, the moving average is used as an indicator to measure the volume of the audio frame in order to avoid the interference of the short-term sharp increase and decrease of the volume on the adjustment result. At the same time, the sensitivity of the automatic volume adjustment can be controlled by increasing the window size of the moving average algorithm.
[0068] Specifically, this embodiment uses an exponentially weighted moving average EWMA algorithm to calculate the moving average, and the calculation formula is:
[0069] v(t)=β*v(t-1)+(1-β)*θ(t)
[0070] Where θ(t) is the actual volume value at time t, the coefficient β is the weighted decrease rate, and v(t) is the moving average of the volume at time t;
[0071] In this embodiment, the frame length W pcm= 80 ms, the weighted descent rate β can be taken as 0.9, and the calculated EWMA value is approximately equal to the weighted moving average of the last 10 frames, that is, the sliding window size is about 800 milliseconds, and the closer to the current calculation frame, the greater the weighting coefficient;
[0072] Step S504, according to L movie '(t0, t1,... t n-1 ) and L AD '(t0, t1,... t n-1 )'s volume values, as well as the state of VAD(t0, t1,... t n-1 ), correct the volume of the audio frames in the PCM data frame sequences F pcm1 (t0, t1,... t n-1 ) and F pcm2 (t0, t1,... t n-1 ). The goal is that when the AD track is explaining, the relative volume of the feature film does not exceed -10 dB, just approaching the threshold of the auditory masking effect between different sound sources, so as to achieve the purpose that the content of the AD track explanation can be clearly understood without overly weakening the volume of the feature film;
[0073] Specifically, the volume correction includes the following steps:
[0074] (a) Determine the relative adjustment amplitude of the volume of each frame in the PCM data frame sequences F pcm1 and F pcm2 frame by frame to obtain the relative adjustment value sequences D movie (t0, t1,... t n-1 ) and D AD (t0, t1,... t n-1 ). The relative adjustment value determination rule is as follows:
[0075] When VAD(t) = 0, D movie (t) = 0, D AD (t) = 0;
[0076] When VAD(t) = 1, according to L movie '(t) - L AD '(t)'s value d:
[0077] If d <= -10, then D movie (t) = 0, D AD (t) = 0;
[0078] If -10 < d <= 0, then D movie = L AD '(t) - L movie '(t) - 10, D AD (t) = 0;
[0079] If 0 < d <= 10, then D movie = -10, D AD (t) = L movie '(t) - L AD '(t) - 10;
[0080] If d > 10, then D movie = -10, D AD (t) = 10;
[0081]
[0082]
[0083] Table 1 shows the changes in the volume data of 5 pairs of audio frames before and after adjustment in this embodiment;
[0084] Figure 4 Intuitively shows the relationship between the adjustment values of the main feature track and the AD track when VAD(t) = 1 in step S504 and the above relative volume Ddb. As can be seen from the figure, in the present invention, the maximum relative adjustment value of the main feature track volume is limited to more than -10dB, which is to prevent the main feature volume from dropping too much and destroying the coherence of the movie atmosphere and background music; on the other hand, in the present invention, the relative adjustment value of the AD track is limited to below 10dB, which is to avoid the volume being too loud and causing damage to hearing, and at the same time avoid overflow in the gain calculation of the AD track; through the collection and analysis of the actual playback scenario, the adjustment limit of ±10dB defined in the present invention can meet the needs of most high-dynamic range movies with obstacle-free AD tracks外挂;
[0085] (b) Perform window smoothing processing on the adjustment value sequence, the purpose is to avoid sudden increases and decreases in volume and achieve a fade-in and fade-out adjustment effect. Set the fade-in and fade-out window length W f , then the number of frames n included in the window = W f / W l , and the final audio adjustment value calculation method is:
[0086]
[0087] (c) According to the final adjustment value of each frame, correct the volume of the audio data frames in the PCM data frame sequences F pcm1 (t0, t1,... t n-1 ) and F pcm2 (t0, t1,... t n-1 ). Specifically, the calculation method for each PCM sampling point is as follows:
[0088] sample' = sample * 10 (D ' / 20)
[0089] Where sample' is the adjusted sample value, sample is the original sample value, and D' is the final volume adjustment value of the current frame;
[0090] Step S6: The PCM data frame sequence Fpcm1 of the positive processing segment and the PCM data frame sequence Fpcm2 of the AD track processing segment are converted into pcm2 The binary data in is written into the device buffer of each of the two audio tracks, played by the sound card, and the above-mentioned positive film PCM data queue Q is updated. pcm1 And AD track PCM data queue Q pcm2 The starting timestamp T0 = T0 + W pcm , waiting to enter the next clock processing cycle;
[0091] Step S7, in the clock processing loop, from Q videoES The video frames are taken out one by one for decoding, and the decoded video frames to be rendered are added to the video rendering queue Q frames , until queue Q frames The length exceeds the video frame synchronization redundancy length T sync ;
[0092] Step S8, according to the video rendering queue Q frames The timestamp T of the first frame, the current playback clock t, and the system hardware audio delay T latency , determine whether to render the queue Q frames Render the current frame data:
[0093] When T>t+T latency , fetch and render the current frame;
[0094] When T < = t + T latency , waiting to enter the next clock processing cycle;
[0095] Figure 5 is an architecture diagram of a barrier-free movie playback system for the blind based on an external AD audio track provided by an embodiment of the present invention, such as Figure 5 As shown, including:
[0096] The media parsing device 10 is used to input the media data stream path of the program main film and the external AD audio track, parse and output the encapsulation format and encoding type of the two data streams;
[0097] The data buffer device 20 is connected to the media parsing device and is used to separate the video frame and the audio frame from the media data stream of the main program, extract the audio frame from the media data stream of the external AD audio track, and control the main video frame queue Q videoES , Main audio frame queue Q audioES , AD track audio frame queue QaudioESAD The lengths of these three frame queues;
[0098] The playback clock control device 30 is connected to the data buffer device and is used to start and manage the playback clock and set the initial value of the playback clock to be the queue Q. audioES The timestamp of the first data frame in the data frame is calculated, and clock update messages are sent regularly;
[0099] The audio decoding device 40 is connected to the playback clock control device and the data buffer device, and is used to decode the AD track audio frame queue Q after receiving the clock update message. audioESAD , AD track audio frame queue Q audioESAD The data in the decoded PCM data is decoded until the length of the decoded PCM data is greater than the length W of the audio processing segment. pcm ;
[0100] The audio processing device 50 is connected to the audio decoding device and is used to perform frame segmentation, voice activity detection, volume detection and correction on the decoded audio data of the main film and the audio data of the AD track, so that when there is a segment of explanation content in the AD track, the volume of the main film relative to the AD track is not more than -10dB as far as possible;
[0101] Furthermore, the above audio processing device includes the following sub-devices:
[0102] The audio framing device 501 is used to frame the PCM data to obtain a PCM data frame sequence F of the positive film processing segment. pcm1 (t0,t1,...t n-1 ) and AD track processing segment PCM data frame sequence F pcm2 (t0,t1,...t n-1 );
[0103] The AD track voice activity detection (VAD) device 502 is connected to the above-mentioned audio framing device and is used to detect the voice activity state of each frame of the above-mentioned Fpcm2 to obtain the AD track voice activity state sequence VAD (t0, t1, ... t n-1 );
[0104] The volume detection device 503 is connected to the above-mentioned audio framing device and is used to detect the F pcm1 The volume is detected for each frame, and the moving average is calculated one by one to obtain the volume value average sequence L of the current positive film processing segment. movie '(t0,t1,...tn-1), and at the same time for the above F pcm2 The volume of the speech frames with VAD(t)=1 in (t) is detected, and the volume of the other frames with VAD(t)=0 is recorded as the mute value -90dB, and the volume value sequence L of the current AD track processing segment is obtained. AD (t0,t1,...tn-1 ), and calculate the moving average of the non-silent elements in the above volume value sequence LAD one by one, and obtain the average volume value sequence L of the current AD track processing segment AD '(t0,t1,...t n-1 );
[0105] In the above-mentioned film volume detection device, the calculation formula of the volume L(t) of each frame of PCM data is:
[0106] L(t)=20*log(Sample max / 32767);
[0107] Sample max The maximum sample amplitude in the current frame data. The amplitude refers to the absolute value of the PCM sample value. When the sample is multi-channel sampling, the sample amplitude is the average of the absolute values of each channel;
[0108] The volume correction device 504 is connected to the AD track voice volume detection device and is used to adjust the volume according to L movie '(t0,t1,...tn-1) and L AD '(t0,t1,...tn-1) volume value, and VAD(t0,t1,...t n-1 ) state, for the PCM data frame sequence F pcm1 (t0,t1,...t n-1 ) and F pcm2 (t0,t1,...t n-1 ) to correct the volume of the audio frames in the AD track. The goal is to make the relative volume of the main film not exceed -10dB when the AD track is explaining, which is close to the threshold of auditory masking effect between different sound sources, so that the explanation of the AD track can be clearly understood without excessively weakening the volume of the main film.
[0109] Specifically, the volume correction device also includes the following sub-devices:
[0110] (a) Relative adjustment value calculation device, used to determine the PCM data frame sequence F frame by frame pcm1 and F pcm2 The relative adjustment amplitude of the volume of each frame in the image is obtained to obtain the relative adjustment value sequence D movie (t0,t1,...t n-1 ) and D AD (t0,t1,...t n-1 ), the relative adjustment value calculation rules are as follows:
[0111] When VAD(t)=0, D movie (t) = 0, D AD (t) = 0;
[0112] When VAD(t) = 1, according to L movie '(t) - L AD ' (t) value d:
[0113] If d <= -10, then D movie (t) = 0, D AD (t) = 0;
[0114] If -10 < d <= 0, then D movie = L AD '(t) - L movie '(t) - 10, D AD (t) = 0;
[0115] If 0 < d <= 10, then D movie = -10, D AD (t) = L movie '(t) - L AD '(t) - 10;
[0116] If d > 10, then D movie = -10, D AD (t) = 10;
[0117] (b) The adjustment value smoothing device, connected to the relative adjustment value calculation device, is used to smooth the adjustment value sequence, avoid sudden increases and decreases in volume, and achieve a fade-in and fade-out adjustment effect. Set the fade-in and fade-out window length W f , then the number of frames n contained in the window = W f / W l , and the final audio adjustment value calculation rule is:
[0118]
[0119] (c) The final correction value calculation device, connected to the adjustment value smoothing device, is used to correct the volume of the audio data frames in the PCM data frame sequences F pcm1 (t0, t1,... t n-1 ) and F pcm2 (t0, t1,... t n-1 ). Specifically, the calculation rule for each PCM sampling point is as follows:
[0120] sample' = sample * 10 (D ' / 20)
[0121] where sample' is the adjusted sample value, sample is the original sample value, and D’ is the final volume adjustment value of the current frame;
[0122] The audio playback device 60 is connected to the audio processing device and is used to play the processed positive film processing segment PCM data frame sequence F pcm1 , AD track processing segment PCM data frame sequence F pcm2 The binary data in is written into the device buffers of the two audio tracks respectively and played by the sound card;
[0123] The video decoding device 70 is connected to the data buffer device and is used to obtain the video data from Q videoES Take out the video frames one by one for decoding, and add the decoded video frames to be rendered into the video rendering queue Q frames ;
[0124] The video rendering device 80 is connected to the video decoding device and the playback clock control device, and is used to realize the synchronous playback of audio and video. frames The timestamp T of the first frame, the current playback clock t, and the system hardware audio delay T latency , determine whether to render the queue Q frames Render the current frame data:
[0125] When T>t+T latency , fetch and render the current frame;
[0126] When T < = t + T latency , waiting for the playback clock control device to send the next clock update message.
[0127] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
Claims
1. A method for processing audio for blind accessible movies based on external AD audio tracks, characterized in that: include: Get the media data stream of the main film and the media data stream of the external AD audio track; Based on the analysis and separation of the media data stream of the main film, the main film video frame queue Q is obtained videoES , Main audio frame queue Q audioES , and based on the media data stream analysis and separation of the external AD audio track, obtain the AD track audio frame queue Q audioESAD , and complete the positive video frame queue Q videoES , Main audio frame queue Q audioES and AD track audio frame queue Q audioESAD Timeline synchronization; Based on the main audio frame queue Q audioES Extract the PCM data frame sequence of the positive film processing segment and queue Q based on the AD track audio frame audioESAD Extract the AD track processing segment PCM data frame sequence; Performing voice activity detection on the PCM data frame sequence of the AD track processing segment to obtain a voice activity state of each frame, wherein the voice activity state is active or inactive; The volume of each frame of the PCM data frame sequence of the positive film processing segment is calculated to obtain a positive film volume sequence, and the moving average of the elements in the positive film volume sequence is calculated one by one to obtain a positive film average volume sequence; Modify the frames with inactive voice activity status in the PCM data frame sequence of the AD track processing segment to a silent value, and calculate the moving average value of the remaining frames one by one to obtain the AD track average volume sequence; Adjust the average volume sequence of the main film and the average volume sequence of the AD track frame by frame based on the voice activity detection result; Generate audio to be played based on the processed average volume sequence of the main film and the average volume sequence of the AD track; The step of adjusting the average volume sequence of the main film and the average volume sequence of the AD track frame by frame based on the voice activity detection result specifically includes: Initial adjustment value generation step: determining the relative adjustment amplitude of each frame volume in the positive film average volume sequence and the AD track average volume sequence frame by frame, and obtaining the positive film relative adjustment value sequence and the AD track relative adjustment value sequence; Volume adjustment step: adjusting the positive film average volume sequence and the AD track average volume sequence according to the positive film relative adjustment value sequence and the AD track relative adjustment value sequence; The process of determining the adjustment value of any frame in the positive film relative adjustment value sequence and the AD track relative adjustment value sequence is as follows: When the voice activity state of the frame is inactive, the positive film relative adjustment value and the AD track relative adjustment value are both 0; When the voice activity status of the frame is active, the difference between the average volume of the positive film and the average volume of the AD track of the frame is calculated: If the difference between the average volume of the main film and the average volume of the AD track in this frame is less than -10, the relative adjustment value of the main film and the relative adjustment value of the AD track are both 0; If the difference between the average volume of the main film and the average volume of the AD track in this frame is less than -10 to 0, the relative adjustment value of the AD track is 0, and the relative adjustment value of the main film is D movie =L AD '(t)-L movie '(t)-10, where D movie is the relative adjustment value of the positive film, L AD '(t) is the average volume of the AD track, L movie '(t) is the average volume of the positive film; If the difference between the average volume of the main film and the average volume of the AD track of the frame is less than 0 to 10, the relative adjustment value of the main film is -10, and the relative adjustment value of the AD track is D AD (t) = L movie '(t)-L AD '(t)-10; If the difference between the average volume of the main film and the average volume of the AD track in this frame is greater than 10, the relative adjustment value of the main film is -10, and the relative adjustment value of the AD track is 10; The method further comprises: adjusting the average volume sequence of the main film and the average volume sequence of the AD track frame by frame based on the voice activity detection result; Adjustment value optimization step: smoothing the positive film relative adjustment value sequence and the AD track relative adjustment value sequence obtained in the initial adjustment value generation step; The volume adjustment step specifically uses the result obtained in the adjustment value optimization step to adjust the volume.
2. The method for processing audio for blind accessible movies based on external AD audio tracks according to claim 1, characterized in that: The specific process of the smoothing process is as follows: Where: D movie is the relative adjustment value of the positive film before smoothing, D movie ' is the relative adjustment value of the positive film after smoothing, D AD is the relative adjustment value of the AD track before smoothing, D AD ' is the relative adjustment value of the AD track after smoothing, n is the step size, and i is the sequence number of the relative adjustment value of the positive film.
3. The method for processing audio for blind accessible movies based on external AD audio tracks according to claim 2, characterized in that: The step size is determined by the fade window length.
4. The method for processing audio for blind accessible movies based on external AD audio tracks according to claim 1, characterized in that: A plurality of PCM data frame sequences of the positive film processing segment and a plurality of PCM data frame sequences of the AD track processing segment are extracted.
5. The method for processing audio for blind accessible movies based on external AD audio tracks according to claim 4, characterized in that: The lengths of all PCM data frame sequences and the AD track processing segment PCM data frame sequence are equal.
6. A blind barrier-free movie audio processing device based on an external AD audio track, comprising a memory, a processor, and a program stored in the memory, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.
7. A storage medium having a program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 5 is implemented.
