looking for a library to load video with an alpha channel

Started by
7 comments, last by fanaticlatic 12 years, 9 months ago
Hi Folks,

The problem I have is that I want to be able to load in a video file (wholly or partially i.e. streaming) where the loaded frames contain an alpha channel. All the libraries (ffmpeg, ffdshow) that I can find do not seem to do this. I have found codecs that are capable of encoding the alpha information such as corePNG and MJpeg but then I would need to write an importer myself or I could use uncompressed AVI but then I would end up with HUGE filesizes.

Will I have to roll my own compression system to get the alpha channel when the video information is imported into my game or is there a library available for commercial use and preferably free already available????


thanks in advance,

Mark.
"I have more fingers in more pies than a leper at a bakery!"
Advertisement
You might wanna give libtheoraplayer playback library a try, free for commercial use and uses the Theora video format
-Jawshttp://uploading.com/files/eff2c24d/TGEpre.zip/
You sure about FFmpeg/Libav? I'm looking at the supported pixel formats and it supports RGBA.

You sure about FFmpeg/Libav? I'm looking at the supported pixel formats and it supports RGBA.


Do you have a link? I spent the better part of yesterday looking through FFmpeg and didn't notice anything that may support the RGBA format. 1 colour alpha won't do (green-screening) I need a full channel.


Thanks for the replies.

Mark.
"I have more fingers in more pies than a leper at a bakery!"

You sure about FFmpeg/Libav? I'm looking at the supported pixel formats and it supports RGBA.


Do you have a link? I spent the better part of yesterday looking through FFmpeg and didn't notice anything that may support the RGBA format. 1 colour alpha won't do (green-screening) I need a full channel.

Thanks for the replies.

Mark.




I called "ffmpeg -pix_fmt list" and it does indeed support argb, rgba, abgr, bgra formats for input and output. So the question then becomes does anyone know which codec ffmpeg uses to decode the video file when one of these formats is used as the input video pixel format?

I would also note that the four rgba versions are not hardware accelerated. Hardware acceleration would be very nice to have but not a deal breaker.


Thanks again.

Mark.
"I have more fingers in more pies than a leper at a bakery!"
Quicktime Animation format supports 32bit RGBA, its called Millions of Colors+ in the QuickTime interface. It is supported for decode and encode in the LibAVCodec library.


[quote name='Shael' timestamp='1311115967' post='4837681']
You sure about FFmpeg/Libav? I'm looking at the supported pixel formats and it supports RGBA.


Do you have a link? I spent the better part of yesterday looking through FFmpeg and didn't notice anything that may support the RGBA format. 1 colour alpha won't do (green-screening) I need a full channel.

Thanks for the replies.

Mark.




I called "ffmpeg -pix_fmt list" and it does indeed support argb, rgba, abgr, bgra formats for input and output. So the question then becomes does anyone know which codec ffmpeg uses to decode the video file when one of these formats is used as the input video pixel format?

I would also note that the four rgba versions are not hardware accelerated. Hardware acceleration would be very nice to have but not a deal breaker.


Thanks again.

Mark.
[/quote]

Quicktime Animation format supports 32bit RGBA, its called Millions of Colors+ in the QuickTime interface. It is supported for decode and encode in the LibAVCodec library.


I spotted this quicktime format as well but from what I read the quicktime animation codec has been superseded by the corePNG codec. I will need to do some checks on file size and speed etc but I think either the animation or corePNG sound like the best formats moving forward.


Thanks all.

Mark.
"I have more fingers in more pies than a leper at a bakery!"
I don't know what possessed me to read through the MPEG-4 standard:

http://mpeg.chiariglione.org/standards/mpeg-4/mpeg-4.htm
http://books.google.co.uk/books?id=ftRvA08WcM4C&pg=PA318&lpg=PA318&dq=mpeg+4+transparency&source=bl&ots=lX4hzZOjNx&sig=PqOMz8QuAjN6xJhueg-A-COSr6U&hl=en&ei=l_UmTsfCDoyYOuK3wNIK&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBcQ6AEwAA#v=onepage&q&f=false



but I did and it would seem it's exactly what I was after :) can anyone think why there aren't more examples of mpeg-4 being used as a video codec with alpha channels?

Are there licensing issues/costs?

Is it because it's a relatively new format, so adoption is fairly low right now?

Thanks in advance,

Mark.
"I have more fingers in more pies than a leper at a bakery!"

I don't know what possessed me to read through the MPEG-4 standard:

http://mpeg.chiarigl...eg-4/mpeg-4.htm
http://books.google....epage&q&f=false



but I did and it would seem it's exactly what I was after :) can anyone think why there aren't more examples of mpeg-4 being used as a video codec with alpha channels?

Are there licensing issues/costs?

Is it because it's a relatively new format, so adoption is fairly low right now?

Thanks in advance,

Mark.


Seems I spoke too soon.

On further inspection it seems I misunderstood that MPEG is merely a framework like OGG or AVI, which you store the encoded data from whichever codec you choose for compression.

So it seems that I actually need the codec to encode the data to retain the alpha. I can only find CorePNG that does this and its output file size is about 8 times what I would like it to be. Ideally I need an LGPL based codec similar to xVid ( can't use xVid as it is GPL and I don't think it supports alpha).

If anyone knows of any public domain / LGPL work going on in this area that may be of use please let me know.


"I have more fingers in more pies than a leper at a bakery!"

This topic is closed to new replies.

Advertisement