working, but stops part way thru
This commit is contained in:
parent
e2cf21bdfa
commit
13032ccb09
47
run.sh
47
run.sh
@ -1,44 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Tehcnically, this works. However, the static needs to scan from one side to the
|
X=200
|
||||||
# other so you can see the difference in the two
|
Y=70
|
||||||
|
|
||||||
X=100
|
|
||||||
Y=50
|
|
||||||
FRAMES=10
|
|
||||||
|
|
||||||
# Create the mask
|
# Create the mask
|
||||||
convert \
|
convert \
|
||||||
-background none -fill black \
|
-background none -fill black \
|
||||||
-pointsize 24 -size ${X}x${Y} -gravity center \
|
-pointsize 60 -size ${X}x${Y} -gravity center \
|
||||||
label:TEST1 mask.png
|
label:TEST1 mask.png
|
||||||
|
|
||||||
# create pictures of static
|
# Create large static image
|
||||||
mkdir -p back fore out
|
convert -size 2000x${Y} canvas: +noise Random -monochrome -alpha off background.png
|
||||||
for i in $(seq 1 $FRAMES); do
|
|
||||||
convert -size ${X}x${Y} canvas: +noise Random -monochrome back/${i}.png
|
|
||||||
# Generate image of static, then mask it out using the mask.png
|
|
||||||
convert -size ${X}x${Y} canvas: +noise Random -monochrome mask.png -compose CopyOpacity -composite fore/${i}.png
|
|
||||||
done
|
|
||||||
|
|
||||||
for i in $(seq 1 $FRAMES); do
|
# Create video
|
||||||
# Layer the two images
|
ffmpeg -y -framerate 60 -loop true -t 10 -i background.png -i mask.png \
|
||||||
convert back/$i.png fore/1.png -gravity center -background None -layers Flatten out/$i.png
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
# create gif
|
|
||||||
# convert -delay 1 -loop 0 out/* out.gif
|
|
||||||
|
|
||||||
# try video
|
|
||||||
convert -size 1920x50 canvas: +noise Random -monochrome -alpha off background.png
|
|
||||||
|
|
||||||
ffmpeg -y -framerate 30 -loop true -t 10 -i background.png -i mask.png -i background.png \
|
|
||||||
-filter_complex "
|
-filter_complex "
|
||||||
[0]crop=x=n:w=${X}:h=${Y}[bg];
|
[0] crop=x=n:w=${X}:h=${Y} [bg];
|
||||||
[2]crop=x=iw-n:w=${X}:h=${Y}[fg];
|
[0] crop=x=out_w-n:w=${X}:h=${Y} [fg];
|
||||||
[1]alphaextract[mask];
|
[1] alphaextract [mask];
|
||||||
[fg][mask]alphamerge[top];
|
[fg][mask] alphamerge [text];
|
||||||
[bg][top]overlay=x=0:y=0"\
|
[bg][text] overlay"\
|
||||||
-c:v libx264 out.mp4
|
-c:v libx264 -crf 10 -an out.mp4
|
||||||
|
|
||||||
|
# rm *.png
|
||||||
|
Loading…
Reference in New Issue
Block a user