Recherche avancée

Médias (91)

Autres articles (78)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (9612)

  • libav C++ sw_scale returns variable byte size of BGR24 buffer

    6 mars 2021, par igor

    I'm trying to convert my local /dev/video0 cam to BGR24 format. It works if I resize the image (although not 100% of the time, more like 85% of the time), but I'd like to keep the same size as input video.

    


    I initialize BGR image like so including the sws context :

    


    AVPixelFormat outputPixFormat = AV_PIX_FMT_BGR24;

    AVFrame* pFrameBGR = av_frame_alloc();
    pFrameBGR->width = decoder->video_codec_context->width;
    pFrameBGR->height = decoder->video_codec_context->height;
    pFrameBGR->format = outputPixFormat;

    int alloRet = av_image_alloc(pFrameBGR->data, pFrameBGR->linesize, decoder->video_codec_context->width, decoder->video_codec_context->height, outputPixFormat, 1);
    if (alloRet < 0) {
        logging("failed to allocate image");
        return -1;
    }

    struct SwsContext *sws_ctx = NULL;

    sws_ctx = sws_getContext(decoder->video_codec_context->width,
    decoder->video_codec_context->height,
    decoder->video_codec_context->pix_fmt,
    decoder->video_codec_context->width,
    decoder->video_codec_context->height,
    outputPixFormat,
    SWS_DIRECT_BGR,
    0,
    0,
    0
    );


    


    This is the portion of my decoding loop :

    


    int response = avcodec_send_packet(pCodecContext, pPacket);
    if (response < 0) {
        logging("Error while sending a packet to decoder: %s", av_err2str(response));
        return response;
    }

    while (response >= 0) {
        response = avcodec_receive_frame(pCodecContext, pFrame);
         if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {
            break;
        } else if (response < 0) {
            logging("Error while receiving a frame from the decoder: %s", av_err2str(response));
            return response;
        }
        if (response >= 0) {

            sws_scale(sws_ctx,  (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecContext->height, pFrameBGR->data, pFrameBGR->linesize);



    


    THe question is how to copy the plane of AVFrame into a buffer :

    


      size_t rgb_size = av_image_get_buffer_size(AV_PIX_FMT_BGR24, bgrFrame->width, bgrFrame->height, 1);

    uint8_t *dst_data;
    dst_data = (uint8_t *)(av_malloc(rgb_size));

    av_image_copy_to_buffer(dst_data, rgb_size, (const uint8_t* const *)bgrFrame->data, bgrFrame->linesize, AV_PIX_FMT_BGR24, bgrFrame->width, bgrFrame->height, 1);



    


    If I try to save to file the BGR image is correctly copied :

    


    char filebuf[256];
snprintf(filebuf, sizeof filebuf, "%s%d%s", "out_", pPacket->dts, ".rgb");
std::FILE *output=fopen(filebuf,"wb+");  

fwrite(bgrFrame->data[0],(pFrame->width)*(pFrame->height)*3,1,output);  
std::fclose(output);


    


    So it looks like my copy to buffer function is faulty, but I can figure out what's wrong with it :

    


      uint8_t *dst_data;
    dst_data = (uint8_t *)(av_malloc(rgb_size));

    av_image_copy_to_buffer(dst_data, rgb_size, (const uint8_t* const *)bgrFrame->data, bgrFrame->linesize, AV_PIX_FMT_BGR24, bgrFrame->width, bgrFrame->height, 1);


    


  • Save StreamTitle tag in recording

    29 décembre 2022, par jarno

    Some streams have StreamTitle tag set and it changes from time to time. Is that information send only when it changes in the stream ? For example in this stream StreamTitle is used to tell the artist and the name of current song :

    


    ffprobe -v error -show_entries format_tags http://st.downtime.fi/sun.mp3


    


    Is the StreamTitle tag exclusive to MP3 streams ? Can one have it in Opus streams as well ?

    


    Can such information be added to the output file created when recording the stream by ffmpeg for example, to be able to see which song is playing when playing the recording later ? Could another tag be used to tell program name which may also alter in time ?

    


  • Draw on Android video and save

    23 novembre 2015, par YI YANG

    I am a beginner to the Android meida programming, so if I have any problem please tell me, thank you very much.

    Recentally, I saw an IOS version App called V1 Sports ! it allows you to record a video and then draw lines, circles or any shapes on the video. Those shapes are stored, next time when you open your video, the shapes are still there, unless you clear the shapes overlay on the video.

    I am wondering how to implement those functions on an Android deveice, it is so cool. Use ffmpeg or something like that ? I do not know where to start. Please tell me some hints Thank you very much.