use FFMpeg to send BMPs to stdout

5,620

The problem is that in ffmpeg, BMP is not a file format. It's an encoder (as seen under ffmpeg -encoders). Normal BMP files can be written with the image2 muxer, but if you only want the raw video codec, you need the rawvideo format.

So, use something like this:

ffmpeg -i input.wmv -c:v bmp -f rawvideo -an - > output.bin
Share:
5,620

Related videos on Youtube

Brannon
Author by

Brannon

I was a professional software developer for many years before I decided that I wanted to be a CS professor instead. Companies I worked for in the past: LBRY, Autonomous Solutions (asirobots.com), Starbridge (now defunct), Journal Tech.

Updated on September 18, 2022

Comments

  • Brannon
    Brannon almost 2 years

    I see lots of examples using FFMpeg to make a video file from a set of images. I can also see how to do the opposite if I want individual files. However, I want the images to be pushed to stdout. This line fails:

    ffmpeg -hwaccel auto -i Wildlife.wmv -pix_fmt bgr24 -an -sn -f bmp - > junk.bin
    

    It says "Requested output format 'bmp' is not a suitable output format". However, this line works fine to generate image files:

    ffmpeg -hwaccel auto -i Wildlife.wmv -pix_fmt bgr24 -an -sn test%03d.bmp
    

    How can I get images pushed to stdout?

  • Glenn Slayden
    Glenn Slayden over 4 years
    Further discussion of this exact issue here.
  • Glenn Slayden
    Glenn Slayden over 4 years
    Followup question to your helpful answer... what's the difference between the image2 and image2pipe muxers in ffmpeg?
  • slhck
    slhck over 4 years
    @GlennSlayden image2 reads from actual files specified by filename; image2pipe reads from a pipe, that is, images piped via STDIN.
  • Glenn Slayden
    Glenn Slayden over 4 years
    Yes, sorry, my question should have been, why are separate binaries needed for that when external piping of stdin and/or stdout should be transparent to any program?
  • slhck
    slhck over 4 years
    @GlennSlayden Not sure I understand. You don't need separate binaries – just one ffmpeg. image2pipe is a fairly simple demuxer part of the image2 code, whereas image2 needs additional capabilities to deal with filenames.