本文介绍了无法从WebM视频中提取WebP中的帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法从8K webp视频中提取帧.
I'm unable to extract frames from a 8K webp video.
我正在使用ffmpeg提取帧,这是我正在使用的命令.
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.
但是,当我导出为png而不是webm时,文件还可以,但尺寸非常大.
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
这是详细的输出:-
/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
推荐答案
添加 -c:v libwebp
:
ffmpeg -i input.webm -c:v libwebp output_%03d.webp
否则,如果有多个框架,它将默认为 -c:v libwebp_anim
,它将所有框架放入一个文件(您的情况下最后一个文件,其他文件无效).
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).
这篇关于无法从WebM视频中提取WebP中的帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!