3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2013 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
13 if (!defined('_ECRIRE_INC_VERSION')) return;
15 function metadata_flv_dist($file, $bigindian = true){
18 if ($fd = fopen($file, 'r')
19 AND $raw = fread($fd, 512)){
21 $keys = array('largeur'=>'width', 'hauteur'=>'height','duree'=>'duration','framerate'=>'framerate');
22 foreach ($keys as $m=>$k) {
23 if (($i = strpos($raw, $k))>-1){
24 $bytes = substr($raw, $i+
strlen($k)+
1, 8);
26 $bytes = strrev($bytes);
27 $zz = unpack("dflt", $bytes); // unpack the bytes
28 $meta[$m] = $zz['flt']; // return the number from the associative array