After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694078 - avenc_huffyuv does not respect alpha channel
avenc_huffyuv does not respect alpha channel
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-18 11:59 UTC by Dirk Van Haerenborgh
Modified: 2013-02-20 09:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dirk Van Haerenborgh 2013-02-18 11:59:29 UTC
When encoding video/x-raw,format=BGRA to huffyuv, the alpha channel is always blank.

This can be reproduced as follows:

* Take this huffyuv encoded rgba sample: http://samples.mplayerhq.hu/V-codecs/HuffYUV/camera2_hfyu32.avi (as found here https://ffmpeg.org/trac/ffmpeg/ticket/668)

* split of the alpha channel, and inspect that it is correct (it should be a mask that refines the 'wobbly' edges of the source video):
avconv -i camera2_hfyu32.avi -vf "[in] format=rgba, split [T1], fifo, lutrgb=r=minval:g=minval:b=minval,[T2] overlay [out]; [T1] fifo, lutrgb=r=maxval:g=maxval:b=maxval [T2]" alpha.avi

* decode and re-encode to huffyuv:
 gst-launch-1.0 filesrc location=camera2_hfyu32.avi ! avidemux ! avdec_huffyuv ! avenc_huffyuv ! avimux ! filesink location=newcamera2_hfyu32.avi

* split of the alpha of newcamera2_hfyu32.avi. It is all blank.


Re-encoding with libav itself works as expected:
avconv -i camera2_hfyu32.avi -vcodec huffyuv out.avi
Comment 1 Dirk Van Haerenborgh 2013-02-18 12:18:25 UTC
This seems to be originated from a preference of the huffyuv developer, as explained in [1], section 'Enable RGBA compression'.

It seems you have to explicitly set bgr32 (in the HYuvContext, [2]) to >0, in order to enable the alpha channel

[1] http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html

[2] http://git.libav.org/?p=libav.git;a=blob;f=libavcodec/huffyuv.h;h=c464d833c14d72cece19b5c2780fd32df48e8b9b;hb=HEAD
Comment 2 Dirk Van Haerenborgh 2013-02-19 12:32:32 UTC
Looking at the latest libav/ffmpeg releases, it seems that some developer has removed alpha channel support from huffyuv[1]. It currently only supports video/x-raw, format=BGRx/RGBx (depending on machine endianness).

[1]http://git.libav.org/?p=libav.git;a=commit;h=2ca5ca2957607cf9604cc6068a9ebc898ff37b06
Comment 3 Tim-Philipp Müller 2013-02-20 09:00:31 UTC
Sounds like this is NOTGNOME then until this functionality gets added back by the libav developers?
Comment 4 Dirk Van Haerenborgh 2013-02-20 09:10:12 UTC
Indeed.

Alpha support in huffyuvenc has recently been removed from libav (newer than what is included in gst-libav 1.0.5). It is still included properly in ffmpeg, so I filed a bug to libav yesterday.

So yes, this is NOTGNOME for sure until libav developers fix it.