-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long thumbnail generation time for S3 loader #89
Comments
Would you please try this docker build, which I am testing imagor with seekable s3 read stream.
|
Doesn't make any difference, it's still above 20s Used this image: |
Ok it seems like I ran into some nested virtualization issues here and the problem is actually on my side performance-wise. Sorry about that. |
hm no actually I think I was right the first time the s3 loader time is higher than http Compared using imagor@s3, imagor@http and just ffmpeg with the same input
Using ffmpegroot@ffmpeg-pod:/# time ffmpeg -y -i https://r2v.**.app/obj_01j6m0ncdpe35bhyybgzzv259x.mp4 -ss 00:00:01 -frames:v 1 -vf scale=1920:1080 -update 1 -f image2 output_thumbnail.jpg real 0m1.654s Using imagor via HTTP loader$ time curl --output thumbnail.png "https://imagor.**.app/unsafe/1920x1080/filters:frame(2)/https://r2v.**.app/obj_01j6m0ncdpe35bhyybgzzv259x. real 0m0.981s Using imagor via S3 loader$ time curl --output thumbnail.png "https://imagor.**.app/unsafe/1920x1080/filters:frame(1s)/sl/obj_01j6m0ncdpe35bhyybgzzv259x.mp4" real 0m20.310s |
Can you share any of the mp4 files to help reproduce the issue? |
Sure It does seem tho that problem is only reproducible by loading from S3 storage (I'm using CloudFlare, but also reproducible with others) |
I'm testing imagorvideo along with s3 storage loader and generating a thumbnail (uncached) consistently takes a very long time, more than 20 seconds every time.
And that is when running on beefy dedicated Hetzner server which I use for encoding the videos.
Is there any way to optimize that time and is that expected? I'm running pretty much the default settings and only set seek to 10 seconds, e.g.:
http://localhost:8000/unsafe/1920x1080/filters:seek(10s)/sl/obj_01j6fxp6ggf2pbarp9276sc4fa.mp4
downloading the same file itself in full is taking only 5 seconds:
$ time curl --output /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 232M 100 232M 0 0 42.8M 0 0:00:05 0:00:05 --:--:-- 45.0M
curl --output /dev/null 0.31s user 0.50s system 14% cpu 5.431 total
so I guess a lot of time is spent on generating the thumbnail, what can I do to reduce that? the video info:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2024-08-25T16:17:54.000000Z
encoder : Blackmagic Design DaVinci Resolve Studio
Duration: 00:00:58.11, start: 0.000000, bitrate: 33523 kb/s
Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 33333 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
I'm also using avif + webp auto settings but that seem to have no impact for performance
The text was updated successfully, but these errors were encountered: