Recherche avancée

Médias (1)

Mot : - Tags -/university

Autres articles (66)

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

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (6718)

  • FFMPEG : Position images in video when creating slide show

    29 décembre 2015, par Jimmy

    I’m using FFMPEG shell utility in an Android app to convert users pictures to video, here’s an example command :

    cat *.jpg | ffmpeg -f image2pipe -r 10  -vcodec mjpeg -i - -vcodec libx264 -s 1280x720 -preset ultrafast slideshow.mp4

    I used to crop images when the user import it in the app but now I would like to allow the user to reposition the image later, here’s an example :

    enter image description here

    So the user could drag or zoom the image to position it in the clear area (video ratio).

    So using the ffmpeg shell command can I specify the image coordinate for each image and position the image in the video.

  • fate/source-check.sh : Use "git show" instead of git —version to test for git

    15 février 2016, par Michael Niedermayer
    fate/source-check.sh : Use "git show" instead of git —version to test for git
    

    This fixes fate with non git source trees

    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] tests/fate/source-check.sh
  • 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.

    &#xA;

    I initialize BGR image like so including the sws context :

    &#xA;

    AVPixelFormat outputPixFormat = AV_PIX_FMT_BGR24;&#xA;&#xA;    AVFrame* pFrameBGR = av_frame_alloc();&#xA;    pFrameBGR->width = decoder->video_codec_context->width;&#xA;    pFrameBGR->height = decoder->video_codec_context->height;&#xA;    pFrameBGR->format = outputPixFormat;&#xA;&#xA;    int alloRet = av_image_alloc(pFrameBGR->data, pFrameBGR->linesize, decoder->video_codec_context->width, decoder->video_codec_context->height, outputPixFormat, 1);&#xA;    if (alloRet &lt; 0) {&#xA;        logging("failed to allocate image");&#xA;        return -1;&#xA;    }&#xA;&#xA;    struct SwsContext *sws_ctx = NULL;&#xA;&#xA;    sws_ctx = sws_getContext(decoder->video_codec_context->width,&#xA;    decoder->video_codec_context->height,&#xA;    decoder->video_codec_context->pix_fmt,&#xA;    decoder->video_codec_context->width,&#xA;    decoder->video_codec_context->height,&#xA;    outputPixFormat,&#xA;    SWS_DIRECT_BGR,&#xA;    0,&#xA;    0,&#xA;    0&#xA;    );&#xA;

    &#xA;

    This is the portion of my decoding loop :

    &#xA;

    int response = avcodec_send_packet(pCodecContext, pPacket);&#xA;    if (response &lt; 0) {&#xA;        logging("Error while sending a packet to decoder: %s", av_err2str(response));&#xA;        return response;&#xA;    }&#xA;&#xA;    while (response >= 0) {&#xA;        response = avcodec_receive_frame(pCodecContext, pFrame);&#xA;         if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {&#xA;            break;&#xA;        } else if (response &lt; 0) {&#xA;            logging("Error while receiving a frame from the decoder: %s", av_err2str(response));&#xA;            return response;&#xA;        }&#xA;        if (response >= 0) {&#xA;&#xA;            sws_scale(sws_ctx,  (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecContext->height, pFrameBGR->data, pFrameBGR->linesize);&#xA;&#xA;

    &#xA;

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

    &#xA;

      size_t rgb_size = av_image_get_buffer_size(AV_PIX_FMT_BGR24, bgrFrame->width, bgrFrame->height, 1);&#xA;&#xA;    uint8_t *dst_data;&#xA;    dst_data = (uint8_t *)(av_malloc(rgb_size));&#xA;&#xA;    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);&#xA;&#xA;

    &#xA;

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

    &#xA;

    char filebuf[256];&#xA;snprintf(filebuf, sizeof filebuf, "%s%d%s", "out_", pPacket->dts, ".rgb");&#xA;std::FILE *output=fopen(filebuf,"wb&#x2B;");  &#xA;&#xA;fwrite(bgrFrame->data[0],(pFrame->width)*(pFrame->height)*3,1,output);  &#xA;std::fclose(output);&#xA;

    &#xA;

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

    &#xA;

      uint8_t *dst_data;&#xA;    dst_data = (uint8_t *)(av_malloc(rgb_size));&#xA;&#xA;    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);&#xA;

    &#xA;