Metadata-Version: 2.4
Name: raricode
Version: 0.2.1
Summary: An ffmpeg transcoding helper.
Author: Bearmine
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Dist: click>=8.4.1
Requires-Dist: shelltastic>=0.11.2
Requires-Dist: termtastic>=0.0.6
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# Raricode

An ffmpeg transcoding helper.

## Requirements

[FFmpeg](https://www.ffmpeg.org/) must be installed and available on your path.

## Installation

### Python

#### Pip

```sh
pip install raricode
```

#### PipX

```sh
pipx install raricode
```

### Shell Completions

See https://click.palletsprojects.com/en/stable/shell-completion/.

#### Bash

```bash
# Add to .bashrc
eval "$(_RARICODE_COMPLETE=bash_source raricode)"
```

#### Fish

```fish
# Add to fish completions
_RARICODE_COMPLETE=fish_source raricode | source
```

#### Zsh

```zsh
# Add to .zshrc
eval "$(_RARICODE_COMPLETE=zsh_source raricode)"
```

#### Powershell

```powershell
# Add this to your PowerShell profile (the path of $PROFILE)
$env:_RARICODE_COMPLETE = 'powershell_source'
raricode | Out-String | Invoke-Expression
Remove-Item Env:_RARICODE_COMPLETE
```

## Usage

See help for commands and flags.

```sh
raricode --help
```

### Example Usage

Below is an example ffmpeg command and the equivalent raricode commands.

```sh
# The below two commands are the same

# ffmpeg command
ffmpeg -i input.mkv -map 0 -c:v libsvtav1 -preset 4 -svtav1-params tile-columns=2:tile-rows=0:fast-decode=1 -b:v 2M -c:a libopus -b:a 128K -c:s copy -disposition:s:0 0 output.mkv

# raricode command
raricode transcode -i input.mkv -c:v libsvtav1 -f:v -preset 4 -f:v -svtav1-params tile-columns=2:tile-rows=0:fast-decode=1 -b:v 2M -c:a libopus -b:a 128K -c:s copy --disposition s:0 0 output.mkv
```

### Usefull features

#### Autocrop

For content with black bars, you can easy and automatically crop the video to remove them by adding `--autocrop` to you `raricode` command.

## Development

### Development Installation

Run in repo root:

```sh
uv tool install --editable .
```
