1. The Perils of Generational Loss in Audio

When a video is recorded on a smartphone or mirrorless camera, the audio track is typically compressed using a lossy codec—most often AAC-LC (Advanced Audio Coding - Low Complexity) or Opus at 128 kbps to 256 kbps.

Lossy psychoacoustic algorithms discard frequency information deemed imperceptible to human ears. However, if a web video tool decodes this lossy stream into raw PCM audio and subsequently compresses it a second time into AAC:

  • Artifact accumulation: Quantization noise from both compression cycles compounds, creating a harsh "metallic" or "underwater" sound in high-frequency ranges.
  • Stereo phase distortion: Spatial soundstage imaging collapses.
  • Truncated frequency cutoff: Aggressive re-encoders introduce steep low-pass filters cutting off frequencies above 15 kHz.

2. Demuxing vs. Transcoding: How Container Remuxing Works

A video file (such as an .mp4 or .mov) is not a single format; it is a multimedia container that multiplexes multiple independent data streams:

[MP4 Container] ├── Stream #0:0 (Video: H.264 / HEVC / ProRes) --> Re-encoded with Delogo filter └── Stream #0:1 (Audio: AAC / Opus / Dolby AC3) --> PASSED THROUGH DIRECTLY (-c:a copy)

During stream copying (passthrough), FFmpeg decouples the video and audio streams at the container boundary:

  1. The video elementary stream is decoded, passed through spatial inpainting filters (like delogo), and re-encoded.
  2. The audio elementary bitstream packets are extracted without touching their inner compressed data.
  3. The new video packets and untouched audio packets are remultiplexed into the output container with perfect millisecond timestamp alignment.

3. Preventing Audio/Video Sync Drift (PTS & DTS Timestamps)

A common bug in rudimentary converters is audio sync drift: the audio gradually slips 50–200ms out of sync over a 5-minute video.

This occurs when the encoder fails to preserve Presentation Time Stamps (PTS) and Decoding Time Stamps (DTS). To ensure sample-accurate synchronization across all players, use the following production command:

ffmpeg -i input.mp4 -vf "delogo=x=100:y=100:w=200:h=80" -c:v libx264 -crf 18 -c:a copy -map 0:v:0 -map 0:a:0? -avoid_negative_ts make_zero output.mp4

The -avoid_negative_ts make_zero flag normalizes initial packet timestamps, guaranteeing that video frame 0 and audio sample 0 commence simultaneously.

4. Inspecting Audio Streams with FFprobe

To verify that your audio stream was preserved bit-for-bit without alteration, run ffprobe to verify codec parameters:

ffprobe -v error -select_streams a:0 -show_entries stream=codec_name,bit_rate,sample_rate,channels output.mp4

Our Architecture at VideoWatermarkRemover.tech

In our Online Video Studio, we built our server pipeline specifically around zero-touch audio remuxing. Whether your file contains 5.1 Dolby Surround, 48 kHz stereo AAC, or studio-grade uncompressed PCM, your audio track is never re-compressed.