From 127ea108e09d885b8553a2ffb2844fb236ab3a53 Mon Sep 17 00:00:00 2001 From: home Date: Sat, 2 Dec 2023 22:31:36 +0300 Subject: [PATCH] ffmpeg : music meta add mka tags. --- .config/bash/module/ffmpeg.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/bash/module/ffmpeg.sh b/.config/bash/module/ffmpeg.sh index aa60eef..72ea3d7 100644 --- a/.config/bash/module/ffmpeg.sh +++ b/.config/bash/module/ffmpeg.sh @@ -25,7 +25,7 @@ ffmpeg_mux_cover() mkdir out for file in *.${format}; do - ffmpeg -i "${file}" -i "${cover}" -map 0 -map 0:-v -map 1 -codec copy -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" -disposition:v attached_pic ./out/"${file}" || return 1 + ffmpeg -i "${file}" -i "${cover}" -map 0 -map 0:-v? -map 1 -codec copy -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" -disposition:v attached_pic ./out/"${file}" || return 1 done mv out/* . @@ -48,6 +48,7 @@ ffmpeg_music_meta() local artist="${PWD%/*}"; artist="${artist##*/}"; artist="${artist//_/ }" local album="${PWD##*/}"; album="${album#*_}"; album="${album//_/ }" local year="${PWD##*/}"; year="${year%%_*}" + # local total=$(ls *.${format} | wc -l) mkdir out @@ -56,7 +57,7 @@ ffmpeg_music_meta() local title="${file#*_}"; title="${title%.*}"; title="${title//_/ }" # echo "${artist}; ${album}; ${year}; ${track}; ${title}" - ffmpeg -i "${file}" -map 0 -c copy -metadata "artist=${artist}" -metadata "album_artist=${artist}" -metadata "album=${album}" -metadata "date=${year}" -metadata "year=${year}" -metadata "track=${track}" -metadata "title=${title}" ./out/"${file}" || return 1 + ffmpeg -i "${file}" -map 0 -c copy -metadata "artist=${artist}" -metadata "album_artist=${artist}" -metadata "album=${album}" -metadata "date=${year}" -metadata "year=${year}" -metadata "date_released=${year}" -metadata "track=${track}" -metadata "part_number=${track}" -metadata "title=${title}" ./out/"${file}" || return 1 done mv out/* .