Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (64)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (6831)

  • Is there an efficient way to retrieve frames from a video in Android ?

    28 mars 2015, par Naveed

    I have an app which requires me to retrieve frames from a video and do some processing with them. However it seems like that the frame retrieval is very slow to the point where it is unacceptable. Sometimes it is taking upto 2.5 second to retrieve a single frame. I am using the MediaMetadataRetriever as most stackoverflow questions suggested. However the performance is very bad. Here is what I have :

      private List<bitmap> retrieveFrames() {

           MediaMetadataRetriever fmmr = new MediaMetadataRetriever();
           fmmr.setDataSource("/path/to/some/video.mp4");
           String strLength = fmmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
           long milliSecs = Long.parseLong(strLength);
           long microSecLength = milliSecs * 1000;

           Log.d("TAG", "length: " + microSecLength);
           long one_sec = 1000000; // one sec in micro seconds

           ArrayList<bitmap> frames = new ArrayList&lt;>();
           int j = 0;
           for (int i = 0; i &lt; microSecLength; i += (one_sec / 5)) {
               long time = System.currentTimeMillis();
               Bitmap frame = fmmr.getFrameAtTime(i, MediaMetadataRetriever.OPTION_CLOSEST);
               j++;
               Log.d("TAG", "Frame number: " + j + " Time taken: " + (System.currentTimeMillis() - time));
               // commented out because each frame would be written to disk instead of holding them in memory
               //  frames.add(frame);
           }
           fmmr.release();
           return frames;
       }
    </bitmap></bitmap>

    The above will logs :

    03-26 21:49:29.781  13213-13239/com.example.naveed.myapplication D/TAG﹕ length: 4949000
    03-26 21:49:30.187  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 1 Time taken: 406
    03-26 21:49:30.779  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 2 Time taken: 592
    03-26 21:49:31.578  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 3 Time taken: 799
    03-26 21:49:32.632  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 4 Time taken: 1054
    03-26 21:49:33.895  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 5 Time taken: 1262
    03-26 21:49:35.382  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 6 Time taken: 1486
    03-26 21:49:37.128  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 7 Time taken: 1746
    03-26 21:49:39.077  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 8 Time taken: 1948
    03-26 21:49:41.287  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 9 Time taken: 2210
    03-26 21:49:43.717  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 10 Time taken: 2429
    03-26 21:49:44.093  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 11 Time taken: 376
    03-26 21:49:44.707  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 12 Time taken: 614
    03-26 21:49:45.539  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 13 Time taken: 831
    03-26 21:49:46.597  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 14 Time taken: 1057
    03-26 21:49:47.875  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 15 Time taken: 1278
    03-26 21:49:49.384  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 16 Time taken: 1508
    03-26 21:49:51.112  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 17 Time taken: 1728
    03-26 21:49:53.096  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 18 Time taken: 1983
    03-26 21:49:55.315  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 19 Time taken: 2218
    03-26 21:49:57.711  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 20 Time taken: 2396
    03-26 21:49:58.065  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 21 Time taken: 354
    03-26 21:49:58.640  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 22 Time taken: 574
    03-26 21:49:59.369  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 23 Time taken: 728
    03-26 21:50:00.112  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 24 Time taken: 742
    03-26 21:50:00.834  13213-13239/com.example.naveed.myapplication D/TAG﹕ Frame number: 25 Time taken: 721

    As you can see from above, it is taking about 18 - 25 sec to retrieve 25 frames from a 4 sec long video.

    I have also tried this which uses FFmpeg underneath to do the same. I am not sure how well this library is implemented but it only improves the over all performance by a couple of seconds meaning it takes about 15-20 sec to do the same.

    So my question is : is there a way to do it quicker ? My friend has an iOS app where he does something similar but it only takes couple of seconds and he is grabbing even more frames however he is not sure how to do it on android.

    Is there anything on android that would speed up the process. Am I approaching this wrong ?

    The end goal is to stitch those frames together into a gif.

  • how to run python opencv using node js and pipe opencv output to ffmpeg and pipe ffmpeg output to nodejs

    31 octobre 2020, par R R

    const express = require('express')&#xA;const app = express()

    &#xA;

    app.get('/', (req, res) =>

    &#xA;

    const { spawn } = require(&#x27;child_process&#x27;);&#xA;const pyProg = spawn(&#x27;python&#x27;, [&#x27;./ml.py&#x27;]);&#xA;pyProg.stdout.on(&#x27;data&#x27;, (data) => {&#xA;    console.log(`stdout: ${data}`);&#xA;  });&#xA;

    &#xA;

    )

    &#xA;

    app.listen(4000, () => console.log('Application listening on port 4000 !'))

    &#xA;

    #capture.py

    &#xA;

  • Anomalie #4562 (En cours) : Suite #4468 : Unification des CSS pour les boutons et les icônes

    5 octobre 2020, par b b

    Je crois que j’ai trouvé un effet de bord sur les boutons des items de la liste des traductions d’un article, exemple ici :

    https://www.spip.net/ecrire/?exec=article&id_article=6431

    La même liste sur contrib :

    https://contrib.spip.net/ecrire/?exec=article&id_article=4189

    La première n’affiche plus l’icone du micro dans les boutons, la seconde si.