Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (62)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (8570)

  • Not able to encode image with ffmpeg

    29 juin 2012, par user1310596

    I am trying to encode one image with the help of ffmpeg library.. Actually i want to encode live video but for now i am starting with encoding an image..
    Here is my code for that..

       av_register_all();
       avcodec_init();
       avcodec_register_all();
       avformat_alloc_context();

       AVCodec *codec;
       AVCodecContext *ctx= NULL;
       int out_size, size, outbuf_size;
       AVFrame *picture;
       uint8_t *outbuf;
       unsigned char *flvdata = malloc(sizeof(unsigned char) * 30);


       outbuf_size = 100000;
       outbuf = malloc(outbuf_size);


       printf("Video encoding\n");

       codec = avcodec_find_encoder(CODEC_ID_FLV1);
       if (!codec) {
               fprintf(stderr, "codec not found\n");
               exit(1);
       }

       ctx= avcodec_alloc_context();
       picture= avcodec_alloc_frame();


       ctx->width = 320;
       ctx->height = 240;
       ctx -> sample_rate = 11025;
       ctx -> time_base.den = 1000;
       ctx -> time_base.num = 23976;
       ctx -> codec_id = CODEC_ID_FLV1;
       ctx -> codec_type = CODEC_TYPE_VIDEO;
       ctx->pix_fmt = PIX_FMT_YUV420P;

       if (avcodec_open(ctx, codec) < 0) {
               fprintf(stderr, "could not open codec\n");
               exit(1);
       }

       outbuf_size = 100000;
       outbuf = malloc(outbuf_size);
       size = ctx->width * ctx->height;

       AVFrame* outpic = avcodec_alloc_frame();
       int nbytes = avpicture_get_size(PIX_FMT_YUV420P, ctx->width, ctx->height);

       uint8_t* outbuffer = (uint8_t*)av_malloc(nbytes);

       fflush(stdout);

       int numBytes = avpicture_get_size(PIX_FMT_YUV420P, ctx->width, ctx->height);

       UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"0.jpg"]];
       CGImageRef newCgImage = [image CGImage];

       CGDataProviderRef dataProvider = CGImageGetDataProvider(newCgImage);
       CFDataRef bitmapData = CGDataProviderCopyData(dataProvider);
       long dataLength = CFDataGetLength(bitmapData);

       uint8_t *buffer = (uint8_t *)av_malloc(dataLength);
       buffer = (uint8_t *)CFDataGetBytePtr(bitmapData);

       for(int i = 0; i < dataLength; i++)
       {
               if((i + 1) % 16 == 1 && i != 1)
                       printf("\n");
               printf("%X\t",buffer[i]); // getting something different than the     actual hex value of the image
       }



       outpic -> pts = 0;        

       avpicture_fill((AVPicture*)picture, buffer, PIX_FMT_RGB8, ctx->width, ctx->height);

       avpicture_fill((AVPicture*)outpic, outbuffer, PIX_FMT_YUV420P, ctx->width, ctx->height);

       struct SwsContext* fooContext = sws_getContext(ctx->width, ctx->height,
                                                              PIX_FMT_RGB8,
                                                              ctx->width, ctx->height,
                                                              PIX_FMT_YUV420P,
                                                              SWS_FAST_BILINEAR, NULL, NULL, NULL);

       sws_scale(fooContext, picture->data, picture->linesize, 0, ctx->height, outpic->data, outpic->linesize);

       printf("abcdefghijklmnop");
       out_size = avcodec_encode_video(ctx, outbuf, outbuf_size, outpic);
       printf("\n\n out_size %d   outbuf_size %d",out_size,outbuf_size);

    so the size of image is 29 kb and the avcodec_encode_video is returning 20143.. So is it correct ? I mean i am encoding so its size should also decrease... And i have opened that image in hex mode and i am getting different data than that is in buffer (as shown in the code). so i think that buffer is not getting correct data. Right ?
    Can anyone please help me with my code ?
    Thank you in advance...

  • Revision 1e30547984 : Skip mode search based on reference frame consistency This commit enables the e

    12 août 2014, par Jingning Han

    Changed Paths :
     Modify /vp9/encoder/vp9_rdopt.c



    Skip mode search based on reference frame consistency

    This commit enables the encoder to skip NEARMV and ZEROMV if the
    above and left blocks have identical reference frame, and the
    current reference is different from that. It reduces the runtime
    of speed 3 for test sequences :
    bus cif at 1000 kbps 10064 ms -> 9823 ms
    pedestrian 1080p at 2000 kbps 193078 ms -> 189559 ms

    The compression performance is changed by
    derf -0.085%
    stdhd -0.103%

    Change-Id : If304f26d42e6412152a84c3dd7b02635c38444f4

  • getting black and white image after encoding

    16 mai 2012, par user1310596

    I am trying to encode image using ffmpeg library and objective c. I am using following code but I am getting black and white image as the result. Is there something to do with pixel format(PIX_FMT) ? Please help me so that I can get colored image.

    av_register_all();
    avcodec_init();
    avcodec_register_all();
    avformat_alloc_context();

    AVCodec *codec;
    AVCodecContext *ctx= NULL;
    int out_size, size, outbuf_size;
    AVFrame *picture;
    uint8_t *outbuf;
    unsigned char *flvdata = malloc(sizeof(unsigned char) * 30);


    outbuf_size = 200000;
    outbuf = malloc(outbuf_size);


    printf("Video encoding\n");

    codec = avcodec_find_encoder(CODEC_ID_FLV1);
    if (!codec) {
           fprintf(stderr, "codec not found\n");
           exit(1);
    }

    ctx= avcodec_alloc_context();
    picture= avcodec_alloc_frame();


    ctx->width = 320;
    ctx->height = 240;
    ctx -> sample_rate = 11025;
    ctx -> time_base.den = 1000;
    ctx -> time_base.num = 23976;
    ctx -> codec_id = CODEC_ID_FLV1;
    ctx -> codec_type = CODEC_TYPE_VIDEO;
    ctx->pix_fmt = PIX_FMT_YUV420P;

    if (avcodec_open(ctx, codec) < 0) {
           fprintf(stderr, "could not open codec\n");
           exit(1);
    }

    outbuf_size = 100000;
    outbuf = malloc(outbuf_size);
    size = ctx->width * ctx->height;

    AVFrame* outpic = avcodec_alloc_frame();
    int nbytes = avpicture_get_size(PIX_FMT_YUV420P, ctx->width, ctx->height);

    uint8_t* outbuffer = (uint8_t*)av_malloc(nbytes);

    fflush(stdout);

    int numBytes = avpicture_get_size(PIX_FMT_YUV420P, ctx->width, ctx->height);

    UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"0.jpg"]];
    CGImageRef newCgImage = [image CGImage];

    CGDataProviderRef dataProvider = CGImageGetDataProvider(newCgImage);
    CFDataRef bitmapData = CGDataProviderCopyData(dataProvider);
    long dataLength = CFDataGetLength(bitmapData);

    uint8_t *buffer = (uint8_t *)av_malloc(dataLength);
    buffer = (uint8_t *)CFDataGetBytePtr(bitmapData);

    for(int i = 0; i < dataLength; i++)
    {
           if((i + 1) % 16 == 1 && i != 1)
                   printf("\n");
           printf("%X\t",buffer[i]); // getting something different than the     actual hex value of the image
    }



    outpic -> pts = 0;        

    avpicture_fill((AVPicture*)picture, buffer, PIX_FMT_RGB8, ctx->width, ctx->height);

    avpicture_fill((AVPicture*)outpic, outbuffer, PIX_FMT_YUV420P, ctx->width, ctx->height);

    struct SwsContext* fooContext = sws_getContext(ctx->width, ctx->height,
                                                          PIX_FMT_RGB8,
                                                          ctx->width, ctx->height,
                                                          PIX_FMT_YUV420P,
                                                          SWS_FAST_BILINEAR, NULL, NULL, NULL);

    sws_scale(fooContext, picture->data, picture->linesize, 0, ctx->height, outpic->data, outpic->linesize);

    printf("abcdefghijklmnop");
    out_size = avcodec_encode_video(ctx, outbuf, outbuf_size, outpic);
    printf("\n\n out_size %d   outbuf_size %d",out_size,outbuf_size);

    Thanks in advance