Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (52)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (8344)

  • Huge memory leak when filtering video with libavfilter

    29 mai 2017, par Captain Jack

    I have a relatively simple FFMPEG C program, to which a video frame is fed, processed via filter graph and sent to frame renderer.

    Here are some code snippets :

    /* Filter graph here */
    char args[512];
    enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_RGB32 };    
    AVFilterGraph   *filter_graph;
    avfilter_register_all();
    AVFilter *buffersrc  = avfilter_get_by_name("buffer");
    AVFilter *buffersink = avfilter_get_by_name("ffbuffersink");
    AVBufferSinkParams *buffersink_params;
    AVFilterInOut *outputs = avfilter_inout_alloc();
    AVFilterInOut *inputs  = avfilter_inout_alloc();
    filter_graph = avfilter_graph_alloc();

    snprintf(args, sizeof(args),
           "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
           av->codec_ctx->width, av->codec_ctx->height, av->codec_ctx->pix_fmt,
           av->codec_ctx->time_base.num, av->codec_ctx->time_base.den,
           av->codec_ctx->sample_aspect_ratio.num, av->codec_ctx->sample_aspect_ratio.den);

    if(avfilter_graph_create_filter(&av->buffersrc_ctx, buffersrc, "in",args, NULL, filter_graph) < 0)
    {
       fprintf(stderr, "Cannot create buffer source\n");
       return(0);
    }

    /* buffer video sink: to terminate the filter chain. */
    buffersink_params = av_buffersink_params_alloc();
    buffersink_params->pixel_fmts = pix_fmts;

    if(avfilter_graph_create_filter(&av->buffersink_ctx, buffersink, "out",NULL, buffersink_params, filter_graph) < 0)
    {
       printf("Cannot create buffer sink\n");
       return(HACKTV_ERROR);
    }

     /* Endpoints for the filter graph. */
       outputs->name       = av_strdup("in");
       outputs->filter_ctx = av->buffersrc_ctx;
       outputs->pad_idx    = 0;
       outputs->next       = NULL;

       inputs->name       = av_strdup("out");
       inputs->filter_ctx = av->buffersink_ctx;
       inputs->pad_idx    = 0;
       inputs->next       = NULL;

    const char *filter_descr = "vflip";

       if (avfilter_graph_parse_ptr(filter_graph, filter_descr, &inputs, &outputs, NULL) < 0)
    {
       printf("Cannot parse filter graph\n");
       return(0);
    }

    if (avfilter_graph_config(filter_graph, NULL) < 0)
    {
       printf("Cannot configure filter graph\n");
       return(0);
    }

    av_free(buffersink_params);
    avfilter_inout_free(&inputs);
    avfilter_inout_free(&outputs);

    The above code is called by these elsewhere :

    av->frame_in->pts = av_frame_get_best_effort_timestamp(av->frame_in);

    /* push the decoded frame into the filtergraph*/
    if (av_buffersrc_add_frame(av->buffersrc_ctx, av->frame_in) < 0)
    {
       printf( "Error while feeding the filtdergraph\n");
       break;
    }

    /* pull filtered pictures from the filtergraph */
    if(av_buffersink_get_frame(av->buffersink_ctx, av->frame_out) < 0)
    {
         printf( "Error while sourcing the filtergraph\n");
          break;
     }  

    /* do stuff with frame */

    Now, the code works absolutely fine and the video comes out the way I expect it to (vertically flipped for testing purposes).

    The biggest issue I have is that there is a massive memory leak. An high res video will consume 2Gb in a matter of seconds and crash the program. I traced the leak to this piece of code :

    /* push the decoded frame into the filtergraph*/
    if (av_buffersrc_add_frame(av->buffersrc_ctx, av->frame_in) < 0)

    If I bypass the filter by doing av->frame_out=av->frame_in; without pushing the frame into it (and obviously not pulling from it), there is no leak and memory usage is stable.

    Now, I am very new to C, so be gentle, but it seems like I should be clearing out the buffersrc_ctx somehow but no idea how. I’ve looked in official documentations but couldn’t find anything.

    Can someone advise ?

  • ffmpeg merge video and audio + fade out

    1er mai 2016, par jacky brown

    I have one video file and one audio file.
    I want to merge them together that the final output video will be in the length of the video and will contain the audio in the background.

    i did :

    ffmpeg -i output.avi -i bgmusic.mp3 -filter_complex " [1:0] apad " -shortest out.avi

    but the background audio is cut in the end of the final merge movie.
    i want it to fade out nicely.

    how can i do it ??

    but the background audio is cut in the end of the final merge movie.
    i want it to fade out nicely.

    how can i do it ??

    thanks.

  • Clips from a Live Video

    12 mai 2022, par Jorge Borreguero Sanmartin

    I am doing a program in Python that gets clips from a live video. To do so, with opencv I get the currrrent_frame_position and with the fps I get the start and final time to run this command :

    


    ffmpeg -i live_video.ts -ss 00:01:30 -to 00:02:00 -c:v copy output.ts

    


    To improve, I want to start dumping the live_video on the new file once I know the starting time, and finish once I get the final time. My intention is to make this process faster and get the result file sooner. It is not necessary to use ffmpeg but it is the tool that I have been using. How can I do this ?