You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
336 B
Plaintext
12 lines
336 B
Plaintext
1 year ago
|
#!/bin/sh
|
||
|
# Extract cover image from the given media (e.g. M4B or MP3)
|
||
|
for fn in "$@"; do
|
||
|
cover_jpg="$(mktemp -u $(dirname "$fn")/cover-XXXXX.jpg)"
|
||
|
if ffmpeg -v error -i "$fn" -map 0:v -map -0:V -c copy "$cover_jpg"; then
|
||
|
echo "$cover_jpg"
|
||
|
else
|
||
|
rm -f "$cover_jpg"
|
||
|
echo "couldn't extract cover from $fn" >&2
|
||
|
fi
|
||
|
done
|