Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-10-2013, 01:57 AM   #1
tatyana
DavidNudesWorld hahahahaha
 
tatyana's Avatar
 
Industry Role:
Join Date: Dec 2008
Location: Scottsdale, AZ
Posts: 151
video thumbnail contact sheet code done

Hi all! Im just working right now on some new site automation work, and finished a simple php script for making a video contact sheet on the server. You can specify num of shots, size, and source video. Couldnt find this anywhere else, so here is mine in case someone out there needs it! (BTW, it figures out the length of your vid and smartly decides where to screenshot the vid, you need ffmpeg and imagemagick on your server)


// make screenshot thumbnail graphics
$video = $source_folder.$sourcefile.'.mp4';
$second = 140; //specify the time to start the screen shot at (can easily be randomly generated)
$num_thumbs = 12;
$output_size = '200x113';
$thumbsheet = $destination_folder.$sourcefile.'_contactsheet.png ';

// get the duration and a random place within that
$retval = system('ffmpeg -i '.$video.' 2>&1 | grep "Duration"',$retval);
if (preg_match('/Duration: ((\d+):(\d+):(\d+))/s', $retval, $time)) {
$total = ($time[2] * 3600) + ($time[3] * 60) + $time[4];
//$second = rand(1, ($total - 1)); //rand second chooser
}

$second_increments = ($total-$second) / $num_thumbs; // example every 305 seconds

$this_second = $second;

for ($i = 1; $i <= $num_thumbs; $i++) {

$image = $destination_folder.$sourcefile.'_ss'.$i.'.jpg'; //define the output file
//finally assemble the command and execute it
$command = "ffmpeg -ss $this_second -i $video -an -vframes 1 -s ".$output_size." $image";
//echo $command;
exec($command);

$this_second = $this_second + $second_increments;

}

//make simple graphic
$command = "montage -verbose -background transparent -define jpeg:size=".$output_size." -geometry ".$output_size."+2+2 ".$destination_folder.$sourcefile."_ss{1..".$num_t humbs."}.jpg ".$thumbsheet;
exec($command);
__________________
David & Tatyana Owner & Producer
DavidNudesWorld.com for all our sites!!
NATS & CCBill Affiliate Program nats.DavidNudesCash.com
tatyana is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-10-2013, 06:52 PM   #2
avrevenue
Confirmed User
 
Industry Role:
Join Date: Apr 2004
Posts: 1,894
nice script, thanks for sharing
An alternative would be to use php-ffmpeg is available.
__________________
AV Revenue High Quality Sites to Promote
Official Twitter account
Official Telegram account
Skype: avrevenue
Telegram: avrevenue
avrevenue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-10-2013, 06:56 PM   #3
fitzmulti
I Like Depth Of Field!
 
fitzmulti's Avatar
 
Industry Role:
Join Date: Jan 2003
Location: Las Vegas, NV, USA: 36.12318 N, 115.090219 W
Posts: 14,861
Very nice...and nice OF you! ;-)
__________________


www.SexyGirlsCash.com


CONTACT // FITZMULTI AT GMAIL.COM //
{Please include a message so I know you are from GFY! I get too many spam "add requests"!}
fitzmulti is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.