reticivis-net / mediaforge

A Discord bot for editing and creating videos, images, GIFs, and more!
GNU General Public License v3.0
82 stars 28 forks source link

Cannot do the caption command onto a gif #183

Open Cordy-Guy opened 1 year ago

Cordy-Guy commented 1 year ago

Describe the bug

I experienced the bot not being able to create a caption for the selected gif

Traceback

DATETIME:2023-06-18 22:06:33.773681 COMMAND:$caption MODS, thug-BAN HIM TRACEBACK: processing.common.CMDError: ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 12 (Debian 12.2.0-13) 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-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 --enable-libjxl --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, png_pipe, from '/dev/shm/mediaforge/RTASOmIg.png': Duration: N/A, bitrate: N/A Stream #0:0: Video: png, rgba(pc), 498x147 [SAR 2835:2835 DAR 166:49], 25 fps, 25 tbr, 25 tbn Input #1, gif, from '/dev/shm/mediaforge/thOdUAPr.gif': Duration: 00:00:02.65, start: 0.000000, bitrate: 8117 kb/s Stream #1:0: Video: gif, bgra, 498x281, 20 fps, 20 tbr, 100 tbn Stream mapping: Stream #0:0 (png) -> format:default Stream #1:0 (gif) -> format:default vstack:default -> Stream #0:0 (png) Press [q] to stop, [?] for help

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/caption.py", line 115, in captioncommand await process(ctx, processing.vips.vipsutils.generic_caption_stack, [["VIDEO", "GIF", "IMAGE"]], File "/mediaforge/src/core/process.py", line 157, in process raise e File "/mediaforge/src/core/process.py", line 125, in process result = await run() ^^^^^^^^^^^ File "/mediaforge/src/core/process.py", line 108, in run command_result = await func(args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mediaforge/src/processing/vips/vipsutils.py", line 23, in generic_caption_stack return await processing.ffmpeg.naive_vstack(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mediaforge/src/processing/ffmpeg.py", line 560, in naive_vstack await run_command("ffmpeg", "-i", file0, "-i", file1, "-filter_complex", 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/RTASOmIg.png', '-i', '/dev/shm/mediaforge/thOdUAPr.gif', '-filter_complex', '[0]format=pix_fmts=yuva420p[0f];[1]format=pix_fmts=yuva420p[1f];[0f][1f]vstack=inputs=2', '-c:v', 'png', '-fs', '1G', '-fps_mode', 'vfr', '/dev/shm/mediaforge/qkdYAott.mp4') failed.

Expected Behavior

I expected the bot to write the caption as normal.

Steps To Reproduce

  1. mods-crush-his-skull-low-tier-god
  2. post "$caption MODS, thug-BAN HIM" while replying to the message

Anything Else

image

PortalRex commented 10 months ago

Updating ffmpeg fixed this for me.