On Fri, Jul 24, 2009 at 3:48 PM, Will Ross <[email protected]> wrote:

> On Jul 24, 2009, at 6:29 PM, Cai, Xin wrote:
>
>> hi guys
>> I am trying to save a frame to disk as a jpeg image. I used the SDL
>> tutorial, but that program saves the image as a ppm which is not naturally
>> supported by Microsoft. So how can I save it as a jpeg or a bmp (a for that
>> windows naively supports?) thanks.
>>
>> Xin Cai
>>
>
> I ran into a similar problem with OS X, and I found two solutions. One was
> to us netpbm (windows version here:
> http://gnuwin32.sourceforge.net/packages/netpbm.htm) to convert the PPM
> images to another format after they've been output. The other option is to
> build the bitmap yourself. I used the built in OS X facilities for this, but
> you could probably do it yourself by building the appropriate header and
> outputting the raw pixel data yourself. Might try looking at the Wikipedia
> entry on the BMP file format.
>  -Will Ross
>

libavcodec supports encoding to BMP and PNG. see files libavcodec/bmpenc.c
and libavcodec/pngenc.c respectively. Use CODEC_ID_BMP or CODEC_ID_PNG as
the second argument in your guess_format() call. There is also support for
Lossless JPEG (libavcodec/jpegls.c), but I couldn't find anything about
regular JPEG.


>
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to