[FFmpeg-devel] sgi without rle

Anne-Laure de Smit annelaure.desmit
Thu Sep 24 10:43:07 CEST 2009

On Thu, Sep 17, 2009 at 11:40 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:

> Anne-Laure de Smit wrote:
>> Hi,
>> I want to modify sgienc.c for that image sgi are not compressed (without
>> rle). How can I do this?
> First of all, look at sgidec.c to see in what compressed and uncompressed
> sgi images differs (and how uncompressed data is stored). Then, you need a
> way to specify through the command line if the user want compression or not.
> I suggest  "-compression_level" command line parameter that will set
> avctx->compression_level (as is done in tiffenc.c). Then, finally, in
> encode_frame(), just write the uncompressed data to the buffer if the
> avctx->compression_level is set to zero.
> -Vitor

Thank you very much for your help.
I propose the attached patch.
For use it:
Uncompressed images:
ffmpeg -i file.bmp -compression_level 0 out.sgi
RLE compressed images:
ffmpeg -i file.bmp -compression_level 1 out.sgi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sgienc.patch
Type: application/octet-stream
Size: 1198 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090924/eb8b8ab1/attachment.obj>

More information about the ffmpeg-devel mailing list