[FFmpeg-user] Image sequence with part pixelated with a mask

Ric Hunter richuntt at gmail.com
Sat Dec 2 06:34:43 EET 2023


Hello
I want to convert an image sequence (jpg) into a mp4 but i want some part
of the image sequence to be pixelated based on another mask image sequence
(jpg, the white being pixelated, the black being not, but it can be png
with alpha I don't mind, the simplest is the best)

After a lot of digging and reading through documentations, exemples and
what I could understand from it, I came up with that batch script (I want
to use a batch script)












*@echo offsetlocal enabledelayedexpansionset
input_folder=C:\ffmpegblurtst\basepicsset
mask_folder=C:\ffmpegblurtst\msk1set
output_folder=C:\ffmpegblurtst\outputset
filelist_path=%input_folder%\filelist.txtset
masklist_path=%mask_folder%\filelist.txtset
masksolo=%mask_folder%\realmask.pngset
output_file=%output_folder%\output.mp4ffmpeg -r 30 -safe 0 -f concat -i
"%filelist_path%" -i "%masklist_path%" -filter_complex
"[0]scale=16:12[scaled];[scaled]scale=640:480:flags=neighbor[pixelated];[1]scale=640:480[ms];[pixelated][ms]alphamerge[okalpha];[okalpha][0]overlay"
-c:v libx264 -pix_fmt yuv420p -b:v 10M "%output_file%"*


Seems logical to me, but turns out it doesn't work and even doesn't read
the image sequence of the mask. But even if I replace the image sequence
with only one still image it still doesn't work..
I'd like to keep it in a single line and not use temporary files since I'd
need to use this on thousands of frames.

Thanks


More information about the ffmpeg-user mailing list