Skip to content

Command List

Harry Munday edited this page Feb 12, 2023 · 74 revisions

VHS Decode Command List

--debug Enables Verbose Mode Better Logging Information.

Data Input & Processing Speed

-f Manual setting of Input Frequency in integers of hz, mhz, ghz or 4fsc/5fsc/8fsc/10fsc (or CXADC desgnators) the default is 40msps 16-bit the rate the DomesDayDuplicator uses (decoder is 8-bit/16-bit agnostic & 10-bit packed is unpacked automatically)

--no_resample Experimental Skips internal resampling to 40mhz, allows for native use of lower sample rates i.e 16-28msps and faster decoding.

-t Threads Sets Number of CPU processing threads default is 1, there is no limit but decoding will only utilise 6-8 threads at upto 10fps observed on x86 and upto 8fps+ on Apple M1 Max Silicon (Apple hardware needs re-testing with current code*)

(Note: Decoding is primarily single-core & cache speed biased)

--tf, --tape_format Sets tape format ''VHS'' ''SVHS'' ''UMATIC'' ''HIGH8'' ''Video8'' ''BETAMAX'' Selects tape format (default is VHS)

--use_saved_levels Experimental Skips doing most of the level detect code on each frame and only does it at the start or if there are issues detecting syncs. Provides a speedup in decoding and seems to work okay on captures that only have one single recording of media.

--level_detect_divisor (Default 2) Experimental (May lower processing time)

Currently, 1-6 value, 1 every sample, 2 every other sample and so on, Changes vsync serration code only use every nth sample when determining sync/blank levels higher value lower accuracy.

Debug & Statistics Data Output

--debug Outputs full debug loging with timestamps, helpful for damaged tapes or keeping track of decode time, costs a small but reltivly negligible amount of extra processing time.

--dp & --debug_plot Do a plot for the requested data, separated by whitespace. Current options are: " + plot_options + ".",

--dp deemphasis Shows the deemphasis curve (note it's not very detailed atm and think it might just show 0-Nyquist rather than properly labeled)

--dp demodblock Displays Raw Demodulated Frequency Spectrum Graphs, makes a pop-up window per each thread so -t 32 would give you 32 GUI windows etc

--dp demodblock

Time & Location Control

-s Jumps ahead to any given frame in the capture.

--start_fileloc Jumps ahead to any given sample in the capture.

-l Limits decode length to n frames.

Decode TBC - Time Base Correction Control

--sl Sharpness Level 0-100 Value sets the level of visual sharpness, default 0, Higher values are better suited for plain, flat images i.e. cartoons and animated material, as strong ghosting can occur and or excessive noise (akin to cranking up the sharpness on any regular TV set.)

-L,--level_adjust Multiply top/bottom IRE in JSON by 1 +/- this value controls Black/White video levels, adjustment can be used to avoid clipping on RGB conversion in chroma decode.

--recheck_phase Re-check chroma phase on every field, useful for multiple recordings on one single VHS tape for example. (No effect on U-matic)

--recheck_phase

--drh, --disable_right_hsync Horizontal Sync Check, Corrects warping in the horizontal lines and corrects the line start position of the video frame, this option Disables the use of the right side of hsync for lineloc detection (old behaviour)

--noAGC (deprecated, already disabled by default) Disables Automatic Gain Control image brightness/gamma levels use if fluctuating

--AGC Enables Automatic Gain Control

--ct Enables Chroma Trap Intended to reduce chroma interference on the main luma signal, Recommended to use if seeing banding or checkerboarding on the main luma .tbc in ld-analyse.

--y_comb Enables Y Channel comb filter (Luminance), optionally specifying IRE limit like --y_comb 5 this option is used to eliminate crosshatch/diamond patterns sometimes found in decoded images.

--nocomb Disables Croma Combing, Disable's internal chroma comb filter.

--sclip --sync_clip Enables Sync Clipping

--nodd Disable diff demod

--nld, --non_linear_deemphasis Can help reduce ringing and oversharpening. (WIP). (Used for hi-band formats and VHS LP/SP)

Dropout Correction & Compensation (DOC)

-D, --dod_t, --dod_threshold_p RF Dropout level fraction Threshold for dropouts in percentage of average (in decimal)

--noDOD Disables Drop Out Detection Default is on. (But processed after the fact with ld-dropout-correct/gen_chroma_vid scripts)

--dod_h, --dod_hysteresis The RF level needs to go above the dropout threshold multiplied by this for a dropout to end.

--dod_t_abs, --dod_threshold_abs RF Dropout level threshold absolute value.

Note: that RF levels vary greatly between tapes and recording setups.

Advanced Frequency Controls

--clamp Enable blanking DC offset clamping/compensation, disabled by default can improve if white level is extremely high.

--noclamp Disables blanking DC offset clamping/compensation.

--fallback_vsync Enable vsync detect fallback. (Will be enabled by default after further testing)

--cafc Chroma Automatic Frequency Control (AFC) Enables, down-converted chroma carrier AFC, implies --recheck_phase

-T If set to 0 or 1, force use of video track phase.

--high_boost Multiplier for boost to high RF frequencies Uses default if not specified. Subject to change

--notch define the centre frequency for the optional built-in notch "bandpass" filter.

--notch_q define Q factor Intended primarily for reducing noise from interference however, the decoder logic already compensates based on tape type and TV System values.

TV Colour System Setting

-n = NTSC Fully Supported.

-p = PAL Fully Supported.

-pm = PAL-M Experimental.

--NTSCJ = NTSC-J Fully Supported.

--MESECAM = MESECAM Support Added.

CXADC Sample Rates (Stock)

--cxadc 28.6 MHz/8-bit (8fsc) Stock Crystal Native 8xFsc 8bit Unsigned Sampling Mode

--cxadc3 35.8 MHz/8-bit (10fsc) Stock Crystal Native 4xFsc 16bit Filtered Vertical Blanking Interval Data

--10cxadc 14.3 MHz/16-bit (4fsc) Stock Crystal 1.25x 8xFsc 8bit Unsigned Sampling Mode

--10cxadc3 17.9 MHz/16-bit (5fsc) Stock Crystal 1.25x 4xFsc 16bit Filtered Vertical Blanking Interval Data

Gen Chroma Script / Chroma Decoder Combined Command-List

Simple Use Example: ./gen_chroma_vid.sh input-tbc-name

Outputs an FFV1 4:2:2 .mkv video file to the same directory as the TBC file.

Note! inputs and outputs can be drag and drop added in Ubuntu/Mint GUI environments.

Basic Operation

-i or --input

Name of the input, without extension. This option is mandatory.

--input-json

Specify the input JSON file

-v or --videosystem

Manually sets video system PAL/NTSC etc (This is now automatic based off .json file)

-a or --audio

Optional Audio track (*.wav, mp3, aac et. al.) to mux with generated video.

-s or --start

Specify the start frame number.

-l or --length

Specify the length (number of frames to process)

Post Decode TBC - Time Base Correction Control

--chroma-gain (Saturation) Gain factor applied to chroma components (default 1.5 for PAL, 2.0 for NTSC)

--chroma-phase (Hue) Phase rotation applied to chroma components (degrees; default 0.0)

-b or --blackandwhite Output video in black and white.

Image Colour & Frame Size Output Control

Pixel formats (colour encoding) are currently:

-p or --output-format (FFmpeg output formats; default yuv422p10le "4:2:2 10bit")

RGB - RGB48 (RGB 16-16-16)

10-Bit 4:2:2 - YUV422P10LE

10-Bit 4:4:4 - YUV444P16

16-bit Grey Scale - GRAY16

--pad or --output-padding Pad the output frame to any multiple of 2 (needs testing)

Vertical Framing Adjustment

The Following commands adjust the image output in the vertical plane, horizontal adjustment is yet to be implemented.

--ffll, --first_active_field_line <number> The first visible line of a field.

Range's

1-259 for NTSC (default: 20)

2-308 for PAL (default: 22)

--lfll, --last_active_field_line <number> The last visible line of a field.

Range's

1-259 for NTSC (default:259)

2-308 for PAL (default: 308)

--ffrl, --first_active_frame_line <number> The first visible line of a frame.

Range's

1-525 for NTSC (default: 40)

1-620 for PAL (default: 44)

--lfrl, --last_active_frame_line <number> The last visible line of a frame.

Range's

1-525 for NTSC (default:525)

1-620 for PAL (default: 620)

Example usage of these commands:

Full-Frame Output "Open Matte"

-f or --full

Sets output to full-frame of composite video signal 1135x625 PAL & 910x525 NTSC Experimental

Panasonic-NV7-Humid-Tropics-Biome-VITC-Full-Frame

Standard + VBI (Full Vertical Blanking Top Area)

These set your output to give you a full vertical image with the VBI area 928x624 PAL 760x528 NTSC

PAL:

--ffll 2 --lfll 308 --ffrl 2 --lfrl 620 <tbc-name>

NTSC:

--ffll 1 --lfll 259 --ffrl 2 --lfrl 525 <tbc-name>

This produces an image like this on SVHS allowing you to see or manually read data in the VBI area such as the VITC Timecode shown:

VITC Frame Export Example

16:9 Widescreen Letterbox Crop

These commands work well for 16:9 widescreen letterbox crop tapes rendering only the centre making a 928x432 PAL & 760x432 NTSCImage ideal for scaling/de-interlacing to 720p 50/60p for Blu-Ray mastering.

PAL:

--ffll 2 --lfll 308 --ffrl 118 --lfrl 548 <tbc-name>

NTSC:

--ffll 2 --lfll 308 --ffrl 118 --lfrl 453 <tbc-name>

Walking-Around-Garden-QTGMC

Exporting VITC to file

Thanks to FFMPEG we have a useful filter to read this data in software, although it is technically human readable.

Simply edit the below commands and replace "input.tbc" / "input.mkv" and "output.mkv" / "vitc.txt" with your input files and desired output name.

Decode VITC Data to .JSON

ld-process-vbi

You will see the HH:MM:SS:FF counter at the bottom of ld-analyse when viewing the TBC files.

ld-anlyse-VITC-readout

Extract VITC from a video file with a VBI area.

ffmpeg -i input.mkv -vf "readvitc=scan_max=-1,metadata=print:file=vitc.txt" -f null -

This will make a human-readable .txt file if the filter correctly detects the data.

ld-chroma-decoder direct luma export:

PAL Extract .TBC to Luma only

ld-chroma-decoder --ffll 2 --lfll 308 --ffrl 2 --lfrl 620 <tbc-name>

NTSC Extract .TBC to Luma only

ld-chroma-decoder --ffll 2 --lfll 308 --ffrl 2 --lfrl 520 <tbc-name>

Extract VITC from .TBC (Luma) to .TXT

PAL:

ffmpeg -hide_banner -y -async 1 -f rawvideo -pix_fmt gray16 -video_size 1135x626 -i "input.tbc" -vf "readvitc=scan_max=-1,metadata=print:file=vitc.txt" -f null -

NTSC:

ffmpeg -hide_banner -y -async 1 -f rawvideo -pix_fmt gray16 -video_size 910x526 -i "input.tbc" -vf "readvitc=scan_max=-1,metadata=print:file=vitc.txt" -f null -

FFMPEG Quick Export Luma B/W FFV1 .MKV

PAL:

ffmpeg -hide_banner -y -async 1 -f rawvideo -pix_fmt gray16 -video_size 1135x626 -i "input.tbc" -vf "il=l='i':c='i',bwdif" -c ffv1 -pix_fmt gray16le -aspect 939:626 -r 50 "output.mkv"

NTSC:

ffmpeg -hide_banner -y -async 1 -f rawvideo -pix_fmt gray16 -video_size 910x526 -i "input.tbc" -vf "il=l='i':c='i',bwdif" -c ffv1 -pix_fmt gray16le -aspect 760:526 -r 60000/1001 "output.mkv"

Gen Chroma Script - Chroma Decoder Control

--decoder Manually sets chroma decoder to use (default is automatic)

PAL: pal2d, transform2d, transform3d

NTSC ntsc1d, ntsc2d, ntsc3d, ntsc3dnoadapt

-r or --reverse Reverse the field order to second/first (default first/second)

-t or --threads Specify the number of concurrent CPU processing threads (default number of logical CPUs)

-q or --quiet Suppress info and warning messages

-o or --oftest NTSC: Overlay the adaptive filter map (only used for testing)

--chroma-nr <number> NTSC: Chroma noise reduction level in dB (default 0.0)

--luma-nr <number> Luma noise reduction level in dB (default 1.0)

--simple-pal Transform: Use 1D UV filter (default 2D)

--transform-mode <mode> Filter mode to use (level, threshold; default threshold)"

--transform-threshold <number> Uniform similarity threshold in 'threshold' mode (default 0.4)"

--transform-thresholds <file> File containing per-bin similarity thresholds in 'threshold' mode"

--show-ffts Overlay the input and output FFTs (Fast Fourier Transforms)

--ntsc-phase-comp Use NTSC QADM decoder taking burst phase into account (BETA)

HiFi Decode

Required Dependencies To Install:

sudo pip3 install -I soundfile==0.10.3.post1

Usage

In-file RF Data, TV System, out-file Audio Data must have .wav extension at the end can be renamed to .flac afterwards if desired for 8mm formats the --h8 flag is needed.

Example:

./hifi-decode -p --cxadc HiFI-Audio-PAL-DdD.lds hifi-decode-output.wav

TV System

n - NTSC

p - PAL

HiFi Decode Sample Rate Commands

f Manual Input Hz, MHz, GHz.

-f 40 For DomesDayDuplicator

--cxadc 28.6 MHz/8-bit (8fsc)

--cxadc3 35.8 MHz/8-bit (10fsc)

--10cxadc 14.3 MHz/16-bit (4fsc) (Technically 4fsc NTSC)

--10cxadc3 17.9 MHz/16-bit (5fsc) (Technically 4fsc PAL)

HiFi Decode Control Options

--bg Forces guessing of the carrier bias.

-t To set the threads for parallel decoding.

--original To force use of vhs-decodes FM demodulation.

--preview Enables a faster decoder for real-time preview. (faster and noisier)

--noise_reduction NOISE_REDUCTION Set noise reduction on/off (default is on)

--auto_fine_tune AUTO_FINE_TUNE Set auto tuning of the analogue front end on/off (useful for mixed standards tapes)

--NR_sidechain_gain Sets the noise reduction envelope tracking sidechain gain (default is 33). Range (20~100): 100 being a hard gate effect, operating range should be 40 and below (dynamic range decompressor adjustment smaller = more aggressive)

--h8 Video8 & High8 HiFi tape format.

--gnuradio Opens ZMQ REP pipe to gnu-radio at port 5555, the sample rate for gnu-radio is 8388608 Hz.

LD-Decode

-h, --help show this help message and exit

Input/Output Arguments

-t threads, --threads threads number of CPU threads to use

-f FREQ, --frequency FREQ RF sampling frequency in source file (default is 40MHz) FREQ can be a bare number in MHz, or a number with one of the case-insensitive suffixes Hz, kHz, MHz, GHz, fSC (meaning NTSC) or fSCPAL.

--analog_audio_frequency AFREQ RF sampling frequency in source file (default is 44100hz)

infile source file

outfile base name for destination files

Time Positional Arguments:

--start file-location, -s file-location rough jump to frame n of capture (default is 0)

--length frames, -l frames limit length to x number of frames

--seek frame, -S frame seek to frame n of capture

--start_fileloc start_fileloc jump to precise sample # in the file

TV System

--PAL, -p, --pal Source is in PAL format

--NTSC, -n, --ntsc Source is in NTSC format

--NTSCJ, -j Source is in NTSC-J (IRE 0 black) format

-m mtf, --MTF mtf Mtf compensation multiplier

--MTF_offset mtf_offset Mtf compensation offset

Audio Decoding

--noEFM Disable EFM front end

--preEFM Write filtered but otherwise pre-processed EFM data

--disable_analog_audio, --disable_analogue_audio, --daa Disable analog(ue) audio decoding

--AC3 Enable AC3 audio decoding (NTSC only)

--audio_filterwidth FREQ Analog audio filter width

Decoder Control

--noAGC Disable AGC

--noDOD Disable dropout detector

--ignoreleadout Continue decoding after lead-out seen

TBC Control

--RF_TBC Create a .tbc.ldf file without decoding, only time base corrects the signal.

--verboseVITS Enable additional JSON fields

--lowband Use more restricted RF settings for noisier disks

--NTSC_color_notch_filter, -N Mitigate interference from analogue audio in reds in NTSC captures

--V4300D_notch_filter, -V LD-V4300D PAL/digital audio captures: remove spurious ~8.5mhz signal

-d deemp_adjust, --deemp_adjust Deemphasis level multiplier

--deemp_low deemp_low Deemphasis low coefficient

--deemp_high deemp_high Deemphasis high coefficient

--video_bpf_high FREQ Video BPF high end frequency

--video_lpf FREQ Video low-pass filter frequency

--video_lpf_order VLPF_ORDER Video low-pass filter order

Useful Data Handling Commands

Say for some reason you have a source file in a certain format that you are either piping or otherwise can't change the extension of to get *-decode to recognize the datatype.

You can use mkfifo to create a named pipe to overcome this.

Example: mkfifo link.u8

flac -d u8capture.flac --force-raw-format --endian=little --sign=unsigned -o link.u8 -f |vhs-decode link.u8 out/u8capture

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