✨ extract-cover: Extract cover from the given media file
This commit is contained in:
parent
a0c20e2c21
commit
03ea4024c9
1 changed files with 11 additions and 0 deletions
11
extract-cover
Executable file
11
extract-cover
Executable file
|
@ -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…
Add table
Add a link
Reference in a new issue