{"id":28144529,"url":"https://github.com/kernelghost/tapeshift","last_synced_at":"2025-08-03T12:07:50.324Z","repository":{"id":258250855,"uuid":"865178251","full_name":"KernelGhost/TapeShift","owner":"KernelGhost","description":"VHS Video Digitisation on GNU/Linux via USB Device 1D19:6108 (Dexatek Technology Ltd. Video Grabber)","archived":false,"fork":false,"pushed_at":"2025-02-03T22:30:27.000Z","size":27975,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T19:03:40.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KernelGhost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-30T05:42:38.000Z","updated_at":"2025-06-02T07:12:45.000Z","dependencies_parsed_at":"2025-05-14T22:12:53.903Z","dependency_job_id":"00ddb351-ad50-42df-8cc7-ac932d733310","html_url":"https://github.com/KernelGhost/TapeShift","commit_stats":null,"previous_names":["kernelghost/tapeshift"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KernelGhost/TapeShift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelGhost%2FTapeShift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelGhost%2FTapeShift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelGhost%2FTapeShift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelGhost%2FTapeShift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KernelGhost","download_url":"https://codeload.github.com/KernelGhost/TapeShift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelGhost%2FTapeShift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268541484,"owners_count":24266715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-14T22:12:44.955Z","updated_at":"2025-08-03T12:07:50.252Z","avatar_url":"https://github.com/KernelGhost.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tape*Shift*\n__VHS Video Digitisation on GNU/Linux via USB Device 1D19:6108 (Dexatek Technology Ltd. Video Grabber)__\n\n## Overview\nThis project provides software and comprehensive instructions for using the USB device 1D19:6108 (Dexatek Technology Ltd. Video Grabber) to perform VHS video digitisation on Linux. Originally sold by ALDI Australia around 2013 as part of the BAUHN DVD Maker (DK8723), this device functions as a composite and component video capture card.\n\n## Motivation\nThe motivation for this project arises from the need to breathe new life into this hardware. The official software that came with the device was severely outdated and limited, featuring:\n\n* A Windows XP-era kernel-mode driver 😨\n* Archaic, proprietary 'ArcSoft ShowBiz' software 🤮\n* No official support for Windows versions beyond Windows 7 👴🏻\n* No support for GNU/Linux 😭\n\n## Features\nThis project leverages `FFMPEG` and `V4L2` in the backend, ensuring efficient and high-quality video processing.\n\nKey features include:\n* Ability to digitise copy-protected VHS tapes (unlike 'ArcSoft ShowBiz').\n* Capture preview window.\n* Support for Video Acceleration API (VAAPI).\n* Preservation of interlacing.\n* Detailed logging for painless debugging.\n* Written in `bash` for easy customisation.\n\n## Installation \u0026 Usage\n1. Install the required dependencies.\n    ```bash\n    sudo dnf install ffmpeg v4l-utils alsa-utils\n    ```\n\n2. Clone the GitHub repository.\n    ```bash\n    git clone https://github.com/KernelGhost/TapeShift.git\n    cd TapeShift\n    ```\n\n3. Plug in the 'Dexatek Technology Ltd. Video Grabber (1D19:6108)'.\n\n4. Run the script.\n    ```bash\n    ./TapeShift.sh\n    ```\n\n## Demonstration\n\u003cimg src=\"./Multimedia/Demonstration.png\" alt=\"Demonstration\" width=\"720\"\u003e\n\n## Sample Video Capture Showcase\nhttps://github.com/KernelGhost/TapeShift/raw/refs/heads/main/Multimedia/Showcase.mp4\n\n## Product Images\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"./Multimedia/1.jpg\" alt=\"Demonstration\" width=\"200\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"./Multimedia/2.jpg\" alt=\"Demonstration\" width=\"200\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"./Multimedia/3.jpg\" alt=\"Demonstration\" width=\"200\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Patching, Compiling \u0026 Signing `cx231xx`\n\u003e [!IMPORTANT]\n\u003e Following these instructions is generally no longer necessary unless you are using an older Linux kernel. Support for '1D19:6108' has been added to the `cx231xx` driver through [my patch](https://patchwork.linuxtv.org/project/linux-media/patch/20241003094039.2893301-2-rohan.barar@gmail.com/), which has now been [merged](https://github.com/torvalds/linux/commit/61a830bc0ea69a05d8a4534f825c6aa618263649).\n\n1. Install the required development tools.\n\n    ```bash\n    sudo dnf groupinstall \"Development Tools\" \"Development Libraries\"\n    sudo dnf install kernel-devel kernel-headers\n    ```\n\n2. Initialise a bare git repository.\n\n    ```bash\n    git init cx231xx_patch\n    cd cx231xx_patch\n    ```\n\n3. Enable the sparse checkout feature.\n\n    ```bash\n    git config core.sparseCheckout true\n    ```\n\n4. Add the Linux kernel source repository URL as the remote.\n\n    ```bash\n    git remote add origin https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n    ```\n\n5. Define the specific directories to clone in the sparse checkout.\n\n    ```bash\n    echo \"drivers/media/tuners/\" \u003e\u003e .git/info/sparse-checkout\n    echo \"drivers/media/dvb-frontends/\" \u003e\u003e .git/info/sparse-checkout\n    echo \"drivers/media/usb/cx231xx/\" \u003e\u003e .git/info/sparse-checkout\n    ```\n\n6. Pull the data from the remote repository.\n\n    ```bash\n    git fetch --depth 1 origin\n    git checkout origin/master\n    ```\n\n7. Using your favourite text editor, modify `drivers/media/usb/cx231xx/cx231xx-cards.c` to include USB device ID `1D19:6108`.\n\n    Before:\n\n    ```c\n     /* table of devices that work with this driver */\n    struct usb_device_id cx231xx_id_table[] = {\n        {USB_DEVICE(0x1D19, 0x6109),\n        .driver_info = CX231XX_BOARD_PV_XCAPTURE_USB},\n    ```\n\n    After:\n\n    ```c\n    /* table of devices that work with this driver */\n    struct usb_device_id cx231xx_id_table[] = {\n        {USB_DEVICE(0x1D19, 0x6108),\n        .driver_info = CX231XX_BOARD_PV_XCAPTURE_USB},\n        {USB_DEVICE(0x1D19, 0x6109),\n        .driver_info = CX231XX_BOARD_PV_XCAPTURE_USB},\n    ```\n\n8. Create the following `Makefile` at `drivers/media/usb/cx231xx/Makefile`. Ensure that TABs are used instead of 4 spaces within the 'all:' and 'clean:' sections.\n\n    ```\n    # cx231xx driver makefile for out-of-tree compilation\n\n    KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build\n    PWD := $(shell pwd)\n\n    obj-m += cx231xx.o\n    cx231xx-y += cx231xx-video.o cx231xx-i2c.o cx231xx-cards.o cx231xx-core.o\n    cx231xx-y += cx231xx-avcore.o cx231xx-417.o cx231xx-pcb-cfg.o cx231xx-vbi.o\n    cx231xx-$(CONFIG_VIDEO_CX231XX_RC) += cx231xx-input.o\n\n    cx231xx-alsa-objs := cx231xx-audio.o\n\n    obj-$(CONFIG_VIDEO_CX231XX_ALSA) += cx231xx-alsa.o\n    obj-$(CONFIG_VIDEO_CX231XX_DVB) += cx231xx-dvb.o\n\n    ccflags-y += -I $(src)/../../tuners\n    ccflags-y += -I $(src)/../../dvb-frontends\n\n    all:\n        make -C $(KERNEL_DIR) M=$(PWD) modules\n\n    clean:\n        make -C $(KERNEL_DIR) M=$(PWD) clean\n    ```\n\n9. Run `make clean \u0026\u0026 make` from within the `drivers/media/usb/cx231xx` directory. The output should resemble:\n\n    ```\n    make -C /lib/modules/6.10.10-200.fc40.x86_64/build M=/home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx modules\n    make[1]: Entering directory '/usr/src/kernels/6.10.10-200.fc40.x86_64'\n    warning: the compiler differs from the one used to build the kernel\n      The kernel was built by: gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)\n      You are using:           gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-video.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-i2c.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-cards.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-core.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-avcore.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-417.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-vbi.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-input.o\n      LD [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-audio.o\n      LD [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-alsa.o\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-dvb.o\n      MODPOST /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/Module.symvers\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx.mod.o\n      LD [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx.ko\n      BTF [M] /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx.ko\n    Skipping BTF generation for /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx.ko due to unavailability of vmlinux\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-alsa.mod.o\n      LD [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-alsa.ko\n      BTF [M] /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-alsa.ko\n    Skipping BTF generation for /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-alsa.ko due to unavailability of vmlinux\n      CC [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-dvb.mod.o\n      LD [M]  /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-dvb.ko\n      BTF [M] /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-dvb.ko\n    Skipping BTF generation for /home/rohanbarar/Desktop/cx231xx_patch/drivers/media/usb/cx231xx/cx231xx-dvb.ko due to unavailability of vmlinux\n    make[1]: Leaving directory '/usr/src/kernels/6.10.10-200.fc40.x86_64'\n    ```\n\n10. Copy the compiled driver to the correct location on your system.\n\n    ```bash\n    sudo cp ./cx231xx.ko /lib/modules/$(uname -r)/kernel/drivers/media/usb/cx231xx\n    ```\n\n11. (Optional) Create and enroll a key pair to sign the compiled driver. If you already have a set of keys, you can skip ahead to the next step.\n    1. Install OpenSSL.\n\n        ```bash\n        sudo dnf install openssl\n        ```\n\n    2. Create a directory to store the keys.\n\n        ```bash\n        mkdir -p ~/keys\n        cd ~/keys\n        ```\n\n    3. Create the keys.\n\n        ```bash\n        # Private Key\n        openssl genrsa -out private_key_for_cx231xx.priv 2048\n\n        # Public Key\n        openssl req -new -x509 -key private_key_for_cx231xx.priv -outform DER -out public_key_for_cx231xx.der -days 36500 -subj \"/CN=Kernel Module Signing\"\n        ```\n\n    4. Enroll the public key within the UEFI.\n\n        ```bash\n        sudo mokutil --import ~/keys/public_key_for_cx231xx.der\n        ```\n\n        Note: You will be prompted to create a one-time password. This does not need to be anything complex, and will only be requested once by the 'Perform MOK management' screen within the UEFI when enrolling the certificate (public key). Using something simple like 'a' or '0' as the password is fine.\n\n    5. Reboot the system and follow the prompts at startup to enroll the public key.\n        - In the MOK Manager screen, choose \"Enroll MOK\".\n        - Select \"Continue\" and enter the one-time password you created earlier.\n        - Confirm the enrollment to finish the process.\n\n11. (Optional) Sign the driver using your new key pair.\n\n    ```bash\n    sudo /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ~/keys/private_key_for_cx231xx.priv ~/keys/public_key_for_cx231xx.der /lib/modules/$(uname -r)/kernel/drivers/media/usb/cx231xx/cx231xx.ko\n    ```\n\n12. Disable the existing copy of the `cx231xx` driver and replace it with your new patched copy.\n\n    ```bash\n    sudo mv /lib/modules/$(uname -r)/kernel/drivers/media/usb/cx231xx/cx231xx.ko.xz /lib/modules/$(uname -r)/kernel/drivers/media/usb/cx231xx/cx231xx.ko.xz.bak\n    sudo xz -zv /lib/modules/$(uname -r)/kernel/drivers/media/usb/cx231xx/cx231xx.ko\n    sudo dracut --force\n    ```\n\n13. Unload and reload `cx231xx` to switch to the patched copy of the driver.\n\n    ```bash\n    sudo modprobe -r cx231xx # Unload Old Driver\n    sudo modprobe cx231xx    # Load Patched Driver\n    ```\n\n14. Confirm the patched driver was loaded.\n    ```bash\n    sudo modinfo cx231xx\n    ```\n\n\u003e [!IMPORTANT]\n\u003e Steps marked as '(Optional)' are mandatory on systems with 'Secure Boot' enabled.\n\u003e The process of manually compiling and signing the patched version of the driver will need to be repeated each time the kernel is updated.\n\u003e While there are automated solutions available (e.g. DKMS), the method described above serves as a temporary workaround until [my patch](https://lore.kernel.org/linux-media/20241003094039.2893301-2-rohan.barar@gmail.com/) is merged into the `cx231xx` driver.\n\n\u003e [!NOTE]\n\u003e You can easily undo all the above changes and switch back to the default version of the `cx231xx` driver by:\n\u003e 1. Deleting `cx231xx.ko.xz` from `/lib/modules/$(uname -r)/kernel/drivers/media/usb/cx231xx/`.\n\u003e 2. Using `mv` to rename the default driver back to its original name (i.e., remove '.bak').\n\u003e 3. Running `sudo dracut --force`, `sudo modprobe -r cx231xx` and `sudo modprobe cx231xx`.\n\u003e 4. Removing the public key from the UEFI using `sudo mokutil --delete ~/keys/public_key_for_cx231xx.der`. Please only do this if no other kernel modules have been signed using the same key!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernelghost%2Ftapeshift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkernelghost%2Ftapeshift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernelghost%2Ftapeshift/lists"}