Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (57)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (10331)

  • ffmpeg decoding mixing frames

    4 avril, par Paulo Morgado

    I'm using FFmpeg.AutoGen in a .NET 8.0 application for decoding H264 and JPEG.

    


    Every usage uses its own instance (there are no shared objects) and there isn't simultanous use of each object.

    


    However, they can be used from different threads.

    


    But I'm getting the encoded results with mixed data from all sources. It happens mostly for the same origin codeec, but not esclusivelly.

    


    I have a base class that looks like this :

    


    public abstract unsafe class Decoder : IDisposable&#xA;{&#xA;    protected readonly object sync = new();&#xA;    protected AVCodecContext* codecContext;&#xA;    protected AVFrame* frame;&#xA;    protected AVPacket* packet;&#xA;    protected SwsContext* swsContext;&#xA;    private bool disposed = false;&#xA;&#xA;    protected Decoder(AVCodecID codecId, ChannelWriter&lt;(ArraySegment<byte> decodedData, int width, int height)> writer)&#xA;    {&#xA;        Writer = writer;&#xA;        var codec = ffmpeg.avcodec_find_decoder(codecId);&#xA;        codecContext = ffmpeg.avcodec_alloc_context3(codec);&#xA;        ffmpeg.avcodec_open2(codecContext, codec, null);&#xA;&#xA;        frame = ffmpeg.av_frame_alloc();&#xA;        packet = ffmpeg.av_packet_alloc();&#xA;    }&#xA;...&#xA;</byte>

    &#xA;

    This is the H264 decoding code :

    &#xA;

    public override void Decode(ReadOnlySpan<byte> data)&#xA;{&#xA;    CheckDisposed();&#xA;&#xA;    lock (sync)&#xA;    {&#xA;        fixed (byte* pData = data)&#xA;        {&#xA;            ffmpeg.av_packet_unref(packet);&#xA;&#xA;            packet->data = pData;&#xA;            packet->size = data.Length;&#xA;&#xA;            var result = ffmpeg.avcodec_send_packet(codecContext, packet);&#xA;            if (result &lt; 0 &amp;&amp; result != ffmpeg.AVERROR(ffmpeg.EAGAIN))&#xA;            {&#xA;                EvalResult(result);&#xA;            }&#xA;&#xA;            while (true)&#xA;            {&#xA;                ffmpeg.av_frame_unref(frame);&#xA;&#xA;                result = ffmpeg.avcodec_receive_frame(codecContext, frame);&#xA;                if (result == ffmpeg.AVERROR(ffmpeg.EAGAIN))&#xA;                {&#xA;                    // Need more input data, continue sending packets&#xA;                    return;&#xA;                }&#xA;                else if (result &lt; 0)&#xA;                {&#xA;                    EvalResult(result);&#xA;                }&#xA;&#xA;                var width = frame->width;&#xA;                var height = frame->height;&#xA;&#xA;                if (swsContext == null)&#xA;                {&#xA;                    swsContext = ffmpeg.sws_getContext(&#xA;                        width, height, (AVPixelFormat)frame->format,&#xA;                        width, height, AVPixelFormat.AV_PIX_FMT_BGRA,&#xA;                        ffmpeg.SWS_BILINEAR, null, null, null);&#xA;                }&#xA;&#xA;                var bgraFrame = ffmpeg.av_frame_alloc();&#xA;                bgraFrame->format = (int)AVPixelFormat.AV_PIX_FMT_BGRA;&#xA;                bgraFrame->width = width;&#xA;                bgraFrame->height = height;&#xA;                ffmpeg.av_frame_get_buffer(bgraFrame, 32);&#xA;&#xA;                ffmpeg.sws_scale(&#xA;                    swsContext,&#xA;                    frame->data, frame->linesize, 0, height,&#xA;                    bgraFrame->data, bgraFrame->linesize);&#xA;&#xA;                var bgraSize = width * height * 4;&#xA;                var bgraArray = ArrayPool<byte>.Shared.Rent(bgraSize);&#xA;                var bgraSegment = new ArraySegment<byte>(bgraArray, 0, bgraSize);&#xA;&#xA;                fixed (byte* pBGRAData = bgraSegment.Array)&#xA;                {&#xA;                    var data4 = new byte_ptr4();&#xA;                    data4.UpdateFrom(bgraFrame->data.ToArray());&#xA;&#xA;                    var linesize4 = new int4();&#xA;                    linesize4.UpdateFrom(bgraFrame->linesize.ToArray());&#xA;&#xA;                    ffmpeg.av_image_copy_to_buffer(&#xA;                        pBGRAData, bgraSize,&#xA;                        data4, linesize4,&#xA;                        (AVPixelFormat)bgraFrame->format, width, height, 1);&#xA;                }&#xA;&#xA;                ffmpeg.av_frame_free(&amp;bgraFrame);&#xA;&#xA;                Writer.TryWrite((bgraSegment, width, height));&#xA;            }&#xA;        }&#xA;    }&#xA;}&#xA;</byte></byte></byte>

    &#xA;

    And this is the JPEG decoding code :

    &#xA;

    public override void Decode(ReadOnlySpan<byte> data)&#xA;{&#xA;    CheckDisposed();&#xA;&#xA;    lock (sync)&#xA;    {&#xA;        fixed (byte* pData = data)&#xA;        {&#xA;            ffmpeg.av_packet_unref(packet);&#xA;&#xA;            packet->data = pData;&#xA;            packet->size = data.Length;&#xA;&#xA;            var result = ffmpeg.avcodec_send_packet(codecContext, packet);&#xA;            if (result &lt; 0 &amp;&amp; result != ffmpeg.AVERROR(ffmpeg.EAGAIN))&#xA;            {&#xA;                EvalResult(result);&#xA;            }&#xA;&#xA;            while (true)&#xA;            {&#xA;                ffmpeg.av_frame_unref(frame);&#xA;&#xA;                result = ffmpeg.avcodec_receive_frame(codecContext, frame);&#xA;&#xA;                if (result == ffmpeg.AVERROR(ffmpeg.EAGAIN))&#xA;                {&#xA;                    // Need more input data, continue sending packets&#xA;                    return;&#xA;                }&#xA;                else if (result &lt; 0)&#xA;                {&#xA;                    EvalResult(result);&#xA;                }&#xA;&#xA;                var width = frame->width;&#xA;                var height = frame->height;&#xA;&#xA;                if (swsContext == null)&#xA;                {&#xA;                    swsContext = ffmpeg.sws_getContext(&#xA;                        width, height, (AVPixelFormat)frame->format,&#xA;                        width, height, AVPixelFormat.AV_PIX_FMT_BGRA,&#xA;                        ffmpeg.SWS_BILINEAR, null, null, null);&#xA;                }&#xA;&#xA;                var bgraFrame = ffmpeg.av_frame_alloc();&#xA;                bgraFrame->format = (int)AVPixelFormat.AV_PIX_FMT_BGRA;&#xA;                bgraFrame->width = frame->width;&#xA;                bgraFrame->height = frame->height;&#xA;                ffmpeg.av_frame_get_buffer(bgraFrame, 32);&#xA;&#xA;                ffmpeg.sws_scale(&#xA;                    swsContext,&#xA;                    frame->data, frame->linesize, 0, frame->height,&#xA;                    bgraFrame->data, bgraFrame->linesize);&#xA;&#xA;                int bgraDataSize = bgraFrame->linesize[0] * bgraFrame->height;&#xA;                byte[] bgraData = ArrayPool<byte>.Shared.Rent(bgraDataSize);&#xA;                var bgraSegment = new ArraySegment<byte>(bgraData, 0, bgraDataSize);&#xA;                Marshal.Copy((IntPtr)bgraFrame->data[0], bgraData, 0, bgraDataSize);&#xA;&#xA;                ffmpeg.av_frame_free(&amp;bgraFrame);&#xA;&#xA;                Writer.TryWrite((bgraSegment, width, height));&#xA;            }&#xA;        }&#xA;    }&#xA;}&#xA;</byte></byte></byte>

    &#xA;

    What am I doing wrong here ?

    &#xA;

  • Anomalie #3239 : _CACHE_CONTEXTES_AJAX génère un dossier /tmp/cache/contextes qui grossit à l’infini

    19 juillet 2014, par marcimat ☺☮☯♫

    Juste un mot tout de même :
    En SPIP 3, il ne faut pas déclarer cette constante. La solution intermédiaire qu’on utilise est de passer automatiquement par tmp/cache/contexte SI certaines conditions sont requises, au cas par cas. Particulièrement :
    - si bug lors du décryptage du hash ajax (un bug sur une version de php) => on met le contexte en fichier cache
    - si la longueur du hash dépasse la longueur autorisée pah suhosin (si présent) => on met le contexte en fichier cache.

    De la sorte, ça limite grandement le nombre de fichiers créés dans ce cache (et c’est fait de façon automatique).

    Mais… ça ne résout pas du tout le problème : ces fichiers restent en cache et ne se nettoient jamais, ce qui potentiellement peut créer le même problème signalé ici.

  • Evolution #4363 : mot de passe vide bloque le formulaire de réinitialisation du mot de passe d’un ...

    12 février 2021, par cy_altern -

    cedric - a écrit :

    mais du coup maintenant qu’on sait qu’il y a une raison, est-il vraiment nécessaire de casser ça et de prendre un risque sécu dessus ?

    perso je dirais que oui vu le nombre de fois où je me suis retrouvé à faire des bricolages à cause de ce mot de passe vide...

    Ou alors il faut prévoir un upgrade de base qui fait le tout des auteurs sans mot de passe et vide le login si jamais il y en a un pour pas prendre de risque ?

    si la réponse à question précédente est oui, ça semble être une soluce raisonnable

    Je postpone car c’est super pas urgent, mais si quelqu’un veut faire une PR, gogogo

    si besoin je finalise dès que les points ci-dessus sont tranchés :)