Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (76)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (3774)

  • Revision 6723e34224 : Merge "fix permissions on cpplint.py (0644->0755)" into experimental

    4 mai 2013, par James Zern

    Merge "fix permissions on cpplint.py (0644->0755)" into experimental

  • php stream any mp4

    3 avril 2012, par GRaecuS

    I'm developing a web app that converts videos and allows to play them through Flowplayer.

    On the current status, I use ffmpeg to convert the videos to mp4 and qtfaststart to fix their metadata for streaming. Everything is working smoothly as I can download any converted mp4 and view it correctly.

    For serving the videos to Flowplayer, I use a php file which contains the following (summarized) code :

    header("Content-Type: {$mediatype}");

    if ( empty($_SERVER['HTTP_RANGE']) )
    {
       if ( $filetype == 'flv' && $seekPos != 0 )
       {
           header("Content-Length: " . ($filesize + 13));
           print('FLV');
           print(pack('C', 1));
           print(pack('C', 1));
           print(pack('N', 9));
           print(pack('N', 9));
       }
       else
       {          
           header("Content-Length: {$filesize}");
       }

       $fh = fopen($filepath, "rb") or die("Could not open file: {$filepath}");

       # seek to requested file position
       fseek($fh, $seekPos);

       # output file
       while(!feof($fh))
       {
           # output file without bandwidth limiting
           echo fread($fh, $filesize);
       }
       fclose($fh);
    }
    else //violes rfc2616, which requires ignoring  the header if it's invalid
    {  
       $fp = @fopen($file, 'rb');

       $size   = filesize($file); // File size
       $length = $size;           // Content length
       $start  = 0;               // Start byte
       $end    = $size - 1;       // End byte
       // Now that we've gotten so far without errors we send the accept range header
       /* At the moment we only support single ranges.
        * Multiple ranges requires some more work to ensure it works correctly
        * and comply with the spesifications: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
        *
        * Multirange support annouces itself with:
        * header('Accept-Ranges: bytes');
        *
        * Multirange content must be sent with multipart/byteranges mediatype,
        * (mediatype = mimetype)
        * as well as a boundry header to indicate the various chunks of data.
        */
       header("Accept-Ranges: 0-$length");
       // header('Accept-Ranges: bytes');
       // multipart/byteranges
       // http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
       if (isset($_SERVER['HTTP_RANGE']))
       {
           $c_start = $start;
           $c_end   = $end;
           // Extract the range string
           list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
           // Make sure the client hasn't sent us a multibyte range
           if (strpos($range, ',') !== false)
           {
               // (?) Shoud this be issued here, or should the first
               // range be used? Or should the header be ignored and
               // we output the whole content?
               header('HTTP/1.1 416 Requested Range Not Satisfiable');
               header("Content-Range: bytes $start-$end/$size");
               // (?) Echo some info to the client?
               exit;
           }
           // If the range starts with an '-' we start from the beginning
           // If not, we forward the file pointer
           // And make sure to get the end byte if spesified
           if ($range0 == '-')
           {

               // The n-number of the last bytes is requested
               $c_start = $size - substr($range, 1);
           }
           else
           {
               $range  = explode('-', $range);
               $c_start = $range[0];
               $c_end   = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
           }
           /* Check the range and make sure it's treated according to the specs.
            * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
            */
           // End bytes can not be larger than $end.
           $c_end = ($c_end > $end) ? $end : $c_end;
           // Validate the requested range and return an error if it's not correct.
           if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size)
           {
               header('HTTP/1.1 416 Requested Range Not Satisfiable');
               header("Content-Range: bytes $start-$end/$size");
               // (?) Echo some info to the client?
               exit;
           }
           $start  = $c_start;
           $end    = $c_end;
           $length = $end - $start + 1; // Calculate new content length
           fseek($fp, $start);
           header('HTTP/1.1 206 Partial Content');
       }

       // Notify the client the byte range we'll be outputting
       header("Content-Range: bytes $start-$end/$size");
       header("Content-Length: $length");

       // Start buffered download
       $buffer = 1024 * 8;
       while(!feof($fp) && ($p = ftell($fp)) <= $end)
       {
           if ($p + $buffer > $end)
           {
               // In case we're only outputtin a chunk, make sure we don't
               // read past the length
               $buffer = $end - $p + 1;
           }
           set_time_limit(0); // Reset time limit for big files
           echo fread($fp, $buffer);
           flush(); // Free up memory. Otherwise large files will trigger PHP's memory limit.
       }

       fclose($fp);
    }

    Unfortunately, it is working only for the majority of the videos. For some of them, Flowplayer keeps returning Error 200, even though they were encoded correctly.

    How can I fix this ? Is it a coding problem or those videos are faulty ?

  • FFMPEG HTTP protocol closing after first packet

    27 août 2019, par rusty

    I’m trying to send a live video stream from my webcam to FFMPEG via the HTTP protocol. However after the first packet is sent FFMPEG closes, but does indeed output a fully playable video. As my intention.

    After going over the documentation for the protocol I thought mulitiple_requests would stop this behavior which it did not. After searching online for a few hours I can not find an example specific to my scenario. i.e. receiving a network stream over HTTP.

    Code running on the client-side :

    var xhttp=new XMLHttpRequest;

    if (navigator.mediaDevices) {

       var constraints = { audio: true, video: true };

       navigator.mediaDevices.getUserMedia(constraints)
         .then(function(stream) {
           var mediaRecorder = new MediaRecorder(stream);
           m = mediaRecorder;
           m.start();
           m.ondataavailable=e=>{
             xhttp.open("POST","http://localhost:8080");
             xhttp.send(e.data);
           }
           setInterval(function(){
             m.requestData();
           },2000);
         }).catch(function(error) {
           console.log(error.message);
         });
    }

    The FFMPEG command I have tried thus far :

    ffmpeg -listen 1 -multiple_requests -i http://localhost:8080 file.webm

    Maybe this is not possible with FFMPEG ? If this is the case then it appears the only solution would be to put this command in a loop and keep appending to the output.