video thumbs idea

Various KDE 1.-4. Improvements

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 50.0%
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 :)

Shahid

12 years ago

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);

Report

RockMan81

13 years ago

I've started taking random frames in mplayerthumbs too.
Check it (it's here in kde-apps.org, too)

Report

Ekardnam

13 years ago

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)

Report

C

ktulu77

13 years ago

yes, for some video format, it is random (just for mpeg if i remember) but all the others videos, it is the first frame.

Report

C

ktulu77

13 years ago

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.

Report

Superstoned

13 years ago

it might end up in kde 3.5.4, if enough ppl ask for it...

Report

C

ktulu77

13 years ago

i had allready submited the idea on bugs.kde.org but no-one did anything.

Report

campusloop

13 years ago

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.

Report

abhay

13 years ago

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 ;)

Report

campusloop

13 years ago

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.

Report

12345678910
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
Details
license
version
0.1
updated May 30 2006
added May 29 2006
downloads 24h
0
page views 24h 1