Recherche avancée

Médias (0)

Mot : - Tags -/latitude

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

Autres articles (103)

  • 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 ;

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

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

  • avcodec/s3tc : fix alpha decoding when dimensions are not a multiple of 4

    7 mai 2015, par Tom Butterworth
    avcodec/s3tc : fix alpha decoding when dimensions are not a multiple of 4
    

    Fix alpha position error for edge blocks of odd-dimensioned frames

    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavcodec/s3tc.c
  • ffmpeg/c++ Encode additional information of video frame with ffmpeg

    29 janvier 2018, par 8793

    I am new with ffmpeg & video encoding, after looking for some related questions on this page, I found this post which is very useful to understand the overview process of ffmpeg.

    However, my work not only needs to manipulate with Mat frame, after extract important information from video (extract edge, position of edge block, type of each edge block, block number, motion vector), I have to encode and send them to client. I tried to find an example code for this part but it seems nobody have done it before.

    My problems is how to encode these additional information along with video frame, and send both to client. I read about Huffman Coding which can help lossless compression, But is it possible encode edge & motion data using huffman coding while encoding video frame using ffmpeg ? I’m doing experiment using udp protocol.

    I can not find any information about this.
    I read into metadata & side information in ffmpeg but it’s not what I want to do.

    I hope if you can give me an advice or a directions to research into this area, so I can understand and try to implement it. If there is any example code for this case, I would be very grateful for your sharing.

    Thank you so much.

    Below is encoder part on server side :

    int encode(Mat&amp; input_frame, EncodedCallback callback, void* userdata = nullptr) {
       AVPacket pkt;
       /* encode 1 second of video */
       av_init_packet(&amp;pkt);
       pkt.data = NULL; // packet data will be allocated by the encoder
       pkt.size = 0;
       int size = 0;
       fflush(stdout);
       cvtFrame2AVFrameYUV420(input_frame, &amp;frame);

       static int time;
       frame->pts = time++;
       /* encode the image */
       ret = avcodec_send_frame(c, frame);
       if (ret &lt; 0) {
           fprintf(stderr, "Error avcodec_send_frame\n");
           exit(1);
       }
       nbFramesEncoded++;
       ret = avcodec_receive_packet(c, &amp;pkt);
       if (!isFirstFrameEmmited) {
           nbNeededFramesInBuffer++;

           printf("nbNeededFramesInBuffer: %d\n", nbNeededFramesInBuffer);
       }
       if (ret &lt; 0) {
           if (ret == -EAGAIN) {
               //output is not available, we must send more input
           } else {
               fprintf(stderr, "Error avcodec_receive_packet %d\n", ret);
               exit(1);
           }
       } else {

           if (callback) {
               callback(pkt, userdata);
           }
           size = pkt.size + 4;
           av_packet_unref(&amp;pkt);
       }

       return size;
    }

    Below is code to handle frame processing (presently we check & send motioned block to client)

    void updateFrame(Mat&amp; frame) {
       //Get all Streams ready
       bool isReady = true;
       if (!frameStreamer->encoder->isFirstFrameEmmited) {
           frameStreamer->sendFrame(frame);
           isReady = false;
       }
       for (int yidx = 0; yidx &lt; gridSize.height; yidx++) {
           for (int xidx = 0; xidx &lt; gridSize.width; xidx++) {
               StreamPtr&amp; stream = streamGrid[yidx][xidx];
               if (!stream->encoder->isFirstFrameEmmited) {
                   Mat block = frame(stream->irect);
                   stream->sendFrame(block);
                   isReady = false;
               }
           }
       }
       if (isReady == false) {
           return;
       }

       if (pGray.empty()) {

           frameStreamer->sendFrame(frame);
           frameStreamer->sendFrame(frame);

           cvtColor(frame, pGray, CV_BGR2GRAY);
           return;
       }

       //Motion Detection
       Mat gray;
       cvtColor(frame, gray, CV_BGR2GRAY);
       Mat diff;
       absdiff(gray, pGray, diff);
       threshold(diff, diff, NOISE_THRESHOLD, 255, CV_THRESH_BINARY);
       if (HEAT_IMAGE) {
           gray.copyTo(diff, diff);
           imshow("Gray", gray);
           threshold(diff, diff, HEAT_THRESH, 255, CV_THRESH_TOZERO);
       }
       if (USE_MORPH_NOISE) {
           Morph_Noise(diff);
       }

       Mat motionImg = Mat::zeros(frameSize, CV_8UC3);
       //Block Classification
       int nbModifiedBlocks = 0;
       for (int yidx = 0; yidx &lt; gridSize.height; yidx++) {
           for (int xidx = 0; xidx &lt; gridSize.width; xidx++) {
               Rect irect(xidx * blockSize.width, yidx * blockSize.height,
                       blockSize.width, blockSize.height);
               int blockDiff = sum(diff(irect))[0];
               if (blockDiff > BLOCK_THRESHOLD * 255) {
                   this->blockCls.at<uchar>(yidx, xidx) = MODI_BLOCK;
                   nbModifiedBlocks++;
               } else {
                   this->blockCls.at<uchar>(yidx, xidx) = SKIP_BLOCK;
               }
           }
       }

       //Send
       if (nbModifiedBlocks > this->nbBlocksThresh) {
           nbSentBytes += this->frameStreamer->sendFrame(frame);
       } else {
           for (int yidx = 0; yidx &lt; gridSize.height; yidx++) {
               for (int xidx = 0; xidx &lt; gridSize.width; xidx++) {
                   uchar cls = this->blockCls.at<uchar>(yidx, xidx);
                   StreamPtr&amp; stream = streamGrid[yidx][xidx];
                   bool send = false;
                   if (cls == MODI_BLOCK) {
                       if (DEBUG_NETWORK) {
                           printf("Normal (%d, %d): ", xidx, yidx);
                       }
                       send = true;
                       stream->encoder->nbFramesBuffered = stream->encoder->nbNeededFramesInBuffer;

                       rectangle(motionImg, stream->irect, Scalar(0, 0, 255), CV_FILLED);

                   } else if (stream->encoder->nbFramesBuffered > 0) {
                       if (DEBUG_NETWORK) {
                           printf("Extra (%d, %d): ", xidx, yidx);
                       }
                       send = true;
                       stream->encoder->nbFramesBuffered--;
                       stream->encoder->nbFlushFrames++;
                       rectangle(motionImg, stream->irect, Scalar(0, 255, 0), CV_FILLED);
                   }

                   if (send) {
                       Mat block = frame(stream->irect);
                       nbSentBytes += stream->sendFrame(block);
                       gray(stream->irect).copyTo(pGray(stream->irect));
                   }
               }
           }
       }
    </uchar></uchar></uchar>

    }

  • FFmpeg : chromakey without green edges

    5 septembre 2020, par Igniter

    I have a video of a person on green background and I'm trying to turn background transparent by this :

    &#xA;

    ffmpeg -i bg.mp4 -i man.mp4 -filter_complex &#x27;[1:v]colorkey=0x00ff00:0.3:0.3[ckout];[0:v][ckout]overlay[out]&#x27; -map &#x27;[out]&#x27; result.mp4&#xA;

    &#xA;

    Colorkey gives this quite noticeable green edge around the person's figure.
    &#xA;Any attempts to increase opacity or blend parameters result in disappearing facial features.

    &#xA;

    enter image description here

    &#xA;

    Is there any smart way to change pure green 0x00ff00 pixels with transparent ones ?

    &#xA;