Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (79)

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

  • 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

Sur d’autres sites (5186)

  • Finding Optimal Code Coverage

    7 mars 2012, par Multimedia Mike — Programming

    A few months ago, I published a procedure for analyzing code coverage of the test suites exercised in FFmpeg and Libav. I used it to add some more tests and I have it on good authority that it has helped other developers fill in some gaps as well (beginning with students helping out with the projects as part of the Google Code-In program). Now I’m wondering about ways to do better.

    Current Process
    When adding a test that depends on a sample (like a demuxer or decoder test), it’s ideal to add a sample that’s A) small, and B) exercises as much of the codebase as possible. When I was studying code coverage statistics for the WC4-Xan video decoder, I noticed that the sample didn’t exercise one of the 2 possible frame types. So I scouted samples until I found one that covered both types, trimmed the sample down, and updated the coverage suite.

    I started wondering about a method for finding the optimal test sample for a given piece of code, one that exercises every code path in a module. Okay, so that’s foolhardy in the vast majority of cases (although I was able to add one test spec that pushed a module’s code coverage from 0% all the way to 100% — but the module in question only had 2 exercisable lines). Still, given a large enough corpus of samples, how can I find the smallest set of samples that exercise the complete codebase ?

    This almost sounds like an NP-complete problem. But why should that stop me from trying to find a solution ?

    Science Project
    Here’s the pitch :

    • Instrument FFmpeg with code coverage support
    • Download lots of media to exercise a particular module
    • Run FFmpeg against each sample and log code coverage statistics
    • Distill the resulting data in some meaningful way in order to obtain more optimal code coverage

    That first step sounds harsh– downloading lots and lots of media. Fortunately, there is at least one multimedia format in the projects that tends to be extremely small : ANSI. These are files that are designed to display elaborate scrolling graphics using text mode. Further, the FATE sample currently deployed for this test (TRE_IOM5.ANS) only exercises a little less than 50% of the code in libavcodec/ansi.c. I believe this makes the ANSI video decoder a good candidate for this experiment.

    Procedure
    First, find a site that hosts a lot ANSI files. Hi, sixteencolors.net. This site has lots (on the order of 4000) artpacks, which are ZIP archives that contain multiple ANSI files (and sometimes some other files). I scraped a list of all the artpack names.

    In an effort to be responsible, I randomized the list of artpacks and downloaded periodically and with limited bandwidth ('wget --limit-rate=20k').

    Run ‘gcov’ on ansi.c in order to gather the full set of line numbers to be covered.

    For each artpack, unpack the contents, run the instrumented FFmpeg on each file inside, run ‘gcov’ on ansi.c, and log statistics including the file’s size, the file’s location (artpack.zip:filename), and a comma-separated list of line numbers touched.

    Definition of ‘Optimal’
    The foregoing procedure worked and yielded useful, raw data. Now I have to figure out how to analyze it.

    I think it’s most desirable to have the smallest files (in terms of bytes) that exercise the most lines of code. To that end, I sorted the results by filesize, ascending. A Python script initializes a set of all exercisable line numbers in ansi.c, then iterates through each each file’s stats line, adding the file to the list of candidate samples if its set of exercised lines can remove any line numbers from the overall set of lines. Ideally, that set of lines should devolve to an empty set.

    I think a second possible approach is to find the single sample that exercises the most code and then proceed with the previously described method.

    Initial Results
    So far, I have analyzed 13324 samples from 357 different artpacks provided by sixteencolors.net.

    Using the first method, I can find a set of samples that covers nearly 80% of ansi.c :

    <br />
    0 bytes: bad-0494.zip:5<br />
    1 bytes: grip1293.zip:-ANSI---.---<br />
    1 bytes: pur-0794.zip:.<br />
    2 bytes: awe9706.zip:-ANSI───.───<br />
    61 bytes: echo0197.zip:-(ART)-<br />
    62 bytes: hx03.zip:HX005.DAT<br />
    76 bytes: imp-0494.zip:IMPVIEW.CFG<br />
    82 bytes: ice0010b.zip:_cont'd_.___<br />
    101 bytes: bdp-0696.zip:BDP2.WAD<br />
    112 bytes: plain12.zip:--------.---<br />
    181 bytes: ins1295v.zip:-°VGA°-.  н<br />
    219 bytes: purg-22.zip:NEM-SHIT.ASC<br />
    289 bytes: srg1196.zip:HOWTOREQ.JNK<br />
    315 bytes: karma-04.zip:FASHION.COM<br />
    318 bytes: buzina9.zip:ox-rmzzy.ans<br />
    411 bytes: solo1195.zip:FU-BLAH1.RIP<br />
    621 bytes: ciapak14.zip:NA-APOC1.ASC<br />
    951 bytes: lght9404.zip:AM-TDHO1.LIT<br />
    1214 bytes: atb-1297.zip:TX-ROKL.ASC<br />
    2332 bytes: imp-0494.zip:STATUS.ANS<br />
    3218 bytes: acepak03.zip:TR-STAT5.ANS<br />
    6068 bytes: lgc-0193.zip:LGC-0193.MEM<br />
    16778 bytes: purg-20.zip:EZ-HIR~1.JPG<br />
    20582 bytes: utd0495.zip:LT-CROW3.ANS<br />
    26237 bytes: quad0597.zip:MR-QPWP.GIF<br />
    29208 bytes: mx-pack17.zip:mx-mobile-source-logo.jpg<br />
    ----<br />
    109440 bytes total<br />

    A few notes about that list : Some of those filenames are comprised primarily of control characters. 133t, and all that. The first file is 0 bytes. I wondered if I should discard 0-length files but decided to keep those in, especially if they exercise lines that wouldn’t normally be activated. Also, there are a few JPEG and GIF files in the set. I should point out that I forced the tty demuxer using -f tty and there isn’t much in the way of signatures for this format. So, again, whatever exercises more lines is better.

    Using this same corpus, I tried approach 2– which single sample exercises the most lines of the decoder ? Answer : blde9502.zip:REQUEST.EXE. Huh. I checked it out and ‘file’ ID’s it as a MS-DOS executable. So, that approach wasn’t fruitful, at least not for this corpus since I’m forcing everything through this narrow code path.

    Think About The Future
    Where can I take this next ? The cloud ! I have people inside the search engine industry who have furnished me with extensive lists of specific types of multimedia files from around the internet. I also see that Amazon Web Services Elastic Compute Cloud (AWS EC2) instances don’t charge for incoming bandwidth.

    I think you can see where I’m going with this.

    See Also :

  • AWS EC2 and OpenCV with UDP consumer

    22 juillet 2021, par NoobZik

    I have two EC2

    &#xA;

      &#xA;
    • A That grabs the video feed from Amazon Kinesis Video to send it into via UDP to B
    • &#xA;

    • B the consumer which it will grab the UDP feed from the A
    • &#xA;

    &#xA;

    While debugging my opencv not grabbing the UDP feed, I suspect something is wrong with ffpmeg, so I am going to make sure that ffplay can read packets sent from A.

    &#xA;

    Now when I try to read udp packets with ffplay {adress-ip-with-port}I have the following error :

    &#xA;

    Could not initialize SDL - No available video device&#xA;(Did you set the DISPLAY variable?)&#xA;

    &#xA;

    How do I fix this one since there is no display on EC2.

    &#xA;

    Also if it can help, this is my code for the consumer part

    &#xA;

     Create your views here.&#xA;from django.http import HttpResponse&#xA;from django.template import loader&#xA;from django.shortcuts import render&#xA;# from .models import Vehicule&#xA;import cv2&#xA;import threading&#xA;from django.views.decorators import gzip&#xA;from django.http import StreamingHttpResponse&#xA;&#xA;&#xA;@gzip.gzip_page&#xA;def webcam(request):&#xA;    try:&#xA;        cam = VideoCamera()&#xA;        return StreamingHttpResponse(gen(cam), content_type="multipart/x-mixed-replace;boundary=frame")&#xA;    except:&#xA;        pass&#xA;    return render(request, &#x27;vebcam.html&#x27;)&#xA;&#xA;#capture video&#xA;class VideoCamera(object):&#xA;    def __init__(self):&#xA;        self.video = cv2.VideoCapture(&#x27;udp://172.31.57.243:55055&#x27;, cv2.CAP_FFMPEG)&#xA;        (self.grabbed, self.frame) = self.video.read()&#xA;        threading.Thread(target=self.update, args=()).start()&#xA;&#xA;    def __del__(self):&#xA;        self.video.release()&#xA;&#xA;    def get_frame(self):&#xA;        image = self.frame&#xA;        _, jpeg = cv2.imencode(&#x27;.jpg&#x27;, image)&#xA;        return jpeg.tobytes()&#xA;&#xA;    def update(self):&#xA;        while True:&#xA;            (self.grabbed, self.frame) = self.video.read()&#xA;&#xA;def gen(camera):&#xA;    while True:&#xA;        frame = camera.get_frame()&#xA;        yield (b&#x27;--frame\r\n&#x27;b&#x27;Content-Type: image/jpeg\r\n\r\n&#x27; &#x2B; frame &#x2B; b&#x27;\r\n\r\n&#x27;)&#xA;

    &#xA;

    It runs fine on local but not on EC2

    &#xA;

    This is the log that led me to check ffplay

    &#xA;

    Traceback (most recent call last):&#xA;  File "/usr/lib/python3.8/wsgiref/handlers.py", line 138, in run&#xA;    self.finish_response()&#xA;  File "/usr/lib/python3.8/wsgiref/handlers.py", line 183, in finish_response&#xA;    for data in self.result:&#xA;  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/utils/text.py", line 304, in compress_sequence&#xA;    for item in sequence:&#xA;  File "/home/ubuntu/site/mysite/mysite/views.py", line 42, in gen&#xA;    frame = camera.get_frame()&#xA;  File "/home/ubuntu/site/mysite/mysite/views.py", line 33, in get_frame&#xA;    _, jpeg = cv2.imencode(&#x27;.jpg&#x27;, image)&#xA;cv2.error: OpenCV(4.5.3) /tmp/pip-req-build-xw6jtoah/opencv/modules/imgcodecs/src/loadsave.cpp:978: error: (-215:Assertion failed) !image.empty() in function &#x27;imencode&#x27;&#xA;

    &#xA;

  • lavc/aarch64 : motion estimation functions in neon

    26 juin 2022, par Swinney, Jonathan
    lavc/aarch64 : motion estimation functions in neon
    

    - ff_pix_abs16_neon
    - ff_pix_abs16_xy2_neon

    In direct micro benchmarks of these ff functions verses their C implementations,
    these functions performed as follows on AWS Graviton 3.

    ff_pix_abs16_neon :
    pix_abs_0_0_c : 141.1
    pix_abs_0_0_neon : 19.6

    ff_pix_abs16_xy2_neon :
    pix_abs_0_3_c : 269.1
    pix_abs_0_3_neon : 39.3

    Tested with :
    ./tests/checkasm/checkasm —test=motion —bench —disable-linux-perf

    Signed-off-by : Jonathan Swinney <jswinney@amazon.com>
    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavcodec/aarch64/Makefile
    • [DH] libavcodec/aarch64/me_cmp_init_aarch64.c
    • [DH] libavcodec/aarch64/me_cmp_neon.S
    • [DH] libavcodec/me_cmp.c
    • [DH] libavcodec/me_cmp.h
    • [DH] tests/checkasm/Makefile
    • [DH] tests/checkasm/checkasm.c
    • [DH] tests/checkasm/checkasm.h
    • [DH] tests/checkasm/motion.c
    • [DH] tests/fate/checkasm.mak