Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7719 closed defect (invalid)

Extracting transparent PNGs from vp9a fails (vp8a works)

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

Description

Extracting transparent PNG files from a vp8a webm video with an alpha channel works. Extracting PNG files from a vp9a webm video with an alpha channel does not work.

How to reproduce:
With a vp8a, no issue...

% ffmpeg -vcodec libvpx -i vp8a.webm -pix_fmt rgba out/image_%d.png
> produces transparent PNGs

Fails with a vp9a webm video:

% ffmpeg -vcodec libvpx -i vp9a.webm -pix_fmt rgba out/image_%d.png
fmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10+deb8u2)
  configuration: --enable-gpl --enable-libx264 --enable-libx265 --enable-libwebp --enable-librsvg --enable-libvorbis --enable-libvpx --disable-network
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[libvpx @ 0x2d0c580] v1.8.0
[libvpx @ 0x2d0c580] Invalid sync code 430042.
[libvpx @ 0x2d0c580] Failed to decode frame: Bitstream not supported by this decoder
[libvpx @ 0x2d0c580] Invalid sync code 844e49.
[libvpx @ 0x2d0c580] Failed to decode frame: Bitstream not supported by this decoder

Versions:

ffmpeg version: 4.1 installed from source built on Debian 4.9.2-10+deb8u2
Also tried with ffmpeg from homebrew on a mac.

Here's ffprobe output for both vids:

ffprobe vp8a.webm 
ffprobe version 4.1 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10+deb8u2)
  configuration: --enable-gpl --enable-libx264 --enable-libx265 --enable-libwebp --enable-librsvg --enable-libvorbis --enable-libvpx --disable-network
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, matroska,webm, from 'vp8a.webm':
  Metadata:
    encoder         : libwebm-0.2.1.0
    creation_time   : 2019-02-07T21:34:38.000000Z
  Duration: 00:00:11.00, start: 0.000000, bitrate: 392 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p(progressive), 1080x1920, SAR 1:1 DAR 9:16, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1


ffprobe vp9a.webm
ffprobe version 4.1 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10+deb8u2)
  configuration: --enable-gpl --enable-libx264 --enable-libx265 --enable-libwebp --enable-librsvg --enable-libvorbis --enable-libvpx --disable-network
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, matroska,webm, from 'vp9a.webm':
  Metadata:
    encoder         : libwebm-0.2.1.0
    creation_time   : 2019-02-07T15:31:54.000000Z
  Duration: 00:00:11.00, start: 0.000000, bitrate: 281 kb/s
    Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv), 1080x1920, SAR 1:1 DAR 9:16, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1

Attachments (1)

vp9a.webm (377.7 KB ) - added by rroller 5 years ago.
vp9a file

Download all attachments as: .zip

Change History (10)

comment:1 by rroller, 5 years ago

Version: unspecified4.1

comment:2 by Carl Eugen Hoyos, 5 years ago

Keywords: vp9a webm png removed
Version: 4.1unspecified

Please provide a sample.

by rroller, 5 years ago

Attachment: vp9a.webm added

vp9a file

comment:4 by Gyan, 5 years ago

Resolution: invalid
Status: newclosed

The VPX decoder for VP9 bitstreams is invoked using -vcodec livbpx-vp9

comment:6 by Carl Eugen Hoyos, 5 years ago

comment:7 by rroller, 5 years ago

Just following up here in hopes it helps anyone who might run across this. I'm compiling both libvpx and ffmpeg from source. I needed to include --extra-libs="-lpthread -lm" to the ./configure of ffmpeg, without that, libvpx-vp9 wasn't picked up.

comment:8 by Carl Eugen Hoyos, 5 years ago

It seems unlikely that -lm was needed.

comment:9 by rroller, 5 years ago

Can you expand on that?
That single line makes the difference between working and not working.
I found it on https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

Without the line I get:

D.V.L. vp9                  Google VP9 

With:

DEV.L. vp9                  Google VP9 (decoders: vp9 libvpx-vp9 ) (encoders: libvpx-vp9 )
Last edited 5 years ago by rroller (previous) (diff)

comment:10 by rroller, 5 years ago

I understand what you are saying now. -lm isn't required, I verified. I only need --extra-libs="-lpthread"

Note: See TracTickets for help on using tickets.