mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 19:46:17 +01:00
23 lines
570 B
Plaintext
23 lines
570 B
Plaintext
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash -p ffmpeg
|
|
|
|
for file in *.flac; do
|
|
BASENAME="`basename "${file}" .flac`"
|
|
COVER="${BASENAME}-cover.jpg"
|
|
METADATA="${BASENAME}.meta"
|
|
|
|
echo "${BASENAME}"
|
|
echo $PATH
|
|
|
|
ffmpeg -y -i "${file}" -an -c:v mjpeg "${COVER}"
|
|
ffmpeg -i "${file}" -f ffmetadata "${METADATA}"
|
|
ogg-cover-art "${COVER}" >> "${METADATA}"
|
|
ffmpeg -i "${METADATA}" -i "${file}" -map_metadata 0 -b:a 320k -c:a libopus -map 1:a:0 "${BASENAME}.ogg"
|
|
rm "${COVER}"
|
|
rm "${METADATA}"
|
|
done
|
|
|
|
# Local Variables:
|
|
# mode: sh
|
|
# End:
|