occ-ai / obs-localvocal

OBS plugin for local speech recognition and captioning using AI
https://obsproject.com/forum/resources/localvocal-live-stream-ai-assistant.1769/
GNU General Public License v2.0
356 stars 28 forks source link

Archlinux compilation and/or AUR package #62

Open LefterisJP opened 6 months ago

LefterisJP commented 6 months ago

Hey thanks a lot for your work on this awesome package!

I wanted to try and build it under archlinux but the guide does not work due to

   =>   Check Linux build requirements
   ✖︎   No apt-get command found. Please install apt

As archlinux uses pacman I guess some adjustment are needed but I am not very familiar with the best way to do it.

What would be amazing if this was packaged in an AUR package like someone did for your other extension to remove the background: https://github.com/Bitals/obs-backgroundremoval-aur/tree/master

Any help appreciated :heart:

royshil commented 6 months ago

i will look into this as soon as i can... but it'll take a while since I'm swamped... join maybe my live stream and we can work on it together?

deweydbdecibel commented 5 months ago

I absolutely love this idea! I'm using Garuda and fish doesn't like me trying to install this either. I spent hours trying to get brain to work on Garuda and ultimately frustration got the best of me. :P I'll be following this as I do a DJ stream and want to see if it will do captions for my ethnically diverse music selection!

BTW, From what I see on your github, ya'll are doing some amazing work!

royshil commented 5 months ago

@umireon whats the process of getting an AUR on aur.archlinux.org ?

umireon commented 5 months ago

@royshil I don't think downloading dependencies by CMake is not permitted on AUR so we need to change the build script to accept tarballs of dependencies first.

Anyway, here is the PKGBUILD script to build the package for pacman.

# Maintainer: Kaito Udagawa <umireon at gmail dot com>
pkgname=obs-localvocal

pkgver=0.1.0
pkgrel=1
pkgdesc='OBS plugin for local speech recognition and captioning using AI'
_source="${pkgname}-${pkgver}"

arch=(x86_64)
url='https://github.com/occ-ai/obs-localvocal'
license=('GPL2')
depends=('obs-studio' 'curl')
makedepends=('cmake' 'ninja')
source=("${_source}.tar.gz::$url/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('90b7321f2cc7e04854d05e97e9f9c6dcac7856923cc4465f0656049e110c6317')

build() {
  cd "$_source"
  cmake -B build --preset linux-x86_64 -DUSE_SYSTEM_CURL=ON
  cmake --build build
}

package() {
  cd "$_source"
  cmake --install build --prefix "$pkgdir/usr"
}

Gist: https://gist.github.com/umireon/eb83c2bd0657931345a3382bfbc4caed

And here are the instructions to build our plugin on Arch Linux

sudo pacman -Syu base-devel git
git clone https://gist.github.com/eb83c2bd0657931345a3382bfbc4caed.git obs-localvocal
makepkg -s
sudo pacman -U obs-localvocal-0.1.0-1-x86_64.pkg.tar.zst

Disclaimer: I haven't checked if this plugin works on OBS built in this way.

LefterisJP commented 5 months ago

So found some time to play with it.

Just by making the package manually with the PKGBUILD and .SRCINFO provided by @umireon it seems to succesfully build. For some reason ninja was not pulled as a build dependency but I manually installed it and it seems to have worked.

Now I have never used this plugin before so tried to use it but I am either doing something wrong or it's not properly installed.

2024-02-05_12-57

As per the tutorial, I put it as a filter in the audio source and connected it to a text/subs element. But nothing appears there or in the logs.

royshil commented 5 months ago

@LefterisJP you get in the log "skipping inference" which means it can't hear any sound to process so it skips the Whisper inference

LefterisJP commented 5 months ago

@LefterisJP you get in the log "skipping inference" which means it can't hear any sound to process so it skips the Whisper inference

yeah works now. Needed to speak louder and wait for quite some time to see the results. Need to play with the parameters I guess.

But anyway for the purpose of this issue the files to make the AUR package seem to work!

LunasShade commented 1 month ago

What is the status of the AUR package? ^^

royshil commented 3 weeks ago

is anyone willing to invest some time to make an AUR pkg?

umireon commented 3 weeks ago

We first need to organize dependent libraries to register our plugin to AUR. That's why I have not been tackling this request.

umireon commented 3 weeks ago

AUR won't allow the pre-built libraries, so we need to enable our plugin to build with the source of the dependent libraries. If all the dependent libraries of localvocal can already be provided from their source, I can quickly submit the PKGBUILD to AUR.

suwagawaki commented 3 weeks ago

Update: installed ccache and openblas before compiling again, module loaded!

Thank you @umireon for the build script. I was able to compile the latest master as well as 0.3.1, though the plug-in has issues loading.


00:42:37.122: 
00:42:37.126: os_dlopen(/usr//lib/obs-plugins/obs-localvocal.so->/usr//lib/obs-plugins/obs-localvocal.so): /usr//lib/obs-plugins/obs-localvocal.so: undefined symbol: _ZN11ctranslate23cpu10reduce_sumILNS0_6CpuIsaE1EN10half_float4halfEEET0_PKS5_l
00:42:37.126: 
00:42:37.126: Module '/usr//lib/obs-plugins/obs-localvocal.so' not loaded
royshil commented 3 weeks ago

@suwagawaki looks like CTranslate2 is missing either as a shared or static library