1

I'm unable to extract frames from a 8K webp video.

I'm using ffmpeg to extract the frames and here is the command, I'm using.

ffmpeg -i /content/to_extract.webm frame%2d.webp

The output files, I'm getting don't have any data in them.

However, when i export to png instead of webm the files are okay, only extremely big in size.

ffmpeg -i /content/to_extract.webm frame%2d.png

Here's the verbose output :-

/bin/bash: line 0: cd: Extracted: No such file or directory
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Routing option format to both codec and muxer layer
Trailing options were found on the commandline.
Input #0, matroska,webm, from '/content/to_extract.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:03:38.70, start: 0.000000, bitrate: 38158 kb/s
    Stream #0:0(eng): Video: vp9 (Profile 0), 1 reference frame, yuv420p(tv, bt709), 7680x4320, SAR 1:1 DAR 16:9, 60 fps, 60 tbr, 1k tbn, 1k tbc (default)
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> webp (libwebp_anim))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x56383d1bf680] w:7680 h:4320 pixfmt:yuv420p tb:1/1000 fr:60/1 sar:1/1 sws_param:flags=2
Output #0, image2, to 'frame%2d.webp':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0(eng): Video: webp (libwebp_anim), 1 reference frame, yuv420p, 7680x4320 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 60 fps, 60 tbn, 60 tbc (default)
    Metadata:
      encoder         : Lavc57.107.100 libwebp_anim
WARNING: Converting frame from YUV(A) to ARGB format; this incurs a small loss.
WARNING: Converting frame from YUV(A) to ARGB format; this incurs a small loss.
INFO: Added frame. offset:0,0 dispose:0 blend:1
KABOOM
  • 45
  • 9

1 Answers1

2

Add -c:v libwebp:

ffmpeg -i input.webm -c:v libwebp output_%03d.webp

Otherwise with multiple frames it will default to -c:v libwebp_anim which puts all frames into one file (the last file in your case with the others being invalid).

llogan
  • 121,796
  • 28
  • 232
  • 243