LINUX.ORG.RU

ffmpeg не конвертирует в webm

 ,


0

1

Gentoo, конвертирую:

ffmpeg -i filein.mp4 -strict -2 fileout.webm

не идёт:

[vorbis @ 0xaaaaeeb0f600] Current FFmpeg Vorbis encoder only supports 2 channels.
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

Что можно предпринять?

★★

у меня тоже идет:

$ ffmpeg -i 'input.mp4' -strict -2 fileout.webm
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 10 (GCC)

  Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
  Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))

[libopus @ 0x55a43714a000] No bit rate set. Defaulting to 96000 bps.
[libvpx-vp9 @ 0x55a437170f80] v1.8.2

Output #0, webm, to 'fileout.webm':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: vp9 (libvpx-vp9), yuv420p, 720x344 [SAR 1:1 DAR 90:43], q=-1--1, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc58.54.100 libvpx-vp9
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: opus (libopus), 48000 Hz, stereo, flt, 96 kb/s (default)
    Metadata:
      encoder         : Lavc58.54.100 libopus
frame=   58 fps= 14 q=0.0 Lsize=      73kB time=00:00:02.53 bitrate= 235.7kbits/s speed=0.608x    
video:42kB audio:28kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.998151%

anonymous ()
Ответ на: комментарий от Rx0
ffmpeg -i filein.mp4 -strict -2 fileout.webm
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.0 (Gentoo 9.2.0-r2 p3)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-4.2.2/html --mandir=/usr/share/man --enable-shared --cc=aarch64-unknown-linux-gnu-gcc --cxx=aarch64-unknown-linux-gnu-g++ --ar=aarch64-unknown-linux-gnu-ar --optflags='-march=armv8-a+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer' --enable-static --enable-avfilter --enable-avresample --disable-stripping --disable-optimizations --disable-libcelt --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --enable-bzlib --enable-runtime-cpudetect --disable-debug --disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv --disable-libtls --enable-libxml2 --enable-lzma --enable-network --disable-opencl --disable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi --disable-vdpau --disable-xlib --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-zlib --disable-libcdio --enable-libiec61883 --disable-libdc1394 --enable-libcaca --disable-openal --disable-opengl --enable-libv4l2 --disable-libpulse --enable-libdrm --disable-libjack --disable-libopencore-amrwb --disable-libopencore-amrnb --enable-libcodec2 --disable-libdav1d --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libgme --disable-libgsm --disable-libaribb24 --disable-mmal --disable-libmodplug --disable-libopus --enable-libilbc --enable-librtmp --enable-libssh --disable-libspeex --disable-libsrt --disable-librsvg --disable-ffnvcodec --enable-libvorbis --disable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-cuda-llvm --disable-libflite --enable-frei0r --disable-libfribidi --disable-fontconfig --disable-ladspa --enable-libass --disable-libtesseract --enable-lv2 --disable-libfreetype --disable-libvidstab --disable-librubberband --disable-libzmq --disable-libzimg --enable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --enable-libkvazaar --enable-libaom --enable-libopenh264 --disable-libsnappy --enable-libtheora --enable-libtwolame --disable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-amd3dnow --disable-amd3dnowext --disable-aesni --disable-avx --disable-avx2 --disable-fma3 --disable-fma4 --disable-mmx --disable-mmxext --disable-sse --disable-sse2 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-xop --cpu=armv8-a+crc --disable-doc --disable-htmlpages --enable-manpages
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'telfer.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:04:07.03, start: 0.000000, bitrate: 4287 kb/s
    Stream #0:0(und): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuvj422p(pc), 1280x720, 4212 kb/s, 30.02 fps, 30.02 tbr, 500k tbn, 60.03 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 69 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> vp8 (vp8_v4l2m2m))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[vp8_v4l2m2m @ 0xaaaaf7a1a6d0] driver 'uvcvideo' on card 'USB 2.0 Camera: USB Camera'
    Last message repeated 1 times
[vp8_v4l2m2m @ 0xaaaaf7a1a6d0] driver 'cedrus' on card 'cedrus'
[vp8_v4l2m2m @ 0xaaaaf7a1a6d0] Could not find a valid device
[vp8_v4l2m2m @ 0xaaaaf7a1a6d0] can't configure encoder
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[libvorbis @ 0xaaaaf7a195e0] 26 frames left in the queue on closing
Conversion failed!
burato ★★ ()
Ответ на: комментарий от burato

Could not find a valid device

Покажи вывод:

$ ffmpeg -codecs | grep "vp[8-9]"

У тебя выключен libvpx –disable-libvpx

Для программного кодирования VP8/VP9 вам нужно включить при сборке ffmpeg libvpx –enable-libvpx.

Rx0 ()
Последнее исправление: Rx0 (всего исправлений: 1)
Ответ на: комментарий от MrClon

с use-флагами

И никто из них эти флаги не знает? Интересно тогда, что означает use? На ffmpeg мало шансов вмазаться в use-, только если у тебя совсем нету X-ов либо SDL, но и это предусматривается параметрами ./configure.

anonymous ()
Ответ на: комментарий от burato

Ну даже не знаю, в ебилде есть всё.
https://gitweb.gentoo.org/repo/gentoo.git/tree/media-video/ffmpeg/ffmpeg-4.2....
Пиши в package.use

media-video/ffmpeg vpx
(или глобально vpx в USE в make.conf) и пересобирай ffmpeg
Посмотри только перед этим emerge -pv media-video/ffmpeg включился ли флаг

TheAnonymous ★★★★★ ()
Последнее исправление: TheAnonymous (всего исправлений: 1)
Ответ на: комментарий от TheAnonymous
# equery u ffmpeg
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-video/ffmpeg-4.2.2:
 U I
 - - X                     : Add support for X11
 - - alsa                  : Add support for media-libs/alsa-lib (Advanced Linux Sound
                             Architecture)
 - - amrenc                : Enables Adaptive Multi-Rate Audio encoding support with
                             media-libs/vo-amrwbenc.
 - - bluray                : Enable playback of Blu-ray filesystems
 + + bzip2                 : Use the bzlib compression library
 - - cdio                  : Enables audio CD grabbing with dev-libs/libcdio.
 - - chromaprint           : Enables audio fingerprinting support with
                             media-libs/chromaprint.
 - - chromium              : Builds libffmpeg.so to enable media playback in
                             Chromium-based browsers like Opera and Vivaldi.
 + + codec2                : Enables codec2 low bit rate speech codec support via
                             media-libs/codec2.
 + + cpudetection          : Enables runtime CPU detection (useful for bindist,
                             compatibility on other CPUs)
 - - dav1d                 : Enables AV1 decoding via media-libs/dav1d.
 - - debug                 : Enable extra debug codepaths, like asserts and extra output.
                             If you want to get meaningful backtraces see https://wiki.gen
                             too.org/wiki/Project:Quality_Assurance/Backtraces
 - - doc                   : Add extra documentation (API, Javadoc, etc). It is
                             recommended to enable per package instead of globally
 + + encode                : Add support for encoding of audio or video files
 - - fdk                   : Use external fdk-aac library for AAC encoding
 + + fftools_aviocat       : cat's a URL to another one, useful for dumping streams.
 + + fftools_cws2fws       : converts cws files (Macromedia Flash, compressed) to fws ones
                             (Macromedia Flash, uncompressed).
 + + fftools_ffescape      : Escapes an input string, adopting the av_get_token() escaping
                             logic.
 + + fftools_ffeval        : A simple expression evalutor.
 + + fftools_ffhash        : Computes a file's digest using libavutil algorithms.
 + + fftools_fourcc2pixfmt : Shows the relationships between rawvideo pixel formats and
                             FourCC tags.
 + + fftools_graph2dot     : A tool to convert a libavfilter graph to a dot file.
 + + fftools_ismindex      : A tool for creating smooth streaming manifests.
 + + fftools_pktdumper     : Dumps packets as demuxed by libavformat.
 + + fftools_qt-faststart  : Rearranges a Quicktime file to facilitate network streaming.
 + + fftools_sidxindex     : Write an MPD file for fragmented MP4 files with a sidx index
                             at the start of the file.
 + + fftools_trasher       : Writes burts of random data into a file. Great for testing
                             error robustness/resilience/concealment.
 - - flite                 : Adds a text-to-speech filter based on
                             app-accessibility/flite.
 - - fontconfig            : Support for configuring and customizing font access via
                             media-libs/fontconfig
 + + frei0r                : Enable frei0r wrapping in libavfilter
 - - fribidi               : Enables fribidi support in the drawtext filter.
 - - gcrypt                : Enables gcrypt support: Needed for rtmp(t)e support if
                             openssl, librtmp or gmp is not used.
 - - gme                   : Enables support for media-libs/game-music-emu for playing
                             various video game music formats.
 - - gmp                   : Add support for dev-libs/gmp (GNU MP library)
 - - gnutls                : Prefer net-libs/gnutls as SSL/TLS provider (ineffective with
                             USE=-ssl)
 + + gpl                   : Build GPL code. Should be enabled unless you require LGPL
                             binaries.
 - - gsm                   : Add support for the gsm lossy speech compression codec
 - - hardcoded-tables      : Use pre-calculated tables rather than calculating them on the
                             fly.
 + + iconv                 : Enable support for the iconv character set conversion library
 + + iec61883              : Support for FireWire DV/HDV input device using
                             media-libs/libiec61883.
 - - jack                  : Add support for the JACK Audio Connection Kit
 - - jpeg2k                : Support for JPEG 2000, a wavelet-based image compression
                             format
 + + kvazaar               : Enables media-libs/kvazaar based HEVC encoder.
 + + libaom                : Enables media-libs/libaom based AV1 codec support.
 - - libaribb24            : Enables ARIB text and caption decoding via
                             media-libs/aribb24.
 + + libass                : SRT/SSA/ASS (SubRip / SubStation Alpha) subtitle support
 + + libcaca               : Add support for colored ASCII-art graphics
 + + libdrm                : Enables x11-libs/libdrm support for better screen grabbing
                             and hardware accelerated codecs.
 + + libilbc               : Enables iLBC de/encoding via media-libs/libilbc.
 - - libressl              : Use dev-libs/libressl instead of dev-libs/openssl when
                             applicable (see also the ssl useflag)
 + + librtmp               : Enables Real Time Messaging Protocol using librtmp
                             (media-video/rtmpdump) in addition to FFmpeg's native
                             implementation.
burato ★★ ()
Ответ на: комментарий от TheAnonymous
+ + libsoxr               : Enables audio resampling through media-libs/soxr.
 - - libtesseract          : Enables the OCR filter via app-text/tesseract.
 + + libv4l                : Uses media-libs/libv4l for video4linux instead of direct
                             calls. Adds support for more devices via the userspace
                             library.
 + + libxml2               : Uses dev-libs/libxml2 to enable dash demuxing support.
 + + lv2                   : Enables lv2 audio filter wrapper.
 + + lzma                  : Support for LZMA (de)compression algorithm
 - - modplug               : Add libmodplug support for playing SoundTracker-style music
                             files
 + + mp3                   : Add support for reading mp3 files
 + + network               : Enables network streaming support
 - - openal                : Add support for the Open Audio Library
 - - opengl                : Add support for OpenGL (3D graphics)
 + + openh264              : Enables H.264 encoding suppoprt via media-libs/openh264.
 - - openssl               : Enables dev-libs/openssl support. Adds support for encrypted
                             network protocols (TLS/HTTPS).
 - - opus                  : Enable Opus audio codec support
 - - oss                   : Add support for OSS (Open Sound System)
 - - pic                   : Force shared libraries to be built as PIC (this is slower)
 + + postproc              : Build and install libpostproc.
 - - pulseaudio            : Add support for PulseAudio sound server
 - - rubberband            : Adds time-stretching and pitch-shifting audio filter based on
                             media-libs/rubberband.
 - - samba                 : Add support for SAMBA (Windows File and Printer sharing)
 + + sdl                   : Add support for Simple Direct Layer (media library)
 - - snappy                : Enable app-arch/snappy support. Required for e.g. Vidvox Hap
                             encoder.
 - - speex                 : Add support for the speex audio codec (used for speech)
 - - srt                   : Enable support for Secure Reliable Transport (SRT) via
                             net-libs/srt
 + + ssh                   : Enable SSH/sftp support via net-libs/libssh.
 + + static-libs           : Build static versions of dynamic libraries as well
 - - svg                   : Add support for SVG (Scalable Vector Graphics)
 - - test                  : Enable dependencies and/or preparations necessary to run
                             tests (usually controlled by FEATURES=test but can be toggled
                             independently)
 + + theora                : Add support for the Theora Video Compression Codec
 + + threads               : Add threads support for various packages. Usually pthreads
 - - truetype              : Add support for FreeType and/or FreeType2 fonts
 + + twolame               : Enables MP2 encoding via media-sound/twolame as an
                             alternative to the internal encoder.
 + + v4l                   : Enable support for video4linux (using linux-headers or
                             userspace libv4l libraries)
 + + vaapi                 : Enable Video Acceleration API for hardware decoding
 - - vidstab               : Enables video stabilization filter using vid.stab library
                             (media-libs/vidstab).
 + + vorbis                : Add support for the OggVorbis audio codec
 - - wavpack               : Add support for wavpack audio compression tools
 + + webp                  : Add support for the WebP image format
 + + x264                  : Enable h264 encoding using x264
 + + x265                  : Enables HEVC encoding with media-libs/x265.
 + + xvid                  : Add support for xvid.org's open-source mpeg-4 codec
 - - zeromq                : Enables net-libs/zeromq support with the zmq/azmq filters.
 - - zimg                  : Enables media-libs/zimg based scale filter.
 + + zlib                  : Add support for zlib (de)compression
burato ★★ ()
Ответ на: комментарий от burato

Да, внезапно юз замаскирован на арм64
https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/arch/arm64/use.mask#n122
Надо размаскировать

-vpx
в файл /etc/portage/profile/use.mask

TheAnonymous ★★★★★ ()
Последнее исправление: TheAnonymous (всего исправлений: 1)
Ответ на: комментарий от burato

+ + libaom

Кстати а вот это то не замаскировано вовсе, можно было сразу в av1 кодировать (его же тоже можно использовать как кодек в шебм -c:v libaom-av1), азазаза пару кадров за сутки закодируется

TheAnonymous ★★★★★ ()
Ответ на: комментарий от TheAnonymous

На опипк+(это арм просто, не 64) юз был и я пробнул-так 0.7 кадра в швебм конвертится. Щас на опи3 и опи4 пробну и сравню.

Вот по пережатию mp4 данные, кому интересно:

opipc+ 2.7 fps

opi3 7.8 fps

opi4 17 fps

burato ★★ ()
Ответ на: комментарий от burato

0.7 кадра в швебм конвертится

я так понимаю, vp8/vp9 это?
На AV1, думаю, будет 0.00007 кадра/сек, но для прикола можешь попробовать запустить, типа

ffmpeg -i filein.mp4 -strict -2 -c:v libaom-av1 fileout.webm

TheAnonymous ★★★★★ ()