Le Transmédia expliqué aux gens from OLR Prod on Vimeo.
An online website very usefull to create favicon.ico
To generate a translation dictionary you can use this command to create a .mo file from a .po file
msgfmt -o mytranslatefile.mo mytranslatefile.po
Here is the command to get the length of a video file
mplayer -frames 0 -identify myvideo > /dev/stdout | grep -i ID_LENGTH
You can use this function to get the time in hh:mm:ss format
function getLength($file) {
// Get Time
$cmd = MPLAYER." -frames 0 -identify ".$file." > /dev/stdout | grep -i ID_LENGTH ";
$duration = exec($cmd);
$duration = str_replace("ID_LENGTH=", "", $duration);
$duration = explode(".", $duration);
$duration = array_shift($duration);
$durationToTime = $this->Sec2Time($duration);
$length = str_pad((int) $durationToTime["hours"],2,"0",STR_PAD_LEFT).":".str_pad((int) $durationToTime["minutes"],2,"0",STR_PAD_LEFT).":".str_pad((int) $durationToTime["seconds"],2,"0",STR_PAD_LEFT);
return $length;
}
You can use this command to make a snapshot with ffmpeg :
ffmpeg -i myvideofile -vcodec png -vframes 1 -an -f rawvideo -s 320×240 -ss 00:00:02 mysnapshot.png
change the -ss option to get the snapshot at a different time in the video
change the -vframes option to get multiple snapshot.
Here is the command to get the length of a video file
ffmpeg -i myfile 2>/dev/stdout | grep -i duration
You can use this function to get the time in hh:mm:ss format
function getLength($file) {
if (is_file($file)) {
// Get Length
$cmd = "ffmpeg -i $file 2>/dev/stdout | grep -i duration";
$duration = system($cmd);
$duration = explode(",", trim($duration));
$tabTime = explode(":", $duration[0]);
$mediaLength = $tabTime[1].':'.$tabTime[2].':'.substr($tabTime[3], 0, 2);
$mediaLength = str_replace(" ", "", $mediaLength);
return $mediaLength;
}
}
A function used to format a string into url string
function urlFormat($str) {
$str = mb_strtolower($str, 'UTF-8');
$str = str_replace(
array(
'à', 'â', 'ä', 'á', 'ã', 'å',
'î', 'ï', 'ì', 'í',
'ô', 'ö', 'ò', 'ó', 'õ', 'ø',
'ù', 'û', 'ü', 'ú',
'é', 'è', 'ê', 'ë',
'ç', 'ÿ', 'ñ',
'À', 'Â', 'Ä', 'Á', 'Ã', 'Å',
'Î', 'Ï', 'Ì', 'Í',
'Ô', 'ö', 'Ò', 'Ó', 'Õ', 'Ø',
'Ù', 'Û', 'Ü', 'Ú',
'É', 'È', 'Ê', 'Ë',
'Ç', 'Ý', 'Ñ',
),
array(
'a', 'a', 'a', 'a', 'a', 'a',
'i', 'i', 'i', 'i',
'o', 'o', 'o', 'o', 'o', 'o',
'u', 'u', 'u', 'u',
'e', 'e', 'e', 'e',
'c', 'y', 'n',
'A', 'A', 'A', 'A', 'A', 'A',
'I', 'I', 'I', 'I',
'O', 'O', 'O', 'O', 'O', 'O',
'U', 'U', 'U', 'U',
'E', 'E', 'E', 'E',
'C', 'Y', 'N',
),
$str
);
str = ereg_replace("[^[:alnum:]]+", '-', $str);
$str = ereg_replace("[-]+", '-', $str);
$str = ereg_replace("[-]$", '', $str);
return $str:
}


