A live video transparent transmission AI commentary adaptive mixing method and system
By using the AI-driven adaptive audio mixing method for live video pass-through, we have achieved pass-through without secondary encoding, adaptive audio track ducking mixing, multi-level priority scheduling, and fault self-healing. This solves the problems of high video processing latency, audio conflicts, and audio-visual asynchrony in existing technologies, thereby improving the quality of live audio and video and the stability of the system.
Patent Information
- Application Number
- CN202611202132.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-27
AI Technical Summary
Existing live streaming AI commentary mixing technology suffers from problems such as high computational cost for video processing, high live streaming latency, audio track mixing conflicts, disordered audio scheduling, audio-visual asynchrony in commentary, poor system fault tolerance, and weak scene adaptability.
The live video pass-through AI narration adaptive mixing method is adopted. The original video stream is passed through without secondary encoding. The system constructs an audio track adaptive ducking mixing, a multi-level priority scheduling queue, an intelligent management and fault self-healing mechanism for audio queue backlog, and realizes audio hierarchical priority scheduling and fault self-healing.
Significantly reduces computing power consumption and live streaming latency, resolves audio loudness conflicts, improves the real-time interactivity of live streaming, eliminates audio-visual desynchronization, and enhances system stability and scene adaptability.
Smart Images

Figure CN123185375A_ABST
Abstract
Description
Technical Field
[0001] This invention provides a live video pass-through AI narration adaptive mixing method and system, belonging to the field of live audio and video processing and AI audio mixing scheduling technology. Background Technology
[0002] The live streaming industry currently widely adopts AI-powered intelligent narration technology to enrich live stream content and enhance the viewing experience by generating real-time AI-generated audio narration. However, existing AI audio mixing solutions for live streaming have numerous technical flaws, severely impacting the playback quality of live audio and video and system stability.
[0003] First, traditional live streaming audio and video processing generally involves decoding, retiming, and re-encoding the original live video. This process not only incurs significant computational overhead, leading to increased latency and excessive server resource usage, but also easily introduces problems such as video stuttering, screen tearing, and frame rate fluctuations, failing to meet the business requirements of high-definition, low-latency live streaming. Second, existing AI commentary mixing methods mostly use fixed-volume superposition mixing, failing to distinguish the primary and secondary relationship between the host's original audio and the AI commentary audio. This easily results in issues such as AI commentary overshadowing the host's original audio, loudness conflicts between the two audio tracks, and inconsistent audio volume, leading to a very poor listening experience for viewers.
[0004] Furthermore, the existing AI-powered audio scheduling mechanism lacks priority differentiation, resulting in the disordered playback of regular on-screen commentary, audience Q&A audio, and welcome audio. Highly real-time interactive audio, such as bullet screen Q&A, is easily blocked by regular commentary audio, leading to delayed responses and severely impacting the real-time interactivity of the live stream. Simultaneously, the audio push buffer queue lacks backlog monitoring and old data cleanup mechanisms, making it highly susceptible to audio clip accumulation and asynchronous issues between commentary content and live screen footage. Moreover, the absence of robust fault self-healing and anomaly degradation mechanisms means that merging process anomalies can directly cause live stream interruptions and audio / video output failures, resulting in poor system stability and fault tolerance.
[0005] Furthermore, existing technologies cannot adapt to special scenarios such as the absence of an audio track in the original live stream and the forced constant bitrate output by downstream platforms, resulting in poor scenario adaptability and difficulty in meeting the diverse needs of live streaming services. Therefore, there is an urgent need for a live streaming AI-powered audio mixing technology solution that features low latency, high stability, adaptive mixing, and support for priority scheduling and fault self-healing. Summary of the Invention
[0006] This invention aims to solve the technical problems in existing live streaming AI commentary mixing technologies, such as high computational cost of video processing, high live streaming latency, audio track mixing conflicts, disordered audio scheduling, audio-visual asynchrony, poor system fault tolerance, and weak scene adaptability. It provides a live streaming video pass-through AI commentary adaptive mixing method and system, which realizes live streaming video pass-through without secondary encoding, adaptive audio track ducking mixing, audio hierarchical priority scheduling, intelligent management of queue backlog and fault self-healing, and significantly improves the quality of live streaming audio and video and the stability of system operation.
[0007] To address the aforementioned problems, the present invention proposes the following technical solution: a live video pass-through AI commentary adaptive mixing method, executed by the live streaming server, comprising the following steps: S1. Start the dual-input single-output merging subprocess and configure two audio and video input channels; the first input channel connects to the original audio and video stream of the broadcaster and is configured with a large-capacity input buffer to smooth sudden fluctuations in the original stream bitrate; the second input channel receives AI narration audio segments through the local TCP loopback port; the video bitstream in the original audio and video stream is output using a direct copy pass-through method, without performing decoding, timestamp retiming, or secondary encoding operations throughout the process; the AI narration audio segments use sample count relative timestamps, abandoning the operating system epoch wall clock timestamps, and eliminate audio input jitter through an asynchronous resampling filter; S2. Perform adaptive ducking mixing of original sound and AI narration audio: Extract the original sound from the original audio and video stream as the main audio, and use the AI narration audio as the sidechain control signal; dynamically reduce the loudness of the original sound in real time according to the sidechain signal through the sidechain compression filter, and automatically restore the original loudness of the original sound when the AI narration audio is silent; superimpose the sidechain compressed original sound and the AI narration audio to synthesize a single output audio track; S3. Construct a multi-level priority audio scheduling queue. The queue storage unit is a triple containing a priority value, a globally monotonically incrementing sequence number, and an audio load. Pre-divide the audio into three levels of priority: the barrage Q&A audio is the highest priority, the audience welcome audio is the middle priority, and the regular AI commentary audio is the lowest priority. Audios of the same priority maintain the order of being enqueued and played according to the globally monotonically incrementing sequence number. When barrage Q&A audio is generated, execute the preemptive insertion process: enqueue the barrage Q&A audio with the highest priority, traverse and discard any unplayed regular AI commentary audio segments in the queue, and interrupt the regular commentary statements that are currently being streamed. S4. Set up an independent buffer queue to store AI narration audio segments to be pushed to the merging subprocess. Allocate a single dedicated sending thread to read the buffer queue data and push it to the second input channel of the merging subprocess via the TCP loopback channel. Calculate the cumulative playback duration of all audio segments in the buffer queue in real time and pre-configure a duration threshold. When the cumulative playback duration exceeds the duration threshold, cyclically discard the audio segment with the earliest storage time from the head of the buffer queue. After the discarding operation is completed, the buffer queue retains at least one audio segment until the cumulative playback duration of the queue falls back below the threshold. Statistically count and output audio segment discard logs at fixed intervals. S5. Set up an audio feed thread to read audio segments from a multi-level priority audio scheduling queue according to a fixed time rhythm. When a single read cannot gather a complete audio segment, fill it with silent audio data to maintain the continuous and stable global audio clock. After the audio segments are processed by the waiting-to-send buffer queue, they are injected into the merging subprocess. The merging subprocess encodes the pass-through video bitstream and the mixed output audio track separately and pushes them to the target third-party live streaming platform. S6. Fault self-healing: If the merged subprocess exits abnormally, the unique dedicated sending thread will restart the merged subprocess locally using an exponential backoff strategy; when the number of times the merged subprocess is restarted within a unit of time reaches a preset alarm threshold, the server will output an abnormal alarm message.
[0008] Furthermore, the sidechain compression filter is configured with fixed engineering parameters: trigger threshold=0.03, compression ratio=8, start time attack=5ms, and recovery time release=300ms; it uses an amix filter to overlay the original sound and AI narration audio, and disables the automatic normalization mode to suppress drastic fluctuations in the loudness of the output audio.
[0009] Furthermore, the merging subprocess is built based on the FFmpeg audio and video processing engine; the merging subprocess's running parameters are not configured with -max_interleave_delta 0, and the wall clock timestamp synchronization mode is not enabled; the first input channel buffer parameters are configured with -rtbufsize64M and -thread_queue_size8192; the standard format of the AI narration audio clips is 24000Hz, mono, 16-bit PCM, with a single audio segment duration of 20ms and a single segment byte length of 960Bytes; the output audio after mixing is uniformly resampled to 44100Hz mono and encoded in AAC format.
[0010] Furthermore, the cumulative playback duration threshold is configured to be 6 seconds by default; the maximum number of bytes allowed to be stored in the pending buffer queue is calculated as follows: maximum number of bytes = duration threshold × audio sampling rate × number of bytes per sample × number of channels; the cumulative audio duration log of the queue is summarized and output every 5 seconds.
[0011] Furthermore, it also includes a degradation step for the original stream without an audio track: when it is detected that the original audio and video stream of the anchor does not contain an audio track, the merge subprocess automatically switches to a degradation operation mode that only outputs the AI narration audio track, so as to avoid the merge subprocess failing to start or exiting abnormally.
[0012] Furthermore, direct copying and pass-through of video is the system's default output mode; an additional constant bitrate secondary encoding backup mode is provided to adapt to business scenarios where downstream live streaming platforms force constant bitrate output.
[0013] Furthermore, it also includes a live broadcast shutdown and cleanup step: configure an independent shutdown interface, and when the live broadcast link shutdown command is triggered, immediately clear all unpushed AI narration audio segments in the pending send buffer queue, and stop the delayed narration audio from being pushed out.
[0014] Furthermore, a live video pass-through AI commentary adaptive mixing system is provided, used to execute the live video pass-through AI commentary adaptive mixing method, deployed on the live streaming server, including a media merging module, a priority audio scheduling module, and an audio injection and follow-up flow control module; the media merging module is used to create a dual-input single-output merging subprocess to perform pass-through processing on the original video bitstream without secondary encoding; it configures a large-capacity input buffer to eliminate original stream bitrate jitter; it receives standardized PCM format AI commentary audio through a local TCP loopback channel, and completes adaptive ducking mixing of the original sound and AI commentary audio through a side-chain compression filter; the priority audio scheduling module is communicatively connected to the media merging module, has a built-in three-level priority audio scheduling queue, and ensures orderly playback of audio of the same priority through a globally monotonically incrementing sequence number; it also has a built-in bullet screen preemption and insertion unit, the bullet screen preemption and insertion unit... The playback unit is used to discard regular commentary segments waiting to be broadcast in the queue and interrupt the regular commentary statements being synthesized, so as to realize the preemptive output of high-priority bullet screen Q&A voice; the audio injection and follow-up flow control module is connected to the media merging module and the priority audio scheduling module respectively, including a unique sending thread, a buffer queue of audio to be sent, a backlog duration monitoring unit, an old segment discarding unit, and a fault self-healing unit; the backlog duration monitoring unit calculates the cumulative playback time of audio in the buffer queue in real time, and drives the old segment discarding unit to remove outdated audio from the head of the queue after exceeding the threshold; the fault self-healing unit restarts the subprocess through an exponential backoff mechanism when the merging subprocess crashes, and triggers an alarm after exceeding the limit; the system also includes an audio feed unit, which reads audio segments from the priority audio scheduling queue at a fixed time of 20ms, and fills in silence data to maintain the continuity of the audio clock when there are not enough audio segments.
[0015] Due to the adoption of the above technical solution, the beneficial effects of the live video pass-through AI commentary adaptive mixing method and system of the present invention are as follows: 1. Achieve zero-secondary-encoding pass-through of live video, significantly reducing computing power consumption and live streaming latency. This invention adopts a direct copy pass-through mode for the original video stream of the broadcaster, eliminating the need for decoding, timestamp re-timing, and secondary encoding throughout the process. This avoids the computing power consumption, image distortion, and latency accumulation problems of traditional video processing. At the same time, it is equipped with a large-capacity input buffer to effectively smooth sudden fluctuations in the bitrate of the original live stream, ensuring stable and smooth video playback.
[0016] 2. Implements adaptive ducking mixing for audio tracks, completely resolving audio loudness conflicts. Using a sidechain compression filter with AI narration audio as the sidechain signal and the broadcaster's original voice as the main audio, the loudness of the original voice is dynamically adjusted. The original voice is automatically lowered during AI narration playback and restored to its original loudness when silent. Combined with fixed optimized engineering parameters and the AMIX filter with automatic normalization disabled, the issues of distortion from dual-track overlay and drastic loudness fluctuations are completely eliminated, significantly improving the listening experience.
[0017] 3. Construct a three-level audio priority scheduling mechanism to improve the real-time interactivity of live streaming. Differentiate between three audio priorities: bullet screen Q&A, welcome messages, and regular commentary. Support high-priority bullet screen voice messages to preempt and insert, automatically discard lagging regular audio and interrupt commentary statements in the synthesis process, and play audio of the same priority in sequence. This balances the immediacy of interaction with the orderly playback of audio, solving the problems of disordered scheduling and delayed interactive response in traditional methods.
[0018] 4. Implement intelligent flow control for audio queues to eliminate audio-visual desynchronization. By monitoring the cumulative playback time of the buffer queue in real time, old and lagging audio segments are automatically removed, limiting the maximum backlog time of the queue. At the same time, discard logs are periodically output to precisely control the audio push rhythm and completely solve the problem of AI narration lagging behind the live broadcast. Fixed beat feeding + silent filling mechanism ensures continuous and stable global audio clock, without audio interruption or stuttering issues.
[0019] 5. Possesses robust fault self-healing and degradation adaptation capabilities, resulting in extremely high system stability. It achieves abnormal restart of merging subprocesses through an exponential backoff strategy, with automatic alarms for exceeding limits; it supports functions such as degradation operation without the original audio track, constant bitrate secondary encoding backup mode, and instant cache clearing upon shutdown, adapting to various abnormal scenarios and platform customization needs. Its fault tolerance and scenario adaptability far exceed traditional solutions.
[0020] 6. Utilizing TCP loopback transmission and a relative timestamp mechanism to eliminate audio jitter. Abandoning wall clock timestamps, a sample count relative timestamp combined with an asynchronous resampling filter is used to completely eliminate audio input jitter, ensuring accurate timing of AI narration audio and higher audio track synchronization precision. Attached Figure Description
[0021] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the overall process of the live video pass-through AI narration adaptive mixing method and system of the present invention; Figure 2 This is a module architecture diagram of a live video pass-through AI narration adaptive mixing method and system according to the present invention; Figure 3 This is a schematic diagram illustrating the multi-level priority audio scheduling queue preemption and insertion process of a live video pass-through AI narration adaptive mixing method and system according to the present invention. Figure 4 This is a flowchart of the audio buffer queue flow control and merging subprocess fault self-healing processing of a live video pass-through AI narration adaptive mixing method and system according to the present invention. Detailed Implementation
[0022] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] This embodiment provides a live video pass-through AI narration adaptive audio mixing method, deployed on a live cloud server, and implemented based on the FFmpeg audio and video processing engine. The specific execution steps are as follows: Initialize the merging subprocess and audio / video input channels: Start the dual-input single-output merging subprocess, configure the first input channel to connect to the broadcaster's real-time raw audio and video stream, and set the buffer parameters -rtbufsize64M and -thread_queue_size8192 to smooth out sudden bitrate changes caused by network fluctuations during the live broadcast through a large-capacity buffer; the second input channel listens for and receives AI narration audio segments output by the AI speech synthesis module through the local TCP loopback port. All AI narration audio is standardized to 24000Hz, mono, 16-bit PCM format, with a single segment duration of 20ms and a byte length of 960 bytes. The video stream uses a direct copy pass-through method throughout, without decoding, timestamp re-timing, or secondary encoding, and the merging subprocess does not configure the -max_interleave_delta 0 parameter, disabling the wall clock timestamp synchronization mode. The AI audio uses sample count relative to the timestamp, and input jitter is eliminated through an asynchronous resampling filter.
[0024] Adaptive ducking mixing is implemented: the original live audio stream from the broadcaster is extracted as the main audio, and the AI narration audio is used as the sidechain control signal. The sidechain compression filter parameters are configured as follows: threshold=0.03, ratio=8, attack=5ms, release=300ms. When effective AI narration audio is detected, the loudness of the original live audio is dynamically reduced in real time; when the AI narration audio enters a silent state, the original loudness is automatically and smoothly restored. Dual audio tracks are superimposed using an amix filter, and automatic normalization mode is disabled to avoid abrupt loudness changes after multi-track superposition. After synthesizing the complete output audio track, it is uniformly resampled to 44100Hz mono and encoded in AAC format.
[0025] Multi-level priority audio scheduling: An audio scheduling queue is constructed using a triplet method. Each triplet contains a priority value, a globally monotonically incrementing sequence number, and an audio payload. Three priority levels are preset: Level 1 is for bullet screen Q&A audio, Level 2 is for audience welcome audio, and Level 3 is for regular AI narration audio. Audios of the same priority are played sequentially according to their globally incrementing sequence number. When a user sends a bullet screen comment triggering Q&A audio generation, that audio is immediately enqueued with the highest priority. The scheduling queue is then traversed synchronously, discarding all unplayed regular Level 3 narration audio segments and interrupting the currently streaming regular narration, thus enabling high-priority interactive audio preemption and insertion.
[0026] Audio queue backlog control and log statistics: A separate buffer queue for sending data is created, and a single dedicated sending thread is configured to handle queue data reading and TCP loopback push. The default cumulative playback duration threshold is set to 6 seconds. The maximum storage bytes of the queue are calculated using the formula: "Maximum byte limit = Duration threshold × Audio sampling rate × Number of bytes per sample × Number of channels". The system continuously tracks the cumulative playback duration of all audio segments in the queue. When the 6-second threshold is exceeded, the oldest audio segment is discarded sequentially from the head of the queue, while always retaining at least one audio segment, until the cumulative duration falls back below the threshold. Every 5 seconds, the system automatically summarizes and outputs log data such as the number of audio segments discarded, the duration of discards, and the peak backlog, for operational monitoring.
[0027] Fixed-beat audio feed and audio / video output: The audio feed thread reads audio segments from the priority scheduling queue at fixed 20ms intervals. If a single read cannot gather a complete audio frame, it automatically fills in silent audio data to ensure uninterrupted and drift-free global audio clock operation. The processed audio segments are sent to the waiting-to-send buffer queue and pushed to the merging subprocess via a dedicated thread. The merging subprocess merges the original video stream and the mixed AAC encoded audio track before pushing it to third-party live streaming platforms such as Douyin, Kuaishou, and Bilibili.
[0028] Fault self-healing and anomaly alarms: During operation, the running status of merged subprocesses is monitored in real time. If a subprocess exits or crashes abnormally, a dedicated sending thread uses an exponential backoff strategy to gradually extend the restart interval and automatically restart the subprocess. The number of restarts per unit time is counted, and when it exceeds a preset alarm threshold, the server proactively pushes anomaly alarm information to remind maintenance personnel to investigate the fault.
[0029] Special scenario adaptation handling: Real-time detection of the original audio and video stream track information of the broadcaster. If the original stream has no audio track, the degradation mode is automatically triggered, and the merged subprocess only outputs the AI narration audio track to avoid process startup failure; The default video pass-through mode is adopted, which can be manually switched to the constant bitrate secondary encoding backup mode to adapt to the bitrate requirements of downstream platforms; When the broadcast ends and the broadcast shutdown command is triggered, all unpushed audio in the pending buffer queue is immediately cleared to prevent the problem of delayed narration audio from being pushed after the broadcast ends.
[0030] This embodiment also provides a mixing system adapted to the above method, including a media merging module, a priority audio scheduling module, an audio injection and follow-up flow control module, and an audio feed unit. The modules work together to complete the entire process of audio and video pass-through, adaptive mixing, priority scheduling, queue flow control, and fault self-healing, so as to achieve efficient, stable, and low-latency live AI commentary mixing effect.
[0031] The present invention and its embodiments have been described above. This description is not restrictive. In short, if a person skilled in the art is inspired by this description and designs a method and embodiment similar to the technical solution without departing from the spirit of the present invention, such method and embodiment should be protected within the scope of the present invention.
Claims
1. A live video pass-through AI narration adaptive audio mixing method, characterized in that, This process is executed by the live streaming server and includes the following steps: S1. Start the dual-input single-output merging subprocess and configure two audio and video input channels; the first input channel connects to the original audio and video stream of the broadcaster and is configured with a large-capacity input buffer to smooth sudden fluctuations in the original stream bitrate; the second input channel receives AI narration audio segments through the local TCP loopback port; the video bitstream in the original audio and video stream is output using a direct copy pass-through method, without performing decoding, timestamp retiming, or secondary encoding operations throughout the process; the AI narration audio segments use sample count relative timestamps, abandoning the operating system epoch wall clock timestamps, and eliminate audio input jitter through an asynchronous resampling filter; S2. Perform adaptive ducking mixing of original sound and AI narration audio: Extract the original sound from the original audio and video stream as the main audio, and use the AI narration audio as the sidechain control signal; dynamically reduce the loudness of the original sound in real time according to the sidechain signal through the sidechain compression filter, and automatically restore the original loudness of the original sound when the AI narration audio is silent; superimpose the sidechain compressed original sound and the AI narration audio to synthesize a single output audio track; S3. Construct a multi-level priority audio scheduling queue. The queue storage unit is a triple containing a priority value, a globally monotonically incrementing sequence number, and an audio load. Pre-divide the audio into three levels of priority: the barrage Q&A audio is the highest priority, the audience welcome audio is the middle priority, and the regular AI commentary audio is the lowest priority. Audios of the same priority maintain the order of being enqueued and played according to the globally monotonically incrementing sequence number. When barrage Q&A audio is generated, execute the preemptive insertion process: enqueue the barrage Q&A audio with the highest priority, traverse and discard any unplayed regular AI commentary audio segments in the queue, and interrupt the regular commentary statements that are currently being streamed. S4. Set up an independent buffer queue to store AI narration audio segments to be pushed to the merging subprocess. Allocate a single dedicated sending thread to read the buffer queue data and push it to the second input channel of the merging subprocess via the TCP loopback channel. Calculate the cumulative playback duration of all audio segments in the buffer queue in real time and pre-configure a duration threshold. When the cumulative playback duration exceeds the duration threshold, cyclically discard the audio segment with the earliest storage time from the head of the buffer queue. After the discarding operation is completed, the buffer queue retains at least one audio segment until the cumulative playback duration of the queue falls back below the threshold. Statistically count and output audio segment discard logs at fixed intervals. S5. Set up an audio feed thread to read audio segments from a multi-level priority audio scheduling queue according to a fixed time beat; when a single read cannot gather a complete audio segment, fill it with silent audio data to maintain the continuous and stable global audio clock. The audio clip is processed by the waiting-to-send buffer queue and then injected into the merging subprocess; the merging subprocess encodes the pass-through video bitstream and the mixed output audio track separately and pushes them to the target third-party live streaming platform; S6. Fault self-healing: If the merged subprocess exits abnormally, the unique dedicated sending thread will restart the merged subprocess locally using an exponential backoff strategy; when the number of times the merged subprocess is restarted within a unit of time reaches a preset alarm threshold, the server will output an abnormal alarm message.
2. The live video pass-through AI commentary adaptive mixing method according to claim 1, characterized in that, The sidechain compression filter is configured with fixed engineering parameters: trigger threshold=0.03, compression ratio=8, start time attack=5ms, and recovery time release=300ms; it uses an amix filter to overlay the original sound and AI narration audio, and disables the automatic normalization mode to suppress drastic fluctuations in the loudness of the output audio.
3. The live video pass-through AI commentary adaptive mixing method according to claim 1, characterized in that, The merge subprocess is built based on the FFmpeg audio and video processing engine; the merge subprocess's running parameters are not configured with -max_interleave_delta 0, and the wall clock timestamp synchronization mode is not enabled; the first input channel buffer parameters are configured with -rtbufsize64M and -thread_queue_size8192; the standard format of the AI narration audio segments is 24000Hz, mono, 16-bit PCM, with a single audio segment duration of 20ms and a single segment byte length of 960Bytes; the output audio after mixing is uniformly resampled to 44100Hz mono and encoded in AAC format.
4. The live video pass-through AI commentary adaptive mixing method according to claim 1, characterized in that, The default configuration for the cumulative playback duration threshold is 6 seconds; the maximum number of bytes allowed to be stored in the pending buffer queue is calculated as follows: maximum number of bytes = duration threshold × audio sampling rate × number of bytes per sample × number of channels; the cumulative audio duration log of the queue is summarized and output every 5 seconds.
5. The live video pass-through AI commentary adaptive mixing method according to claim 1, characterized in that, It also includes a degradation step for the original stream without an audio track: when it is detected that the original audio and video stream of the anchor does not contain an audio track, the merge subprocess automatically switches to a degradation operation mode that only outputs the AI narration audio track, so as to avoid the merge subprocess failing to start or exiting abnormally.
6. The live video pass-through AI commentary adaptive mixing method according to claim 1, characterized in that, Direct copying and pass-through of video is the system's default output mode; an additional constant bitrate secondary encoding backup mode is provided to adapt to business scenarios where downstream live streaming platforms force constant bitrate output.
7. The live video pass-through AI commentary adaptive mixing method according to claim 1, characterized in that, It also includes a live broadcast shutdown and cleanup step: configure an independent shutdown interface, and when the live broadcast link shutdown command is triggered, immediately clear all unpushed AI narration audio segments in the pending send buffer queue, and stop the delayed narration audio from being pushed out.
8. A live video pass-through AI narration adaptive mixing system, characterized in that, This system, deployed on a live streaming server, is designed to implement an adaptive audio mixing method for AI-powered live video pass-through. It includes a media merging module, a priority audio scheduling module, and an audio injection and follow-up flow control module. The media merging module creates a dual-input, single-output merging subprocess to perform pass-through processing on the original video stream without secondary encoding. It configures a large-capacity input buffer to eliminate original stream bitrate jitter and receives standardized PCM format AI-powered audio through a local TCP loopback channel. A sidechain compression filter is used to achieve adaptive ducking mixing between the original sound and the AI-powered audio. The priority audio scheduling module communicates with the media merging module and has a built-in three-level priority audio scheduling queue. A globally monotonically incrementing sequence number ensures orderly playback of audio of the same priority. It also includes a built-in bullet screen preemption and insertion unit, which discards audio from the queue awaiting playback. The system includes a regular commentary segment and interrupts the synthesis of regular commentary statements to achieve high-priority bullet screen Q&A audio output. The audio injection and update flow control module is connected to the media merging module and the priority audio scheduling module, respectively. It includes a unique sending thread, a pending audio buffer queue, a backlog duration monitoring unit, an old segment discarding unit, and a fault self-healing unit. The backlog duration monitoring unit calculates the cumulative playback time of audio in the buffer queue in real time. When the time exceeds the threshold, it drives the old segment discarding unit to remove outdated audio from the head of the queue. When the merging subprocess crashes, the fault self-healing unit restarts the subprocess through an exponential backoff mechanism and triggers an alarm when the limit is exceeded. The system also includes an audio feed unit that reads audio segments from the priority audio scheduling queue at a fixed 20ms time interval. When there are not enough audio segments, it fills in silence data to maintain the continuity of the audio clock.
