Receiving FFMPEG error -22 when piping data to stdout

12,231

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.

Share:
12,231

Related videos on Youtube

dvlsg
Author by

dvlsg

Updated on September 18, 2022

Comments

  • dvlsg
    dvlsg over 1 year

    I am attempting to use FFMPEG to transcode avi files to mp4 and pipe the data to stdout using the following command (technically through NodeJS, but I receive the same error when executing the following command directly on the command line):

    ffmpeg -i myavi.avi -vcodec libx264 -acodec libvo_aacenc -f mp4 pipe:1
    

    This error will occur:

    Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred.
    

    When I execute this next command, everything works as expected:

    ffmpeg -i myavi.avi -vcodec libx264 -acodec libvo_aacenc -f mp4 newmp4.mp4
    

    Note that I am using (or attempting) FFMPEG on Windows -- Any ideas as to what's going on here?

    Edit: One last note, the version of FFMPEG I am using is N-63439-g96470ca, built on May 25, 2014 (the most recent version of FFMPEG available for the Windows Static files on http://ffmpeg.zeranoe.com/builds/).

  • dvlsg
    dvlsg about 10 years
    Makes sense. Is WebM a suitable format for piping? My real end goal is to stream to a Chromecast, and the devkit states that the only compatible streaming protocols at this point are MP4 and WebM. (Here is the Chromecast documentation I am referencing: developers.google.com/cast/docs/media)