Metadata-Version: 2.4
Name: video2psp
Version: 0.4.0
Summary: CLI tool to convert videos into PSP-compatible MP4, with interactive track selection, subtitle burn-in, volume adjustment, and CRF-based quality control.
Home-page: https://github.com/ghurone/video2psp
Author: Erick Ghuron
Author-email: ghuron@usp.br
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-python
Dynamic: summary

# video2psp

**video2psp** is a Python CLI tool that converts videos to a PSP-compatible MP4 format, allowing you to select which audio and subtitle track to include (burned in) or optionally use an external subtitle file.

## Installation

1. Make sure you have [FFmpeg](https://ffmpeg.org/) (including `ffprobe`) installed and accessible in your system’s PATH.  
2. Clone or download this repository and run:
   ```bash
   pip install .
   ```
   This will install **video2psp** as a console command.

Or install using PyPI

```bash
pip install video2psp
```

## Usage

### GUI

Prefer a graphical interface? Run:
```bash
video2psp --gui
```
(`-g` also works). This opens a window where you can pick the input/output files, choose tracks, and tweak volume/preset/CRF without touching the terminal.

### CLI

With the tool installed, simply run:
```bash
video2psp <input_video> <output_video> [options]
```
- If you do **not** specify `--video-track`, `--audio-track` or `--subtitle-track`, the script will prompt you to pick which tracks to use.  
- To skip prompts, you can set them explicitly, for example:
  ```bash
  video2psp movie.mkv out.mp4 --video-track 0 --audio-track 0 --subtitle-track 1
  ```
- To burn an external subtitle file instead of an embedded track:
  ```bash
  video2psp movie.mkv out.mp4 --external-subs subs.srt
  ```
- To adjust audio volume (e.g. 150%):
  ```bash
  video2psp movie.mkv out.mp4 --volume 1.5
  ```
- To trade encoding speed for compression efficiency (default: `medium`):
  ```bash
  video2psp movie.mkv out.mp4 --preset veryfast
  ```
  Available presets (slowest/best compression to fastest): `veryslow`, `slower`, `slow`, `medium`, `fast`, `faster`, `veryfast`, `superfast`, `ultrafast`.
- To control video quality/file size via CRF (0-51, lower = higher quality and larger file, default: `23`):
  ```bash
  video2psp movie.mkv out.mp4 --crf 26
  ```
  Video is encoded at a constant quality target rather than a fixed bitrate, so simple scenes take up less space; `-maxrate`/`-bufsize` still cap the peak bitrate to respect the PSP's decoder buffer limits.
  
## Notes & Limitations

- The **PSP** typically supports H.264 Baseline Level 3.0 with AAC audio.  
- Resolution is scaled to fit within **480x272** (PSP screen size), preserving aspect ratio and padding with black bars as needed.  
- Only **one** video and audio track is included, and **one** subtitle track can be burned.  
- For image-based subtitles (like PGS or VobSub), you need to convert them to a text format (e.g., SRT) before burning.

Feel free to contribute or customize further. Enjoy converting videos for your PSP!
