I have followed other stackoverflow question and came up with following code , Still audio and video are not synching
$cmd = 'ffmpeg -i video/1.mp4 -c:v copy -af apad intermediate1.ts
ffmpeg -i video/2.mp4 -c:v copy -af apad intermediate1.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc '.$outpath;