Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (61)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

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

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (4114)

  • Announcement : Piwik to focus on Reliability, Performance and Security

    7 octobre 2014, par Matthieu Aubry — About, Community

    To our valued team and community,

    Well, we have moved fast and achieved so much during the past few months. Relentlessly releasing major version after major version… We got a lot done including several major new features !

    The speed of adding new features was a great showcase of how agile our small teams and the larger community are. And I’m so proud to see automated testing becoming common practice among everyone hacking on Piwik !

    For the next few months until the new year we will focus on making what we have better. We will fix those rare but longstanding critical bugs, and aim to solve all Major issues and other must-have performance and general improvements. The core team and Piwik PRO will have the vision of making the existing Piwik and all plugins very stable and risk free. This includes edge cases, general bugs but also specific performance issues for high traffic or issues with edge case data payloads.

    We’ll be more pro-active and take Piwik platform to the next level of Performance, Security, Privacy & Reliability ! We will prove to the world that Free/Libre Web software can be of the highest standard of quality. By focusing on quality we will make Piwik even easier to maintain and improve in the future. We are building the best open platform that will let every user liberate their data and keep full control of it.

    If you have any feedback or questions get in touch or let’s continue the discussion in the forum.

    Thank you for your trust and for liberating your data with Piwik,

    Matthieu Aubry
    Piwik founder

    More information

    This is an amazing testament of the power of free/libre software and yet we think this is just the beginning. We hope more developers will join and contribute to the Piwik project !

  • How AVCodecContext bitrate, framerate and timebase is used when encoding single frame

    28 mars 2023, par Cyrus

    I am trying to learn FFmpeg from examples as there is a tight schedule. The task is to encode a raw YUV image into JPEG format of the given width and height. I have found examples from ffmpeg official website, which turns out to be quite straight-forward. However there are some fields in AVCodecContext that I thought only makes sense when encoding videos(e.g. bitrate, framerate, timebase, gopsize, max_b_frames etc).

    


    I understand on a high level what those values are when it comes to videos, but do I need to care about those when I just want a single image ? Currently for testing, I am just setting them as dummy values and it seems to work. But I want to make sure that I am not making terrible assumptions that will break in the long run.

    


    EDIT :

    


    Here is the code I got. Most of them are copy and paste from examples, with some changes to replace old APIs with newer ones.

    


    #include "thumbnail.h"
#include "libavcodec/avcodec.h"
#include "libavutil/imgutils.h"
#include 
#include 
#include 

void print_averror(int error_code) {
    char err_msg[100] = {0};
    av_strerror(error_code, err_msg, 100);
    printf("Reason: %s\n", err_msg);
}

ffmpeg_status_t save_yuv_as_jpeg(uint8_t* source_buffer, char* output_thumbnail_filename, int thumbnail_width, int thumbnail_height) {
    const AVCodec* mjpeg_codec = avcodec_find_encoder(AV_CODEC_ID_MJPEG);
    if (!mjpeg_codec) {
        printf("Codec for mjpeg cannot be found.\n");
        return FFMPEG_THUMBNAIL_CODEC_NOT_FOUND;
    }

    AVCodecContext* codec_ctx = avcodec_alloc_context3(mjpeg_codec);
    if (!codec_ctx) {
        printf("Codec context cannot be allocated for the given mjpeg codec.\n");
        return FFMPEG_THUMBNAIL_ALLOC_CONTEXT_FAILED;
    }

    AVPacket* pkt = av_packet_alloc();
    if (!pkt) {
        printf("Thumbnail packet cannot be allocated.\n");
        return FFMPEG_THUMBNAIL_ALLOC_PACKET_FAILED;
    }

    AVFrame* frame = av_frame_alloc();
    if (!frame) {
        printf("Thumbnail frame cannot be allocated.\n");
        return FFMPEG_THUMBNAIL_ALLOC_FRAME_FAILED;
    }

    // The part that I don't understand
    codec_ctx->bit_rate = 400000;
    codec_ctx->width = thumbnail_width;
    codec_ctx->height = thumbnail_height;
    codec_ctx->time_base = (AVRational){1, 25};
    codec_ctx->framerate = (AVRational){1, 25};

    codec_ctx->gop_size = 10;
    codec_ctx->max_b_frames = 1;
    codec_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
    int ret = av_image_fill_arrays(frame->data, frame->linesize, source_buffer, AV_PIX_FMT_YUV420P, thumbnail_width, thumbnail_height, 32);
    if (ret < 0) {
        print_averror(ret);
        printf("Pixel format: yuv420p, width: %d, height: %d\n", thumbnail_width, thumbnail_height);
        return FFMPEG_THUMBNAIL_FILL_FRAME_DATA_FAILED;
    }

    ret = avcodec_send_frame(codec_ctx, frame);
    if (ret < 0) {
        print_averror(ret);
        printf("Failed to send frame to encoder.\n");
        return FFMPEG_THUMBNAIL_FILL_SEND_FRAME_FAILED;
    }

    ret = avcodec_receive_packet(codec_ctx, pkt);
    if (ret < 0) {
        print_averror(ret);
        printf("Failed to receive packet from encoder.\n");
        return FFMPEG_THUMBNAIL_FILL_SEND_FRAME_FAILED;
    }

    // store the thumbnail in output
    int fd = open(output_thumbnail_filename, O_CREAT | O_RDWR);
    write(fd, pkt->data, pkt->size);
    close(fd);

    // freeing allocated structs
    avcodec_free_context(&codec_ctx);
    av_frame_free(&frame);
    av_packet_free(&pkt);
    return FFMPEG_SUCCESS;
}


    


  • Mapping v4l2 pixel format codes to ffmpeg pixel format names

    12 décembre 2019, par DekiChan

    I’m building an app that is capturing frames from any v4l2 supported webcam. I’m controlling the camera with v4l2 (golang package https://github.com/blackjack/webcam) and one of the things I need is pixel format. However, what I get is uint32 representing the format in v4l2.

    I do the streaming by wrapping ffmpeg command and reading from its stdout :

    args := []string{
       "-f", "v4l2",
       "-c:v", "rawvideo",
       "-pix_fmt", pixFmt,
       "-s", size,
       "-i", input,
       "-f", "image2pipe",
       "-c:v", "mjpeg",
       "-qscale:v", "5",
       "-", // pipes to stdout
    }

    cmd := exec.Command("ffmpeg", args...)

    Now the problem is that -pix_fmt option requires format name in string that is recognized by ffmpeg (for example 8-bit Bayer RGGB8 corresponds to bayer_rggb8, while this format in v4l2 has code 1111967570).

    I found the mapping code for it in ffmpeg’s libavdevice : https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/v4l2-common.h includes the functions I need, but somehow I’m not able to include <libavdevice></libavdevice>v4l2-common.h> in CGo (no problems with <libavdevice></libavdevice>avdevice.h>) :

    package conv

    /*
       #cgo pkg-config: libavdevice
       #include <libavdevice></libavdevice>avdevice.h>
       #include <libavdevice></libavdevice>v4l2-common.h>
    */
    import "C"

    type (
    )

    // PixFmtToFF takes v4l2 pixel format code and converts it to a string
    // recognized by ffmpeg command
    // example: 1111967570 to "bayer_rggb8"
    func PixFmtToFF(v4l2code uint32) (string, error) {
       // should work something like this, couldn't test
       codecID := C.ff_fmt_v4l2codec(v4l2code)
       pixFmt := C.ff_fmt_v4l2ff(vfd.pixelformat, codec_id)
       return C.av_get_pix_fmt_name(pixFmt)
    }

    Build output returns :

    go build \
           -mod=vendor \
           -o ./bin/camera-api \
           ./cmd/camera-api
    # kca/internal/camera/conv
    internal/camera/conv/convert.go:6:11: fatal error: libavdevice/v4l2-common.h: No such file or directory
     #include <libavdevice></libavdevice>v4l2-common.h>
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:13: build/camera-api] Error 2
    make: *** [builder/camera-api] Error 2

    Output of pkg-config --libs libavdevice is -L/usr/local/lib -lavdevice.

    So, I have two questions :

    1) How could I include v4l2-common.h so I can use the mapping functions ?

    2) Is there a better way ? I need ffmpeg wrapping so we can support wide range of formats for captured frames.