GithubHelp home page GithubHelp logo

t1stm / nvfbc-v4l2 Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 494 KB

A tool (hack) that captures frames from NVIDIA GPUs to a V4L2 loopback device using their NvFBC API.

License: MIT License

CMake 0.38% C 99.62%
c linux nvfbc v4l2loopback replacement obs-nvfbc

nvfbc-v4l2's Introduction

nvfbc-v4l2

Miss obs-nvfbc? Need a replacement? This project is for you!

This project is a tool (hack) for Linux that uses the Nvidia NvFBC API and passes the captured frames to a v4l2loopback device.

Because why not? It's better than nothing!

Requirements:

  • A Nvidia GPU that supports NvFBC. (if it wasn't obvious)
  • A Linux Desktop with CMake and GCC installed.
  • Proprietary Nvidia Drivers. (maybe. I haven't tested it with the open-source drivers yet)
  • X11 as a display server.

Installation:

In short: CMake

But how?

Like this:

$ git clone https://github.com/t1stm/nvfbc-v4l2.git
$ cd nvfbc-v4l2
$ mkdir build && cd build
$ cmake ..
$ make -j$(nproc)

Running:

If you have worked with v4l2loopback before:

$ ./nvfbc-v4l2 -h

If you haven't:

  1. Create a v4l2loopback device.

IMPORTANT: replace x and y with actual numbers and remember them.

$ sudo modprobe v4l2loopback devices=1 video_nr=x card_label="NvFBC Capture" exclusive_caps=1

...or if you want to use the OBS Virtual Camera:

If you don't have any other capture devices set x to 0, and if you do, set it to the highest device number + 1

$ sudo modprobe v4l2loopback devices=2 video_nr=x,y card_label="OBS Virtual Camera, NvFBC Capture" exclusive_caps=1,1
  1. Optional: List all available displays.
$ ./nvfbc-v4l2 -l
  1. Use the virtual v4l2loopback device and optionally the selected screen.
$ ./nvfbc-v4l2 -o [v4l2-nr] -s [screen]
  1. Profit

Screenshot of Desktop in OBS

If the capture appears corrupted, try removing the v4l2loopback module and adding it again with the commands above. If that doesn't help, open up an issue, and I'll try my best to help. Remember to close the program while doing this.

Special Thanks To:

  • umläute (umlaeute) - Developer of the v4l2loopback Linux module. | Without his work, this tool won't exist.
  • Florian Zwoch (fzwoch) - Developer of the obs-nvfbc plugin. | I read his plugin's code to understand the NvFBC API.
  • The Nvidia Capture SDK devs | For making the API easy to use.

Known Issues:

* V4L2 device doesn't show in Chromium-based applications, due to the BGRA444 color space being used.

nvfbc-v4l2's People

Contributors

t1stm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

hzmslx

nvfbc-v4l2's Issues

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.