1
0
Fork 0

anonradio: add ffmpeg transcode preset

Also provide token documentation and a real example.

Signed-off-by: Joseph B. Konno <thac0@tx0.org>
This commit is contained in:
Joseph B. Konno 2023-07-03 05:12:24 +00:00
parent 26ced8f59c
commit f97f3c2550
Signed by: thac0
GPG Key ID: 48A376816B9E0CD3
3 changed files with 34 additions and 0 deletions

20
anonradio/README.md Normal file
View File

@ -0,0 +1,20 @@
# aNONradio
For the coolest DJs on the interwebs.
The magic values for the encoder? They come from the [Open Mic page][openmic].
[openmic]: https://anonradio.net/openmic/
## ffmpeg
`transcode.ffpreset` shows how you provide arguments to ffmpeg in a file instead of the command line. In preset files, you can also add comments. Anyone who's spent any time with ffmpeg knows the argument list can get out of control quickly. Note this is a "generic" preset example-- you can get fancy by adding per-codec presets. If you want the full story, consult [the documentation][ffpresets].
`transcode.bash` just puts things together, and takes two positional arguments:
- input filename
- output filename
Example invocation:
- `$ bash transcode.bash sintel_trailer-audio.flac trailer.mp3`
[ffpresets]: https://ffmpeg.org/ffmpeg.html#Preset-files

10
anonradio/transcode.bash Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: 0BSD
if [ -z $1 ] || [ -z $2 ]; then
echo "ERROR: expecting 2 arguments: input file (1) and output file (2)"
exit 1
fi
FFMPEG_DATADIR="$PWD" \
ffmpeg -i "$1" -fpre transcode.ffpreset "$2"

View File

@ -0,0 +1,4 @@
acodec=libmp3lame
ac=2
ar=44100
b=192k