[bugfix] cover function

This commit is contained in:
Klesh Wong 2020-12-20 10:56:53 +08:00
parent 077c42b9ec
commit 397f06bedf
2 changed files with 9 additions and 10 deletions

View File

@ -13,7 +13,7 @@ function cut -a infile from to outfile -d "cut out portion to new media file"
help
exit 1
end
ffmpeg -ss $from -i $infile -t to -c copy $outfile
ffmpeg -ss $from -i $infile -t $to -c copy $outfile
end
function cover -a infile outfile title gravity x y -d "create cover"
@ -32,7 +32,7 @@ function cover -a infile outfile title gravity x y -d "create cover"
-pointsize 120 -font "$SC_FONT" \
-fill '#fdf6e3' -stroke '#fdf6e3' -strokewidth 40 \
-annotate +$x+$y "$title"\
-fill '#839496' -stroke '#839496' -strokewidth 5 \
-fill '#839496' -stroke '#839496' -strokewidth 0 \
-annotate +$x+$y "$title"\
$outfile
end
@ -45,7 +45,6 @@ function chapter -a infile outfile title duration gravity -d "prepend chapter to
test -z $duration && set duration 3
set tmpjpeg /tmp/tmpjpeg.jpg
set tmpcover /tmp/tmpcover.jpg
set tmpchapter /tmp/chapter.mp4
ffmpeg -i $infile -vframes 1 -f image2 -y $tmpjpeg
cover $tmpjpeg $tmpcover $title
ffmpeg \
@ -57,8 +56,7 @@ function chapter -a infile outfile title duration gravity -d "prepend chapter to
[1:v][v0]overlay" \
-c:v h264 -crf 0 -preset ultrafast -pix_fmt yuv444p \
-t 5 \
-y $tmpchapter
join $outfile $tmpchapter $infile
-y $outfile
preview $outfile
end
@ -89,6 +87,7 @@ function help
echo " commads:"
echo " preview <infile>"
echo " cut <infile> <from> <to>"
echo " cover <infile> <outfile> <title>"
echo " chapter <infile> <title>"
echo " join <outfiles> <...infiles>"
echo " concat <indir> <outfile>"
@ -100,7 +99,7 @@ if test (count $argv) -lt 2
end
switch $argv[1]
case preview cut join concat chapter help
case preview cut join concat cover chapter help
$argv
case "*"
help

View File

@ -11,10 +11,10 @@ function mark_end()
end
function output_marked()
--if not begin_pos and not end_pos then
--mp.osd_message('Please set Begin Position with Ctrl-b, End Position with Ctrl-e')
--return
--end
if not begin_pos and not end_pos then
mp.osd_message('Please set Begin Position with Ctrl-b, End Position with Ctrl-e')
return
end
ss = begin_pos or 0
t = end_pos or mp.get_property('duration')
path = mp.get_property('path')