# rembg_for_video
Uses [ffmpeg-python](https://github.com/kkroening/ffmpeg-python) and [rembg](https://github.com/danielgatis/rembg) to attempt removal of a background from a video file.
Based on project [rembg_from_video](https://github.com/seth-tribbey/rembg_from_video) by [seth-tribbey](https://github.com/seth-tribbey)
## Installation:
### For Newer Architecture (GeForce 1600+ Series)
```bash
python -m venv .venv
pip install -r requirements.txt
```
### For Pascal Arhitecture (GeForce 1000 Series)
```bash
python3.12 -m venv .venv
pip install -r requirements(3.12).txt
```
> **Script for fixing the cudnn path on Linux:**
> export LD_LIBRARY_PATH=/path/to/kakisalmi/.venv/lib/python3.12/site-packages/nvidia/cudnn/lib:$LD_LIBRARY_PATH
## Usage:
```
python .\rembg_video.py [-h] [--help] [-o] [--model] [--workers] [--smooth] [--smooth-workers] [--buffer-size] input
```
| Optional Arguments: |
| -o | Output path |
| -h --help | Show help |
| --model | Choose model for rembg |
| --workers | Number of concurrent process workers |
| --smooth | Size of window for temporal smoothing |
| --smooth-workers | Number of CPU threads for temporal smoothing |
| --buffer-size | Set size of processing buffer |
| Positional Arguments: |
| input | Input Video |