reticivis-net / mediaforge

A Discord bot for editing and creating videos, images, GIFs, and more!
https://discord.com/oauth2/authorize?client_id=780570413767983122
GNU General Public License v3.0
84 stars 28 forks source link

ffmpeg: requested bitrate is too low. #144

Closed idahoe-ceo closed 1 year ago

idahoe-ceo commented 1 year ago

idk what to write here so imma just post the thing it told me to post


COMMAND:$videodl https://www.youtube.com/watch?v=C7-vezH4DPc
TRACEBACK:
processing.common.CMDError: ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-9)
  configuration: --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-gnutls --disable-liblensfun --disable-libopencv --disable-podpages --disable-sndio --disable-stripping --enable-avfilter --enable-chromaprint --enable-frei0r --enable-gcrypt --enable-gpl --enable-ladspa --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libdavs2 --enable-libdc1394 --enable-libdrm --enable-libfdk-aac --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libkvazaar --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librsvg --enable-librubberband --enable-libshine --enable-libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-nonfree --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --enable-vulkan --incdir=/usr/include/x86_64-linux-gnu --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --toolchain=hardened --enable-vaapi --enable-libmfx --enable-libvmaf --enable-libilbc --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/dev/shm/mediaforge/VJvBdFllUgHp.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.27.100
  Duration: 00:07:30.07, start: 0.000000, bitrate: 212 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 76 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 11/21/2018.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 11/21/2018.
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x55b4be3dd0c0] using SAR=1/1
[libx264 @ 0x55b4be3dd0c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55b4be3dd0c0] requested bitrate is too low. estimated minimum is 11 kbps
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
[aac @ 0x55b4be3dbe40] Qavg: 65536.000
[aac @ 0x55b4be3dbe40] 2 frames left in the queue on closing
Conversion failed!

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/mediaforge-HXFskkj--py3.11/lib/python3.11/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaforge/src/commands/conversion.py", line 104, in videodl
    r = await processing.ffmpeg.assurefilesize(r, re_encode=False)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaforge/src/processing/ffmpeg.py", line 185, in assurefilesize
    return await twopasscapvideo(media, config.file_upload_limit)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaforge/src/processing/ffmpeg.py", line 124, in twopasscapvideo
    await run_command('ffmpeg', '-i', video, '-c:v', 'h264', '-b:v', str(target_video_bitrate), '-pass', '2',
  File "/mediaforge/src/processing/common.py", line 75, in run_command
    raise CMDError(f"Command {args} failed.") from CMDError(result)
processing.common.CMDError: Command ('ffmpeg', '-i', '/dev/shm/mediaforge/VJvBdFllUgHp.mp4', '-c:v', 'h264', '-b:v', '10548.96427912805', '-pass', '2', '-passlogfile', '/dev/shm/mediaforge/LMvBvyGC', '-c:a', 'aac', '-b:a', '128000', '-f', 'mp4', '-movflags', '+faststart', '/dev/shm/mediaforge/gnwJvzVG.mp4') failed.```
reticivis-net commented 1 year ago

Oh dupe of #70