You can do this with ffmpeg:
mkfifo temp0 temp1
ffmpeg -i input0.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y temp0 2> /dev/null & \
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y temp1 2> /dev/null & \
ffmpeg -f mpegts -i "concat:temp0|temp1" -c copy -absf aac_adtstoasc output.mp4
This doesn't re-encode anything, it places them in a new transport stream container, which makes them more easy to concatenate, and then concatenates them back into an MP4. If output.mp4 already exists, the command will fail. The version above uses named pipes, if you're on a system that doesn't support those you'd have to use intermediate files (like windows):
ffmpeg -i input0.mp4 -c copy -bsf:v h264_mp4toannexb temp0.ts
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb temp1.ts
ffmpeg -i "concat:temp0.ts|temp1.ts" -c copy -bsf:a aac_adtstoasc output.mp4
See also http://stackoverflow.com/questions/7333232/concatenate-two-mp4-files-using-ffmpeg
– rogerdpack – 2014-10-16T18:15:03.333