Tag Archives: font

flock first thoughts

2 Oct

so far i’m not to happy with flock, and thats just after loading it. the whole flock bar seems like a decent idea. but I’m seriously hatting that in order to use it, i also have to have bookmarks showing. they should make the flock bar movable, as on my laptop i’d like to have it at the top right next to navigation…

I’m using the blog posting feature right now to write this post, but i’m sure theres got to be a plugin like this for firefox. Also their blog post editor allows me to enter tags, but doesn’t display current tags.

the tabs, and pretty much over layout just feels annoying at the moment, maybe it’ll grow on me. or maybe i’m just not their target market.

check it out : http://flock.com

Blogged with Flock

Tags: ,

simple viewer flash image gallery

27 Sep

this is old news, Just realized i’ve never mentioned simple viewer.

simple viewer is a flash gallery system. I’ve used it for a number of projects (actually using it now) and it allows for dynamic content / config.

Features:

* Intelligent image pre-loading.
* Intuitive image navigation
* Lightweight (17k).
* Customizable interface – Set text color, frame color and width, navigation position.
* Resizable interface – Interface scales to fit browser window.
* Cross platform – Windows/Macintosh/Linux (requires Flash 7 or higher).
* Flash 7 detection. Users without Flash 7 are messaged to upgrade Flash.
* International font support.
* Keyboard Navigation (Cursor keys, Home, End, Page Up/Down)
* Mousewheel navigation
* Optionally right-click to open image in a new window.
* Free!

Creating your own SimpleViewer gallery is easy. There are 5 options for creating a SimpleViewer gallery:

*
Automatic via Desktop software

Automatically create a SimpleViewer gallery using desktop software (such as PhotoShop, Picasa, iPhoto, RapidWeaver, Aperture, Lightroom). View Automatic Desktop Instructions.
*
Automatic via Server-side Script

Automatically create a SimpleViewer gallery using a script that runs on your web server. Scripts are provided for PHP, ASP and Cold Fusion. View Automatic via Server-side Script Instructions.
*
Manual

Manually create a SimpleViewer gallery using a text editor and image editing software of your choice. View Manual Instructions.
*
FlickrViewer

FlickrViewer allows you view Flickr photo sets using SimpleViewer. Download FlickrViewer here. Note: FlickrViewer currently supports SimpleViewer v1.7. Dustin Senos has updated FlickrViewer to work with SimpleViewer v1.8.
*
SimpleViewerAdmin

SimpleViewerAdmin is an web based admin interface which allows you to create and manage multiple galleries. Note: SimpleViewerAdmin currently supports SimpleViewer v1.7. Ben Hughes has updated SimpleViewerAdmin to work with SimpleViewer v1.8.
*
Using WordPress

WP-SimpleViewer is a plugin to easily integrate SimpleViewer galleries into Wordpress.

check it out: get it now!
http://www.airtightinteractive.com/simpleviewer/

code : ffmpeg and ffmpeg-php demo flv conversion system

5 Sep

here is the code for a Proof of concept i did a few months ago. Its a demo ffmpeg and ffmpeg-php video conversion system that will also generate thumbnails. you either upload a file to the server (for large files) or select the file to upload (small files).

the code is offered as is. Please note this is a first version POC so the code is choppy and theres functionality missing, probably also alot of beta testing code.

*update: wordpress converts some of the characters into invalid code, so download / copy the source file here
http://elsid.net/wp-content/uploads/2007/10/ffmpeg_convert.php.txt

*update: the file works on php5, on at least it did when i tested. change the folder / url path to whatever your using.

you can view the source below

<?php
//error_reporting(2047);
//setup directory vars
$url_dir = "/video-convert-alpha/";
$url_folder="uploads";
$upload_dir = realpath($url_folder)."/";//"";
$url_dir="http://".$_SERVER['HTTP_HOST'].$url_dir.$url_folder."/";

//echo "uploads : ". $upload_dir;
function time_stamp()
{
return gmdate("YmdHis");
}
///my trusty old upload function
function upload_from_form($file_item)
{
global $_FILES, $upload_dir, $url_dir;
//echo "uploading<br>";
if (!empty($_FILES[$file_item]['name'])) {
//echo $_FILES[$file_item]['tmp_name'];

if($_FILES[$file_item]['size']*1==0){
echo "File : ".$_FILES[$file_item]['name']." is either empty or exceeds the file size limit, please reduce the size of this document, check the file, or contact Greg to increase the limit";
return "%";
}else{

$file_name = str_replace(" ", "_" , $_FILES[$file_item]['name']);
$file_name = str_replace("’", "_" ,$file_name);
$file_name = str_replace("\\", "_" ,$file_name);
$file_name = str_replace("#", "_" ,$file_name);
$file_name = str_replace("&", "_" ,$file_name);
$file_name = str_replace("\"", "_" ,$file_name);
$file_name = str_replace("(", "_" ,$file_name);
$file_name = str_replace(")", "_" ,$file_name);
$file_name = str_replace("@", "_" ,$file_name);
$file_name = str_replace("\$", "_" ,$file_name);
$file_name = str_replace("*", "_" ,$file_name);
$file_name = str_replace("~", "_" ,$file_name);
$file_name = str_replace("`", "_" ,$file_name);
$file_name = str_replace("+", "_" ,$file_name);
$file_name = str_replace("=", "_" ,$file_name);
$file_name = str_replace("|", "_" ,$file_name);
$file_name= time_stamp() . "_" . $file_name;

if (!file_exists($upload_dir . $file_name)) {
$file_loc = copy($_FILES[$file_item]['tmp_name'], $upload_dir . $file_name);
} else {
$file_name = time_stamp() . "_" . $file_name;
$file_loc = copy($_FILES[$file_item]['tmp_name'], $upload_dir . $file_name);
}
if ($file_loc != false) {
$file_loc = $upload_dir . $file_name;

return $file_loc;
} else {
echo "Could not find file : ".$_FILES[$file_item]['name'];
return "%";

} }
} else {
echo "upload failed<br>";
return "%";
}

}

 

 

$flvtool2Path=’/usr/bin/flvtool2′;
$ffmpegPath=’/usr/bin/ffmpeg’;
$qualitySettings=array(‘low’=>’-ar 22050 -ab 32′,’med’=>’-ab 48k -ac 1 -ar 44100 -deinterlace -nr 500 -croptop 4 -cropbottom 4 -cropleft 8 -cropright 8 -aspect 4:3 -r 25 -b 270k -me_range 25 -i_qfactor 0.71 -g 500′,’high’=>’-ab 64k -ac 2 -ar 44100 -deinterlace -nr 500 -croptop 4 -cropbottom 4 -cropleft 8 -cropright 8 -aspect 4:3 -r 25 -b 650k -me_range 25 -i_qfactor 0.71 -g 500′);
$reqFields="email|password|quality|size|format";
$reqFields=explode("|",$reqFields);
$filesMessage="";
$formatSettings=array(‘flv’=>’-f flv -acodec mp3′);

$badSubmit=false;
//check for post
if(!empty($_POST['password'])){
//check for pass and user
//echo "checking pass<br>";
if(trim($_POST['password'])==’ricecrispytreat’ && !empty($_POST['email'])){
//check submission
//echo "password excepted<br>";
for($i=0;$i<count($reqFields);$i++){
if(empty($_POST[$reqFields[$i]])){
$badSubmit=true;
echo $reqFields[$i]." not completed<br>";
break;

}
}
//ok we’ve done basic checking – now lets get to work
if(!$badSubmit){
//first lets make sure we have a file
if(!empty($_POST['serverPath']) || !empty($_FILES['fileUploaded'])){
if(!empty($_FILES['fileUploaded'])){

$processFile=upload_from_form(‘fileUploaded’);
}else{
$processFile=$_POST['serverPath'];
$processFile=realpath($processFile);
if(!file_exists($processFile)){
$processFile="%";
}

}

 

}else{
$processFile=’%';
}
if($processFile==’%'){
echo " either you have entered a non valid path, or your uploaded file wasn’t in the right format<br>";

}
//end file checks
if($processFile!=’%'){
//now lets see if we have thumbnails to make
if(isset($_POST['useThumbs'])){
//echo "thumbnailing<br>";
//defaults
$maxThumbnails=5;
$thumbnailsFrom=1;

//if they were set
if(!empty($_POST['thumbsMax'])){
$maxThumbnails=$_POST['thumbsMax'];
$maxThumbnails*=1;
}

if(!empty($_POST['thumbStart'])){
$thumbnailsFrom=$_POST['thumbStart'];
$thumbnailsFrom*=1;
}
//echo "making thumbnails";
//lets do the work
//setup ffmpeg-php object, and needed vars
$ffmpegObj = new ffmpeg_movie($processFile);
$totalTime=$ffmpegObj->getDuration();
$frameRate=$ffmpegObj->getFrameRate();
$thumbIncrements=(($totalTime*$frameRate)-($thumbnailsFrom*$frameRate))/$maxThumbnails;
$wide=$ffmpegObj->getFrameWidth();
$high=$ffmpegObj->getFrameHeight();
$startFrame=$thumbnailsFrom*$frameRate;
//echo "frame rate: ".$frameRate;
$filesMessage.="ThumbNails can be viewed at :<p>";
//echo "thumbs being processed now";
for($t=0;$t<$maxThumbnails;$t++){
//$image= @imagecreatetruecolor($wide,$high);
$thumbFile=$processFile.".".$t.".png";
$currFrame=floor($startFrame+($thumbIncrements*$t));
//echo "<br>thumb of frame $currFrame: ".$thumbFile;
$thumb=$ffmpegObj->getFrame($currFrame);

if ($thumb) {
$thumbImage = $thumb->toGDImage();
if ($thumbImage) {
imagepng($thumbImage,$thumbFile);
imagedestroy($thumbImage);
}
}
//echo "<br>saved";
$thumbUrl=$url_dir."".basename($thumbFile);
$filesMessage.="<a href=’".$thumbUrl."’>".$thumbUrl."</a><br>";

}
$filesMessage.="</p>";

}

//echo "outside thumbs";
$newFile=substr($processFile,0,strrpos($processFile,".")).".".$_POST['format'];
$ffmpegCall=$ffmpegPath." -i ".$processFile." ".$qualitySettings[$_POST['quality']]." ".$formatSettings[$_POST['format']]." -s ".$_POST['size']." ".$newFile;

$flvtool2Call=flvtool2Path." -U stdin ".$newFile."";
$encodeCall=$ffmpegCall." | ".$flvtool2Call;
exec($encodeCall);
$fileUrl=$url_dir."".basename($newFile);
$filesMessage.="<p>You Can Now View / Download Your Video @<a href=’".$fileUrl."’>".$fileUrl."</a><br></p>";
$user=$_POST['email'];
mail($user,basename($newFile),$filesMessage);
$foo=@unlink($processFile);
//echo $fileMessage;
}
}

}

}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#FF0000" bgcolor="#CCCCCC">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td colspan="5"><font color="#ff0000"><?php echo $filesMessage;?></font></td>
</tr>
<tr>
<td colspan="5">video convert .01 alpha</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">this isn’t pretty, but it gets the job done. consider this a POC. More options to come, and maybe an ajax or flash interface. Probaly Flash :) </td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">Access and reporting</td>
</tr>
<tr>
<td colspan="3"><label for="email">enter your email address </label>
<input type="text" name="email" id="email" />
<br />
This will be used to notify you once conversion has completed.</td>
</tr>
<tr>
<td colspan="3"><label for="password">Enter the video system password</label>
<input type="text" name="password" id="password" value=’ricecrispytreat’ /></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">video file—</td>
</tr>
<tr>
<td><label for="serverPath">file server path</label>
<input type="text" name="serverPath" id="serverPath" /></td>
<td>or</td>
<td><label for="fileUploaded">upload file</label>
<input type="file" name="fileUploaded" id="fileUploaded" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3">thumbnails</td>
</tr>
<tr>
<td><label for="label">Make thumbnails</label>
<input type="checkbox" name="useThumbs" id="useThumbs" />
<label for="useThumbs"></label></td>
<td><label for="thumbsMax">how many</label>
<input type="text" name="thumbsMax" id="thumbsMax" />
– defaults to 5 if not set</td>
<td><label for="thumbStart">from what postion</label>
<input type="text" name="thumbStart" id="thumbStart" />
<label for="thumbsMax"> (time in seconds) so 6:05 would be 6*60+5= 365 – defaults to 0 if not set</label></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">video settings</td>
</tr>
<tr>
<td><label for="quality">Select quality</label>
<select name="quality" id="quality">
<option value="low">Low</option>
<option value="med">Medium</option>
<option value="high" selected="selected">High</option>
</select></td>
<td><label for="size">Select Size</label>
<select name="size" id="size">
<option value="160×120">160×120</option>
<option value="320×240" selected="selected">320×240</option>
<option value="480×360">480×360</option>
<option value="640×480">640×480</option>
<option value="720×480">720×480</option>
<option value="1024×768">1024×768</option>
<option value="1280×720">1280×720</option>
<option value="1280×1024">1280×1024</option>
<option value="1600×1200">1600×1200</option>
<option value="1920×1080">1920×1080</option>
</select> </td>
<td><label for="format">select format</label>
<select name="format" id="format">
<option value="flv" selected="selected">Flash Video</option>
</select> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Audio Settings</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><input type="checkbox" name="noVideo" id="noVideo" />
<label for="noVideo">Audio Only – not working yet</label></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><label for="button"></label>
<input type="submit" name="button" id="button" value="Submit" /></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>

Hope this helps someone

how to: install w32codecs and libdvdcss on ubuntu feisty

12 Aug

A few weeks ago i installed w32codecs and libdvdcss with no problems. since then ubuntu has decided to disable users from downloading these and other “restricted” or non free / not open source packages.

in order to download these, and other packages (flash player, microsoft fonts, etc) do:
sudo apt-get install ubuntu-restricted-extras

Good flash dynamic buttons and gradients tutorial

6 Jun

came across a good and simple flash tutorial covering dynamic buttons using gradients and the glow filter.

From the site :

In this easy ActionScript lesson I will explain to you how to create professional, clean and polished buttons. No design tools will be used in this tutorial. Just pure ActionScript code! Please note that this is a lesson made for Flash 8 pro. You will learn how to:

* Create new movie clips from scratch,
* Create nested movie clips with ActionScript too,
* Create stunning gradients and other graphics via ActionScript,
* Import and embed fonts into Flash, understand how they work and add to the size of your SWF movie,
* Create dynamic text fields from scratch and format them using the myriad properties available in ActionScript,
* Import, create and apply filter effects to movie clips and text fields, and more.

Below are a few examples of the many buttons, menus and designs that you can create via ActionScript.

view it : http://www.lukamaras.com/tutorials/actionscript/amazing-actionscript-designed-button.html

flash using embedded fonts

31 May

found two really good overviews about using embedded fonts in flash.

http://theolagendijk.wordpress.com/2006/08/12/embedding-fonts-in-flash/
covers basic embedding

http://theolagendijk.wordpress.com/2006/08/13/another-day-another-fight-with-flash/
covers embedding and using via stylesheets