✨ extract-cover: Extract cover from the given media file
parent
a0c20e2c21
commit
03ea4024c9
@ -0,0 +1,11 @@
|
|||||||
|
#!/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
|
Loading…
Reference in New Issue