
Recherche avancée
Autres articles (50)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (8099)
-
Get video duration from file location without using ffmpeg
12 juillet 2021, par user3508453function getDuration($file){
 if (file_exists($file)){
 ## open and read video file
 $handle = fopen($file, "r");
 ## read video file size
 $contents = fread($handle, filesize($file));
 fclose($handle);
 $make_hexa = hexdec(bin2hex(substr($contents,strlen($contents)-3)));
 if (strlen($contents) > $make_hexa){
 $pre_duration = hexdec(bin2hex(substr($contents,strlen($contents)-$make_hexa,3))) ;
 $post_duration = $pre_duration/1000;
 $timehours = $post_duration/3600;
 $timeminutes =($post_duration % 3600)/60;
 $timeseconds = ($post_duration % 3600) % 60;
 $timehours = explode(".", $timehours);
 $timeminutes = explode(".", $timeminutes);
 $timeseconds = explode(".", $timeseconds);
 $duration = $timehours[0]. ":" . $timeminutes[0]. ":" . $timeseconds[0];}
 return $duration;
 }
 else {
 return false;
 }
}




This code is working fine but for some files it shows
variable $duration is undefined
even if the file exists ! please help someone.


Source Daniweb



is there any other way to get the video duration ? 
and is it fast enough ?


-
Get video duration from file location without using ffmpeg
15 juin 2014, par user3508453function getDuration($file){
if (file_exists($file)){
## open and read video file
$handle = fopen($file, "r");
## read video file size
$contents = fread($handle, filesize($file));
fclose($handle);
$make_hexa = hexdec(bin2hex(substr($contents,strlen($contents)-3)));
if (strlen($contents) > $make_hexa){
$pre_duration = hexdec(bin2hex(substr($contents,strlen($contents)-$make_hexa,3))) ;
$post_duration = $pre_duration/1000;
$timehours = $post_duration/3600;
$timeminutes =($post_duration % 3600)/60;
$timeseconds = ($post_duration % 3600) % 60;
$timehours = explode(".", $timehours);
$timeminutes = explode(".", $timeminutes);
$timeseconds = explode(".", $timeseconds);
$duration = $timehours[0]. ":" . $timeminutes[0]. ":" . $timeseconds[0];}
return $duration;
}
else {
return false;
}
}This code is working fine but for some files it shows
variable $duration is undefined
even if the file exists ! please help someone.Source Daniweb
is there any other way to get the video duration ?
and is it fast enough ? -
Read part of every frame of a video file
18 novembre 2012, par user1414470I'm doing some tracking on video files. First I separate frames using ffmpeg and the for each frame i apply a mask and then perform the tracking algorithm.
To make this process faster I'm thinking about reading only the parts I need. like reading the part that I apply the mask or better than that reading boxes around the previous positions of objects. So I'm looking for a way to decode and read a specific part of a specific frame from a video file. Is there any way to do that ?