Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#5792 closed defect (invalid)

Alpha planes not found/ignored decoding VP8a/VP9a (VPxa)

Reported by: cdlvcdlv Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug

Though FFmpeg is now able to fully decode VPxa, alpha planes are not used (as before), and VPxa videos are reported as yuv420p (not yuva420p).

Decoding VPxa alpha planes has been recently added

I opened a ticket (now closed) to request adding VP8a decoding to FFmpeg (though I didn't know how to express it to make myself understand). A few days later I found that Vignesh Venkatasubramanian had already coded it and was asking for including it in FFmpeg. I sent an e-mail to VV and he confirmed that his code had been commited yet. It's commit 134fe2898 (2016-07-20).

Nevertheless, I haven't been able to make it work. In Windows 7 and XP, I've tried latest Zeranoe's build, rogerdpack build and I've compiled natively FFmpeg in Windows to no avail.

VPxa versus another two codecs with transparency

First, I create 3 videos with alpha channel (mov/qtrle, avi/huffyuv and webm/VP8a) from the same animated PNG with transparency:

ffmpeg -i https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png -c:v libvpx ball+alpha.webm -c:v qtrle ball+alpha.mov -c:v huffyuv ball+alpha.avi

(I found out that -pix_fmt yuva420p -metadata:s:v:0 alpha_mode="1" is not necessary to make the VP8a video. Using Chrome, I verify that the transparency of the webm video works.)

Then I use ffplay to watch every video overlaid on testsrc filter:

ffplay -f lavfi -i testsrc -t 1 -vf movie=ball+alpha.mov[ov];[in][ov]overlay
ffplay -f lavfi -i testsrc -t 1 -vf movie=ball+alpha.avi[ov];[in][ov]overlay
ffplay -f lavfi -i testsrc -t 1 -vf movie=ball+alpha.webm[ov];[in][ov]overlay

The first two are right (just as if you use the original .png as value of movie filter). However, the third overlay is wrong (the background of the ball is a black rectangle, not testsrc).

I extracted the first frame of every video and uploaded them:

ffmpeg -f lavfi -i testsrc -i ball+alpha.mov -filter_complex [0][1]overlay -vframes 1 qtrle.png
ffmpeg -f lavfi -i testsrc -i ball+alpha.avi -filter_complex [0][1]overlay -vframes 1 huffyuv.png
ffmpeg -f lavfi -i testsrc -i ball+alpha.webm -filter_complex [0][1]overlay -vframes 1 VP8a.png

qtrle overlay frame
huffyuv overlay frame
VP8a overlay frame

Another way to check this issue is using alphaextract filter:

ffplay -i ball+alpha.mov -vf alphaextract
ffplay -i ball+alpha.avi -vf alphaextract
ffplay -i ball+alpha.webm -vf alphaextract

The first two work as expected, the third just stops with error (remember that it works fine in Chrome):

Input #0, matroska,webm, from 'ball+alpha.webm':B sq=    0B f=0/0
  Metadata:
    encoder         : Lavf57.47.101
  Duration: 00:00:01.50, start: 0.000000, bitrate: 115 kb/s
    Stream #0:0: Video: vp8, yuv420p, 100x100, SAR 1:1 DAR 1:1, 13.33 fps, 13.33
 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1
[Parsed_alphaextract_0 @ 0621e1a0] Requested planes not available.
[Parsed_alphaextract_0 @ 0621e1a0] Failed to configure input pad on Parsed_alpha

Test sample from Chome demo

You can also use one of the sample VP8a videos from http://simpl.info/videoalpha to check it:

wget http://simpl.info/videoalpha/video/soccer1.webm
ffplay -f lavfi -i "testsrc=size=640x480" -vf movie=soccer1.webm[ov];[in][ov]overlay

Or, if you have a fast connection (and machine):

ffmpeg -f lavfi -i "testsrc=size=640x480" -i http://simpl.info/videoalpha/video/soccer1.webm -filter_complex [0][1]overlay -f matroska - | ffplay -

soccer1.webm overlaid (grey rectangle)

Trying to use alphaextract with soccer1.webm stops also on error:

ffplay -i http://simpl.info/videoalpha/video/soccer1.webm -vf alphaextract
...
Input #0, matroska,webm, from 'http://simpl.info/videoalpha/video/soccer1.webm':

  Metadata:
    encoder         : libwebm-0.2.1.0
  Duration: 00:01:20.20, start: 0.000000, bitrate: 526 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p, 360x360, SAR 1:1 DAR 1:1, 30 fps, 30
tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1
[Parsed_alphaextract_0 @ 062b7f60] Requested planes not available.
[Parsed_alphaextract_0 @ 062b7f60] Failed to configure input pad on Parsed_alpha
extract_0
    nan M-V:    nan fd=   0 aq=    0KB vq=   58KB sq=    0B f=0/0

Summary

These videos were all VP8a, but the preceding applies also to VP9a.

It seems to me that the new decoder is not aware of the existence of the alpha planes (ffprobe says the videos are yuv420p, and alphaextract complaints of not finding the requested planes). Maybe I'd need to add an unknown option to make VV's commit work (I googled, but found no one). Then, my request would be of better documentation.

Builds used

ffmpeg compiled by me using rdp build helpers: 2016-08-20.

ffmpeg version N-81413-g45e5d5f Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/cygdrive/c/ffmpeg-
windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cr
oss_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --dis
able-w32threads --enable-libsoxr --enable-fontconfig --enable-libass --enable-li
bbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --
enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extr
a-libs=-lpng --enable-decklink --extra-libs=-loleaut32 --enable-libmp3lame --ena
ble-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheor
a --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enabl
e-libfreetype --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enabl
e-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-li
bvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --ena
ble-dxva2 --enable-avisynth --enable-gray --enable-libopenh264 --enable-nvenc --
enable-libebur128 --enable-netcdf --enable-libflite --enable-lzma --enable-libsn
appy --enable-libzimg --enable-gpl --enable-libx264 --enable-libx265 --enable-fr
ei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-
libxavs --enable-libxvid --extra-libs=-lpsapi --extra-libs=-lspeexdsp --extra-cf
lags='-mtune=core2' --extra-cflags=-O3 --enable-static --disable-shared --prefix
=/cygdrive/c/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_loc
al_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 --enable-nonfr
ee --enable-libfdk-aac --disable-libfaac --enable-runtime-cpudetect
libavutil      55. 29.100 / 55. 29.100
libavcodec     57. 54.100 / 57. 54.100
libavformat    57. 47.101 / 57. 47.101
libavdevice    57.  0.102 / 57.  0.102
libavfilter     6. 52.100 /  6. 52.100
libswscale      4.  1.100 /  4.  1.100
libswresample   2.  1.100 /  2.  1.100
libpostproc    54.  0.100 / 54.  0.100

rogerdpack builds (https://sourceforge.net/projects/ffmpegwindowsbi/) : 2016-08-12 (v3.1.2)

ffmpeg version n3.1.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/rdp/dev/ffm
peg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mi
ngw32- --pkg-config=pkg-config --disable-w32threads --enable-libsoxr --enable-fo
ntconfig --enable-libass --enable-libbluray --enable-iconv --enable-libtwolame -
-extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-lib
modplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-decklink --extra-libs=
-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp
--enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --e
nable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-bzli
b --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc
--enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --
enable-libwebp --enable-libgme --enable-dxva2 --enable-avisynth --enable-gray --
enable-libopenh264 --enable-nvenc --enable-libebur128 --enable-netcdf --enable-l
ibflite --enable-lzma --enable-libsnappy --enable-libzimg --enable-gpl --enable-
libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubb
erband --enable-libvidstab --enable-libxavs --enable-libxvid --extra-libs=-lpsap
i --extra-libs=-lspeexdsp --extra-cflags='-mtune=core2' --extra-cflags=-O3 --ena
ble-static --disable-shared --prefix=/home/rdp/dev/ffmpeg-windows-build-helpers/
sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 --enable-runtime-cpudete
ct
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100

Zeranoe build: 2016-08-21

ffmpeg version N-81423-g61fac0e Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva
2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libeb
ur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enabl
e-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreety
pe --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable
-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libop
enh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroe
dinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorb
is --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enabl
e-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --ena
ble-decklink --enable-zlib
libavutil      55. 29.100 / 55. 29.100
libavcodec     57. 54.100 / 57. 54.100
libavformat    57. 47.101 / 57. 47.101
libavdevice    57.  0.102 / 57.  0.102
libavfilter     6. 52.100 /  6. 52.100
libswscale      4.  1.100 /  4.  1.100
libswresample   2.  1.100 /  2.  1.100
libpostproc    54.  0.100 / 54.  0.100

Attachments (1)

VPxa.7z (291.8 KB) - added by cdlvcdlv 2 years ago.
Files created in the tests

Download all attachments as: .zip

Change History (3)

Changed 2 years ago by cdlvcdlv

Files created in the tests

comment:1 in reply to: ↑ description Changed 2 years ago by cehoyos

  • Keywords VP8a VP9a decoding alpha-planes removed
  • Resolution set to invalid
  • Status changed from new to closed

Replying to cdlvcdlv:

ffplay -i ball+alpha.webm -vf alphaextract

This needs -vcodec libvpx.

Please understand that this is not a support forum, and that separating the console output from the command only makes reading tickets much more difficult.
I opened ticket #5793 for the issue with the movie filter, work-around is to compile with --disable-decoder=vp8,vp9.

comment:2 Changed 2 years ago by cdlvcdlv

So that's the option I needed. Thank you.

This way it's possible to use overlay in ffmpeg to blend two videos or use alphaextract in ffplay, but I cannot make a proper overlay in ffplay because it accepts only one input. Then I must use movie filter, but I cannot specify the -vcodec libvpx.

As I said, I googled for an additional option to make the new decoder work but I didn't find it. Where was this documented? That's why I thought there was a problem and opened the ticket. Sorry.

I'll try the --disable-decoder=vp8,vp9 but I think that, when VPxa is used as input or in a filter, libvpx should be understood. Why would anyone want to overlay a video with alpha (no matter the codec) on a background ignoring the alpha planes? At least it's the improbable case.

Note: See TracTickets for help on using tickets.