Skip to content

Software defined VHS decoder - Fork (maybe temporary) of the ld-decode Laserdisc rf decoder

License

Notifications You must be signed in to change notification settings

oyvindln/vhs-decode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vhs-decode logo

VHS-Decode (It does more than VHS now!)

A fork of LD-Decode, the decoding software powering the Domesday86 Project.
This version has been modified to work with the differences found in the tracked RF drum head signals taken directly from colour-under & FM modulated composite videotape formats.

Caution

Not to be confused with the TV Modulator/Demodulator pack or the "antenna connectors" on the back of the VCR!

SMPTE ColourBars (16:9) Test Tape With WSS (PAL) exported full-frame (1112 x 624)

VHS 625-line and 525-line - NTSC, NTSC-J, PAL and PAL-M. Generally well supported

SVHS 625-line and 525-line - NTSC, NTSC-J, PAL and PAL-M. Basic support

U-Matic Low Band 625-line and 525-line - PAL and NTSC. Supported

U-Matic High Band 625-line - PAL. Basic support

Betamax 625-line and 525-line - PAL & NTSC. Supported

SuperBeta 625-line and 525-line - PAL & NTSC. Preliminary support

Video8 & Hi8 625-line and 525-line - PAL & NTSC. Basic support

1" Type C (SMPTE Type C) 625-line and 525-line - PAL & NTSC. Basic support (More Samples Required!)

1" Type B (SMPTE Type B) 625-line and 525-line - PAL & NTSC. Basic support (More Samples Required!)

EIAJ 625-line - PAL. Supported (NTSC Samples Required!)

Philips VCR & Philips VCR "LP" 625-line - PAL. Supported

Example Videos: VHS-Decode / The Rewinding / Video Dump.

Example Workflow Flowcharts and Overview Graphics

The frequently asked questions page and the Wiki, will help break things down and explain the real world benefits of direct RF capture preservation and software decoding compared to conventional high-cost hardware based workflows, so if you have just found this project welcome to the affordable future of tape media preservation.

This repository also contains an experimental CVBS decoder, cvbs-decode, which shares code with ld-decode and vhs-decode. Capable of decoding basic RAW digitized NTSC and PAL composite video, including colour if the source is somewhat stable.

RAW CVBS has been captured using CX Cards & CXADC, however, only at lowest gain states and or with external signal feed into it to stop its hardware decoder from triggering.

Caution

CVBS capture is not possible with the DomesDayDuplicator Rev3 due to input filtering on the hardware, but is possible with the MISRC boards.

Test samples & signals can be digitally generated using HackTV or downloaded from The Internet Achive.

Thanks to VideoMem's work on Superheterodyne Decoding Tools we now have a working HiFi Audio Decoder which provides decoding for VHS & Video8/Hi8 HiFi FM tracks which takes uncompressed or FLAC compressed RF captures of HiFi FM signals and outputs standard 24-bit 44.1-192khz FLAC stereo audio files.

RTLSDR capture & decoding (cross plafrom as its 100% GNURadio based) can run in realtime on most systems (1~3 sec delay) and provide live playback, Alongside 8msps RF files and a 48khz 24-bit FLAC file of the decoded audio.

Dependencies - Hardware

A Working Tape Player (VCR/VTR etc)

Preferably somewhat calibrated and in excellent mechanical and head condition, prosumer metal track decks are preferable as they were built generally better in terms of mechnical stability than cheaper later consumer decks that use more plastics.

However, the only crtical requirement is avalible test points or a head amplifyer that is easy to tap into, this goes for any and all tape formats any later 90s prosumer HiFi deck for VHS as an example can provide visually identical results top a top end SVHS deck with FM RF capture and decoding, it levels the playing field.

Tip

SVHS tapes can be RF captured on standard VHS HiFi decks.

Tip

SVHS NTSC Decks - Currently inflated, but you can import PAL decks with NTSC support for 1/3rd the price though this only applys if conventional refrence SVHS captures are required.

Important

  • Please read the Cleaning & Servicing Guide.
  • Always clean your tape track/drum/heads before and afterwards with 99.9% isopropanol and lint free cloths/pads/paper. This ensures fewer dropouts from dirty heads or tracks including the track of the head drum.
  • Its good practice to avoid cross contamination of tapes, especially if dealing with mouldy or contaminated tapes.
  • It also helps to make sure to re-lubricate metal and plastic moving joints cogs and bearings with appropriate greases and oils to avoid mechanical failures.

An RF Capture Device

Tip

Currently is there is 3 standardised hardware workflows, but RF Capture is not just limited to these devices.

Capture is done using an intuative GUI application.

Linux / Windows / MacOS

Built and geared torwards capturing RF from Laserdisc players, it does however also work perfectly well for digitizing many forms of tape FM RF signals. It consists of a custom analogue to digital board with an amplifier, an off-the-shelf DE0-NANO FPGA development board, and a Cypress FX3 SuperSpeed Explorer USB 3.0 board.

Warning

Don't use USB storage or video devices on the same USB bus as the DdD, it will crash the capture!

Where to Buy? & More Info

CX Card & CXADC (20-120USD)

Capture & Config uses simple command-line arguments and parameters to oprate the CXADC driver.

The most cost-effective approach is using a video capture cards based on a Conexant CX23880/1/2/3 PCI chipset.

Today with a modified Linux driver, these cards can be forced to output RAW signal data that can be captured to file, instead of decoding video normally as they otherwise would, there is also a Windows Driver that's in-development.

While you can use any generic card with the correct chips, today we recommend the ‘‘New’’ Chinese variants that can be found on AliExpress that have integrated Asmedia or ITE 1x PCIE bridge chips allowing modern systems to use them, and consistent performance.

These cards combined with a dedicated amplifier & the clockgen mod enabling Video + HiFi RF + Baseband (Baseband = linear or deck decoded hifi audio) to be captured in perfect hardware sync, a highly reliable turn-key "one run and done" capturing workflow for a wide range of videotape formats.

Where to Buy? & More Info

Dependencies & Installation - Hardware

Information on various VCRs that have been documented alongside high resolution pictures of VCR's that have had RF taps installed, guidance on recommended cables/connectors & tools to use are also included.

The setup process for RF capture involves running a short cable internally from points that provide the unprocessed modulated or "FM" video and or audio signal signals.

This cable is then routed to an added BNC jack at back of your metal/plastic VCR chassis or cable threaded out a vent, this allows direct access to the FM RF signals conveniently & reliably, we call this a Tap Point or RF Tap respectively for some decks and camcorders however DuPont conectors (2.54mm headders) and ribbon jigs can be used, but can be less mechanically safe/secure in some setups.

Adding an amplifyer in-between your RF Tap and your Bulkheads or cabled connection to an ADC solution can drastically improve the proformance of lower signal level output machines, and reduce/eliminate issues such as crosshatching from too much signal draw on the internal head amplifyer, this also removes most needs to change any capture device gain levels.

- VCR Unit ==> Head Drum ==> RAW Signal From Heads ==> Amplification & Tracking IC ==> Tracked FM RF signals ==> 
- FM RF Test/Signal Points ==> Amplifyer ==> FM RF Capture ==> 
- Software Decoding ==> Lossless 4fsc TBC Files ==> YUV Conversion ==> Standard Audio/Video Files.

Caution

Just because a test points has this name doesn't automatically mean it will have the signal we want, especially when it comes to hi-fi audio, be sure to check with the service manual if possible and do small test captures before finalizing any RF Tap setup.

Basic Guidance

Finding Test Points

Decks follow this naming or close to it not every possible name is covered.

Video FM RF Signal:

RF C, RF Y, RF Y+C, V RF, PB, PB.FM, V ENV, ENV, ENVE, ENVELOPE, VIDEO ENVE, VIDEO ENVELOPE

HiFi Audio FM Signal:

HiFi, A.PB, A FM, A.PB.FM, Audio FM, A ENV, HIFI Envelope, FM Mix Out

Linear Baseband Audio Signal

A-Out (normally this is easy to tell, but always check service manuals)

Parts for an RF Tap

What tools do I need?

Connection Cables

On CX White Cards you use the RCA (Vmux 1) for the RF input with C31 capacitor removed, but a BNC can be easily added.

Install A RF Tap

[!TIP]
The Hardware Installation Guide visually goes over all the installation steps for tape decks to Sony 8mm camcorders.

Adding a 10uf (0.1uf to 100uf range) capacitor to the test point or amplifier is recommended can help improve signal integrity (a handful VCRs have this on the test point already).

Center is Signal, Outer is Ground, this goes for jacks and for coaxial cable in general.

For an electrolytic capacitor Positive leg (longer) goes on test/signal point, Negative leg (shorter) on cable to connector/probe.

However, this does not matter for Ceramic which are bidirectional & recommend today.

While type and voltage does not matter drastically it's best to use new/tested capacitors.

Important Notes:

  • We use Aliexpress links for wide availability globally, but local vendors are a thing.

  • With some Sony decks you can use Dupont connectors on the test point pins making an easy RF tap.

  • Do not make sharp bends in any RF cabling, keep total cable runs as short as possible Ideally 30-60cm, more cable = more signal loss.

  • Some UMATIC decks have an RF output on the back, however this only provides Luma RF for dropout detection and not the full signal required for RF capture.

Dependencies & Installation - Software

VHS-Decode, as with LD-Decode, has been developed and tested on machines running the latest versions of Ubuntu, Debian, Linux Mint & Windows 10, and has user testing on current versions of MacOS.

The tools should however be able to be built on other distributions too provided they have access somewhat recent versions to the needed dependencies, including at least python 3.8.

There is a Linux compatibility doc for various tested distributions of Linux.

Other dependencies include Python 3.8+, numpy, scipy, cython, numba, pandas, Qt5, qwt, Cmake, and FFmpeg.

Windows Builds

Windows Setup & Usage Docs

The ld-tools suite, tbc-video-export and combined exe version of ld-decode / vhs-decode / cvbs-decode / hifi-decode which is simply decode.exe exists for Windows and is eniterly self-contained or portable.

This allows the use of ld-analyse's GUI to view TBC files, ld-lds-converter to convert and compress DdD captures inside Windows with drag and drop bat scripts.

The decode suite can also be built & run natively on Windows 10/11 or built inside WSL2 22.04.1 LTS (Windows Subsystem for Linux) however issues with larger captures i.g 180gb+ may require expanding the default virtual disk size.

MacOS Builds

MacOS Setup & Usage Docs

Currently, MacOS builds while supported and deployable these are not directly verifyed and tested by the developers of ld-decode or vhs-decode due ot lack of owning physical Apple M1 or newer hardware.

Installation on Linux (Ubuntu/Debian-based)

Install all dependencies required by LD-Decode and VHS-Decode:

sudo apt install git qtbase5-dev libqwt-qt5-dev libfftw3-dev libavformat-dev libavcodec-dev libavutil-dev ffmpeg pv pkg-config make cmake sox pipx g++ python3-dev

Ubuntu 22.04/Linux Mint 21/Debian may also need this library installed if one wants to use the GUI version of hifi-decode:

sudo apt install libxcb-cursor0

For Arch Linux

pacman -S base-devel git qt5-base qwt fftw ffmpeg pv cmake sox python python-pipx

Set up pipx

pipx ensurepath

(Alternatively, a python virtual environment can be used instead of using pipx)

Install TBC-Video-Export

pipx install tbc-video-export

(There is also self-contained builds if install issues arise)

Optional dependencies for GPU (Nvidia Cards) FLAC compression support:

sudo apt install make ocl-icd-opencl-dev mono-runtime

Also Requires FlaLDF Download & Install via .deb for Linux

Build VHS-Decode & LD-Tools Suite

The vhs-decode respository also has hifi-decode, cvbs-decode, ld-decode included.

Download VHS-Decode:

git clone https://github.com/oyvindln/vhs-decode.git vhs-decode

Install VHS-Decode:

cd vhs-decode

Build and install vhs-decode via pipx

pipx install .[hifi_gui_qt6]

Compile and Install ld-tools suite: (Required)

mkdir build2
cd build2
CXXFLAGS="-march=native" CFLAGS="-march=native" cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT_VERSION=5
make -j4
sudo make install

Go back to the main directory with

cd .. 

How to Update

To update your local repository enter git pull into the terminal while inside the vhs-decode directory, and then do pipx install .[hifi_gui_qt6] --force it will overwrite your pervious installation and deploy the current version of the decoders.

To update the tools to the latest version, the steps under "Compile and Install ld-tools suite: (Required)" has to be re-ran after a git pull. The tools are not updated very often.

[!NOTE]
debian/ubuntu does not have a qt6 version of qwt in repositories as of yet, so you have to inform the build script to use Qt5 if both qt5 and qt6 are installed with -DUSE_QT_VERSION=5 as it might otherwise try to compile with qt6 instead and failing to locate qwt. The option is otherwise not needed.

Usage

Note with WSL2 & Ubuntu, ./ in front of applications and scripts may be needed to run them or to run scripts within the folder.

Use cd vhs-decode to enter into the directory to run commands, cd.. to go back a directory.

Use Ctrl+C to stop the current process.

You dont actaully type < and > on your input & output files.

FM RF Capture

Here's the full RF Capture Guide

But to get started here is a simplifyed guide:

Basic CX Card Setup & RF Capture
  • Ensure system is powered off
  • Physically Install CX Card
  • Install CXADC driver

Connect Card to RF Tap

  • Find Vmux Input (Via Live Preview)
  • Configure Capture
  • Capture RF Data
  • FLAC Compress RF Data (Archive)

CXADC Readme for information on how to install & configure the driver, this also goes into depth on modes.

Commands for real-time FLAC capture on CX Cards

Naming Guide For RF Captures!

To see if you have a connection, use the live preview mode and then hook up your RF cable, normally you will see a white flash as a signal, if not change your vmux or input within a 0-2 range with the below command.

sudo echo 0 >/sys/class/cxadc/cxadc0/device/parameters/vmux

To see a live preview of tape signal being received by a CXADC card, note that the video head tracked signal will be unstable or wobbly if settings are not the same; you may only see "signal flash" if in 16-bit mode for example.

This is quite useful if you don't own a CRT with Horizontal/Vertical shifting, as it will allow you to inspect the full area for alignment and/or tracking issues.

PAL framing for the default 28.64 MHz/8-bit mode:

ffplay -hide_banner -async 1 -f rawvideo -pix_fmt gray8 -video_size 1832x625 -i /dev/cxadc0 -vf scale=1135x625,eq=gamma=0.5:contrast=1.5

NTSC framing for 28.64 MHz/8-bit mode:

ffplay -hide_banner -async 1 -f rawvideo -pix_fmt gray8 -video_size 1820x525 -i /dev/cxadc0 -vf scale=910x525,eq=gamma=0.5:contrast=1.5

Capture 30 seconds of tape signal using CXADC driver 8-bit samples

timeout 30s cat /dev/cxadc0 > <capture>_CXADC.u8

For 16-bit, simply change the output filename extension to .u16

For FLAC captures, set the output filename extension to your desired tape format, for example .VHS

It is recommended to use a fast storage device with 40-100 MB/s or faster write capacity, in order to avoid dropped samples, ideally an dedicated SSD (via M.2 or SATA connector, not USB) formatted with the exFAT filesystem.

What should a FM video signal look like on the preview?

Compress Your Captures!

Caution

Ignoring this will cost you a lot of storage space!

The FM RF archival workflow may seem initially daunting in terms of RAW storage space usage, however thanks to this data being PCM style data, just like audio but with some extra zeros on the end, we can simply use lossless compression, with FLAC this is a 40-60% reduction of file sizes, which is normally under 1GB/minute down to 325MB/minute! (depending on sample rate & bit-depth used for capture).

After this compression your data is still able to be decoded with the added benefit of easily being able to open for visual inspection and manipulation.

CX Card Users

For CXADC and other standard 8-bit or 16-bit RF captures use the following:

Copy Paste FLAC Compression Commands for CXADC

DomesDay Duplicator Users

For DomesDayDuplicator captures on Linux simply run:

ld-compress <capture>

For DomesDayDuplicator captures on Windows simply drag and drop on:

ld-compress.bat or ld-compress-nvidia-gpu.bat

Your .lds file will be compressed to an FLAC OGG .ldf file.

Manual Compression & De-Compression

Editable flags are:

The --bps flag can be changed to --bps=8 or --bps=16 for 8 & 16 bit captures and --ogg is optional.

Change <capture> & <output-name>.flac to your input & output file name.

Reduce size of captured CXADC data (by 40-60%):

flac --best --sample-rate=28636 --sign=unsigned --channels=1 --endian=little --bps=8 --ogg -f <capture>.u8 <output-name>.flac

Output will be <output-name>.flac if wanted you can rename the end extension to .vhs / .hifi etc, but include _8-bit_28msps and NTSC or PAL etc in the name, to always know what the data and tape format is.

Decompress FLAC compressed captures:

flac -d --force-raw-format --sign=unsigned --endian=little <capture>.vhs <capture>.u16

Decoding FM RF Captures

Tip

  • .tbc files are headerless you can open them at any time during decoding, preview is limited to what frame info has been fully written to the JSON file updated every 100 frames or so.
  • You can download example demo tapes here.

Decode your captured tape to .tbc by using:

vhs-decode [arguments] <capture file> <output name>

Full Usage Example:

vhs-decode --debug --ire0_adjust --frequency 28.6 --pal --threads 8 --tape_format VHS CX-White-2022.10.25.u8 my-first-decode-2022.10.25

Use analyse tool during or after decoding to inspect decoded data:

ld-analyse <decoded tape name>.tbc

After decoding process your tapes VBI data with:

ld-process-vbi <decoded tape name>.tbc

Output File Format

VHS-Decode produces 4fsc sampled, non-square pixel, timebase corrected headderless files, there are two formatting versions of these files.

  • S-Video signal in two files for colour-under format tape media such as VHS/Umatic/Betamax/SuperBeta/Video8/Hi8 etc.

  • Composite/CVBS signal in a single file for SMPTE-C/B/A this also applies to 2" Quad and LaserDisc & anything CVBS-Decode.

These tbc files store 16-bit GREY16 headerless data separated into chroma/luma composite video signals in the .tbc format filename.tbc & filename_chroma.tbc respectively alongside .json and .log files which carry the frame, tv system and decode information, usable with the LD-Decode family of tools ld-analyse, ld-process-vbi, ld-process-vits, ld-dropout-correct & ld-chroma-decoder etc.

Exporting to Video Files

Linux, MacOS & Windows

tbc-video-export Input-Media.tbc

This will create an FFV1 10-bit 4:2:2 MKV File ready for playback or post-processing.

The export tool will by default render a lossless, interlaced top field first and high-bitrate (roughly 70-100 Mb/s) FFV1 codec video which, which although ideal for archival and further processing has only recently started to gain support in modern NLEs.

Some recommended free tools for post-processing are:

These cover editing to across operating systems, and can provide an easier FFmpeg/AviSynth/Vapoursynth encoding and QTGMC de-interlacing experience, and full colour grading and post-production ability.

Profile Options

For archival to web use we have a wide range of premade FFmpeg profiles defined inside the tbc-video-export.json file.

Warning

  • Odysee uploads the provided web AVC files are ideal.
  • Vimeo uploads de-interlace the FFV1 export it re-encodes progressive SD quite well.
  • YouTube de-interlace and upscale to 2880x2176 with HEVC 120mbps (anything below the 4k bracket is destroyed by compression.)

The stock profiles for web use the BDWIF deinterlacer, but QTGMC is always recommended give the de-interlacing guide a read for more details.

ProRes 4444XQ & FFV1 with PCM audio have been added for editing support.

Define your profile with for example: --profile ffv1_8bit_pcm

Encoding Profile List
Profile Name Codec Compression Type Bit-Depth Chroma Sub-Sampling Audio Format Container File Extension Bitrate
ffv1 FFV1 Lossless Compressed 10-bit 4:2:2 FLAC Audio Matroska .mkv 70-100mbps
ffv1_8bit FFV1 Lossless Compressed 8-bit 4:2:2 FLAC Audio Matroska .mkv 40-60mbps
ffv1_pcm FFV1 Lossless Compressed 10-bit 4:2:2 PCM Audio Matroska .mkv 70-100mbps
ffv1_8bit_pcm FFV1 Lossless Compressed 8-bit 4:2:2 PCM Audio Matroska .mkv 40-60mbps
prores_hq_422 ProRes HQ Compressed 10-bit 4:2:2 PCM Audio QuickTime .mov 55-70mbps
prores_4444xq ProRes 4444XQ Compressed 10-bit 4:4:4 PCM Audio QuickTime .mov 80-110mbps
v210 V210 Uncompressed 10-bit 4:2:2 PCM Audio QuickTime .mov 200mbps
v410 V410 Uncompressed 10-bit 4:4:4 PCM Audio QuickTime .mov 400mbps
x264_web AVC/H.264 Lossy 8-bit 4:2:0 AAC Audio QuickTime .mov 8mbps
x265_web HEVC/H.265 Lossy 8-bit 4:2:0 AAC Audio QuickTime .mov 8mbps

Time Control & Audio Muxing

  • -s Skips number of frames -s 25 for example skips 1 second of PAL video.

  • -l Defines length to export so -l 1500 is 1 minute of PAL video at 25fps or -l 1500 for NTSC at 29.97fps

  • --audio-track Embed an audio file example: --audio-track HiFi_24-bit_192khz.flac & --audio-track Linear_24-bit_48khz.flac from HiFi-Decode.

Full Example:

Linux, MacOS & Windows:

tbc-video-export -s 50 -l 1500 --audio-track HiFi_24-bit_48khz.flac --audio-track Linear_24-bit_48khz.flac Input.tbc

VBI (Vertical Blanking Interval) Recovery & Preservation

Linux, MacOS & Windows:

tbc-video-export --vbi input.tbc

This creates a scaled 720x608 PAL or 720x508 NTSC (IMX/D10) standard video file with the top VBI space visually exported.

Software decoding provides the full signal frame to work with, including the VBI space, as such recovery software can be used to read and extract this information, or it can be exported visually unlike legacy (and broadcast specialised) capture hardware.

The decode projects tool suite has built-in tools for this ld-process-vbi & ld-process-vits supporting decoding of VITC, VITS & Closed Captions from your .TBC files and saves it inside the .JSON metadata file alongside the outer tape technical data.

VITC Timecode (Standard SMPTE Timecode)

CC EIA-608 (Closed Captioning)

Teletext (European Subtitles & Information Graphics)

Tape-based Arcade Games!

Ruxpin TV Teddy (Extra audio in visible frame)

Terminal Arguments

The decoder's support various arguments to change how captured tape recordings are processed.

These vary slightly between formats like VHS & Umatic, but the basic arguments remain the same.

The list below is a short list for common/daily usage but does not cover all the abilities and new or advanced command arguments possible, so please read the complete and upto-date command list on the wiki as commands may change or be deprecated, so its always good to check this list for any updates or specific issues you're trying to correct.

Sample Rate Commands

Caution

This is a mandatory setting for the decoders to work.

By default, this is set to 40 Mhz (40msps) (the sample rate used internally and by the Domesday Duplicator) at 16 bits.

The decoder is 8/16 bit agnostic so as long as sample rate is defined, it will decode it same for 10-bit packed captures and if its FLAC compressed.

-f Adjusts sampling frequency in integer units.

Example's -f 280000hz or -f 28mhz or -f 8fsc

In the case of stock CX Card use -f 28.6 for example or legacy CXADC designers.

TV System Commands

Caution

This is a mandatory setting for the decoders to work as intended.

Changes the TV System (line system & respective, colour system if any) to your required regional media format.

Note

  • Support for PAL-M is experimental.
  • MESECAM (requires extra GNUradio script for decoding colour after the TBCs currently)

--system followed by the TV System

Options are: NTSC, PAL, PAL-M, NTSC-J & MESECAM

For example: --system NTSC

Tape Format Commands

Caution

This is a mandatory setting for the decoders to work properly.

--tf or --tape_format sets the format of media you wish to decode.

Current Options are VHS (Default), VHSHQ, SVHS, UMATIC, UMATIC_HI, BETAMAX, BETAMAX_HIFI, SUPERBETA, VIDEO8, HI8 ,EIAJ, VCR, VCR_LP, TYPEC & TYPEB.

Example: --tape_format vhs

Tape Speed Commands

Warning

This is not a mandatory setting for the decoders to work properly, but can make a "visual" difference in decoding results.

--ts or --tape_speed sets the tape speed of media you wish to decode.

Tape speed adjusts the format parameters slightly so will not always make a difference, but it can make one for LP tapes for example.

SP (default), LP, SLP, EP, and VP. Only supported for some formats such as but not limited to (S)VHS & Sony 8mm.

Example: --tape_speed LP

Note

SLP and EP refers to the same speed.

These commands are used for jumping ahead in a file or for defining limits. Useful to recover decoding after a crash, or for limiting process time by producing shorter samples.

-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.

-t Defines the number of processing threads to use during demodulation, decode cant use more then 6-8 threads per decode currently so using 8 threads is the practical limit as its mostly a single core task.

Caution

Upon crashing, vhs-decode automatically dumps the last known sample location in the terminal output.

--debug sets logger verbosity level to debug. Useful for debugging and better log information. (Recommended to enable for archival.)

--ire0_adjust Automatically adjust the black/video level on a per-field basis, using the back porch level. Unlike --clamp this is done after time base correction. Therefore it can fix the per-field variations caused by the slight carrier shift of VHS-HQ and S-VHS. more info.

--ct enables a chroma trap, a filter intended to reduce chroma interference on the main luma signal. Use if seeing banding or checkerboarding on the main luma .tbc in ld-analyse.

--recheck_phase re-check chroma phase on every field, fixes most colour issues. (No effect on U-matic.)

--sl defines the output sharpness level, as an integer from 0-100, the default being 0. Higher values are better suited for plain, flat images i.e. cartoons and animated material, as strong ghosting can occur. (Akin to cranking up the sharpness on any regular TV set.)

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

Input file formats:

Note

The decoders can be RAW uncompressed data or FLAC compressed data.

Tip

.RAW will need to be renamed to s16/u16

.ldf/.lds (40msps Domesday Duplicator FLAC-compressed and uncompressed data).

.r8/.u8 (CXADC 8-bit raw data).

.r16/.u16 (CXADC 16-bit raw data).

.flac/.cvbs/.vhs/.svhs/.betacam/.betamax/.video8/.hi8 (FLAC-compressed captures, can be either 8-bit or 16-bit).

Caution

If using custom extensions include, tv system, bit depth, and sample rate xxMSPS inside the file name so it's clear what basic settings you will need to use to decode it, and it helps a lot when sharing or archiving something to know what it actually is.

Output file formats:

Unlike CVBS-Decode & LD-Decode, VHS-Decode does not output its timebase-corrected frames as a single Composite .tbc file for colour-under formats, but does for composite modulated ones such as SMPTE-C.

Both the luminance and chrominance channels are separate data files, essentially digital "S-Video", additionally useful for troubleshooting. Descriptor/log files are generated so you end up with 4 files with the following naming:

filename.tbc - Luminance (Y) Image Data (Combined Y/C for CVBS)

filename_chroma.tbc - Chrominance (C) Image Data (QAM Modulated)

filename.tbc.json - Frame Descriptor Table (Resolution/Dropouts/SNR/Frames/VBI Timecode)

filename.log - Timecode Indexed Action/Output Log

Join us!

Support us!

More Documentation

If in doubt - feel free to read the docs/wiki again, if its not there then ask!

For future documentation changes, speak with Harry Munday ([email protected]) or on Discord (therealharrypm)

About

Software defined VHS decoder - Fork (maybe temporary) of the ld-decode Laserdisc rf decoder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 83.5%
  • C++ 10.0%
  • Python 5.8%
  • Cython 0.3%
  • Shell 0.2%
  • CMake 0.1%
  • Other 0.1%