'video output to stream in mp4 format fail

I'm trying to output mp4 file from the input stream

ffmpeg -f mp4 -i pipe:0 -an -c:v libx264 -crf 18 -s 400x400 -q:v 3 -f mp4 pipe:1

and I'm getting

[mp4 @ 0x55a646cca340] muxer does not support non seekable output Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 -- Conversion failed!

When I convert to mpeg it works fine.

ffmpeg -f mp4 -i pipe:0 -an -c:v libx264 -crf 18 -s 400x400 -q:v 3 -f mpeg pipe:1

Is this mean that I cannot output to mp4? if so what is the best practice to convert video to be accepted from most browsers today?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source