开发者

Convert raw image using open-source library with permissive license

I need to convert a raw, rgb32-formatted image to a PNG with a library (written in, in order of preference, Java, C, C++) having a permissive (e.g. BSD or Apache) license.

I'm able to convert the image using FFmpeg with this call:

ffmpeg.exe -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 20x40 -i infile -f image2 -vcodec png out.png

where 20x40 is the width by the height.

But, sadly, I need to avoid FFmpeg due to its license.

I've seen people speculate that libpng cou开发者_Go百科ld do the job, but I'm skeptical given the documentation I've seen at the libpng site. Perhaps you'll give an example.

I don't know what the rawvideo and rgb32 values mean to FFmpeg, so I asked this question.

EDIT 1: edited the ffmpeg call to show width x height.


Are you sure that you can't link ffmpeg into a proprietary application? According to http://ffmpeg.org/legal.html, most of ffmpeg is available under the GNU LGPL, which lets you link with proprietary programs, as long as you follow the "license compliance checklist" and don't use the GPL-only features.

If you don't want to dynamically link, look at ImageMagick, released under the permissive Apache license. ImageMagick appears to support reading from raw RGB images (see its list of formats.) It is written in C and has Java bindings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜