What happened?
Description
On my local DDEV system, I added ffmpeg as an extended package. After that, video uploads stalled and caused a gateway timeout on my underpowered container.
Using “top,” I could see the “ffmpeg” process, which was consuming a lot of CPU and took forever to finish, until I finally had to kill it.
The reason for this is the alt-text extraction in the Asset class, where Imagick apparently uses ffmpeg as a delegate to read the information from video files and (at least in my case) gets stuck.
A patch is attached.
craftcms_alt_image_only.patch
Steps to reproduce
- Set up a fresh instance of DDEV Craft CMS 5
- Add ffmpeg to the “webimage_extra_packages”
- Restart DDEV, set up Craft CMS, etc.
- SSH into DDEV
- In the shell, type “top”
- Upload an MP4 video in the backend (my test video was https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_10MB.mp4)
- ffmpeg appears in the “top” process list
- The upload hangs
Expected behavior
The upload should go through, and ffmpeg should not be used to extract alt text from videos.
Actual behavior
Video upload hangs until the ffmpeg process terminates
Craft CMS version
Craft CMS 5.10.7
PHP version
8.4.20
Operating system and version
Debian GNU/Linux 13 (trixie)
Database type and version
PostgreSQL 18.3
Image driver and version
ImageMagick 7.1.1-43 Q16 aarch64 22550 https://imagemagick.org
Installed plugins and versions
No response
What happened?
Description
On my local DDEV system, I added ffmpeg as an extended package. After that, video uploads stalled and caused a gateway timeout on my underpowered container.
Using “top,” I could see the “ffmpeg” process, which was consuming a lot of CPU and took forever to finish, until I finally had to kill it.
The reason for this is the alt-text extraction in the Asset class, where Imagick apparently uses ffmpeg as a delegate to read the information from video files and (at least in my case) gets stuck.
A patch is attached.
craftcms_alt_image_only.patch
Steps to reproduce
Expected behavior
The upload should go through, and ffmpeg should not be used to extract alt text from videos.
Actual behavior
Video upload hangs until the ffmpeg process terminates
Craft CMS version
Craft CMS 5.10.7
PHP version
8.4.20
Operating system and version
Debian GNU/Linux 13 (trixie)
Database type and version
PostgreSQL 18.3
Image driver and version
ImageMagick 7.1.1-43 Q16 aarch64 22550 https://imagemagick.org
Installed plugins and versions
No response