ffmpeg : add mux cover.
This commit is contained in:
parent
3fa9f62f09
commit
f105776271
|
@ -485,6 +485,7 @@ Variable|Description
|
||||||
Command|Description
|
Command|Description
|
||||||
---|---
|
---|---
|
||||||
`ffmpeg_mux_audio <SOUND> <RESULT>`|Mux external audio into one container with video (replaces original audio). Run inside dir with original video. <SOUND> names should be the same for each video.
|
`ffmpeg_mux_audio <SOUND> <RESULT>`|Mux external audio into one container with video (replaces original audio). Run inside dir with original video. <SOUND> names should be the same for each video.
|
||||||
|
`ffmpeg_mux_cover <FORMAT> <COVER>`|Mux image into files of specified format.
|
||||||
|
|
||||||
## File.
|
## File.
|
||||||
|
|
||||||
|
|
|
@ -9,3 +9,21 @@ ffmpeg_mux_audio()
|
||||||
|
|
||||||
for file in *; do ffmpeg -i "$file" -i "$1"/"$file" -c copy -map 0:v:0 -map 1:a:0 -shortest "$2"/"$file"; done
|
for file in *; do ffmpeg -i "$file" -i "$1"/"$file" -c copy -map 0:v:0 -map 1:a:0 -shortest "$2"/"$file"; done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Mux cover into music file.
|
||||||
|
# Usage: ffmpeg_mux_cover <FORMAT> <COVER>
|
||||||
|
ffmpeg_mux_cover()
|
||||||
|
{
|
||||||
|
if [[ "${1}" = "" ]]; then
|
||||||
|
echo "Usage: ffmpeg_mux_cover <FORMAT> <COVER>"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir out
|
||||||
|
|
||||||
|
for file in *.${1}; do
|
||||||
|
ffmpeg -i "${file}" -i "${2}" -map 0:a -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/* . && rm -d out/ && rm "${2}"
|
||||||
|
}
|
||||||
|
|
Reference in a new issue