Skip to content

ld-decode command

ld-decode's execution is largely controlled by a number of command line switches:

ld-decode [-h] [--start file-location] [--length frames] [--seek frame] [--PAL] [--NTSC] [--NTSCJ] [-m mtf]
                 [--MTF_offset mtf_offset] [--noAGC] [--noDOD] [--noEFM] [--preEFM] [--disable_analog_audio] [--AC3]
                 [--start_fileloc start_fileloc] [--ignoreleadout] [--verboseVITS] [--RF_TBC] [--lowband]
                 [--NTSC_color_notch_filter] [--V4300D_notch_filter] [--deemp_low deemp_low] [--deemp_high deemp_high]
                 [--deemp_strength deemp_str] [-t threads] [-f FREQ] [--analog_audio_frequency AFREQ]
                 [--video_bpf_low FREQ] [--video_bpf_high FREQ] [--video_lpf FREQ] [--video_lpf_order VLPF_ORDER]
                 [--audio_filterwidth FREQ] [--use_profiler] [--write-test-ldf output.ldf]
                 infile outfile

Synopsis

ld-decode [OPTIONS] infile outfile

Positional Arguments

infile

Required. Path to the source file containing the raw RF capture data.

outfile

Required. Base name for destination files. The tool will create multiple output files with this base name and appropriate extensions (e.g., .tbc, .tbc.json, .efm, .pcm).

Options

Version Information

--version, -v

Display the version number of ld-decode and exit. Does not require positional arguments.

Example:

ld-decode --version

Basic Decoding Options

--start file-location, -s file-location

Jump roughly to frame n of the capture before starting decoding. - Type: Float - Default: 0 - Range: Any non-negative number - Note: This performs a rough seek; use --seek for precise frame seeking

Example:

ld-decode --start 1000 input.ldf output

--length frames, -l frames

Limit the number of frames to decode. - Type: Integer - Default: 110000 - Range: Any positive integer - Note: Specifies the maximum number of video frames to process

Example:

ld-decode --length 5000 input.ldf output

--seek frame, -S frame

Seek to a precise frame number in the capture before starting decoding. - Type: Integer - Default: -1 (disabled) - Range: Any non-negative integer - Note: More precise than --start; requires valid frame synchronization data

Example:

ld-decode --seek 2500 input.ldf output

--start_fileloc start_fileloc

Jump to a precise sample number in the file. - Type: Float - Default: -1 (disabled) - Range: Any non-negative number - Note: Specifies the exact sample position in the RF capture file; overrides --start

Example:

ld-decode --start_fileloc 10000000 input.ldf output

Video Standard Options

Note: Only one video standard can be selected. Selecting both PAL and NTSC (or NTSCJ) will result in an error.

--PAL, -p, --pal

Decode the source as PAL format. - Default: If neither PAL nor NTSC is specified, NTSC is assumed - Incompatible with: --NTSC, --NTSCJ

Example:

ld-decode --PAL input.ldf output

--NTSC, -n, --ntsc

Decode the source as NTSC format. - Default: NTSC is the default if no standard is specified - Incompatible with: --PAL - Note: Uses IRE 7.5 black level (standard NTSC)

Example:

ld-decode --NTSC input.ldf output

--NTSCJ, -j

Decode the source as NTSC-J (Japanese NTSC) format. - Default: Disabled - Incompatible with: --PAL - Note: Uses IRE 0 black level (Japanese standard) instead of IRE 7.5

Example:

ld-decode --NTSCJ input.ldf output

Video Processing Options

-m mtf, --MTF mtf

MTF (Modulation Transfer Function) compensation multiplier. - Type: Float - Default: 1.0 - Range: Typically 0.5 to 2.0 - Note: Adjusts the compensation for frequency-dependent signal loss; values > 1.0 increase high-frequency boost

Example:

ld-decode -m 1.5 input.ldf output

--MTF_offset mtf_offset

MTF compensation offset. - Type: Float - Default: 0 - Range: Any float value - Note: Additional offset applied to MTF compensation

Example:

ld-decode --MTF_offset 0.1 input.ldf output

--noAGC

Disable Automatic Gain Control. - Default: AGC is enabled - Note: AGC normalizes signal levels; disabling may be useful for analyzing the raw signal

Example:

ld-decode --noAGC input.ldf output

--noDOD

Disable the dropout detector. - Default: Dropout detection is enabled - Note: Dropouts are signal losses; disabling detection means they won't be flagged in the output

Example:

ld-decode --noDOD input.ldf output

--lowband

Use more restricted RF settings optimized for noisier disks. - Default: Disabled - Note: Applies more conservative filtering suitable for degraded or noisy source material

Example:

ld-decode --lowband input.ldf output

Video Filter Options

--video_bpf_low FREQ

Video band-pass filter low-end frequency. - Type: FREQ (see Frequency Format section) - Default: System-dependent (varies by PAL/NTSC) - Note: Sets the lower cutoff frequency for the video band-pass filter

Example:

ld-decode --video_bpf_low 2.5MHz input.ldf output

--video_bpf_high FREQ

Video band-pass filter high-end frequency. - Type: FREQ (see Frequency Format section) - Default: System-dependent (varies by PAL/NTSC) - Note: Sets the upper cutoff frequency for the video band-pass filter

Example:

ld-decode --video_bpf_high 13MHz input.ldf output

--video_lpf FREQ

Video low-pass filter frequency. - Type: FREQ (see Frequency Format section) - Default: System-dependent (varies by PAL/NTSC) - Note: Sets the cutoff frequency for the video low-pass filter

Example:

ld-decode --video_lpf 5.0MHz input.ldf output

--video_lpf_order VLPF_ORDER

Video low-pass filter order. - Type: Integer - Default: -1 (use system default) - Range: Positive integers (typically 1-10) - Note: Higher orders provide sharper cutoff but more processing

Example:

ld-decode --video_lpf_order 8 input.ldf output

NTSC-Specific Video Options

--NTSC_color_notch_filter, -N

Mitigate interference from analog audio in red colors in NTSC captures. - Default: Disabled - Note: Only effective with NTSC video standard; addresses crosstalk from audio carriers

Example:

ld-decode --NTSC --NTSC_color_notch_filter input.ldf output

PAL-Specific Video Options

--V4300D_notch_filter, -V

Remove spurious ~8.5MHz signal present in LD-V4300D PAL/digital audio captures. - Default: Disabled - Note: Only effective with PAL video standard; specific to Pioneer LD-V4300D player captures

Example:

ld-decode --PAL --V4300D_notch_filter input.ldf output

Deemphasis Options

Video signals are typically pre-emphasized during recording and must be de-emphasized during playback.

--deemp_low deemp_low

Deemphasis low frequency in nanoseconds. - Type: Float - Default: System-dependent - NTSC: 3.125MHz equivalent - PAL: 2.5MHz equivalent - Range: Any positive float - Note: Specifies the time constant for low-frequency deemphasis

Example:

ld-decode --deemp_low 320 input.ldf output

--deemp_high deemp_high

Deemphasis high frequency in MHz. - Type: Float - Default: System-dependent - NTSC: 8.33MHz - PAL: 10MHz - Range: Any positive float - Note: Specifies the frequency for high-frequency deemphasis

Example:

ld-decode --deemp_high 10.0 input.ldf output

--deemp_strength deemp_str

Strength of deemphasis filter. - Type: Float - Default: 1.0 - Range: Typically 0.0 to 2.0 - Note: Multiplier for deemphasis effect; 1.0 is standard, <1.0 reduces effect, >1.0 increases effect

Example:

ld-decode --deemp_strength 0.8 input.ldf output

Audio Decoding Options

--disable_analog_audio, --disable_analogue_audio, --daa

Disable analog audio decoding. - Default: Analog audio is enabled at 44100Hz - Note: Useful when only video is needed or when processing digital-only sources

Example:

ld-decode --disable_analog_audio input.ldf output

--analog_audio_frequency AFREQ

Set the analog audio output sampling frequency. - Type: Integer (Hz) - Default: 44100 - Range: Typically 44100 or 48000 - Note: Output sample rate for analog audio tracks

Example:

ld-decode --analog_audio_frequency 48000 input.ldf output

--audio_filterwidth FREQ

Set the analog audio filter width. - Type: FREQ (see Frequency Format section) - Default: System-dependent - Note: Bandwidth of the analog audio channel filters

Example:

ld-decode --audio_filterwidth 150kHz input.ldf output

--noEFM

Disable EFM (Eight-to-Fourteen Modulation) front end for digital audio. - Default: EFM decoding is enabled - Note: EFM is used for digital audio (CD audio) on laserdiscs; disabling skips digital audio extraction

Example:

ld-decode --noEFM input.ldf output

--preEFM

Write filtered but otherwise pre-processed EFM data. - Default: Disabled - Note: Outputs intermediate EFM data before full decoding; useful for debugging or custom processing

Example:

ld-decode --preEFM input.ldf output

--AC3

Enable AC3 audio decoding (NTSC only). - Default: Disabled - Note: Only compatible with NTSC; attempting to use with PAL will result in an error - Incompatible with: --PAL

Example:

ld-decode --NTSC --AC3 input.ldf output

RF Sampling Options

-f FREQ, --frequency FREQ

RF sampling frequency of the source file. - Type: FREQ (see Frequency Format section) - Default: 40MHz - Note: If the source file has a different sample rate, specify it here; the decoder will resample to 40MHz internally

Example:

ld-decode -f 28.636363MHz input.ldf output
ld-decode -f 8fsc input.ldf output

Processing Options

-t threads, --threads threads

Number of CPU threads to use for decoding. - Type: Integer - Default: 4 - Range: 1 to number of CPU cores - Note: More threads can speed up processing but may have diminishing returns beyond the number of CPU cores

Example:

ld-decode -t 8 input.ldf output

Output Options

--RF_TBC

Create a .tbc.ldf file containing time-base corrected RF data. - Default: Disabled - Note: Outputs the RF signal after time-base correction; useful for archival or analysis

Example:

ld-decode --RF_TBC input.ldf output

--ignoreleadout

Continue decoding after detecting the lead-out section. - Default: Disabled (stop at lead-out) - Note: Lead-out marks the end of the disc content; this option processes beyond that marker

Example:

ld-decode --ignoreleadout input.ldf output

--verboseVITS

Enable additional fields in the JSON metadata output. - Default: Disabled - Note: VITS (Vertical Interval Test Signals) contain technical information; this outputs more detailed data

Example:

ld-decode --verboseVITS input.ldf output

Debugging and Development Options

--write-test-ldf output.ldf

Write the input portion being decoded to a .ldf file for bug reporting. - Type: String (filename) - Default: Disabled - Note: Creates a reproducible test case containing the input samples that were decoded; useful for submitting bug reports. The output file cannot be the same as the input file.

Example:

ld-decode --write-test-ldf test-case.ldf input.ldf output

--use_profiler

Enable line_profiler on select functions for performance analysis. - Default: Disabled - Note: Development tool for identifying performance bottlenecks; requires line_profiler to be installed

Example:

ld-decode --use_profiler input.ldf output

Frequency Format

Many options accept frequency values with the FREQ type. These can be specified in several formats:

Bare Number

A number without a suffix is interpreted as MHz.

--frequency 40      # 40 MHz

With Suffix (case-insensitive)

  • Hz: Hertz
    --frequency 40000000Hz
    
  • kHz: Kilohertz (10³ Hz)
    --frequency 40000kHz
    
  • MHz: Megahertz (10⁶ Hz)
    --frequency 40MHz
    
  • GHz: Gigahertz (10⁹ Hz)
    --frequency 0.04GHz
    
  • fSC: NTSC color subcarrier frequency (315/88 MHz ≈ 3.579545 MHz)
    --frequency 8fsc    # 8× NTSC subcarrier ≈ 28.636 MHz
    
  • fSCPAL: PAL color subcarrier frequency (283.75 × 15625 + 25 Hz ≈ 4.43361875 MHz)
    --frequency 8fscpal # 8× PAL subcarrier ≈ 35.469 MHz
    

Common Usage Examples

Basic PAL Decode

ld-decode --PAL input.ldf output

NTSC Decode with Custom Length

ld-decode --NTSC --length 30000 input.ldf output

High-Quality PAL Decode with Custom Settings

ld-decode --PAL -m 1.2 --lowband -t 8 input.ldf output

NTSC with AC3 Audio

ld-decode --NTSC --AC3 input.ldf output

Decode Specific Frame Range

ld-decode --PAL --start 1000 --length 5000 input.ldf output

Custom Sample Rate Input

ld-decode --PAL -f 28.636363MHz input.ldf output

NTSC with Color Notch Filter

ld-decode --NTSC --NTSC_color_notch_filter input.ldf output

PAL V4300D Capture

ld-decode --PAL --V4300D_notch_filter input.ldf output

Video Only (No Audio)

ld-decode --PAL --disable_analog_audio --noEFM input.ldf output

Create Test Case for Bug Report

ld-decode --PAL --start 5000 --length 10 --write-test-ldf bug-report.ldf input.ldf output

Output Files

Based on the base name provided as outfile, ld-decode creates several output files:

  • outfile.tbc: Time-base corrected video data
  • outfile.tbc.json: Frame metadata in JSON format
  • outfile.pcm: Analog audio (if enabled, one file per audio channel)
  • outfile.efm: Digital audio EFM data (if enabled)
  • outfile.log: Detailed log file
  • outfile.tbc.ldf: TBC'd RF data (if --RF_TBC is used)

Exit Behavior

The decoder will stop processing when: 1. The requested number of frames (--length) has been decoded 2. Lead-out is detected (unless --ignoreleadout is specified) 3. End of file is reached 4. An error occurs 5. User interrupts with Ctrl+C (SIGINT)

Error Conditions

PAL/NTSC Conflict

ERROR: Can only be PAL or NTSC
Occurs when multiple video standards are specified.

AC3 with PAL

ERROR: AC3 audio decoding is only supported for NTSC
AC3 audio is only available on NTSC laserdiscs.

Write Test LDF Collision

ERROR: --write-test-ldf output file cannot be the same as input file
The test output file must be different from the input file.

Seek Failure

ERROR: Seeking failed
Unable to seek to the requested frame; may indicate corrupted data or invalid frame number.

Notes

  • Default Video Standard: If neither --PAL nor --NTSC is specified, NTSC is assumed.
  • Thread Count: The default of 4 threads is suitable for most systems; adjust based on your CPU core count.
  • Sample Rate: The decoder internally works at 40MHz; all other sample rates are resampled.
  • Frame Counting: Frames are counted as complete video frames; internally, the decoder processes fields (2 fields = 1 frame).
  • Lead-out: The lead-out section marks the end of valid disc content; decoding typically stops here unless --ignoreleadout is used.

Version Information

To check the installed version:

ld-decode --version

or

ld-decode -v