Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (94)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

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

  • Is it possible for me to put a mask over a transparent image with ffmpeg ?

    14 juin 2019, par Pedro Valle

    I’m trying to make an overlay with a mask over a transparent image with ffmpeg, but the background of the image that gets the mask turns black, is there any way to make this background remain transparent ?

    ffmpeg -i background.jpg -loop 1 -i image.png -loop 1 -i mask.png -filter_complex [0]setpts=PTS-STARTPTS,scale=720:720[background];[2]alphaextract,scale=640x320[mask];[1]scale=640x320[image];[image][mask]alphamerge[final_mask];[background][final_mask]overlay=100:100[final] -map [final] -t 00:00:05.000 -y result.mp4
    result

  • How to save video data in a vector using ffmpeg ? (C++)

    25 octobre 2022, par nokla

    I'm new to ffmpeg and I am trying to write a program for video editing.

    


    I want to import a video file and save it somehow in a vector so I could edit its frames later.
When I saved all the decoded AVFrames in a vector I saw it takes a lot of memory and that I need to find a better way to do so.

    


    The function I used for reading a video :

    


    ** the function is in a class that representing video, source type is std::vector<avframe></avframe>

    &#xA;

    void VideoSource::ReadSource(std::string path)&#xA;{&#xA;    // Open the file using libavformat&#xA;    AVFormatContext* av_format_ctx = avformat_alloc_context();&#xA;    if (!av_format_ctx) {&#xA;        printf("Couldn&#x27;t create AVFormatContext\n");&#xA;        return; &#xA;    }&#xA;    if (avformat_open_input(&amp;av_format_ctx, path.c_str(), NULL, NULL) != 0) {&#xA;        printf("Couldn&#x27;t open video file\n");&#xA;        return;&#xA;    }&#xA;&#xA;    // Find the first valid video stream inside the file&#xA;    int video_stream_index = -1;&#xA;    AVCodecParameters* av_codec_params = NULL;&#xA;    const AVCodec* av_codec = NULL;&#xA;    for (int i = 0; i &lt; av_format_ctx->nb_streams; i)&#xA;    {&#xA;        av_codec_params = av_format_ctx->streams[i]->codecpar;&#xA;        av_codec = avcodec_find_decoder(av_codec_params->codec_id);&#xA;&#xA;        if (!av_codec) {&#xA;            continue;&#xA;        }&#xA;        if (av_codec_params->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;            video_stream_index = i;&#xA;            break;&#xA;        }&#xA;    }&#xA;&#xA;    if (video_stream_index == -1) {&#xA;        printf("Couldn&#x27;t find valid video stream inside file\n");&#xA;        return;&#xA;    }&#xA;&#xA;    // Set up a codec context for the decoder&#xA;    AVCodecContext* av_codec_ctx = avcodec_alloc_context3(av_codec);&#xA;    if (!av_codec_ctx) {&#xA;        printf("Couldn&#x27;t create AVCpdecContext\n");&#xA;        return;&#xA;    }&#xA;&#xA;    if (avcodec_parameters_to_context(av_codec_ctx, av_codec_params) &lt; 0)&#xA;    {&#xA;        printf("Couldn&#x27;t initialize AVCodecContext\n");&#xA;        return;&#xA;    }&#xA;    if (avcodec_open2(av_codec_ctx, av_codec, NULL) &lt; 0) {&#xA;        printf("Couldn&#x27;t open codec\n");&#xA;        return;&#xA;    }&#xA;&#xA;    AVFrame* av_frame = av_frame_alloc();&#xA;    if (!av_frame) {&#xA;        printf("Couldn&#x27;t allocate AVFrame\n");&#xA;        return;&#xA;    }&#xA;    AVPacket* av_packet = av_packet_alloc();&#xA;    if (!av_packet) {&#xA;        printf("Couldn&#x27;t allocate AVPacket\n");&#xA;        return;&#xA;    }&#xA;    int response;&#xA;&#xA;    while (av_read_frame(av_format_ctx, av_packet) >= 0) {&#xA;        if (av_packet->stream_index != video_stream_index) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        }&#xA;        response = avcodec_send_packet(av_codec_ctx, av_packet);&#xA;        if (response &lt; 0) {&#xA;            printf("Failed to decode packet: %s\n", av_err2str(response));&#xA;            return;&#xA;        }&#xA;        response = avcodec_receive_frame(av_codec_ctx, av_frame);&#xA;        if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        }&#xA;        else if (response &lt; 0) {&#xA;            printf("Failed to decode frame: %s\n", av_err2str(response));&#xA;            return;&#xA;        }&#xA;        av_packet_unref(av_packet);&#xA;&#xA;        av_packet = av_packet_alloc();&#xA;&#xA;        // response = avcodec_send_frame(av_codec_ctx, av_frame);&#xA;&#xA;        source.push_back(*new AVFrame);&#xA;        source.back() = *av_frame_clone(av_frame);&#xA;&#xA;        av_frame_unref(av_frame);&#xA;    }&#xA;    &#xA;&#xA;    avformat_close_input(&amp;av_format_ctx);&#xA;    avformat_free_context(av_format_ctx);&#xA;    av_frame_free(&amp;av_frame);&#xA;    av_packet_free(&amp;av_packet);&#xA;    avcodec_free_context(&amp;av_codec_ctx);&#xA;}&#xA;

    &#xA;

    I thought maybe I should save it as a vector of encoded AVFrames or as a vector of encoded packet that contains some frames in it.

    &#xA;

    When I tried to encode a single AVFrame, I added this line&#xA;response = avcodec_send_frame(av_codec_ctx, av_frame); before pushing the frame into the vector (You can see it marked as a comment in the code above).
    &#xA;It returned invalid argument (-22) and I am not sure why.

    &#xA;

    Questions :

    &#xA;

      &#xA;
    1. Why did I get that error (-22) ?
    2. &#xA;

    3. How to save an encoded packet with multiple AVFrame in it ?
    4. &#xA;

    5. Is there a better way of working on a video that won't take as much memory ?
    6. &#xA;

    &#xA;

  • Révision 19166 : Upgrade du fichier avec retours d’experience du plugin migration

    27 mars 2012, par cedric -