From f83665e7770dc1a1bbc67103b0ce41f826540ccb Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Fri, 8 Mar 2024 17:36:58 +0300 Subject: [PATCH] refactor(install\_software.sh): remove redundant script for recording screen and delete the corresponding file record\_screen.sh remove the following lines from install\_software.sh: ```bash ffmpeg -vsync 0 -hwaccel cuda -hwaccel_output_format cuda `# we need nvidia acceleration because of low fps without it` \ --r 30 -video_size 640x480 -i /dev/video0 `# this is camera` \ --f alsa -i default -async 1 `# this is audio. Why not pulse? Nvidia?` \ --c:v h264_nvenc `# this is video codec` \ video.mp4 # output file ``` Also, remove the filter\_complex line and the x11grab section. This refactoring is done to simplify the script and make it more focused on installing software rather than recording the screen. --- install_software.sh | 28 ++++++++++++---------------- record_screen.sh | 9 --------- 2 files changed, 12 insertions(+), 25 deletions(-) delete mode 100755 record_screen.sh diff --git a/install_software.sh b/install_software.sh index 1d6b7e9..c9676c3 100755 --- a/install_software.sh +++ b/install_software.sh @@ -6,6 +6,8 @@ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dear sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list # for nodejs/opencommit curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - +# obs-studio repo +sudo add-apt-repository ppa:obsproject/obs-studio -y # apt packages sudo nala update @@ -16,7 +18,10 @@ strace `# for tracing` \ docker.io `# containers` \ docker-compose `# containers` \ nvidia-container-toolkit `# containers` \ -nodejs `# for opencommit` +nodejs `# for opencommit` \ +ffmpeg `# for video` \ +v4l2loopback-dkms `# for obs-studio` \ +obs-studio `# for screen recording` sudo nvidia-ctk runtime configure --runtime=docker --set-as-default sudo service docker restart @@ -28,6 +33,12 @@ do sudo usermod -a -G $group $USER done +# background removal for obs-studio +wget https://github.com/occ-ai/obs-backgroundremoval/releases/download/1.1.10/obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb +sudo apt install -y ./obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb +rm -f obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb + + # install opencommit if ! command -v opencommit &> /dev/null then @@ -41,21 +52,6 @@ then oco config set OCO_AI_PROVIDER=ollama fi -# install ffmpeg with nvidia -if ! command -v ffmpeg &> /dev/null -then - git clone --depth 1 https://git.ffmpeg.org/ffmpeg.git ffmpeg/ - git clone --depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git - cd nv-codec-headers && sudo make install && cd - - sudo nala install -y build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev libasound2-dev - cd ffmpeg - ./configure --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-libxcb --enable-indev=alsa --enable-outdev=alsa --extra-cflags=-I/usr/lib/cuda/include --extra-ldflags=-L/usr/lib/cuda/lib64 --disable-static --enable-shared - make -j 8 - sudo make install - cd - -rm -rf ffmpeg nv-codec-headers -fi - # install pet if ! command -v pet &> /dev/null then diff --git a/record_screen.sh b/record_screen.sh deleted file mode 100755 index b723db3..0000000 --- a/record_screen.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -export LD_LIBRARY_PATH=/usr/local/lib -ffmpeg -vsync 0 -hwaccel cuda -hwaccel_output_format cuda `# we need nvidia acceleration because of low fps without it` \ --r 30 -video_size 640x480 -i /dev/video0 `# this is camera` \ --f alsa -i default -async 1 `# this is audio. Why not pulse? Nvidia?` \ --c:v h264_nvenc `# this is video codec` \ -video.mp4 # output file -#-filter_complex 'overlay=main_w-overlay_w:main_h-overlay_h' `# this is overlay` \ -#-f x11grab -framerate 30 -video_size 1920x1080 -i :0 `# this is screen` \