Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (82)

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

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

  • Utilisation et configuration du script

    19 janvier 2011, par

    Informations spécifiques à la distribution Debian
    Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
    Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
    Récupération du script
    Le script d’installation peut être récupéré de deux manières différentes.
    Via svn en utilisant la commande pour récupérer le code source à jour :
    svn co (...)

Sur d’autres sites (9396)

  • avformat/nsvdec : Do not parse multiple NSVf

    16 août 2018, par Michael Niedermayer
    avformat/nsvdec : Do not parse multiple NSVf
    

    The specification states "NSV files may contain a single file header. "
    Fixes : out of array access
    Fixes : nsv-asan-002f473f726a0dcbd3bd53e422c4fc40b3cf3421

    Found-by : Paul Ch <paulcher@icloud.com>
    Tested-by : Paul Ch <paulcher@icloud.com>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavformat/nsvdec.c
  • Evolution #3926 : Remplacement de safehtml par le plug htmlpurifier ou autre

    15 août 2018, par Guillaume Fahrner

    Je me permet de rebondir sur ce ticket pour lancer la discussion, expliquer le travail déjà réalisé de mon coté et les problèmes rencontrés :

    un constat : on rencontre souvent des contenus HTML devant passer dans safehtml() qui ne respecte pas à la lettre la spécification, quelques exemples :

    Ces morceaux de code HTML seront systématiquement normalisé par htmlPurifier ; ce qui est une bonne chose.

    Cela pose un problème d’incompatibilité avec le fonctionnement de la fonction echapper_html_suspect() https://core.spip.net/projects/spip/repository/entry/spip/ecrire/inc/texte_mini.php#L471 :

    1. <span class="CodeRay"><span class="keyword">if</span> (<span class="predefined">strlen</span>(safehtml(<span class="local-variable">$texte</span>)) !== <span class="predefined">strlen</span>(<span class="local-variable">$texte</span>)) {
    2. </span>

    Télécharger

    Tous les contenus modifiés car normalisés se retrouveront donc encodés puis affichés :(

    Plusieurs solutions :

    • changer la logique de la fonction echapper_html_suspect() pour faire confiance à safehtml()@htmlPurifier
    • normaliser tout ce qui est susceptible de passer à travers cette fonction pour éviter ces modifications et conserver cette logique
  • Image overlay in FFMpeg using the C library

    11 juin 2018, par Ludwig Pumberger

    I would like to dynamically manipulate a video to show a number that is pulled from an external source.

    This works well if I just the drawText filter. Unfortunately the customer would like the overlay to look a lot fancier. I have an image with digits in the required format and I can use that to dynamically generate an image containing the number. However, I am unsure how to use the FFMPEG overlay filter to merge this image with the video.

    I have found samples for doing this on the command line with a command like this one :

    ffmpeg -itsoffset 5 -i in.mp4 -r 25 -loop 1 -i intro.png -filter_complex "[1:v] fade=out:125:25:alpha=1 [intro]; [0:v][intro] overlay [v]" -map "[v]" -map 0:a -acodec copy out.mp4

    The main problem is that I cannot use the command line tool. I need to manipulate the video on the fly (the video data is sent to a third party streaming library). The working solution I have, which uses drawtext only needs one source (the original video). For the overlay I would have to somehow specify a second source (the image) and I have no idea how I can do this.

    Currently I use this method (taken from the FFMPEG filter example) to create the filter :

    static int init_filters(AVFormatContext *fmt_ctx,
    AVCodecContext *dec_ctx,
    AVFilterContext **buffersink_ctx,
    AVFilterContext **buffersrc_ctx,
    AVFilterGraph **filter_graph,
    int video_stream_index,
    const char *filters_descr)
    {
       char args[512];
       int ret = 0;
       AVFilter *buffersrc = avfilter_get_by_name("buffer");
       AVFilter *buffersink = avfilter_get_by_name("buffersink");
       AVFilterInOut *outputs = avfilter_inout_alloc();
       AVFilterInOut *inputs = avfilter_inout_alloc();
       AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base;
       enum AVPixelFormat pix_fmts[] = { dec_ctx->pix_fmt, AV_PIX_FMT_NONE };
       *filter_graph = avfilter_graph_alloc();
       if (!outputs || !inputs || !filter_graph) {
           ret = AVERROR(ENOMEM);
           goto end;
       }

       /* buffer video source: the decoded frames from the decoder will be inserted here. */
       snprintf(args, sizeof(args),
           "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
           dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
           time_base.num, time_base.den,
           dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);

       ret = avfilter_graph_create_filter(buffersrc_ctx, buffersrc, "in",
           args, NULL, *filter_graph);
       if (ret &lt; 0) {
           av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");
           goto end;
       }

       /* buffer video sink: to terminate the filter chain. */
       ret = avfilter_graph_create_filter(buffersink_ctx, buffersink, "out",
           NULL, NULL, *filter_graph);
       if (ret &lt; 0) {
           av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
           goto end;
       }

       ret = av_opt_set_int_list(*buffersink_ctx, "pix_fmts", pix_fmts,
           AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
       if (ret &lt; 0) {
           av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n");
           goto end;
       }

       /*
       * Set the endpoints for the filter graph. The filter_graph will
       * be linked to the graph described by filters_descr.
       */

       /*
       * The buffer source output must be connected to the input pad of
       * the first filter described by filters_descr; since the first
       * filter input label is not specified, it is set to "in" by
       * default.
       */
       outputs->name = av_strdup("in");
       outputs->filter_ctx = *buffersrc_ctx;
       outputs->pad_idx = 0;
       outputs->next = NULL;

       /*
       * The buffer sink input must be connected to the output pad of
       * the last filter described by filters_descr; since the last
       * filter output label is not specified, it is set to "out" by
       * default.
       */
       inputs->name = av_strdup("out");
       inputs->filter_ctx = *buffersink_ctx;
       inputs->pad_idx = 0;
       inputs->next = NULL;

       if ((ret = avfilter_graph_parse_ptr(*filter_graph, filters_descr,
           &amp;inputs, &amp;outputs, NULL)) &lt; 0)
           goto end;

       if ((ret = avfilter_graph_config(*filter_graph, NULL)) &lt; 0)
           goto end;

    end:
       avfilter_inout_free(&amp;inputs);
       avfilter_inout_free(&amp;outputs);

       return ret;
    }

    I can use the same kind of filter strings that would be used on the console. This code later applies the filter to the current frame (this->pVideoFrame) :

    if (av_buffersrc_add_frame_flags(buffersrc_ctx, this->pVideoFrame, AV_BUFFERSRC_FLAG_KEEP_REF) &lt; 0) {
       av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
       break;
    }

    /* pull filtered frames from the filtergraph */
    while (1) {
       int ret = av_buffersink_get_frame(buffersink_ctx, this->pVideoFilterFrame);
       if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
       {
           break;
       }
    }

    In order for this filter to work with the overlay filter specification I would need to get the image into the system somehow and I have no idea how to do this.

    Ideally I would like to feed the system with an in memory buffer. But, if necessary, I can write the generated image to a tempfile first. The image will be valid for at least a second before the number changes. The C++ library that uses FFMPEG to manipulate and transmit the image is part of a larger .NET project.

    Any help would be appreciated.

    Regards,
    Ludwig