Recherche avancée

Médias (91)

Autres articles (77)

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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (6336)

  • Using gcovr with FFmpeg

    6 septembre 2010, par Multimedia Mike — FATE Server

    When I started investigating code coverage tools to analyze FFmpeg, I knew there had to be an easier way to do what I was trying to do (obtain code coverage statistics on a macro level for the entire project). I was hoping there was a way to ask the GNU gcov tool to do this directly. John K informed me in the comments of a tool called gcovr. Like my tool from the previous post, gcovr is a Python script that aggregates data collected by gcov. gcovr proves to be a little more competent than my tool.

    Results
    Here is the spreadsheet of results, reflecting FATE code coverage as of this writing. All FFmpeg source files are on the same sheet this time, including header files, sorted by percent covered (ascending), then total lines (descending).

    Methodology
    I wasn’t easily able to work with the default output from the gcovr tool. So I modified it into a tool called gcovr-csv which creates data that spreadsheets can digest more easily.

    • Build FFmpeg using the '-fprofile-arcs -ftest-coverage' in both the extra cflags and extra ldflags configuration options
    • 'make'
    • 'make fate'
    • From build directory : 'gcovr-csv > output.csv'
    • Massage the data a bit, deleting information about system header files (assuming you don’t care how much of /usr/include/stdlib.h is covered — 66%, BTW)

    Leftovers
    I became aware of some spreadsheet limitations thanks to this tool :

    1. OpenOffice can’t process percent values correctly– it imports the percent data from the CSV file but sorts it alphabetically rather than numerically.
    2. Google Spreadsheet expects CSV to really be comma-delimited– forget about any other delimiters. Also, line length is an issue which is why I needed my tool to omit the uncovered ine number ranges, which it does in its default state.
  • Any way to assign terminal output to variable with python ?

    12 août 2016, par Gordon Fontenot

    I need to grab the duration of a video file via python as part of a larger script. I know I can use ffmpeg to grab the duration, but I need to be able to save that output as a variable back in python. I thought this would work, but it’s giving me a value of 0 :

    cmd = 'ffmpeg -i %s 2>&1 | grep "Duration" | cut -d \' \' -f 4 | sed s/,//' % ("Video.mov")
    duration = os.system(cmd)
    print duration

    Am I doing the output redirect wrong ? Or is there simply no way to pipe the terminal output back into python ?

  • Pass a process to a subclass

    16 décembre 2014, par Brett

    I would like to pass a process to a subclass so I may kill it but I can’t figure out how to pass the process. I’m unsure how to store it so I can return it to the form and be able to call the subclass method to kill it. here are my classes

    package my.mashformcnts;
    import java.io.IOException;
    import java.util.Scanner;
    import java.util.regex.Pattern;


    /**
    *
    * @author brett
    */
    public class MashRocks {

       public static Process startThread(MashFormCnts mashFormCnts) throws IOException {
           ProcessBuilder pb = new ProcessBuilder("ffmpeg", "-i", "C:\\Users\\brett\\Documents\\Telegraph_Road.mp4", "C:\\Users\\brett\\Documents\\out.mp4");

           //Here is where i would like to name and store the Process


           final Process p = pb.start();
           // create a new thread to get progress from ffmpeg command , override  
           // it's run method, and start it!  
           Thread t = new Thread() {
               @Override
               public void run() {
                   Scanner sc = new Scanner(p.getErrorStream());
                   // Find duration  
                   Pattern durPattern = Pattern.compile("(?<=Duration: )[^,]*");
                   String dur = sc.findWithinHorizon(durPattern, 0);
                   if (dur == null) {
                       throw new RuntimeException("Could not parse duration.");
                   }
                   String[] hms = dur.split(":");
                   double totalSecs = Integer.parseInt(hms[0]) * 3600 + Integer.parseInt(hms[1]) * 60 + Double.parseDouble(hms[2]);
                   System.out.println("Total duration: " + totalSecs + " seconds.");
                   // Find time as long as possible.  
                   Pattern timePattern = Pattern.compile("(?<=time=)[\\d:.]*");
                   String match;
                   String[] matchSplit;
                   //MashForm pgbar = new MashForm();
                   while (null != (match = sc.findWithinHorizon(timePattern, 0))) {
                       matchSplit = match.split(":");
                       double progress = (Integer.parseInt(matchSplit[0]) * 3600 + Integer.parseInt(matchSplit[1]) * 60 + Double.parseDouble(matchSplit[2])) / totalSecs;
                       int prog = (int) (progress * 100);
                       mashFormCunts.setbar(prog);
                   }
               }
           };
          t.start();
          return p;
       }
      public synchronized static void stop(Thread t) throws IOException{
              Runtime.getRuntime().exec("taskkill /F /IM ffmpeg.exe");  
               t = null;
             //t.interrupt();



      }
    }
      class killMash extends MashRocks{
       public static void Kfpeg(Process p){

         p.destroyForcibly();
       }
    }

    So those are my classes. I’m very new.

    Next there is the event Listener on the form, so when I click this I want to kill the ffmpeg proecess with the Thread t :

     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
           // TODO add your handling code here:
           Thread n = Thread.currentThread();
           System.out.print(n);
           try {
               //MashRocks.stop(n);
                //This isnt working but i think its closer
                killMash.Kfpeg(MashRocks.startThread(this));
    //Not Sure what to do here
     //here is where i want to pass the process sorry for the typo
     killMash.kfpeg(p);
               } catch (IOException ex) {
                   Logger.getLogger(MashFormCunts.class.getName()).log(Level.SEVERE, null, ex);
               }

           }  

    Any help is awesome cheers