Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (69)

  • Les images

    15 mai 2013
  • 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

  • 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 (...)

Sur d’autres sites (8584)

  • h264idct_template : fix include path

    11 mai 2011, par Michael Niedermayer

    h264idct_template : fix include path

  • os.path.join () on firstargv and list [closed]

    5 novembre 2019, par user243

    I am iterating through a directory and sorting the filenames based on time. These sorted filenames are then stored as a list. The directory is specified as firstargv

    I need to take each filename from the list and join it with the directory specified as firstargv creating an entire path so that I can pass it as file to ffprobe later for further process.

    Below is the code I am using but I am not getting desired result,

    import subprocess, sys, os

    firstarg=sys.argv[1]
    a = str(firstarg)
    time = sorted(os.listdir( a ), key=lambda s: s[9:])
    filename = time
    for y in filename:
       new_path = os.path.join(firstarg, *y)
    for z in new_path:
       p1 = subprocess.Popen (['ffprobe', '-i', z, '-show_entries', 'format=duration', '-sexagesimal', '-v', 'error', '-of', 'csv=%s' % ("p=0")], stdout=subprocess.PIPE)
       out = p1.communicate() [0]

    Any ideas here please ?

  • FFMPEG show encoding progress

    18 janvier 2016, par Mick Jack

    I am using ffmpeg to convert a video file large files take a long time to get encode. i will like to show a progress bar with a percentage/time remaining

    i saw and tried this example example but progress bar is not showing

    FFMPEG script and autorefresh both in upload.php

       <?php
    shell_exec("C:\\ffmpeg\\bin\\ffmpeg.exe -y -i ".$target_file." -c:v libx264 -s:v 854x480 -c:a copy \"{$newFileName}\" > logfile.txt 2>&1");

            ?>

           <code class="echappe-js">&lt;script src=&quot;https://code.jquery.com/jquery-2.1.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script&gt;<br />
           $(document).ready(function(){<br />
           setInterval(function(){<br />
           $(&quot;#screen&quot;).load('progress.php')<br />
           }, 10000);<br />
           });<br />
           &lt;/script&gt;

    Progress.php

    &lt;?php

    $content = @file_get_contents('logfile.txt');

               if($content){
               //get duration of source
               preg_match("/Duration: (.*?), start:/", $content, $matches);

               $rawDuration = $matches[1];

               //rawDuration is in 00:00:00.00 format. This converts it to seconds.
               $ar = array_reverse(explode(":", $rawDuration));
               $duration = floatval($ar[0]);
               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 . "%";

    }

    ?>

    ffmpeg

    shell_exec("C:\\ffmpeg\\bin\\ffmpeg.exe -y -i ".$target_file." -c:v libx264 -s:v 854x480 -c:a copy \"{$newFileName}\" > logfile.txt 2>&amp;1");