I am having trouble combining these 4 passes in ffmpeg into a single process.
First
exec("$this->ffmpeg -i ".storage_path('/app/public_html/uploads/job.mp4')." -codec:a libmp3lame -b:a 128k -vf scale=".$res_dimension->res_width."x".$res_dimension->res_height.",setsar=1:1 ".storage_path('2.mp4'));
Second
exec("$this->ffmpeg -i ".storage_path($original_file_path)." -codec:a libmp3lame -b:a 128k -vf scale=".$res_dimension->res_width."x".$res_dimension->res_height.",setsar=1:1 ".storage_path('3.mp4'));
Third
exec("$this->ffmpeg -i ".storage_path('3.mp4')." -i ".storage_path('/app/public_html/uploads/images/index2.png')." -filter_complex 'overlay=20:20' ".storage_path('4.mp4'));
Forth
exec("$this->ffmpeg -i ".storage_path('2.mp4')." -i ".storage_path('3.mp4')." -filter_complex '[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' ".storage_path('out4.mp4'));