Bug #979
looks like some images are not stored in blob cache.
Status: | Fixed | Start date: | 05/05/2012 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | 4.0 | |||
Found in version: | git | Platform: | Linux |
Description
I added some debug info when fetching the frame thumb as following output,
when key is not found a new frame decoded but not stored for next fetch..
imageloader [DEBUG]: looking up key file:///media/storage/Downloads/shrek.mp4#30--1-182-3 in cache
imageloader [DEBUG]: looking up key file:///media/storage/Downloads/shrek.mp4#265--1-46-3 in cache
imageloader [DEBUG]: key file:///media/storage/Downloads/shrek.mp4#265--1-46-3 NOT in cache
imageloader [DEBUG]: looking up key file:///media/storage/Downloads/shrek.mp4#265--1-46-3 in cache
imageloader [DEBUG]: key file:///media/storage/Downloads/shrek.mp4#265--1-46-3 NOT in cache
History
#1
Updated by Andreas Smas almost 11 years ago
Are they of the same dimensions?
#2
Updated by Andreas Smas almost 11 years ago
nevermind .. that's part of the URL
#3
Updated by Henrik Andersson almost 11 years ago
I have tested with hardcoded resolution but the first image is always successfully encoded,
must be something subsequental image retrevials from same file..
#4
Updated by Henrik Andersson almost 11 years ago
After some more testing this is definitely related to the reuse of ifv_ctx
when making subsequental calls to same video source, the first image is
always encoded and pushed to cache.
If i switch to another videostream the same procedure applies, first works
and subsequents fails.
#5
Updated by Henrik Andersson almost 11 years ago
Found the issue, avcodec_encode_video() doesn't accept an output buffer size
smaller then FF_MIN_BUFFER_SIZE and bails, with other words thumbs smaller then
16Kb will never be cached.
#6
Updated by Henrik Andersson almost 11 years ago
The following patch fixes the issue.
diff --git a/src/fileaccess/fa_imageloader.c b/src/fileaccess/fa_imageloader.c
index 859d06b..0131c6c 100644
--- a/src/fileaccess/fa_imageloader.c
+++ b/src/fileaccess/fa_imageloader.c@ -488,6 +488,8
@ fa_image_from_video2(const char *url, const image_meta_t *im,
oframe->linesize0 = pm->pm_linesize;
size_t outputsize = pm->pm_linesize * h;
+ if(outputsize < FF_MIN_BUFFER_SIZE)
+ outputsize = FF_MIN_BUFFER_SIZE;
void *output = malloc(outputsize);
pngencoder->width = w;
pngencoder->height = h;
#7
Updated by Henrik Andersson almost 11 years ago
The following patch fixes the issue.
diff --git a/src/fileaccess/fa_imageloader.c b/src/fileaccess/fa_imageloader.c index 859d06b..0131c6c 100644 --- a/src/fileaccess/fa_imageloader.c +++ b/src/fileaccess/fa_imageloader.c @@ -488,6 +488,8 @@ fa_image_from_video2(const char *url, const image_meta_t *im, oframe->linesize[0] = pm->pm_linesize; size_t outputsize = pm->pm_linesize * h; + if(outputsize < FF_MIN_BUFFER_SIZE) + outputsize = FF_MIN_BUFFER_SIZE; void *output = malloc(outputsize); pngencoder->width = w; pngencoder->height = h;
#8
Updated by Andreas Smas almost 11 years ago
- Status changed from New to Fixed
#9
Updated by Andreas Smas over 10 years ago
- Target version set to 4.0