title: FFMpegCore C# read bytes from file
body: <p>I am trying to read byte array or stream from mp4/h264 file using <strong>&quot;FFMpegCore&quot;</strong> library.<br />
  I am trying to read file and store it into <code>fileStreamOnlyWithMedia</code> but I have error</p>
  <blockquote>
  <p>Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument&quot;</p>
  </blockquote>
  <pre class="lang-cs prettyprint-override"><code>var fileStreamOnlyWithMedia = new MemoryStream();
  
  FFMpegArguments
     .FromFileInput(filePath)
     .OutputToPipe(new StreamPipeSink(fileStreamOnlyWithMedia), options =&gt; options
        .WithVideoCodec(VideoCodec.LibX264).WithoutMetadata().ForceFormat(&quot;mp4&quot;).WithFastStart()).ProcessSynchronously();
  
  fileBytes = fileStreamOnlyWithMedia.ToArray();
  </code></pre>