https://github.com/umstek/tv-media-conv
Bun + ffmpeg batch converter for TV-friendly MP4 (H.264 + AAC) with simple zero-padded filenames.
https://github.com/umstek/tv-media-conv
aac batch-converter bun ffmpeg ffmpeg-wrapper file-renamer h264 hardware-acceleration intel-qsv jellyfin media-converter media-server mp4 plex transcoding tv-shows typescript video-converter
Last synced: about 1 month ago
JSON representation
Bun + ffmpeg batch converter for TV-friendly MP4 (H.264 + AAC) with simple zero-padded filenames.
- Host: GitHub
- URL: https://github.com/umstek/tv-media-conv
- Owner: umstek
- Created: 2025-08-09T05:18:40.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2026-01-25T12:14:57.000Z (5 months ago)
- Last Synced: 2026-01-26T03:31:55.521Z (5 months ago)
- Topics: aac, batch-converter, bun, ffmpeg, ffmpeg-wrapper, file-renamer, h264, hardware-acceleration, intel-qsv, jellyfin, media-converter, media-server, mp4, plex, transcoding, tv-shows, typescript, video-converter
- Language: TypeScript
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# tv-media-conv
Bun + ffmpeg batch converter for TV-friendly MP4 (H.264 + AAC) with simple zero-padded filenames.
## Prerequisites
- Bun installed
- ffmpeg and ffprobe available on PATH
## Install
```bash
bun install
```
## Usage
### 1) Benchmark the machine
Detects hardware acceleration (Intel QSV, NVIDIA NVENC, AMD AMF) and measures CPU scaling, then writes `tv-media-conv.config.json`.
```bash
bun run index.ts benchmark --input
```
Optional: custom config path
```bash
bun run index.ts benchmark --input --config ./my.config.json
```
### 2) Convert a folder
Converts all videos under the input folder to MP4 (H.264 + AAC), output filenames `NNN.mp4` for proper TV sorting.
```bash
bun run index.ts convert --in "D:/Videos/My Show" --out "D:/Videos/My Show/TV"
```
Options:
- `--force`: overwrite existing outputs
- `--dry-run`: print planned actions without converting
- `--config `: use a specific config file
## Hardware Acceleration
The tool automatically detects and benchmarks available hardware acceleration:
- **Intel QSV** (Quick Sync Video): Uses `h264_qsv` encoder on Intel CPUs with integrated graphics
- **NVIDIA NVENC**: Uses `h264_nvenc` encoder on NVIDIA GPUs
- **AMD AMF** (Advanced Media Framework): Uses `h264_amf` encoder on AMD GPUs
Each hardware acceleration type runs one worker alongside CPU workers for maximum throughput. If hardware encoding fails for any file, it automatically falls back to CPU encoding.
Notes:
- Hardware acceleration significantly improves encoding speed (3-10x faster than CPU-only)
- Multiple hardware acceleration types can be active simultaneously if available
- Episode numbers are extracted heuristically from filenames (e.g. `S01E03`, `Ep 3`, `03 - title`, etc.).