dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 221f0e96a12a085b106c151ba571a36636f96d26
parent 35e1059d8d3dcb67cc1795f2f9764f91c15de388
Author: hhvn <dev@hhvn.uk>
Date:   Mon,  5 Sep 2022 16:05:39 +0100

Scripts for handling cover art metadata

Diffstat:
A.scripts/tag/cover/set | 18++++++++++++++++++
A.scripts/tag/cover/view | 13+++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/.scripts/tag/cover/set b/.scripts/tag/cover/set @@ -0,0 +1,18 @@ +#!/bin/rc +# +# Add cover art to audio. +# +# usage: tag/cover/set <cover> files... + +cover = $1 +shift + +fn sigexit { + rm $tmp +} + +for (f in $*) { + tmp = /tmp/$pid.cover.`$nl{echo $f | tr / _} + ffmpeg -i $f -i $cover -map 0:0 -map 1:0 -codec copy -id3v2_version 3 -metadata:s:v title='Album cover' -metadata:s:v comment='Cover (front)' $tmp + mv $tmp $f +} diff --git a/.scripts/tag/cover/view b/.scripts/tag/cover/view @@ -0,0 +1,13 @@ +#!/bin/rc +# +# View cover art of a file with sxiv. +# +# usage: tag/cover/view file + +fn sigexit { + rm $tmp +} + +tmp = /tmp/$pid.view.jpg +ffmpeg -nostdin -y -i $1 -an $tmp +sxiv $tmp