Coder Social home page Coder Social logo

camlink's Introduction

Camlink

A small library to force removal of invalid colorspaces exported by the Elgato Cam Link 4K.

Table of Contents

Setup

Prerequisites

You will need gcc and make to build.

Top

Building

Run mkdir build && make

Top

Installing

Simply run sudo make install. The camlink.so file will be copied to the path /usr/local/lib/camlink/camlink.so

Top

Uninstalling

Run sudo make uninstall.

Top

Usage

This library is run as a LD_PRELOAD to other applications. It intercepts all ioctl calls and determines if the call is intended to query the colorspaces available on a camlink.

If so, it rejects all return values that are NOT YUYV 4:2:2. This should make colors work correctly on the Camlink in Linux.

Top

Examples

Video4Linux2 CTL application:

$ LD_PRELOAD=/usr/local/lib/camlink/camlink.so v4l2-ctl -d /dev/video2 --list-formats-ext

Top

Zoom

$ LD_PRELOAD=/usr/local/lib/camlink/camlink.so zoom

Top

Flatpak Zoom

$ flatpak override us.zoom.Zoom --filesystem=/usr/local/lib/camlink/camlink.so
$ flatpak run --env=LD_PRELOAD=/usr/local/lib/camlink/camlink.so us.zoom.Zoom

Top

Firefox

$ LD_PRELOAD=/usr/local/lib/camlink/camlink.so firefox

Top

Universal

export LD_PRELOAD=/usr/local/lib/camlink/camlink.so

Top

Getting this to work in a desktop environment

Say you use Google Chrome. You click on the icon in your desktop environment, and it locates the .desktop file. (located @ /usr/share/applications/google-chrome.desktop on my machine)

Inside that file is an Exec= line that specifies how to the browser should be started. On my machine, the line is:

Exec=/usr/bin/google-chrome-stable %U

You need to edit that line, and you need that line to STAY edited even if you update Google Chrome. The solution is to make a local copy of this file in your home directory:

$ cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/

Then edit the new file @ ~/.local/share/applications/google-chrome.desktop and change the exec line to include the LD_PRELOAD call. Something like this:

Exec=env LD_PRELOAD=/usr/local/lib/camlink/camlink.so /usr/bin/google-chrome-stable %U 

Top

Troubleshooting

If running the browser on the command line DOES NOT WORK -- even after fully quitting it first:

Then the issue is different; likely the LD_PRELOAD path is incorrect. The examples assume that you have installed the camlink library. If you have not, instead use the path where your camlink.so file can be found. For example: LD_PRELOAD=/home/yourname/path/to/camlink/sources/build/camlink.so

Top

This is a Cam Link 4K bug. What does Elgato support say?

I contacted Elgato about the issue and got this reply:

Thank you for contacting Elgato Technical support.

I understand you are in need of some information regarding running a Cam Link 4K on a Linux computer. I will be happy to help!

As it turns out, Linux OS is not supported. Elgato products were designed to work with Windows and Mac only.

I understand this may not be the information your were expecting to hear and for that I apologize.

So they will not be helpful. That doesn't mean you shouldn't contact them about the issue! Manufacterers need to know how their product is being used.

Top

Alternatives

There are several other possible fixes for the color issue for the Cam Link 4K:

Top

camlink's People

Contributors

bttnns avatar lummish avatar rationalsa avatar xkahn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.