I'm currently converting a video to a gif with the following command (taken from this example)
ffmpeg -y -ss 30 -t 3 -i input.flv \
-vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
ffmpeg -ss 30 -t 3 -i input.flv -i palette.png -filter_complex \
"fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
What I'm trying to accomplish is have text show on the top of the gif while it plays but I'm slightly confused as to how I add in the command below tweaked from this example
drawtext="fontfile=/path/to/font.ttf: \
text='Stack Overflow': fontcolor=black: x=160: y=-1"
You would insert it after the scaling but before the palette filters.
ffmpeg -y -ss 30 -t 3 -i input.flv \
-vf fps=10,scale=320:-1:flags=lanczos,drawtext="fontfile=/path/to/font.ttf: \
text='Stack Overflow': fontcolor=black: x=160: y=-1",palettegen palette.png
ffmpeg -ss 30 -t 3 -i input.flv -i palette.png -filter_complex \
"fps=10,scale=320:-1:flags=lanczos,drawtext="fontfile=/path/to/font.ttf: \
text='Stack Overflow': fontcolor=black: x=160: y=-1"[x];[x][1:v]paletteuse" output.gif
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다