Recherche avancée

Médias (91)

Autres articles (96)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (5386)

  • ffmpeg fails on conversion from .mov to .mp4 fails aT 98%

    3 avril 2013, par user2241249

    Our code is below. When converting a uploaded .mov to .mp4 the conversion halts at 98%.

    Almost all of our other preferred formats encode flawlessly. Anyone has any clue on where we went wrong ? We are struggling on this for a while now so we want to ask the experts, thanks in advance for any help.

    &lt;?php
    $Path = dirname(__FILE__) . "/";
    $url = "http://" . $_SERVER[&#39;SERVER_NAME&#39;] . str_replace(&#39;\\&#39;, &#39;/&#39;, dirname($_SERVER[&#39;SCRIPT_NAME&#39;])) . "/";

    session_start();
    include_once &#39;inc/config.inc.php&#39;;
    include_once &#39;common.php&#39;;
    include_once &#39;inc/ffmpegprogressbar.class.php&#39;;

    ob_flush();
    ?>


       
       
       &lt;?php

    // Specifie Inputfile for FFMPEG
       $count = count($_SESSION[&#39;Files&#39;]);
    // $file  = array_pop($_SESSION[&#39;Files&#39;]);

       $FileInstance = array_pop($_SESSION[&#39;Files&#39;]);
       //$FileInstance = $_SESSION[&#39;Files&#39;][0];
       $file = $FileInstance[&#39;FileName&#39;];
       $passNeeded = $FileInstance[&#39;PassNeeded&#39;];
       $fmt = $FileInstance[&#39;fmt&#39;];

       $FFMPEGInput = $Path . &#39;data/&#39; . $_SESSION[&#39;OldSession&#39;] . "/" . $file;

       $timeUnique = time();
       //echo "Start:Session holds: ".$_SESSION["cstatus"].", cstatus var =   $cstatus";


     /*  if ($FileInstance[&#39;PassNeeded&#39;] == 5) {
           $FFMPEGParams = "-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 1920x1080";
       } else if ($FileInstance[&#39;PassNeeded&#39;] == 4) {
           $FFMPEGParams ="-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 1280x720";
       } else if ($FileInstance[&#39;PassNeeded&#39;] == 3) {
           $FFMPEGParams = "-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 854x480";
       } else if ($FileInstance[&#39;PassNeeded&#39;] == 2) {
           $FFMPEGParams = "-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 640x360";
       }
       */
    if($fmt=="flv"){
    if ($FileInstance[&#39;PassNeeded&#39;] == 5) {
           $FFMPEGParams = "-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 1920x1080";
       } else if ($FileInstance[&#39;PassNeeded&#39;] == 4) {
           $FFMPEGParams ="-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 1280x720";
       } else if ($FileInstance[&#39;PassNeeded&#39;] == 3) {
           $FFMPEGParams = "-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 854x480";
       } else if ($FileInstance[&#39;PassNeeded&#39;] == 2) {
           $FFMPEGParams = "-r 1000 -ar 11025 -ab 32 -f $fmt -sameq -g 15 -s 640x360";
       }
    }elseif($fmt=="mp4"){
    $FFMPEGParams = " -pix_fmt yuv420p -s 640x360";

    }elseif($fmt=="ogv"){
    $FFMPEGParams = " -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 125k -s 640x360";

    }elseif($fmt=="webm"){
    $FFMPEGParams = " -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 125k -s 640x360";
    //}elseif($fmt!==""){
    //-i %1 -s qvga -acodec libfaac -ar 22050 -ab 128k -vcodec libx264 -threads 0 -f   ipod %2
    //-vcodec mpeg4 -acodec aac output.mp4
    //$FFMPEGParams = "-r 20 -ar 44100 -ab 196 -f $fmt -s 480x351";
    }
       if ($FileInstance[&#39;PassNeeded&#39;] > 2) {
           $FileInstance[&#39;PassNeeded&#39;] = $FileInstance[&#39;PassNeeded&#39;] - 1;
           array_unshift($_SESSION[&#39;Files&#39;], $FileInstance);
       }

       $flv_rpath = &#39;data/&#39; . $_SESSION[&#39;OldSession&#39;] . "/" . $file. $timeUnique . ".".$fmt;

        $FFMPEGOutput = $FFMPEGInput . $timeUnique . ".$fmt";

       $_SESSION[&#39;ConvertedFiles&#39;][$file][] = array(&#39;Pass&#39; => $passNeeded, &#39;OutFile&#39; => $file . $timeUnique . ".$fmt","fmt"=>$fmt);



       if (!$_GET["pkey"]) {
           $pkey = rand();
       } elseif (file_exists(&#39;log/&#39; . $_GET["pkey"] . &#39;.ffmpeg&#39;)) {
           $pkey = $_GET["pkey"];
       } else {
           $pkey = rand();
       }

    // initializing and create ProgressBar
       flush();
       $FFMPEGProgressBar = &amp;new FFMPEGProgressBar();
       flush();
    // Show Progressbar
       if ($count > 0) {
           if ($FileInstance[&#39;PassNeeded&#39;] &lt; 3) {
           define(&#39;FFMPEG_LIBRARY&#39;, &#39;/usr/local/bin/ffmpeg &#39;);
           $extension = "ffmpeg";
           $extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
           $extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;
               if (!extension_loaded($extension)) {
                   dl($extension_soname) or die("Can&#39;t load extension $extension_fullname\n");
               }
               exec(FFMPEG_LIBRARY . " -y -i &#39;" . $FFMPEGInput . "&#39; -vframes 1 -ss 00:00:03 -an -vcodec png -f rawvideo -s 160x90 &#39;$FFMPEGInput.png&#39;");
           }
           $FFMPEGProgressBar->Show($pkey, $count, $url, $passNeeded, $file, $timeUnique,$fmt);
           if (!$_GET["pkey"] || !file_exists(&#39;log/&#39; . $_GET["pkey"] . &#39;.ffmpeg&#39;)) {
               flush();
               $FFMPEGProgressBar = &amp;new FFMPEGProgressBar();
               flush();
               @$FFMPEGProgressBar->execFFMPEG($FFMPEGInput, $FFMPEGOutput, $FFMPEGParams, $pkey);

               flush();
               $_SESSION[&#39;new_space&#39;]["video"] = &#39;data/&#39; . $_SESSION[&#39;OldSession&#39;] . "/" . $file;
               $_SESSION[&#39;new_space&#39;]["{$FileInstance[&#39;name&#39;]}"] = $flv_rpath;
               $_SESSION[&#39;new_space&#39;]["session"] =   $_SESSION[&#39;OldSession&#39;];
           }
       //echo "End:Session holds: ".$_SESSION["cstatus"].", cstatus var = $cstatus";
       } else {
    //  header("Location: $url" . "index.php" );
           echo "<code class="echappe-js">&lt;script type=\&quot;text/javascript\&quot;&gt;window.location.href=&amp;#39;&quot; . $url . &quot;&amp;#39;;&lt;/script&gt;

    No Input" ;
    }
    // ShowProgressbar
     ?>

  • FFmpeg detecting the first frame after a commercial

    5 novembre 2013, par William Joe Baldwin

    I've been searching for a way to detect the very first frame after a commercial in FFmpeg.
    My recorder records TV shows, approximately 1 second before the sequence.
    Therefore the video file starts with few frames of the commercial.

    By checking the page below, it seems there is a way to detect scene changes :

    Extract Thumbnails of Every Camera Change on a Video File

    Does anyone know a way to rewrite the code from the link to get the first scene change as frame count ?

    Thanks !

  • Audio decoding using ffms2(ffmegsource)

    1er mai 2013, par praks411

    I'm using ffms2(ffmpegsource) a wrapper around libav to get video and audio frame from a file.
    Video decoding is working fine. However I'm facing some issues with audio decoding.
    FFMS2 provide a simple function FFMS_GetAudio(FFMS_AudioSource *A, void *Buf, int64_t Start, int64_t Count, FFMS_ErrorInfo *ErrorInfo); api to get the decoded buffer. The decoded data is return in buffer provided by user.

    For single channel the data is interpretation is straight forward with data byte starting from first location of user buffer. However when it comes to two channel there are two possibilities the decoded data could be planar or interleaved depending upon sample format return by FFMS_GetAudioProperties. In my case the sample format is always planar which means that decoded data will in two sperate data plane data[0] and data[1]. And this is what is explained by libav/ffmpeg and also by portaudio which consider planar data to be in two separate data plane.

    However FFMS_GetAudio just take single buffer from user. So can I assume for planar data
    data[0] = buf, data[1] = buf + offset, where offset is half the length of buffer return by FFMS_GetAudio.

    FFMS does not provide any good document for this interpretation. It would be great help if some can provide more information on this.