Skip to content

Auto Audio Align

Harry Munday edited this page Oct 25, 2025 · 6 revisions

Auto Audio Alignment

After decoding your Video RF and or HiFi FM audio you will want to sync your decoded audio data with your video file or Linear captures made by audio ADC's running off the same clock source like the Clockgen Mod or MISRC.

There is a few ways to do this, as it is only a simple process of reading the post decoded .JSON file for total duration and offsets from dropped fields/frames of information, but the standard workflow currently uses Rene Wolfs implementation for Windows, Linux and MacOS, however this may change to a more universal python replacement later as Mono is considered an extra dependency.

Using Auto Audio Align

With a standard configuration you just need to alter the following:

  • -i baseband.wav

Input PCM or FLAC audio file.

  • --json capture.tbc.json

Input TBC JSON from decoded video RF.

  • baseband_aligned.flac

Output name at the end (also s16 will do 16-bit if s24 is replaced)

  • --stream-sample-rate-hz -

Input rate of your audio file in Hz i.e 46875 for clockgen baseband or 48000 for hifi-decode or 44100 for ld-decode.

  • --rf-video-sample-rate-hz

Capture rate of your base file this normally will be 40000000 (40Msps) or 20000000 (20Msps) & 16000000 (16Msps) for down-sampled captures.

Tip

Below is premade commands for usage:

Linux & MacOS

Stereo

"ffmpeg" -i baseband.wav -filter 'channelmap=map=FL-FL|FR-FR' -f s24le -ac 2 - | mono VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 6 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg -f s24le -ar 46875 -ac 2 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac

Mono

"ffmpeg" -i baseband.wav -filter_complex "[0:a]channelsplit=channel_layout=2.1:channels=FL[FL]" -map "[FL]" -f s24le -ac 1 - | mono VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 3 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg -f s24le -ar 46875 -ac 1 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac

Windows

Stereo

ffmpeg.exe -i baseband.wav -filter_complex "channelmap=map=FL-FL|FR-FR" -f s24le -ac 2 - | VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 6 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg.exe -f s24le -ar 46875 -ac 2 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac

Mono

ffmpeg.exe -i baseband.wav -filter_complex "[0:a]channelsplit=channel_layout=2.1:channels=FL[FL]" -map "[FL]" -f s24le -ac 1 - | VhsDecodeAutoAudioAlign.exe stream-align --sample-size-bytes 3 --stream-sample-rate-hz 46875 --json capture.tbc.json --rf-video-sample-rate-hz 40000000 | ffmpeg.exe -f s24le -ar 46875 -ac 1 -i - -af aresample=48000 -sample_fmt s32 baseband_aligned.flac

Page End

Home

Starting & Contributing

Software Installation

Capture Hardware

Hardware Installation

Software Usage

VBI Data Extraction & Decoding

Tools & Scripts

Guides

Technical

Other Decoders

Support & Community

Clone this wiki locally