웹 비디오에서 알파 채널 추출 56.

알파 투명도를 가진 webm 비디오에서 마스크를 추출하려고합니다.

ffmpeg -i test.webm -vf "alphaextract" -y output.mp4

하지만 오류가 발생했습니다.

[Parsed_alphaextract_2 @ 0x7f924b700d00] Requested planes not available.
[Parsed_alphaextract_2 @ 0x7f924b700d00] Failed to configure input pad on Parsed_alphaextract_2

내가 뭔가 잘못하고 있습니까? 문서 에 대한 alphaextract은 의외로 드물다.

ffprobe 판독 값 은 다음과 같습니다 .

ffprobe version 2.8.6 Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.6 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libvpx --enable-libopus --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, matroska,webm, from 'test.webm':
  Metadata:
    encoder         : Lavf56.40.101
  Duration: 00:00:05.00, start: 0.000000, bitrate: 407 kb/s
    Stream #0:0: Video: vp8, yuv420p, 480x244, SAR 1:1 DAR 120:61, 24 fps, 24 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1



답변

현재로서는 ffmpeg의 VP8 디코더 중 어느 것도 VP8 비디오 스트림에서 알파를 디코딩 할 수 없습니다. ffmpeg-user 메일 링리스트 의이 게시물 은 알파가 스트림 내에 저장 되는 비정상적인 방법 때문임을 시사합니다 .

webm-tools를 살펴볼 가치가 있습니다 .


답변

2016-07-20부터 알파 채널 (VP8a 또는 VP9a)을 사용하여 webm을 올바르게 디코딩 할 수 있지만 -vcodec libvpx옵션 이 필요합니다 . 해당 날짜 이후에 컴파일 된 FFmpeg 를 다운로드 하거나 최신 커밋으로 컴파일하고 다음 명령을 사용해야합니다.

ffmpeg -vcodec libvpx -i test.webm -vf alphaextract -y output.mp4

참고 -vcodec libvpx입니다 전에 입력하지 뒤에.


답변