diff --git a/trunk/functions.pl b/trunk/functions.pl index 29c99bb..eaaae72 100644 --- a/trunk/functions.pl +++ b/trunk/functions.pl @@ -93,7 +93,8 @@ sub fill_results #before code cleanup, this was a really obfuscated array/hash creation push @{ $page->{'results'}->{'result'} }, { - 'thumbnail' => $duration == 0 ? "/images/tango/video-x-generic.png" : "/video-stills/$id", + 'thumbnail' => "$domain/video-stills/thumbnails/$id", + 'preview' => "$domain/video-stills/previews/$id", 'duration' => $duration, 'viewcount' => $viewcount, 'rdf:RDF' => diff --git a/trunk/tools/daemon.pl b/trunk/tools/daemon.pl index 406402b..1e32453 100755 --- a/trunk/tools/daemon.pl +++ b/trunk/tools/daemon.pl @@ -143,7 +143,8 @@ while(1) $duration = int($1*3600 + $2*60 + $3 + $4/10 + .5); #create thumbnail - $thumbnailsec = int($duration/3 + .5); + $thumbnailsec = int(rand($duration)); + $previewsec = $thumbnailsec; #the width/height calculation could of course be much shorter but less readable then #all thumbs have equal height @@ -151,7 +152,8 @@ while(1) $tnheight = $tnmaxheight; $tnwidth = int($tnheight*($width/$height)/2 + .5)*2; - system "ffmpeg -i /tmp/$id -vcodec mjpeg -vframes 1 -an -f rawvideo -ss $thumbnailsec -s ".$tnwidth."x$tnheight $root/video-stills/$id"; + system "ffmpeg -i /tmp/$id -vcodec mjpeg -vframes 1 -an -f rawvideo -ss $thumbnailsec -s ".$tnwidth."x$tnheight $root/video-stills/thumbnails/$id"; + system "ffmpeg -i /tmp/$id -vcodec mjpeg -vframes 1 -an -f rawvideo -ss $previewsec $root/video-stills/previews/$id"; $vmaxheight = 640; diff --git a/trunk/upload.pl b/trunk/upload.pl index 85cf0be..cd7e813 100644 --- a/trunk/upload.pl +++ b/trunk/upload.pl @@ -32,7 +32,7 @@ if($userinfo->{'username'}) { $subject.=$tag." "; } - $page->{'uploadform'}->{'DC.Subject'} = $ubject; + $page->{'uploadform'}->{'DC.Subject'} = $subject; $page->{'innerresults'} = ['']; diff --git a/trunk/video.pl b/trunk/video.pl index 3d91db7..aa5ee8e 100644 --- a/trunk/video.pl +++ b/trunk/video.pl @@ -128,7 +128,8 @@ if($query->url_param('title') or $query->url_param('id')) #before code cleanup, this was a really obfuscated array/hash creation push @{ $page->{'video'} }, { - 'thumbnail' => "$domain/video-stills/$id", + 'thumbnail' => "$domain/video-stills/thumbnails/$id", + 'preview' => "$domain/video-stills/previews/$id", 'filesize' => $filesize, 'duration' => $duration, 'width' => $width,