I've been trying for a while to figure out a way in which I can have FFMpeg input a flv url and output to stdout mp4.
Apparently mp4 requires to read the size of the file to fully work.
Is there a way in which I could use FFMpeg by piping it?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The MP4 muxer needs the ability to seek back in a stream to update the metadata after the stream is written. Seeking backwards is impossible on stdout—or pipes in general.
Hence, there's no way to pipe an MP4 container in a meaningful way. That does however not restrict you from using any specific codec, such as H.264 which is referred to as MPEG-4 (AVC) as well. Just make sure to use a container format that allows for streaming, such as MPEG-TS or Matroska.
If you are willing to accept a solution that does not truly stream the resulting frames, but does still adhere to your specification (read FLV from URL resource, output MP4 to stdout), you can always try to first encode the FLV to a temporary file and then output that to stdout.