f
This commit is contained in:
parent
abe6f6cf5f
commit
e1ebfb9f0c
|
@ -37,22 +37,23 @@ ffmpeg_mux_cover()
|
||||||
ffmpeg_music_meta()
|
ffmpeg_music_meta()
|
||||||
{
|
{
|
||||||
if [[ "${1}" = "" ]]; then
|
if [[ "${1}" = "" ]]; then
|
||||||
echo "Usage: ffmpeg_mux_cover <FORMAT> <COVER>"
|
echo "Usage: ffmpeg_music_meta <FORMAT>"
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local format="${1}"
|
local format="${1}"
|
||||||
|
|
||||||
local artist="${PWD%/*}"; artist="${artist##*/}"
|
local artist="${PWD%/*}"; artist="${artist##*/}"; artist="${artist//_/ }"
|
||||||
local album="${PWD##*/}"; album="${album#*_}"
|
local album="${PWD##*/}"; album="${album#*_}"; album="${album//_/ }"
|
||||||
local year="${PWD##*/}"; year="${year%%_*}"
|
local year="${PWD##*/}"; year="${year%%_*}"
|
||||||
|
|
||||||
mkdir out
|
mkdir out
|
||||||
|
|
||||||
for file in *.${format}; do
|
for file in *.${format}; do
|
||||||
local track="${file%%_*}"
|
local track="${file%%_*}"; track=$((10#${track})); [[ "${track}" = "" ]] && track=0
|
||||||
local title="${file#*_}"; title="${title%.*}"
|
local title="${file#*_}"; title="${title%.*}"; title="${title//_/ }"
|
||||||
|
|
||||||
|
# echo "${artist}; ${album}; ${year}; ${track}; ${title}"
|
||||||
ffmpeg -i "${file}" -c copy -metadata "artist=${artist}" -metadata "album_artist=${artist}" -metadata "album=${album}" -metadata "date=${year}" -metadata "track=${track}" -metadata "title=${title}" ./out/"${file}" || return 1
|
ffmpeg -i "${file}" -c copy -metadata "artist=${artist}" -metadata "album_artist=${artist}" -metadata "album=${album}" -metadata "date=${year}" -metadata "track=${track}" -metadata "title=${title}" ./out/"${file}" || return 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Reference in a new issue