Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (111)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip 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 2013

    Puis-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

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (11531)

  • PHP readfile on a file which is increasing in size

    13 février 2013, par Sathiya Sundaram

    Is it possible to use PHP readfile function on a remote file whose size is unknown and is increasing in size ? Here is the scenario :

    I'm developing a script which downloads a video from a third party website and simultaneously trans-codes the video into MP3 format. This MP3 is then transferred to the user via readfile.

    The query used for the above process is like this :

    wget -q -O- "VideoURLHere" | ffmpeg -i - "Output.mp3" > /dev/null 2>&1 &

    So the file is fetched and encoded at the same time.
    Now when the above process is in progress I begin sending the output mp3 to the user via readfile. The problem is that the encoding process takes some time and therefore depending on the users download speed readfile reaches an assumed EoF before the whole file is encoded, resulting in the user receiving partial content/incomplete files.

    My first attempt to fix this was to apply a speed limit on the users download, but this is not foolproof as the encoding time and speed vary with load and this still led to partial downloads.

    So is there a way to implement this system in such a way that I can serve the downloads simultaneously along with the encoding and also guarantee sending the complete file to the end user ?

    Any help is appreciated.

    EDIT :
    In response to Peter, I'm actually using fread(read readfile_chunked) :

    <?php
    function readfile_chunked($filename,$retbytes=true) {
               $chunksize = 1*(1024*1024); // how many bytes per chunk
               $totChunk = 0;
               $buffer = '';
               $cnt =0;
               $handle = fopen($filename, 'rb');
               if ($handle === false) {
                   return false;
               }
               while (!feof($handle)) {
                   //usleep(120000); //Used to impose an artificial speed limit
                   $buffer = fread($handle, $chunksize);
                   echo $buffer;
                   ob_flush();
                   flush();
                   if ($retbytes) {
                       $cnt += strlen($buffer);
                   }
               }
                   $status = fclose($handle);
               if ($retbytes && $status) {
                   return $cnt;        // return num. bytes delivered like readfile() does.
               }
               return $status;
           }
           readfile_chunked($linkToMp3);
       ?>

    This still does not guarantee complete downloads as depending on the users download speed and the encoding speed, the EOF() may be reached prematurely.

    Also in response to theJeztah's comment, I'm trying to achieve this without having to make the user wait..so that's not an option.

  • md5 : Allocate a normal private context for the opaque md5 context pointer

    11 octobre 2012, par Martin Storsjö

    md5 : Allocate a normal private context for the opaque md5 context pointer

  • md5 : Allocate a normal private context for the opaque md5 context pointer

    11 octobre 2012, par Martin Storsjö

    md5 : Allocate a normal private context for the opaque md5 context pointer