Recherche avancée

Médias (0)

Mot : - Tags -/page unique

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

Autres articles (86)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (11017)

  • fftools/ffmpeg_dec : abort if avcodec_send_packet() returns EAGAIN

    22 mai 2023, par James Almer
    fftools/ffmpeg_dec : abort if avcodec_send_packet() returns EAGAIN
    

    As the comment in the code mentions, EAGAIN is not an expected value here
    because we call avcodec_receive_frame() until all frames have been returned.
    avcodec_send_packet() returning EAGAIN means a packet is still buffered, which
    hints that the underlying decoder is buggy and not fetching packets as it
    should.

    An example of this behavior was in the libdav1d wrapper before f209614290,
    where feeding it split frames (or individual OBUs) would result in the CLI
    eventually printing the confusing "Error submitting packet to decoder : Resource
    temporarily unavailable" error message, and just keep going until EOF without
    returning new frames.

    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] fftools/ffmpeg_dec.c
  • How to convert from AV_PIX_FMT_BGRA to PIX_FMT_PAL8 ?

    29 juillet 2014, par Jona

    I’m having a hard time converting my images from AV_PIX_FMT_BGRA to PIX_FMT_PAL8. Unfortunately sws_getCachedContext doesn’t support the conversion to PIX_FMT_PAL8.

    What I’m trying to do is convert my images into a GIF video with higher quality output. It seems that PIX_FMT_PAL8 could potentially provide the higher quality output I’m looking for.

    According to this documentation I need to palettize the pixel data, but I have no clue how to do that.

    When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
    image data is stored in AVFrame.data[0]. The palette is transported in
    AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
    formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
    also endian-specific). Note also that the individual RGB palette
    components stored in AVFrame.data[1] should be in the range 0..255.
    This is important as many custom PAL8 video codecs that were designed
    to run on the IBM VGA graphics adapter use 6-bit palette components.

    Any help or direction would be appreciated.

  • RGB to YUV conversion with libav (ffmpeg) triplicates image

    17 avril 2021, par José Tomás Tocino

    I'm building a small program to capture the screen (using X11 MIT-SHM extension) on video. It works well if I create individual PNG files of the captured frames, but now I'm trying to integrate libav (ffmpeg) to create the video and I'm getting... funny results.

    &#xA;

    The furthest I've been able to reach is this. The expected result (which is a PNG created directly from the RGB data of the XImage file) is this :

    &#xA;

    Expected result

    &#xA;

    However, the result I'm getting is this :

    &#xA;

    Obtained result

    &#xA;

    As you can see the colors are funky and the image appears cropped three times. I have a loop where I capture the screen, and first I generate the individual PNG files (currently commented in the code below) and then I try to use libswscale to convert from RGB24 to YUV420 :

    &#xA;

    while (gRunning) {&#xA;        printf("Processing frame framecnt=%i \n", framecnt);&#xA;&#xA;        if (!XShmGetImage(display, RootWindow(display, DefaultScreen(display)), img, 0, 0, AllPlanes)) {&#xA;            printf("\n Ooops.. Something is wrong.");&#xA;            break;&#xA;        }&#xA;&#xA;        // PNG generation&#xA;        // snprintf(imageName, sizeof(imageName), "salida_%i.png", framecnt);&#xA;        // writePngForImage(img, width, height, imageName);&#xA;&#xA;        unsigned long red_mask = img->red_mask;&#xA;        unsigned long green_mask = img->green_mask;&#xA;        unsigned long blue_mask = img->blue_mask;&#xA;&#xA;        // Write image data&#xA;        for (int y = 0; y &lt; height; y&#x2B;&#x2B;) {&#xA;            for (int x = 0; x &lt; width; x&#x2B;&#x2B;) {&#xA;                unsigned long pixel = XGetPixel(img, x, y);&#xA;&#xA;                unsigned char blue = pixel &amp; blue_mask;&#xA;                unsigned char green = (pixel &amp; green_mask) >> 8;&#xA;                unsigned char red = (pixel &amp; red_mask) >> 16;&#xA;&#xA;                pixel_rgb_data[y * width &#x2B; x * 3] = red;&#xA;                pixel_rgb_data[y * width &#x2B; x * 3 &#x2B; 1] = green;&#xA;                pixel_rgb_data[y * width &#x2B; x * 3 &#x2B; 2] = blue;&#xA;            }&#xA;        }&#xA;&#xA;        uint8_t* inData[1] = { pixel_rgb_data };&#xA;        int inLinesize[1] = { in_w };&#xA;&#xA;        printf("Scaling frame... \n");&#xA;        int sliceHeight = sws_scale(sws_context, inData, inLinesize, 0, height, pFrame->data, pFrame->linesize);&#xA;&#xA;        printf("Obtained slice height: %i \n", sliceHeight);&#xA;        pFrame->pts = framecnt * (pVideoStream->time_base.den) / ((pVideoStream->time_base.num) * 25);&#xA;&#xA;        printf("Frame pts: %li \n", pFrame->pts);&#xA;        int got_picture = 0;&#xA;&#xA;        printf("Encoding frame... \n");&#xA;        int ret = avcodec_encode_video2(pCodecCtx, &amp;pkt, pFrame, &amp;got_picture);&#xA;&#xA;//                int ret = avcodec_send_frame(pCodecCtx, pFrame);&#xA;&#xA;        if (ret != 0) {&#xA;            printf("Failed to encode! Error: %i\n", ret);&#xA;            return -1;&#xA;        }&#xA;&#xA;        printf("Succeed to encode frame: %5d - size: %5d\n", framecnt, pkt.size);&#xA;&#xA;        framecnt&#x2B;&#x2B;;&#xA;&#xA;        pkt.stream_index = pVideoStream->index;&#xA;        ret = av_write_frame(pFormatCtx, &amp;pkt);&#xA;&#xA;        if (ret != 0) {&#xA;            printf("Error writing frame! Error: %framecnt \n", ret);&#xA;            return -1;&#xA;        }&#xA;&#xA;        av_packet_unref(&amp;pkt);&#xA;    }&#xA;

    &#xA;

    I've placed the entire code at this gist. This question right here looks pretty similar to mine, but not quite, and the solution did not work for me, although I think this has something to do with the way the line stride is calculated.

    &#xA;