Intership @ Sympl Week 12
AI Image Scanning & Wrapping Up
Mon 24 - Fri 28 April:
Finetuning the FFmpeg script
While doing research into training a model and implementing it I stumbled upon a solution in the Cloudinary documentation. The Cloudinary service also had a way to let a powerful AI scan the image and find out the most interesting parts of the image.
When the AI had found the most interesting aprts of the pictures I could use the coordinates as parameters for the image cropping. Once it was implemented I was happy with the result. It needed some more funetuning but it was a good start.
Close to finished product
I was very close to having a finished product. Below is a copy of the command that is built after taking into account all the parameters that the user has set.
ffmpeg -loop 1 -t 8 -i https://res.cloudinary.com/dvf9otlzi/image/upload/v1687117667/szanlcdnidmmd5qitsst.jpg -loop 1 -t 8 -i https://res.cloudinary.com/dvf9otlzi/image/upload/v1687117669/uio1befhlwemn1lokfa5.jpg -loop 1 -t 8 -i https://res.cloudinary.com/dvf9otlzi/image/upload/v1687117671/wcgteqrjcayjxfltcrvp.jpg -loop 1 -t 8 -i https://res.cloudinary.com/dvf9otlzi/image/upload/v1687117673/l9g8y28kko0fg12vvez3.png -loop 1 -t 8 -i https://res.cloudinary.com/dvf9otlzi/image/upload/v1687117675/a6afipmlwn3htw59iohj.png -i logo/logo.png -i audio/track.mp3 -filter_complex "[0]scale=540*10:960*10:force_original_aspect_ratio=decrease,pad=540*10:960*10:(ow-iw)/2:(oh-ih)/2,
zoompan=z=pzoom+0.001:x=iw/2-iw/zoom/2:y=ih/2-ih/zoom/2:d=1:s=540x960,
drawbox= x=0:y=0:w=iw:h=82:color=#007156@1:t=fill,
drawbox= x=0:y=ih-82:w=iw:h=82:color=#007156@1:t=fill,
drawbox= x=0:y=0:w=iw:h=ih:color=#007156@1,
drawtext=text=WANTED:x=(w-text_w)/2:y=32:fontsize=38:fontcolor=white:fontfile=fonts/droid-sans-bold.ttf,
drawtext=text='Inspecteur Autokeuring':x=(w-text_w)/2:y=(h-text_h)-32:fontsize=30:fontcolor=white:fontfile=fonts/droid-sans-bold.ttf[v0]; [5]scale=100:100[logo_scaled]; [v0][logo_scaled]overlay=25:100[v0]; [1]scale=540*10:960*10:force_original_aspect_ratio=decrease,pad=540*10:960*10:(ow-iw)/2:(oh-ih)/2,
zoompan=z=pzoom+0.003:d=1:s=540x960,
drawbox= x=0:y=0:w=iw:h=ih:color=#007156@1,
drawtext=text=' Deze tekst is
normaal veeeel te
lang':x=(w-text_w)/2:y=(h-text_h)*0.75:fontsize=35:fontcolor=white:box=1:boxcolor=#007156@1:boxborderw=10:fontfile=fonts/droid-sans-bold.ttf[v1]; [5]scale=100:100[logo_scaled]; [v1][logo_scaled]overlay=25:25[v1]; [2]scale=540*10:960*10:force_original_aspect_ratio=decrease,pad=540*10:960*10:(ow-iw)/2:(oh-ih)/2,
zoompan=z=pzoom+0.001:x=iw/2-iw/zoom/2:y=ih/2-ih/zoom/2:d=1:s=540x960,
drawbox= x=0:y=0:w=iw:h=ih:color=#007156@1,
drawtext=text=' Aantrekkelijk
salaris':x=(w-text_w)/2:y=(h-text_h)*0.75:fontsize=35:fontcolor=white:box=1:boxcolor=#007156@1:boxborderw=10:fontfile=fonts/droid-sans-bold.ttf[v2]; [5]scale=100:100[logo_scaled]; [v2][logo_scaled]overlay=25:25[v2]; [3]scale=540*10:960*10:force_original_aspect_ratio=decrease,pad=540*10:960*10:(ow-iw)/2:(oh-ih)/2,
zoompan=z=pzoom+0.003:y=7200:d=1:s=540x960,
drawbox= x=0:y=0:w=iw:h=ih:color=#007156@1,
drawtext=text=' Mooie
werkomgeving':x=(w-text_w)/2:y=(h-text_h)*0.75:fontsize=35:fontcolor=white:box=1:boxcolor=#007156@1:boxborderw=10:fontfile=fonts/droid-sans-bold.ttf[v3]; [5]scale=100:100[logo_scaled]; [v3][logo_scaled]overlay=25:25[v3]; [4]scale=540:960:force_original_aspect_ratio=decrease,pad=540:960:(ow-iw)/2:(oh-ih)/2,
drawtext=text=Solliciteer nu!:x=(w-text_w)/2:y=(h-text_h)/2+150:fontsize=38:fontcolor=#007156:fontfile=fonts/droid-sans-bold.ttf[v4]; [5]scale=250:250[logo_scaled]; [v4][logo_scaled]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2[v4]; [v0][v1]xfade=transition=smoothright:duration=0.5:offset=2.5[f0]; [f0][v2]xfade=transition=distance:duration=0.5:offset=5[f1]; [f1][v3]xfade=transition=smoothright:duration=0.5:offset=7.5[f2]; [f2][v4]xfade=transition=pixelize:duration=0.5:offset=10[f3]" -y -map "[f3]" -r 25 -pix_fmt yuv420p -vcodec libx264 output-no-audio.mp4
And here is the output video created with the command above: