Description: Hi everyone ! I have a lot of video on my hard drive and I have i think there is a problem with the video thumbs. I think it should be better to take an random frame in the film like in nautilus. The tumbs are useless in konqueror because most of time, the first frame is just black. Just see the screenshot. I love konqueror so i think it should be better like that. Sorry for my bad english ! thank you
I have a patch which already does this but it rewrites the related kde installed files .. As such i don't want to upload it to kde-apps.org
If anybody wants it please suggest a site/place where i can upload the tarball.
Why don't you create a bug on bugs.kde.org and upload the patch? If the patch is stable enough then you might find it in official KDE release some day ;)
There is no point putting it up on bugs.kde.org. KDE4 is in active development and the videothumbnailer is going to be switched to phonon and the current code might be totally replaced.
Ratings & Comments
10 Comments
By applying this patch, we have a random frames as thumbnails diff -purN xine-thumbnail/thumbnail/videocreator.cpp xine-thumbnail.new/thumbnail/videocreator.cpp --- xine-thumbnail/thumbnail/videocreator.cpp 2006-05-30 18:18:51.000000000 +0400 +++ xine-thumbnail.new/thumbnail/videocreator.cpp 2007-06-26 15:54:06.000000000 +0400 @@ -32,11 +32,13 @@ #include <qimage.h> #include <qpainter.h> #include <qpaintdevice.h> +#include <qdatetime.h> #include <iostream> #include <kstandarddirs.h> #include <kapplication.h> +#include <krandomsequence.h> #define XINE_ENABLE_EXPERIMENTAL_FEATURES 1 @@ -260,13 +262,18 @@ bool VideoCreator::create(const QString int length; bool canPlay = false; - /* For streams for which length info is available seek to 1/3 file + /* For streams for which length info is available seek from 1/6 to 5/6 file * or else play for the first 5-10 seconds and get the frame */ - - if ( ((!xine_get_pos_length( stream, NULL, NULL, &length )) && xine_play( stream, 0, 5000 )) || - xine_play (stream, 21845, 0)) + KRandomSequence* rand = new KRandomSequence(QDateTime::currentDateTime().toTime_t()); + unsigned long rand_frame = rand -> getLong (45535) + 10000; + unsigned long rand_msec = rand -> getLong (5000) + 5000; + + if ( ((!xine_get_pos_length( stream, NULL, NULL, &length )) && xine_play( stream, 0, rand_msec )) || + xine_play (stream, rand_frame, 0)) canPlay = true; - + + // Destructor of KRandomSequence + rand -> ~KRandomSequence(); bool hasVideo = xine_get_stream_info (stream, XINE_STREAM_INFO_HAS_VIDEO); bool videoHandled = xine_get_stream_info (stream, XINE_STREAM_INFO_VIDEO_HANDLED);
I've started taking random frames in mplayerthumbs too. Check it (it's here in kde-apps.org, too)
It seems like some of the previews already shows random (?) frame. At least it's not the first frame(s). Yes, I'm using Konqueror (3.5.2)
yes, for some video format, it is random (just for mpeg if i remember) but all the others videos, it is the first frame.
ok, i have tried campusloop's patch, it works ! thank you very much ! why have we to wait kde 4 for this so small patch ? it is too bad.
it might end up in kde 3.5.4, if enough ppl ask for it...
i had allready submited the idea on bugs.kde.org but no-one did anything.
I have a patch which already does this but it rewrites the related kde installed files .. As such i don't want to upload it to kde-apps.org If anybody wants it please suggest a site/place where i can upload the tarball.
Why don't you create a bug on bugs.kde.org and upload the patch? If the patch is stable enough then you might find it in official KDE release some day ;)
There is no point putting it up on bugs.kde.org. KDE4 is in active development and the videothumbnailer is going to be switched to phonon and the current code might be totally replaced.