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¶
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:
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:
--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:
--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:
--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:
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:
--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:
--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:
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:
--MTF_offset mtf_offset¶
MTF compensation offset. - Type: Float - Default: 0 - Range: Any float value - Note: Additional offset applied to MTF compensation
Example:
--noAGC¶
Disable Automatic Gain Control. - Default: AGC is enabled - Note: AGC normalizes signal levels; disabling may be useful for analyzing the raw signal
Example:
--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:
--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:
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:
--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:
--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:
--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:
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:
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:
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:
--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:
--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:
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:
--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:
--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:
--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:
--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:
--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:
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:
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:
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:
--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:
--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:
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:
--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:
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.
With Suffix (case-insensitive)¶
- Hz: Hertz
- kHz: Kilohertz (10³ Hz)
- MHz: Megahertz (10⁶ Hz)
- GHz: Gigahertz (10⁹ Hz)
- fSC: NTSC color subcarrier frequency (315/88 MHz ≈ 3.579545 MHz)
- fSCPAL: PAL color subcarrier frequency (283.75 × 15625 + 25 Hz ≈ 4.43361875 MHz)
Common Usage Examples¶
Basic PAL Decode¶
NTSC Decode with Custom Length¶
High-Quality PAL Decode with Custom Settings¶
NTSC with AC3 Audio¶
Decode Specific Frame Range¶
Custom Sample Rate Input¶
NTSC with Color Notch Filter¶
PAL V4300D Capture¶
Video Only (No Audio)¶
Create Test Case for Bug Report¶
Output Files¶
Based on the base name provided as outfile, ld-decode creates several output files:
outfile.tbc: Time-base corrected video dataoutfile.tbc.json: Frame metadata in JSON formatoutfile.pcm: Analog audio (if enabled, one file per audio channel)outfile.efm: Digital audio EFM data (if enabled)outfile.log: Detailed log fileoutfile.tbc.ldf: TBC'd RF data (if--RF_TBCis 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¶
Occurs when multiple video standards are specified.AC3 with PAL¶
AC3 audio is only available on NTSC laserdiscs.Write Test LDF Collision¶
The test output file must be different from the input file.Seek Failure¶
Unable to seek to the requested frame; may indicate corrupted data or invalid frame number.Notes¶
- Default Video Standard: If neither
--PALnor--NTSCis 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
--ignoreleadoutis used.
Version Information¶
To check the installed version:
or