Recherche avancée

Médias (1)

Mot : - Tags -/stallman

Autres articles (81)

  • 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" ;

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (3541)

  • Revision 2b426969c3 : Simplify RDMULT and RDDIV derivation Don't divide RDMULT and RDDIV by 100 when

    26 septembre 2013, par Guillaume Martres

    Changed Paths :
     Modify /vp9/encoder/vp9_rdopt.c



    Simplify RDMULT and RDDIV derivation

    Don't divide RDMULT and RDDIV by 100 when RDMULT > 1000. This was
    probably done to avoid overflow when the rd cost was stored in a 32 bits
    integer but this is not the case anymore. This change will make it easier
    to support multiple quantizers per frame.

    derf compression gain at speed 0 : 0.037%

    Change-Id : Ibeeb9b7cfa1a132a7af41bc90fc07a3bba0857f6

  • Evolution #3071 (Nouveau) : Performance boucle DATA sur CSV

    9 octobre 2013, par lrt rln

    Il semble que l’analyse CSV avant passage dans la boucle DATA pose de gros soucis de perf. Le temps d’exécution passe rapidement à 2/3 minutes (avec gros set_time_limit) de traitement sur des fichiers >10Mo. A titre comparatif un simple fgetcsv avec un while (($data = fgetcsv($handle, 1000, ",")) est 50 fois plus rapide en exécution que le traitement par la boucle DATA. Il y a sans doute moyen d’optimiser /inc/csv.php pour éviter un plantage assez systèmatique de PHP sur bouclage de fichiers de + 5000 lignes.

  • Fast video compression like Whatsapp

    5 août 2015, par Douglas Anunciação

    I need to speed up video compression in my Android app. I’m using FFMPEG and it takes 3 minutes to compress 80MB video. Does anyone knows a better solution ?

    The command I’m using is :

    /data/data/com.moymer/app_bin/ffmpeg -y -i /storage/emulated/0/DCIM/Camera/VID_20150803_164811363.mp4 -s 640x352 -r 25 -vcodec mpeg4 -ac 1 -preset ultrafast -strict -2 /storage/emulated/0/DCIM/Camera/compressed_video.mp4

    I’m running this command using FFMPEG for Android from this github repo : https://github.com/guardianproject/android-ffmpeg-java

    The code to use FFMPEG in my project is inside an AsyncTask and is copied below :

       @Override
       protected Object doInBackground(Object... params) {

           ItemRoloDeCamera compressedVideo = new ItemRoloDeCamera();

           File videoInputFile = new File(video.getSdcardPath());

           File videoFolderFile = videoInputFile.getParentFile();

           File videoOutputFile = new File(videoFolderFile, "video_comprimido_moymer.mp4");

           if (videoFolderFile.exists())
               android.util.Log.e("COMPRESS VIDEO UTILS", "video folder exist");
           else
               android.util.Log.e("COMPRESS VIDEO UTILS", "video folder DON'T exist");

           if (videoInputFile.exists())
               android.util.Log.e("COMPRESS VIDEO UTILS", "video input file exist");
           else
               android.util.Log.e("COMPRESS VIDEO UTILS", "video input file DON'T exist");

           if (videoOutputFile.exists())
               android.util.Log.e("COMPRESS VIDEO UTILS", "video output file exist");
           else
               android.util.Log.e("COMPRESS VIDEO UTILS", "video output file DON'T exist");

           FfmpegController ffmpegController;

           try {

               ffmpegController = new FfmpegController(context, videoFolderFile);

               Clip clipIn = new Clip(videoInputFile.getAbsolutePath());

               ffmpegController.getInfo(clipIn, new ShellUtils.ShellCallback() {
                   @Override
                   public void shellOut(String shellLine) {
                       videoInfo.add(shellLine);
                   }

                   @Override
                   public void processComplete(int exitValue) {
                       videoInfo.add(String.valueOf(exitValue));
                   }
               });

               int rotate = getRotateMetadata();

               Clip clipOut = new Clip(videoOutputFile.getAbsolutePath());
               clipOut.videoFps = "24";
               clipOut.videoBitrate = 512;
               clipOut.audioChannels = 1;
               clipOut.width = 640;
               clipOut.height = 352;

               if (rotate == 90)
                   clipOut.videoFilter = "transpose=1";
               else if (rotate == 180)
                   clipOut.videoFilter = "transpose=1,transpose=1";
               else if (rotate == 270)
                   clipOut.videoFilter = "transpose=1,transpose=1,transpose=1";

               millisDuration = getVideoDuration(videoInputFile.getAbsolutePath());

               float secondsDuration = millisDuration / 1000f;

               clipOut.duration = secondsDuration;

               ffmpegController.processVideo(clipIn, clipOut, true, new ShellUtils.ShellCallback() {
                   @Override
                   public void shellOut(String shellLine) {

                       android.util.Log.e("COMPRESS VIDEO UTILS", "shellOut - " + shellLine);

                       float percentage = getTimeMetadata(shellLine);

                       if (percentage >= 0f)
                           publishProgress(percentage);

                   }

                   @Override
                   public void processComplete(int exitValue) {
                       android.util.Log.e("COMPRESS VIDEO UTILS", "proccess complete - " + exitValue);
                   }
               });


           } catch (IOException e) {
               e.printStackTrace();
           } catch (Exception e) {
               e.printStackTrace();
           } finally {

               if (videoOutputFile.exists()) {

                   android.util.Log.e("COMPRESS VIDEO UTILS", "finished ffmpeg ---> video output file exist");

                   compressedVideo.setSdcardPath(videoOutputFile.getAbsolutePath());

                   return compressedVideo;

               } else
                   android.util.Log.e("COMPRESS VIDEO UTILS", "finished ffmpeg ---> video output file DON'T exist");

           }

           return compressedVideo;

       }

       private float getTimeMetadata(String shellLine) {

           float percentage = -1;

           if (shellLine.contains("time=")) {

               String[] timeLine = shellLine.split("=");

               String time = timeLine[5];
               time = time.replace("bitrate", "");
               time = time.trim();

    //            String source = "00:10:17";
               String[] tokens = time.split(":");
               int secondsToMs = (int) (Float.parseFloat(tokens[2]) * 1000);
               int minutesToMs = Integer.parseInt(tokens[1]) * 60000;
               int hoursToMs = Integer.parseInt(tokens[0]) * 3600000;
               long timeInMillis = secondsToMs + minutesToMs + hoursToMs;

               percentage = (timeInMillis * 100.0f) / millisDuration;

           }

           return percentage;

       }

       private int getRotateMetadata() {

           int rotate = 0;

           String durationString = "";

           for (String shellLine : videoInfo) {

               if (shellLine.contains("rotate")) {

                   //rotate          : 270

                   String[] rotateLine = shellLine.split(":");

                   rotate = Integer.parseInt(rotateLine[1].trim());

               }

           }

           return rotate;

       }

       public static long getVideoDuration(String videoPath) {

           MediaMetadataRetriever retriever = new MediaMetadataRetriever();

           retriever.setDataSource(videoPath);

           String time = retriever
                   .extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);

           long timeInmillisec = Long.parseLong(time);

           return timeInmillisec;

       }

    The only change I made in the processVideo method was to add the following lines when building the commmand :

    cmd.add("-preset");
    cmd.add("ultrafast");