Files
vektron 978bcf9478 Update scripts to make them more versatile:
- Support WAV
- Directories are now name original and converted
- Keep and copy mp3 and m4a files without reencoding them
- Fix mp3convert failing when there is no cover art
2026-06-05 22:08:26 +02:00

14 lines
331 B
Bash
Executable File

#!/bin/bash
INPUT_FILE="$1"
OUT_DIR="$2"
# get filename without extension
BASE_NAME="${INPUT_FILE##*/}"
# make filename with .mp3 extension
MP3_FILE="./${OUT_DIR}/${BASE_NAME%.*}.mp3"
mkdir -p "$OUT_DIR"
if [[ ! -f "$MP3" ]]; then
ffmpeg -i "$INPUT_FILE" -c:a libmp3lame -b:a 320K -map a:0 -map v:0? -c:v copy "$MP3_FILE"
fi