Receiving FFMPEG error -22 when piping data to stdout

the mp4 container requires the ability to seek within the file. A pipe is a stream, and impossible to seek inside of. Try using a streaming container like ts, or flv.