Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (91)

  • L’utiliser, en parler, le critiquer

    10 avril 2011

    La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
    Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
    Une liste de discussion est disponible pour tout échange entre utilisateurs.

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

Sur d’autres sites (10378)

  • Difference between single and double quotes in subprocess [Python 3.4]

    11 décembre 2016, par Vasilis

    I’m using Python 3.4 in Windows Server 12 and I have some Python code that executes the ffmpeg command bellow :

    ffmpeg -i input.mp4 -vf select='not(mod(n\,30)),setpts=N/((30)*TB)' -c:v rawvideo  -pix_fmt uyvy422 -y output.avi

    I use the following code to execute the external command :

    try:
       output = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
    except subprocess.CalledProcessError as exc:
       print ("Command %s failed with error code" % command, exc.returncode, exc.output, file=sys.stderr)

    When I pass the command enclosed in single quotes it successfully runs the command :

    command = 'ffmpeg -i input.mp4 -vf select="not(mod(n\,30)),setpts=N/((30)*TB)" -c:v rawvideo  -pix_fmt uyvy422 -y output.avi'

    When I pass the command as a string enclosed in double quotes it fails :

    command = "ffmpeg -i input.mp4 -vf select='not(mod(n\,30)),setpts=N/((30)*TB)' -c:v rawvideo  -pix_fmt uyvy422 -y output.avi"

    The error message is the following :

    [Eval @ 0000000eaf2fe040] Invalid chars ',setpts=N/((30)*TB)' at the end of expression 'not(mod(n,30)),setpts=N/((30)*TB)'  
    [Parsed_select_0 @ 0000000eb0d27ca0] Error while parsing expression 'not(mod
    (n,30)),setpts=N/((30)*TB)'  
    [AVFilterGraph @ 0000000eb0d0a5a0] Error initializing filter 'select' with args 'not(mod(n\\,30)),setpts=N/((30)*TB)'  
    Error opening filters!"

    So it appears that when using double quotes the slash / that is part of the setpts=N/((30)*TB) option is not interpreted correctly, while with double quotes there’s no problem. Note that both commands (either with double or single quotes in the select option) work fine when I run them directly from the command prompt.
    However, I’ve seen many people saying that from a technical perspective single and double quotes make no difference, e.g.

    Does slash parsing depend on the quotes around the string or this is just a behavior specific to the executable I’m running ?

  • Anomalie #3688 (Nouveau) : Différence de traitement du IN selon qu’un critère est facultatif ou pas

    9 février 2016, par tcharlss (*´_ゝ`)

    Description :

    Il semble y avoir une différence de traitement selon qu’un critère est facultatif ou pas, quand dans l’environnement, la valeur correspondant au critère est un array. Dans un cas, ça fait bien un WHERE machin IN (x,y,z), dans l’autre, ça fait un WHERE machin = truc bizarre.

    Pour reproduire :

    Soit un squelette qui en inclus un autre :

    
    

    Squelette inclus :

    #ID_AUTEUR
    

    Au niveau de ce dernier, #ENV{id_auteur} est un tableau qui contient des strings, au lieu de int :

    array (size=10)
      0 => string ’1’ (length=1)
      1 => string ’2’ (length=1)
      etc.
    

    Avec le critere facultatif {id_auteur ?}, la boucle passe, on a bien un IN dans le WHERE :

    auteurs.id_auteur  IN (1,2,3,4,5,6,7,8,9,10)
    

    En revanche avec le critere id_auteur, ça ne fonctionne pas :

    auteurs.id_auteur = (2 1 (3) : 4)
    
  • TSCC RLE Decoding : Best way to get difference between two frames

    25 janvier 2016, par Dylan Alvaro

    Hello video codec experts,

    I am working with a video codec which is tscc video codec. It uses RLE algorithm.

    I am looking for a way to get the differences between the current decoded frame and the previous frame and store those differences in an array (the best case scenario would be to store those frame differences in an openCV matrice cv::Mat).

    Currently, I am waiting to have 2 frames decoded, I keep in memory those two decoded frames and from the 3rd one, I am comparing the two previous frames to look for any difference between them and then I store the differences in a vector.
    This algorithm could be optimized because I’m using lost of resources and not taking advantage of the compressed frame...

    If anyone could help me find a way to improve the idea I have behind this it would be great :

    The decode function is the following. (It uses two control bytes at the beginning of the compressed RLE frame to analyse whether it is an end of frame, end of line, jump of pixels, etc...) :

    static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
    {
       unsigned char *src = c->decomp_buf;
       unsigned char *output, *output_end;
       int p1, p2, line=c->height, pos=0, i;
       uint16_t pix16;
       uint32_t pix32;

       output = c->pic.data[0] + (c->height - 1) * c->pic.linesize[0];
       output_end = c->pic.data[0] + (c->height) * c->pic.linesize[0];
       while(src < c->decomp_buf + srcsize) {
           p1 = *src++;
           //Escape code
           if(p1 == 0)
           {
               p2 = *src++;
               if(p2 == 0) { //End-of-line
                   output = c->pic.data[0] + (--line) * c->pic.linesize[0];
                   if (line < 0)
                       return -1;
                   pos = 0;
                   continue;
               } else if(p2 == 1) { //End-of-picture
                   return 0;
               } else if(p2 == 2) { //Skip
                   p1 = *src++;
                   p2 = *src++;
                   line -= p2;
                   if (line < 0)
                       return -1;
                   pos += p1;
                   output = c->pic.data[0] + line * c->pic.linesize[0] + pos * (c->bpp / 8);
                   continue;
               }
               // Copy data
               if (output + p2 * (c->bpp / 8) > output_end) {
                   src += p2 * (c->bpp / 8);
                   continue;
               }
               if (c->bpp == 16)
               {
                   for(i = 0; i < p2; i++)
                   {
                       pix16 = AV_RL16(src);
                       src += 2;
                       *(uint16_t*)output = pix16;
                       output += 2;
                   }
               }
               pos += p2;
           }
           else
           { //Run of pixels
               int pix[4]; //original pixel
               switch(c->bpp){
               case  8: pix[0] = *src++;
                        break;
               case 16: pix16 = AV_RL16(src);
                        src += 2;
                        *(uint16_t*)pix = pix16;
                        break;
               case 24: pix[0] = *src++;
                        pix[1] = *src++;
                        pix[2] = *src++;
                        break;
               case 32: pix32 = AV_RL32(src);
                        src += 4;
                        *(uint32_t*)pix = pix32;
                        break;
               }
               if (output + p1 * (c->bpp / 8) > output_end)
                   continue;
               for(i = 0; i < p1; i++) {
                   switch(c->bpp){
                   case  8: *output++ = pix[0];
                            break;
                   case 16: *(uint16_t*)output = pix16;
                            output += 2;
                            break;
                   case 24: *output++ = pix[0];
                            *output++ = pix[1];
                            *output++ = pix[2];
                            break;
                   case 32: *(uint32_t*)output = pix32;
                            output += 4;
                            break;
                   }
               }
               pos += p1;
           }
       }

    Thank you for your kind help !