Recherche avancée

Médias (0)

Mot : - Tags -/signalement

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (66)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (6880)

  • FFMPEG (2.5.7 ) Progress Bar from PHP

    6 mars 2016, par kunal

    i want to have the Progress bar of FFmpeg encoding.This is the Code which i am using to get the percentage value of encoding Process.

    <?php
    $content = @file_get_contents("with-logo/output.txt");
    //echo $content;
    if($content) {
       preg_match("/Duration: (.*?), start:/", $content, $matches);

       $rawDuration = $matches[1];

       $ar = array_reverse(explode(":", $rawDuration));
       $duration = floatval($ar[0]);
       //echo $duration;
       if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
       if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;

       //get the time in the file that is already encoded
       preg_match_all("/time=(.*?) bitrate/", $content, $matches);

       $rawTime = array_pop($matches);

       //this is needed if there is more than one match
       if (is_array($rawTime)){$rawTime = array_pop($rawTime);}

       //rawTime is in 00:00:00.00 format. This converts it to seconds.
       $ar = array_reverse(explode(":", $rawTime));
       $time = floatval($ar[0]);
       if (!empty($ar[1])) $time += intval($ar[1]) * 60;
       if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;

       //calculate the progress
       $progress = round(($time/$duration) * 100);

       echo "Duration: " . $duration . "<br />";
       echo "Current Time: " . $time . "<br />";
       echo "Progress: " . $progress . "%";
    }
    ?>

    here is relevant log line form my FFMPEG Log files for Better Understanding.

    Stream mapping:
     Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (pcm_s24le (native) -> aac (native))
    Press [q] to stop, [?] for help

    frame=   11 fps=0.0 q=0.0 size=       0kB time=00:00:00.41 bitrate=   0.9kbits/s    
    frame=   22 fps= 21 q=0.0 size=       0kB time=00:00:00.85 bitrate=   0.4kbits/s    
    frame=   33 fps= 21 q=0.0 size=       0kB time=00:00:01.30 bitrate=   0.3kbits/s    
    frame=   43 fps= 20 q=0.0 size=       0kB time=00:00:01.69 bitrate=   0.2kbits/s  

    and this code is not returning the Value for Duration and as a result of this i am getting PHP warning and code is not calculating the Current percentage.

    here is the PHP warning , which i am getting-

    PHP Warning:  Division by zero in /var/www/html/mm/progressbar.php

    i think we can also calculate the percentage from the timebut i have no idea, how can i make it work ?

    or any help to solve the Problem with Duration.

    thanks for the help !

  • Anomalie #3815 (Nouveau) : sql_updateq qui ne fait pas de jointure

    10 août 2016, par Ybbet SPIP

    Bonjour,

    Suite à des tests, je remarque que sql_updateq n’applique pas de jointures (explicites) sur les SET.

    Un exemple de comparaison, voici une requête faite avec sql_allfetsel :

    1. <span class="CodeRay">sql_allfetsel(<span class="string"><span class="delimiter">'</span><span class="content">mots.id_mot, mots.id_groupe,mots.titre,groupes.titre as type</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">spip_mots as mots, spip_groupes_mots as groupes</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">mots.id_groupe=groupes.id_groupe</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="predefined-constant">false</span>);
    2. </span>

    Télécharger


    Lancera la requête SQL :

    1. <span class="CodeRay"><span class="class">SELECT</span> mots.id_mot, mots.id_groupe,mots.titre,groupes.titre <span class="keyword">as</span> TYPE
    2. <span class="keyword">FROM</span> spip_mots <span class="keyword">as</span> mots, spip_groupes_mots <span class="keyword">as</span> groupes
    3. <span class="keyword">WHERE</span> mots.id_groupe=groupes.id_groupe
    4. </span>

    Télécharger

    Tandis que sql_updateq :

    1. <span class="CodeRay">sql_updateq(<span class="string"><span class="delimiter">'</span><span class="content">spip_mots as mots, spip_groupes_mots as groupes</span><span class="delimiter">'</span></span>, <span class="predefined">array</span>(<span class="string"><span class="delimiter">'</span><span class="content">mots.type</span><span class="delimiter">'</span></span> => <span class="string"><span class="delimiter">'</span><span class="content">groupes.titre</span><span class="delimiter">'</span></span>), <span class="string"><span class="delimiter">"</span><span class="content">mots.id_groupe=groupes.id_groupe</span><span class="delimiter">"</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="predefined-constant">false</span>);
    2. </span>

    Télécharger


    Lancera la requête SQL :

    1. <span class="CodeRay"><span class="class">UPDATE</span> spip_mots <span class="keyword">as</span> mots, spip_groupes_mots <span class="keyword">as</span> groupes
    2. <span class="keyword">WHERE</span> mots.id_groupe=groupes.id_groupe
    3. </span>

    Télécharger

    Ce qui forcément crée une erreur SQL car il n’y a pas de SET.
    La requête attendue serait celle-ci :

    UPDATE spip_mots as mots, spip_groupes_mots as groupes
    SET mots.type=groupes.titre
    WHERE mots.id_groupe=groupes.id_groupe

    Soit je n’utilise pas correctement cette fonction, soit elle a du mal à interpréter les expressions du SET.

    Qu’en pensez-vous ?

  • Using WebRTC to send canvas stream to peer connection

    16 août 2021, par nameless

    I'm currently trying a little project. I have a canvas I can draw in with simple strokes. Now I want to send this canvas content to a MPV player to receive it there, so something like a live stream of the canvas to another computer (in the same network), which receives the live stream via MPV.

    &#xA;&#xA;

    I thought about using FFMPEG to send the live stream then, but the question is how..

    &#xA;&#xA;

    I found WebRTC (click here) to be able to send a canvas to a peer connection as well as to a video element. Sending it to a video element also works fine, sending to a peer connection didn't work so far.

    &#xA;&#xA;

    However I'm still not sure how to send it to FFMPEG or something else in order to receive it on another PC.

    &#xA;&#xA;

    Other ideas are also welcome, its mainly about sending the live image of the canvas to another client with a static IP adress.

    &#xA;&#xA;

    This, by the way, is the code I tried in order to send the canvas content to a video element :

    &#xA;&#xA;

    var canvas = $(&#x27;#can&#x27;)[0];&#xA;var ctx = canvas.getContext(&#x27;2d&#x27;);&#xA;var stream = canvas.captureStream(60);&#xA;&#xA;var video = $(&#x27;#video&#x27;)[0];&#xA;video.srcObject = stream;&#xA;

    &#xA;