Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (58)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (5394)

  • Revision c5aac1771e298ce58f7353999948a17d0b8d059d : Pour se deplacer a l’interieur d’un document DATA, on utilise une notation ...

    22 décembre 2010, par Fil — Log

    Pour se deplacer a l’interieur d’un document DATA, on utilise une notation avec des slash plutot qu’avec des . ; c’est plus coherent avec l’existant, et plus proche de xpath. […] a noter dans l’exemple ci-dessus : #URL et #VALEURurl sont tous les deux bien renseignes : la description de (...)

  • How to get picture buffer data in ffmpeg ?

    5 juin 2014, par 4ntoine

    I’m trying to pass bitmap from ffmpeg to android.
    It already works but it’s displaying picture right on surface passed from java to native code.
    How can i get frame buffer bitmap data to pass it to java ?

    I’ve tried to save out_frame buffer data :

    unsigned char bmpFileHeader[14] = {'B', 'M', 0,0,0,0, 0,0, 0,0, 54, 0,0,0};
    unsigned char bmpInfoHeader[40] = {40,0,0,0, 0,0,0,0, 0,0,0,0, 1,0, 24,0};
    unsigned char bmpPad[3] = {0, 0, 0};

    void saveBuffer(int fileIndex, int width, int height, unsigned char *buffer, int buffer_size) {

       unsigned char filename[1024];
       sprintf(filename, "/storage/sdcard0/3d_player_%d.bmp", fileIndex);

       LOGI(10, "saving ffmpeg bitmap file: %d to %s", fileIndex, filename);

       FILE *bitmapFile = fopen(filename, "wb");
       if (!bitmapFile) {
           LOGE(10, "failed to create ffmpeg bitmap file");
           return;
       }

       unsigned char filesize = 54 + 3 * width * height; // 3 = (r,g,b)

       bmpFileHeader[2] = (unsigned char)(filesize);
       bmpFileHeader[3] = (unsigned char)(filesize >> 8);
       bmpFileHeader[4] = (unsigned char)(filesize >> 16);
       bmpFileHeader[5] = (unsigned char)(filesize >> 24);

       bmpInfoHeader[4] = (unsigned char)(width);
       bmpInfoHeader[5] = (unsigned char)(width >> 8);
       bmpInfoHeader[6] = (unsigned char)(width >> 16);
       bmpInfoHeader[7] = (unsigned char)(width >> 24);
       bmpInfoHeader[8] = (unsigned char)(height);
       bmpInfoHeader[9] = (unsigned char)(height >> 8);
       bmpInfoHeader[10] = (unsigned char)(height >> 16);
       bmpInfoHeader[11] = (unsigned char)(height >> 24);

       fwrite(bmpFileHeader, 1, 14, bitmapFile);
       fwrite(bmpInfoHeader, 1, 40, bitmapFile);
       int i;
       for (i=0; iplayer;
       int stream_no = decoder_data->stream_no;
       AVCodecContext * ctx = player->input_codec_ctxs[stream_no];
       AVFrame * frame = player->input_frames[stream_no];
       AVStream * stream = player->input_streams[stream_no];
       int interrupt_ret;
       int to_write;
       int err = 0;
       AVFrame *rgb_frame = player->rgb_frame;
       ANativeWindow_Buffer buffer;
       ANativeWindow * window;

    #ifdef MEASURE_TIME
       struct timespec timespec1, timespec2, diff;
    #endif // MEASURE_TIME
       LOGI(10, "player_decode_video decoding");
       int frameFinished;

    #ifdef MEASURE_TIME
       clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &timespec1);
    #endif // MEASURE_TIME
       int ret = avcodec_decode_video2(ctx, frame, &frameFinished,
               packet_data->packet);

    #ifdef MEASURE_TIME
       clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &timespec2);
       diff = timespec_diff(timespec1, timespec2);
       LOGI(3, "decode_video timediff: %d.%9ld", diff.tv_sec, diff.tv_nsec);
    #endif // MEASURE_TIME

       if (ret < 0) {
           LOGE(1, "player_decode_video Fail decoding video %d\n", ret);
           return -ERROR_WHILE_DECODING_VIDEO;
       }
       if (!frameFinished) {
           LOGI(10, "player_decode_video Video frame not finished\n");
           return 0;
       }

       // saving in buffer converted video frame
       LOGI(7, "player_decode_video copy wait");

    #ifdef MEASURE_TIME
       clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &timespec1);
    #endif // MEASURE_TIME

       pthread_mutex_lock(&player->mutex_queue);
       window = player->window;
       if (window == NULL) {
           pthread_mutex_unlock(&player->mutex_queue);
           goto skip_frame;
       }
       ANativeWindow_setBuffersGeometry(window, ctx->width, ctx->height,
               WINDOW_FORMAT_RGBA_8888);
       if (ANativeWindow_lock(window, &buffer, NULL) != 0) {
           pthread_mutex_unlock(&player->mutex_queue);
           goto skip_frame;
       }
       pthread_mutex_unlock(&player->mutex_queue);

       int format = buffer.format;
       if (format < 0) {
           LOGE(1, "Could not get window format")
       }
       enum PixelFormat out_format;
       if (format == WINDOW_FORMAT_RGBA_8888) {
           out_format = PIX_FMT_RGBA;
           LOGI(6, "Format: WINDOW_FORMAT_RGBA_8888");
       } else if (format == WINDOW_FORMAT_RGBX_8888) {
           out_format = PIX_FMT_RGB0;
           LOGE(1, "Format: WINDOW_FORMAT_RGBX_8888 (not supported)");
       } else if (format == WINDOW_FORMAT_RGB_565) {
           out_format = PIX_FMT_RGB565;
           LOGE(1, "Format: WINDOW_FORMAT_RGB_565 (not supported)");
       } else {
           LOGE(1, "Unknown window format");
       }

       avpicture_fill((AVPicture *) rgb_frame, buffer.bits, out_format,
               buffer.width, buffer.height);
       rgb_frame->data[0] = buffer.bits;
       if (format == WINDOW_FORMAT_RGBA_8888) {
           rgb_frame->linesize[0] = buffer.stride * 4;
       } else {
           LOGE(1, "Unknown window format");
       }
       LOGI(6,
               "Buffer: width: %d, height: %d, stride: %d",
               buffer.width, buffer.height, buffer.stride);
       int i = 0;

    #ifdef MEASURE_TIME
       clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &timespec2);
       diff = timespec_diff(timespec1, timespec2);
       LOGI(1,
               "lockPixels and fillimage timediff: %d.%9ld", diff.tv_sec, diff.tv_nsec);
    #endif // MEASURE_TIME
    #ifdef MEASURE_TIME
       clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &timespec1);
    #endif // MEASURE_TIME
       LOGI(7, "player_decode_video copying...");
       AVFrame * out_frame;
       int rescale;
       if (ctx->width == buffer.width && ctx->height == buffer.height) {
           // This always should be true
           out_frame = rgb_frame;
           rescale = FALSE;
       } else {
           out_frame = player->tmp_frame2;
           rescale = TRUE;
       }

       if (ctx->pix_fmt == PIX_FMT_YUV420P) {
           __I420ToARGB(frame->data[0], frame->linesize[0], frame->data[2],
                   frame->linesize[2], frame->data[1], frame->linesize[1],
                   out_frame->data[0], out_frame->linesize[0], ctx->width,
                   ctx->height);
       } else if (ctx->pix_fmt == PIX_FMT_NV12) {
           __NV21ToARGB(frame->data[0], frame->linesize[0], frame->data[1],
                   frame->linesize[1], out_frame->data[0], out_frame->linesize[0],
                   ctx->width, ctx->height);
       } else {
           LOGI(3, "Using slow conversion: %d ", ctx->pix_fmt);
           struct SwsContext *sws_context = player->sws_context;
           sws_context = sws_getCachedContext(sws_context, ctx->width, ctx->height,
                   ctx->pix_fmt, ctx->width, ctx->height, out_format,
                   SWS_FAST_BILINEAR, NULL, NULL, NULL);
           player->sws_context = sws_context;
           if (sws_context == NULL) {
               LOGE(1, "could not initialize conversion context from: %d"
               ", to :%d\n", ctx->pix_fmt, out_format);
               // TODO some error
           }
           sws_scale(sws_context, (const uint8_t * const *) frame->data,
                   frame->linesize, 0, ctx->height, out_frame->data,
                   out_frame->linesize);
       }

       if (rescale) {
           // Never occurs
           __ARGBScale(out_frame->data[0], out_frame->linesize[0], ctx->width,
                   ctx->height, rgb_frame->data[0], rgb_frame->linesize[0],
                   buffer.width, buffer.height, __kFilterNone);
           out_frame = rgb_frame;
       }

       // TODO: (4ntoine) frame decoded and rescaled, ready to call callback with frame picture from buffer
       int bufferSize = buffer.width * buffer.height * 3; // 3 = (r,g,b);  

       static int bitmapCounter = 0;
       if (bitmapCounter < 10) {
           saveBuffer(bitmapCounter++, buffer.width, buffer.height, (unsigned char *)out_frame->data, bufferSize);
       }

    but out_frame is empty and file has header and 0x00 bytes body.

    How to get picture buffer data in ffmpeg ?

  • Revision 6108ce178a70e3fb0655165b0cc661b0dfc5768e : Pas la peine de garder l’iterateur generique, car le décorateur fait très ...

    21 décembre 2010, par Matthieu Marcillaud — Log

    Pas la peine de garder l’iterateur generique, car le décorateur fait très bien l’affaire en passant un new Iterator() directement si la classe donnée n’existe pas. git-svn-id : svn ://trac.rezo.net/spip/spip@16785 caf5f3e8-d4fe-0310-bb3e-c32d5e47d55d