Skip to content

RF Compression & Decompression Guide

Harry Munday edited this page Mar 2, 2023 · 21 revisions

RF Compression & De-Compression Guide

Previous Page RF Capture Guide

Next Page RF Decoding Guide

Sub-Page Speed & Decoding Testing

RF Compresson & Resampling Commands - Linux & Windows Users

FM RF data is just like audio data same electrical values digitised, handling just more information in a different pattern than normal sound data, as such we can use lossless audio codecs like FLAC to compress this RF data down A LOT or lossy ones to just break the files in fun ways too!

Re-sampling is practical with 40msps 8-bit and 40msps 16-bit captures from the DomesDayDuplicator or CX Cards Modified/Stock ideal in some use cases like using limited size optical discs for archival the commands can be easily tweaked on an as-needed basis however and for unstable media it's advised to keep just normal FLAC compressed RF not re-sampling it.

Linux Scripts (40msps DomesDayDuplicator Captures)

Copy the scripts below into a text document, save and then add .sh extention to the end, you can use these in any directory witch the script file is put inside of, you can name the scripts however you like but the below example is clear enough.

40msps-DdD-16msps-8bit.sh DdD-capture.lds

Will make a DdD-capture.flac

DomesDayDuplicator FLAC

ld-compress DdD-capture.lds

Will just compress your capture to a lossless 40msps 16-bit FLAC

Down Sampling + FLAC Compression

Down-sampling is ideal for maximum space saving of stable media, however this is not lossless this is lossy so is not recommended unless you absolutely have to save space as this can yield up~to a 10:1 ratio these values below should be taken with a grain of salt as re-sampling can very per media format and per TV system such as NTSC/PAL. (NTSC VHS command has been fully tested)

NTSC - VHS/Betamax (16msps 8-bit)

#!/bin/bash

echo "Conversion of 10-bit 40msps .lds to 8-bit 16msps NTSC .flac has started"

ld-lds-converter -i $1 | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 16000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-7650000 | flac -8 --sample-rate=16000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o $1_NTSC_16msps_8-bit.flac

PAL - VHS/BetaMax (18msps 8-bit)

#!/bin/bash

echo "Conversion of 10-bit 40msps .lds to 8-bit 18msps PAL .flac has started"

ld-lds-converter -i $1 | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 18000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-8670000 | flac -8 --sample-rate=18000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o $1_PAL_18msps_8-bit.flac

NTSC/PAL - Umatic/SVHS/SuperBeta/ED-Beta (24msps 8-bit)

#!/bin/bash

echo "Conversion of 10-bit 40msps .lds to 8-bit 24msps .flac has started"

ld-lds-converter -i $1 | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 24000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-9400000 | flac -8 --sample-rate=20000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o $1_24msps_8-bit.flac

VHS HiFi FM Audio

#!/bin/bash

echo "Conversion of 10-bit 40msps .lds to 8-bit 10msps .flac has started"

ld-lds-converter -i $1 | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 10000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-3050000 | flac -8 --sample-rate=10000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o $1_VHS_HiFi.flac

Note

Video8/High8 hifi is in the same modulated signal as video just on different carriers so you use 1 file for both video/hifi decoding.

RF Compression & Resampling Commands - Windows Users

Open PowerShell as an administrator

Install Choco (chocolatey package manager)

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Then you can install these tools system-wide (PATH) without any hassle.

Install FFmpeg

choco install ffmpeg

Install FLAC

choco install flac

Install SoX

choco install sox.portable

Manual .exe downloads SoX / FLAC / FFmpeg

Make a spectrum graph with SoX

sox input.u8 -n spectrogram

FLAC Compression with FFmepg

Download ld-tools for windows rename the folder to ld-tools-suite-windows and place it in the C:/ directory or your boot drives main directory.

DomesDayDuplicator

2.8GB/Min 10-bit packed to 625MB/Min 16-bit FLAC

C:\ld-tools-suite-windows\ld-lds-converter.exe -u -i INPUT.lds | ffmpeg -f s16le -ar 40k -ac 1 -i - -acodec flac -compression_level 12 -f ogg OUTPUT.flac

Down-sampling + FLAC Compression (Windows Commands)

NTSC - VHS/Betamax (16msps 8-bit)

C:\ld-tools-suite-windows\ld-lds-converter.exe -i INPUT.lds | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 16000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-7650000 | flac -8 --sample-rate=16000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o OUTPUT_NTSC_16msps_8-bit.flac

PAL - VHS/BetaMax (18msps 8-bit)

C:\ld-tools-suite-windows\ld-lds-converter.exe -i INPUT.lds | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 18000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-8800000 | flac -8 --sample-rate=17000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o OUTPUT_PAL_18msps_8-bit.flac

NTSC/PAL - Umatic/SVHS/SuperBeta/ED-Beta (24msps 8-bit)

C:\ld-tools-suite-windows\ld-lds-converter.exe -i INPUT.lds | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 24000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-9400000 | flac -8 --sample-rate=20000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o OUTPUT_24msps_8-bit.flac

HiFi FM Audio

C:\ld-tools-suite-windows\ld-lds-converter.exe -i INPUT.lds | sox -r 40000000 -b 16 -c 1 -e signed -t raw - -b 8 -r 10000000 -e unsigned -c 1 -t raw - sinc -n 2500 0-3050000 | flac -8 --sample-rate=10000 --sign=unsigned --channels=1 --endian=little --bps=8 - -o OUTPUT_HiFi.flac

Rename & Format Your Files

Rename the .flac to your media format name using standard designators

Page End

Sub-Page Speed & Decoding Testing

Previous Page RF Capture Guide

Next Page RF Decoding Guide

Clone this wiki locally