Archive for February 15th, 2008

Other to FLV file conversion in PHP

Hi using this php code any one can convert any video file to flv.

Requirements : ffmpeg software

You can download this software from

http://www.videohelp.com/tools/ffmpeg

Code :

$curdir = define (‘FULL_PATH’, dirname(__FILE__).’/');

if(strstr($_SERVER['SERVER_SOFTWARE'],”Win32″))
$ffmpeg_format = $curdir.”ffmpeg.exe -y -i %s %s”;
else
$ffmpeg_format = “LD_LIBRARY_PATH=. “.$curdir.”ffmpeg -y -i %s %s > /dev/null 2>&1″;

$ret_value = 0;
// prepare ffmpeg command

$ffmpeg_command = sprintf($ffmpeg_format, $video_file_name, $flv_name);

//echo $ffmpeg_command;

if (system($ffmpeg_command, $ret_value) === FALSE || $ret_value != 0) {
// ffmpeg was failed
return false;
}
return true;

Where this php page directory should ffmpeg.exe directory

By the help of flvtool2 mencoder software file conversion you can follow

http://reazulk.wordpress.com/2008/01/24/easy-way-to-convert-a-no-flash-movie-to-flash/

1 comment February 15, 2008

Tiny_mce ibrowser setting


Sometime tiny_mce plugins ibrowser does not work properly in live server. Common cause is for wrong ibrowser settings like path settings and chmod 777 or 755 change
I want to write some settings for tiny_mce ibrowser it will help everyone who trying to use ibrowser in tiny_mce.

Option :
1) if you are working with php 4.x.x in your local machine and your ibrowser are working nice
when you upload it in live project and you server contain php 5.x.x then you must have to change the ibrowser
tiny_mce/plugins/ibrowser/scripts/phpThumb folder from
http://phpthumb.sourceforge.net

2) if your local machine with php 5.x.x and ibrowser working nice it is not required to change in live server.

Configuration :
1) set ibrowser in tiny_mce/plugins/ibrowser
2) in html document

var root_url = ‘{$BASE_URL}’;

tinyMCE.init({
….
plugins : “ibrowser”,
theme_advanced_buttons3 : “ibrowser”,
….

});

3) in config.inc.php $cfg['thumbs'] = array (
array ( // settings
’size’ => ‘*’,
‘ext’ => ‘*’,
‘crop’ => false,
)

uncomment this above code

set $con['ilibs_dir'] with library default dir

ex : $cfg['ilibs_dir'] = array(‘/ib_image’);

4) in phpthumb.class.php no line 75 set
var $config_document_root = “/home/…../public_html”;

5) sometimes some server dis not know $_SERVER['DOCUMENT_ROOT'] and it return null almost
for that reason
in phpthumb.class.php no line 220 set comment and repeace with second line

example :

//$this->config_document_root = (@$_SERVER['DOCUMENT_ROOT'] ? $_SERVER['DOCUMENT_ROOT'] : $this->config_document_root);

$this->config_document_root = ((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), ”, str_replace(‘\\’, ‘/’, realpath(‘.’))));

with this all configuration if it does not work properly then ser config_document_root value by force in ResolveFilenameToAbsolute() in phpthumb.class.php line no 976

example :
function ResolveFilenameToAbsolute($filename) {
$this->config_document_root = “/home/…../public_html”;

6) 1. image libraries (chmod 0755 or 0777)
2. ibrowser/scripts/phpThumb/cache (chmod 0755 or 0777)
3. ibrowser/temp (chmod 0755 or 0777)

image libraries which contain all iBrowser uploaded image.

Think now it will work fine!

Add comment February 15, 2008



Jewel Ahmed's Facebook profile
Jewel Ahmed's Facebook profile

Pages

Categories

 

February 2008
M T W T F S S
    Mar »
 123
45678910
11121314151617
18192021222324
2526272829  

Blogroll

Recent Comments

Wardell on MySql Type Casting
Ahsan on Other to FLV file conversion i…
mySql Type Casting t… on MySql Type Casting
bibomedia on About

Recent Posts

Archives