File & Data Formats - harrypm/vhs-decode GitHub Wiki
RF Formats
CXADC 16-bit Unsigned
CXADC 08-bit Unsigned
DDD 10-bit Packed (10-bit unsigned integers)
DDD 16-bit Signed
Context of Extension Formats
.lds - DDD 10-bit Packed or 16-bit Signed
.u8/.r8 - CXADC 08-bit Unsigned
.u16.r16 - CXADC 16-bit Unsigned
.ldf - FLAC Compressed 16-bit
.vhs - FLAC Compressed VHS 8-bit or 16-bit
.svhs - FLAC Compressed S-VHS 8-bit or 16-bit
.cvbs - FLAC Compressed Composite Capture
.flac/.wav/.raw can also be used but would need file name context.
The decoder accepts RF capture input in FLAC compressed, 10-bit packed 8bit raw and 16bit raw sample formats.
TBC Data Output Formats
filename.tbc - Luminance Image Data
filename_chroma.tbc - Chrominance Image Data
filename.tbc.json - Frame Descriptor Table (Resolution/Dropouts/SNR/Frames/VBI Timecode)
filename.log - Timecode Indexed Action/Output Log
The TBC Format
TBC = Time Base Corrector A TBC retimes the signal to make the video lines more accurately the same length correction the time base as such this fixes wobbly or skied images as observed on lower-end VCRs the lines vary in length across the picture however in a stable tape workflow a TBC acts as a buffer and conforms signal output to broadcast equipment acceptable one.
The TBC file is created by the RF decoder directly after the signal de-modulation.
Decoding takes the 2 channels chrominance and luminance (C & Y) and creates separate TBC files for each respectively this allows for very clinical post adjustments and the ability to remove Croma entirely if unstable and or source is black and white media for example.
The format is a stream of 16-bit unsigned values; each value representing a single grey-scale value in a headerless data file.
So you end with a "full-frame" digital video file of the video signal.
PAL output is 1135x625 16-bit values.
NTSC output is 910x525 16-bit values.
The 16-bit greyscale values used by the output format are scaled representations of the standard 8-bit digital component values i.e. an 8-bit right shift of the value will provide the standard 8-bit digital component intensity values.
Gen Croma Scripts & Chroma-Decoder
The gen Croma .sh scripts do several things, dropout compensation, combine Croma & Luma TBC's to create a full-colour video stream there is also dropout compensation in this step but can be done separately in the ld-tools segment allowing for multi-stage metadata extraction or even stacking to compensate for normal operation dropouts.
To encode a black and white luminance only video use the chroma decoder
./ld-chroma-decoder tapename.tbc -p y4m OutputName.mov
This gives you an uncompressed YUY 4:2:2 video file.
./gen_chroma_vid.sh tapename.tbc -f OutputName.mov
Experimental full 1135x625 PAL 910x525 NTSC output currently has issues with frame order and it's a few pixels off this will be improved in the future.
This gives you a Losslessly Compressed YUY 4:2:2 FFV1 file in .mkv containers.
The NTSC and PAL chroma-decoders 3D/2D (a.k.a. comb filters) accept .tbc files and produce a raw RGB bit-stream with 16 bits per colour value.
So you get an RGB 16-16-16 48-bits per pixel in .rgb
This can be processed through FFmpeg by specifying the raw RGB format with a depth of 16 i.e -pixel_format yuv444p16le