3

I'm trying to encode a sequence of 32-bit 8bpc PNG images (RGB with an alpha channel) using the lossless VP9 codec with ffmpeg; specifically:

ffmpeg -framerate 60 -i out%04d.png -c:v libvpx-vp9 -lossless 1 -pix_fmt yuva420p output.webm

This seems to encode the video losslessly; however, when I run:

ffmpeg -i output.webm out%04d.png

the resulting PNG images that it spits out are missing the alpha channel (they are 24 bit, 8bpc)! What's going wrong here?

These are the files that I'm testing this on if you want to try it for yourself: https://drive.google.com/open?id=1IKThU4X_Ub1IqW-pnhds4Z_KwQEwUMtK

If it helps, I'm using this build of ffmpeg on Windows 10:

  built with gcc 9.1.1 (GCC) 20190621
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 30.100 / 56. 30.100
  libavcodec     58. 53.101 / 58. 53.101
  libavformat    58. 28.101 / 58. 28.101
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 55.100 /  7. 55.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100```

1 Answers1

6

The native VP9 decoder does not support alpha, so the VPX decoder has to be forced.

ffmpeg -c:v libvpx-vp9 -i output.webm out%04d.png
Gyan
  • 38,955