Recherche avancée

Médias (91)

Autres articles (66)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • 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

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

Sur d’autres sites (5106)

  • ffmpeg code changes

    12 juillet 2012, par toutou0091

    To install FFmpeg, I followed the instructionsin this web sit http://buildall.wordpress.com/2011/05/09/how-to-compile-and-install-ffmpeg-in-ubuntu-11-04/ and it works well. In the file "mpegvideo_enc.c" there is a variable called "qp". I added in this file the istruction printf to display this varaible. I redid after : ". / configure" and "make" and it works as well. The Result of this compilation gives no executable file. I would like to know why the printf that I added in the code is not displayed ?
    Thank u in advance.

  • Different code(.java file) for different platform ?

    2 mars 2016, par AR792

    I have a code where image data is passed from bitmap to FFmpeg frame recorder and converted to a video. But i need to make small changes while running it on LG G3(armv7) from Asus zenfone 5(x86).

    Following are the class variables that create the issue :(declared under, class Main Activity)

    inputWidth = 1024 ;

    inputHeight = 650 ;

    Following is the method where the issue occurs :

    byte [] getNV21(int inputWidth, int inputHeight, Bitmap bitmap) {

       int [] argb = new int[inputWidth * inputHeight];

       bitmap.getPixels(argb, 0, inputWidth, 0, 0, inputWidth, inputHeight);

       byte [] yuv = new byte[inputWidth*inputHeight*3/2];
       encodeYUV420SP(yuv, argb, inputWidth, inputHeight);

       return yuv;
    }

    void encodeYUV420SP(byte[] yuv420sp, int[] argb, int width, int height) {
       final int frameSize = width * height;

       int yIndex = 0;
       int uvIndex = frameSize;

       int a, R, G, B, Y, U, V;
       int index = 0;
       for (int j = 0; j < height; j++) {
           for (int i = 0; i < width; i++) {

               a = (argb[index] & 0xff000000) >> 24; // a is not used obviously
               R = (argb[index] & 0xff0000) >> 16;
               G = (argb[index] & 0xff00) >> 8;
               B = (argb[index] & 0xff) >> 0;

               // well known RGB to YUV algorithm
               Y = ( (  66 * R + 129 * G +  25 * B + 128) >> 8) +  16;
               U = ( ( -38 * R -  74 * G + 112 * B + 128) >> 8) + 128;
               V = ( ( 112 * R -  94 * G -  18 * B + 128) >> 8) + 128;

               // NV21 has a plane of Y and interleaved planes of VU each sampled by a factor of 2
               //    meaning for every 4 Y pixels there are 1 V and 1 U.  Note the sampling is every other
               //    pixel AND every other scanline.
               yuv420sp[yIndex++] = (byte) ((Y < 0) ? 0 : ((Y > 255) ? 255 : Y));
               if (j % 2 == 0 && index % 2 == 0) {
                   yuv420sp[uvIndex++] = (byte)((V<0) ? 0 : ((V > 255) ? 255 : V));
                   yuv420sp[uvIndex++] = (byte)((U<0) ? 0 : ((U > 255) ? 255 : U));
               }

               index ++;
           }
       }
    }

    Working CODE :

    LG G3 :I can use the above variables at any place in the code to get the required output.
    Bitmap size returned = 2734200

    Asus Zenfone 5 : Except at creating the bitmap, I have to use everywhere else bitmap.getHeight() and bitmap.getWidth(), to get the required output.

    Surprisingly here Bitmap size returned = 725760 (So its not setting according to set bitmap parameters ?)

    INCORRECT CODE :

    LG G3 : IF i use bitmap.getHeight() and bitmap.getWidth(), i get java.lang.ArrayIndexOutOfBoundsException : length = 102354 , index = 102354. @getNV21 method

    Asus Zenfone 5 : If i use inputWidth , inputHeight i get
    java.lang.IllegalArgumentException : x + width must be <= bitmap.width() @getNV21 method

    How can i generalize the above code for both phones ?

  • When I run code in Docker I get a Django error [Errno 2]. When running locally everything works. Why ?

    8 février 2021, par Bartłomiej Kokoszka

    I don't know what's going on. A script run by Django works fine, but not through Docker and Django. An error is returned :

    &#xA;

    Pic Errno 2 No such file or directory

    &#xA;

    Below is the code of the function with the error and the code of the Dockerfile.

    &#xA;

    '''

    &#xA;

    def mediainfo(filepath):&#xA;    &#xA;

    &#xA;

    Original code :

    &#xA;

    &#xA;
        prober = get_prober_name()&#xA;    command_args = [&#xA;        "-v", "quiet",&#xA;        "-show_format",&#xA;        "-show_streams",&#xA;        filepath&#xA;    ]&#xA;&#xA;    command = [prober, &#x27;-of&#x27;, &#x27;old&#x27;] &#x2B; command_args&#xA;

    &#xA;

    &#xA;

    Modified code :

    &#xA;

    &#xA;
        command = f"ffprobe -v error -show_format -show_streams -select_streams v:0 {filepath}"&#xA;

    &#xA;

    &#xA;

    The rest of the functions :

    &#xA;

        res = Popen(command, stdout=PIPE)&#xA;    output = res.communicate()[0].decode("utf-8")&#xA;&#xA;    if res.returncode != 0:&#xA;        output = Popen(command, stdout=PIPE).communicate()[0].decode("utf-8")&#xA;&#xA;    rgx = re.compile(r"(?:(?P.*?):)?(?P<key>.*?)\=(?P<value>.*?)$")&#xA;    info = {}&#xA;&#xA;    if sys.platform == &#x27;win32&#x27;:&#xA;        output = output.replace("\r", "")&#xA;&#xA;    for line in output.split("\n"):&#xA;        # print(line)&#xA;        mobj = rgx.match(line)&#xA;&#xA;        if mobj:&#xA;            # print(mobj.groups())&#xA;            inner_dict, key, value = mobj.groups()&#xA;&#xA;            if inner_dict:&#xA;                try:&#xA;                    info[inner_dict]&#xA;                except KeyError:&#xA;                    info[inner_dict] = {}&#xA;                info[inner_dict][key] = value&#xA;            else:&#xA;                info[key] = value&#xA;&#xA;    return info&#xA;</value></key>

    &#xA;

    '''

    &#xA;

    Code of the Dockerfile

    &#xA;

    '''

    &#xA;

    FROM python:3.7 as base&#xA;&#xA;EXPOSE 80&#xA;&#xA;WORKDIR /app&#xA;COPY . /app&#xA;&#xA;&#xA;ENV PYTHONDONTWRITEBYTECODE=1&#xA;&#xA;ENV PYTHONUNBUFFERED=1&#xA;&#xA;RUN pip install --upgrade pip&#xA;RUN echo &#x27;deb http://deb.debian.org/debian buster-backports main contrib non-free&#x27; >> /etc/apt/sources.list&#xA;RUN apt-get update&#xA;&#xA;RUN apt-get -y install ffmpeg&#xA;RUN apt-get update&#xA;&#xA;COPY requirements.txt .&#xA;RUN python -m pip install -r requirements.txt&#xA;&#xA;FROM base as prod&#xA;&#xA;ENTRYPOINT ["python","manage.py","runserver","0.0.0.0:80"]&#xA;

    &#xA;

    '''

    &#xA;