The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Pixelize Part Of A Video With ffmpeg

TODO: Pull subtitle into page object
With pixelize (v6 and maybe earlier, not sure when)
F="[0:v]copy[base];";

F="$F[0:v]crop=200:100:50:50,pixelize=12:12[tmp];"
F="$F[base][tmp]overlay=50:50[base];"

F="$F[0:v]crop=200:100:350:50,pixelize=12:12[tmp];"
F="$F[base][tmp]overlay=350:50[base];"

F="$F[0:v]crop=200:100:350:350,pixelize=12:12[tmp];"
F="$F[base][tmp]overlay=350:350[base];"

ffmpeg -i "in.mp4" \
-filter_complex "$F" \
-map "[base]" \
-y out.mp4
Without pixelize (for when pixelize isn't avaialble)
#!/bin/bash

F="[0:v]copy[base];";

F="$F[0:v]crop=94:23:0:0,scale=iw/16:ih/16,scale=16*iw:16*ih:flags=neighbor[tmp];"
F="$F[base][tmp]overlay=0:0[base];"

F="$F[0:v]crop=72:52:6:47,scale=iw/16:ih/16,scale=16*iw:16*ih:flags=neighbor[tmp];"
F="$F[base][tmp]overlay=6:47[base];"

F="$F[0:v]crop=130:18:77:48,scale=iw/16:ih/16,scale=16*iw:16*ih:flags=neighbor[tmp];"
F="$F[base][tmp]overlay=77:48[base];"

ffmpeg -i "in.mp4" \
-filter_complex "$F" \
-map "[base]" \
-y out.mp4 \
&& open out.mp4



# F="[0:v]crop=94:23:0:0,boxblur=4[blur1];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur2];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur3];"

# F="$F[0:v]crop=200:100:50:50,pixelize=12:12[tmp];"
# F="$F[base][tmp]overlay=50:50[base];"

# F="$F[0:v]crop=200:100:350:50,pixelize=12:12[tmp];"
# F="$F[base][tmp]overlay=350:50[base];"

# F="$F[0:v]crop=200:100:350:350,pixelize=12:12[tmp];"
# F="$F[base][tmp]overlay=350:350[base];"

ffmpeg -i "in.mp4" \
-filter_complex "$F" \
-map "[base]" \
-y out.mp4

# F="$F[0:v]crop=300:300:20:20,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=20:20[base];"



# F="$F[0:v][blur1]overlay=113:4[blurred1];"
# F="[0:v]crop=94:23:0:0,boxblur=4[blur1];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur2];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur3];"
# F="$F[blurred1][blur2]overlay=6:47[blurred2];"
# F="$F[blurred2][blur3]overlay=77:48"

# F="[0:v]copy[base];";
# F="$F[0:v]crop=94:23:0:0,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=113:4[base];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=6:47[base];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=77:48[base];"

# F="[0:v]copy[base];";
# F="$F[0:v]crop=94:23:0:0,boxblur=4[blur0];"
# F="$F[base][blur0]overlay=113:4[base];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur1];"
# F="$F[base][blur1]overlay=6:47[base];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur2];"
# F="$F[base][blur2]overlay=77:48[base]"


# F="[0:v]crop=94:23:0:0,boxblur=4[blur0];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur1];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur2];"
# F="$F[0:v]copy[base];";
# F="$F[base][blur0]overlay=113:4[base];"
# F="$F[base][blur1]overlay=6:47[base];"
# F="$F[base][blur2]overlay=77:48[base];"




# -filter_complex "[0:v]crop=94:23:0:0,boxblur=4[blur1];[0:v][blur1]overlay=113:4[blurred1];[0:v]crop=72:52:6:47,boxblur=4[blur2];[blurred1][blur2]overlay=6:47[blurred2];[0:v]crop=130:18:77:48,boxblur=4[blur3];[blurred2][blur3]overlay=77:48" \
#
# -map "[outv]"

# -filter_complex "[0:v]crop=200:200:300:300,boxblur=10[blur1];[0:v][blur1]overlay=300:300[blurred1];[0:v]crop=200:200:600:600,boxblur=10[blur2];[blurred1][blur2]overlay=600:600" \

#-filter_complex "[0:v]crop=200:200:300:300,boxblur=10[blur1];[0:v][blur1]overlay=300:300" \

#-filter_complex "[0:v]crop=94:23:113:4,boxblur=4[blur1];[0:v]crop=72:52:6:47,boxblur=4[blur2];[0:v]crop=130:18:77:48,boxblur=4[blur3];[0:v][blur1]overlay=100:100[bg1];[bg1][blur2]overlay=100:100[bg2];[bg2][blur3]overlay=100:100" \

#-filter_complex "[0:v]crop=94:23:113:14,boxblur=4[blur1];[0:v][blur1]overlay=50:50" \
#-filter_complex "[0:v]crop=94:23:113:4,boxblur=10[blur1]; [0:v]crop=72:52:6:47,boxblur=10[blur2]; [0:v]crop=130:18:77:48,boxblur=10[blur3]; [0:v][blur1]overlay=0:0[bg];[bg][blur2]overlay=0:0[bg2];[bg2][blur3]overlay=0:0" \
#;[0:v]crop=100:50:100:50,boxblur=10[blur2]; [0:v][blur1]overlay=140:175[bg];[bg][blur2]overlay=50:50" \



# ffmpeg -i ACCT.mp4 \
# -filter_complex "[0:v]crop=850:100:140:175,boxblur=10[blur1];[0:v]crop=100:50:100:50,boxblur=10[blur2]; [0:v][blur1]overlay=140:175[bg];[bg][blur2]overlay=50:50" \
# -c:a copy \
# blurredVideo.mp4




Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Pixelize Part Of A Video With ffmpeg

-- code
-- title: With pixelize (v6 and maybe earlier, not sure when)

F="[0:v]copy[base];";

F="$F[0:v]crop=200:100:50:50,pixelize=12:12[tmp];"
F="$F[base][tmp]overlay=50:50[base];"

F="$F[0:v]crop=200:100:350:50,pixelize=12:12[tmp];"
F="$F[base][tmp]overlay=350:50[base];"

F="$F[0:v]crop=200:100:350:350,pixelize=12:12[tmp];"
F="$F[base][tmp]overlay=350:350[base];"

ffmpeg -i "in.mp4" \
-filter_complex "$F" \
-map "[base]" \
-y out.mp4


-- code
-- title: Without pixelize (for when pixelize isn't avaialble)

#!/bin/bash

F="[0:v]copy[base];";

F="$F[0:v]crop=94:23:0:0,scale=iw/16:ih/16,scale=16*iw:16*ih:flags=neighbor[tmp];"
F="$F[base][tmp]overlay=0:0[base];"

F="$F[0:v]crop=72:52:6:47,scale=iw/16:ih/16,scale=16*iw:16*ih:flags=neighbor[tmp];"
F="$F[base][tmp]overlay=6:47[base];"

F="$F[0:v]crop=130:18:77:48,scale=iw/16:ih/16,scale=16*iw:16*ih:flags=neighbor[tmp];"
F="$F[base][tmp]overlay=77:48[base];"

ffmpeg -i "in.mp4" \
-filter_complex "$F" \
-map "[base]" \
-y out.mp4 \
&& open out.mp4



# F="[0:v]crop=94:23:0:0,boxblur=4[blur1];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur2];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur3];"

# F="$F[0:v]crop=200:100:50:50,pixelize=12:12[tmp];"
# F="$F[base][tmp]overlay=50:50[base];"

# F="$F[0:v]crop=200:100:350:50,pixelize=12:12[tmp];"
# F="$F[base][tmp]overlay=350:50[base];"

# F="$F[0:v]crop=200:100:350:350,pixelize=12:12[tmp];"
# F="$F[base][tmp]overlay=350:350[base];"

ffmpeg -i "in.mp4" \
-filter_complex "$F" \
-map "[base]" \
-y out.mp4

# F="$F[0:v]crop=300:300:20:20,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=20:20[base];"



# F="$F[0:v][blur1]overlay=113:4[blurred1];"
# F="[0:v]crop=94:23:0:0,boxblur=4[blur1];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur2];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur3];"
# F="$F[blurred1][blur2]overlay=6:47[blurred2];"
# F="$F[blurred2][blur3]overlay=77:48"

# F="[0:v]copy[base];";
# F="$F[0:v]crop=94:23:0:0,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=113:4[base];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=6:47[base];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[tmp];"
# F="$F[base][tmp]overlay=77:48[base];"

# F="[0:v]copy[base];";
# F="$F[0:v]crop=94:23:0:0,boxblur=4[blur0];"
# F="$F[base][blur0]overlay=113:4[base];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur1];"
# F="$F[base][blur1]overlay=6:47[base];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur2];"
# F="$F[base][blur2]overlay=77:48[base]"


# F="[0:v]crop=94:23:0:0,boxblur=4[blur0];"
# F="$F[0:v]crop=72:52:6:47,boxblur=4[blur1];"
# F="$F[0:v]crop=130:18:77:48,boxblur=4[blur2];"
# F="$F[0:v]copy[base];";
# F="$F[base][blur0]overlay=113:4[base];"
# F="$F[base][blur1]overlay=6:47[base];"
# F="$F[base][blur2]overlay=77:48[base];"




# -filter_complex "[0:v]crop=94:23:0:0,boxblur=4[blur1];[0:v][blur1]overlay=113:4[blurred1];[0:v]crop=72:52:6:47,boxblur=4[blur2];[blurred1][blur2]overlay=6:47[blurred2];[0:v]crop=130:18:77:48,boxblur=4[blur3];[blurred2][blur3]overlay=77:48" \
#
# -map "[outv]"

# -filter_complex "[0:v]crop=200:200:300:300,boxblur=10[blur1];[0:v][blur1]overlay=300:300[blurred1];[0:v]crop=200:200:600:600,boxblur=10[blur2];[blurred1][blur2]overlay=600:600" \

#-filter_complex "[0:v]crop=200:200:300:300,boxblur=10[blur1];[0:v][blur1]overlay=300:300" \

#-filter_complex "[0:v]crop=94:23:113:4,boxblur=4[blur1];[0:v]crop=72:52:6:47,boxblur=4[blur2];[0:v]crop=130:18:77:48,boxblur=4[blur3];[0:v][blur1]overlay=100:100[bg1];[bg1][blur2]overlay=100:100[bg2];[bg2][blur3]overlay=100:100" \

#-filter_complex "[0:v]crop=94:23:113:14,boxblur=4[blur1];[0:v][blur1]overlay=50:50" \
#-filter_complex "[0:v]crop=94:23:113:4,boxblur=10[blur1]; [0:v]crop=72:52:6:47,boxblur=10[blur2]; [0:v]crop=130:18:77:48,boxblur=10[blur3]; [0:v][blur1]overlay=0:0[bg];[bg][blur2]overlay=0:0[bg2];[bg2][blur3]overlay=0:0" \
#;[0:v]crop=100:50:100:50,boxblur=10[blur2]; [0:v][blur1]overlay=140:175[bg];[bg][blur2]overlay=50:50" \



# ffmpeg -i ACCT.mp4 \
# -filter_complex "[0:v]crop=850:100:140:175,boxblur=10[blur1];[0:v]crop=100:50:100:50,boxblur=10[blur2]; [0:v][blur1]overlay=140:175[bg];[bg][blur2]overlay=50:50" \
# -c:a copy \
# blurredVideo.mp4






-- categories
-- ffmpeg 
-- Command Line 

-- metadata
-- date: 2023-09-16 03:21:21
-- id: 2vt8o9tz
-- site: aws
-- type: post
-- status: scratch