将图片/文件转为二维码动画

yum install qrencode 
test="$(cat dianlong.jpg| base64|tr '\n' ' '|sed 's/[[:space:]]//g')"
echo $test >> base64.txt #文件转base64
split -b 1k base64.txt 1_ #按1K分割
for x in $(find -type f  -name "1_*"); do cat $x|qrencode -o $x.png -s 4 ;done
ffmpeg -framerate 6  -pattern_type glob -i '1_*.png'  -loop 0 out1.gif #转GIF
ffmpeg -framerate 10  -pattern_type glob -i '1_*.png'  -c:v libx264 -pix_fmt yuv420p out.mp4
#计算帧数,验证
ffprobe -i out.mp4
ffmpeg -i out.mp4  -map 0✌️0 -c copy -f null -
ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 out.mp4

还原:

ffmpeg -i out1.gif re/img_%2d.jpg
base64 -d base64.txt >b.jpg