Recherche avancée

Médias (91)

Autres articles (28)

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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (5315)

  • Pointer peril

    18 octobre 2011, par Mans — Bugs, Optimisation

    Use of pointers in the C programming language is subject to a number of constraints, violation of which results in the dreaded undefined behaviour. If a situation with undefined behaviour occurs, anything is permitted to happen. The program may produce unexpected results, crash, or demons may fly out of the user’s nose.

    Some of these rules concern pointer arithmetic, addition and subtraction in which one or both operands are pointers. The C99 specification spells it out in section 6.5.6 :

    When an expression that has integer type is added to or subtracted from a pointer, the result has the type of the pointer operand. […] If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow ; otherwise, the behavior is undefined. […]

    When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object ; the result is the difference of the subscripts of the two array elements.

    In simpler, if less accurate, terms, operands and results of pointer arithmetic must be within the same array object. If not, anything can happen.

    To see some of this undefined behaviour in action, consider the following example.

    #include <stdio.h>
    

    int foo(void)

    int a, b ;
    int d = &b - &a ; /* undefined */
    int *p = &a ;
    b = 0 ;
    p[d] = 1 ; /* undefined */
    return b ;

    int main(void)

    printf("%d\n", foo()) ;
    return 0 ;

    This program breaks the above rules twice. Firstly, the &a - &b calculation is undefined because the pointers being subtracted do not point to elements of the same array. Most compilers will nonetheless evaluate this to the distance between the two variables on the stack. Secondly, accessing p[d] is undefined because p and p + d do not point to elements of the same array (unless the result of the first undefined expression happened to be zero).

    It might be tempting to assume that on a modern system with a single, flat address space, these operations would result in the intuitively obvious outcomes, ultimately setting b to the value 1 and returning this same value. However, undefined is undefined, and the compiler is free to do whatever it wants :

    $ gcc -O undef.c
    $ ./a.out
    0

    Even on a perfectly normal system, compiled with optimisation enabled the program behaves as though the write to p[d] were ignored. In fact, this is exactly what happened, as this test shows :

    $ gcc -O -fno-tree-pta undef.c
    $ ./a.out
    1

    Disabling the tree-pta optimisation in gcc gives us back the intuitive behaviour. PTA stands for points-to analysis, which means the compiler analyses which objects any pointers can validly access. In the example, the pointer p, having been set to &a cannot be used in a valid access to the variable b, a and b not being part of the same array. Between the assignment b = 0 and the return statement, no valid access to b takes place, whence the return value is derived to be zero. The entire function is, in fact, reduced to the assembly equivalent of a simple return 0 statement, all because we decided to violate a couple of language rules.

    While this example is obviously contrived for clarity, bugs rooted in these rules occur in real programs from time to time. My most recent encounter with one was in PARI/GP, where a somewhat more complicated incarnation of the example above can be found. Unfortunately, the maintainers of this program are not responsive to reports of such bad practices in their code :

    Undefined according to what rule ? The code is only requiring the adress space to be flat which is true on all supported platforms.

    The rule in question is, of course, the one quoted above. Since the standard makes no exception for flat address spaces, no such exception exists. Although the behaviour could be logically defined in this case, it is not, and all programs must still follow the rules. Filing bug reports against the compiler will not make them go away. As of this writing, the issue remains unresolved.

  • PHP - How to get Shell errors echoed out to screen

    26 février 2013, par Ash

    I am in the process of using shell_exec() for the first time. I am trying to convert some video files on my server using the ffmpeg shell script.

    When I the below code in the browser, it returns NULL :

    var_dump(shell_exec("ffmpeg -i /var/www/html/sitedomain/httpdocs/tmp/ebev1177.mp4"));

    However when I run the equivalent code in my terminal :

    > ffmpeg -i /var/www/html/sitedomain/httpdocs/tmp/ebev1177.mp4

    I get back a whole load of useful information which ends in an error "At least one output file must be specified"

    Why is this info not being passed back to my PHP script so I can echo it out ?

  • Anomalie #2942 (Fermé) : {"inter"} bugue si on a un critère {id_rubrique=#ID_OBJET}

    28 février 2013, par marcimat -

    Je ne sais pas ce que tu veux faire, mais la réaction du compilo est correcte. Tu dis quelque chose d’équivalent à (RUBRIQUES)id_rubrique=3"inter". Forcément il n’y a qu’un résultat à la boucle. Donc, pas de inter et une partie alternative toujours présente. Je ferme (...)