Recherche avancée

Médias (91)

Autres articles (105)

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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (11656)

  • avcodec_send_packet high memory usage

    11 novembre 2023, par iexav

    So for a while now I have been making something like a video player application. The video player receives a video stream, decodes it and displays its contents. I am writing it in java using the ffmpeg wrapper (this should not be of any real significance I am just mentioning that because the code I provide will be in java but the functions that I am using just make calls to the relevant c/c++ functions of the ffmpeg library). The issue is that when I call avcodec_send_packet it nets me a very high memory usage which also scales with the resolution of the video. Most recently I tried decoding a 4k video stream and every call to avcodec_send_packet netted me about 40 mb of memory usage. This stabilizes after the first frame. In other words when I receive the frame the memory usage stops climbing for subsequent frames. For that particular 4k video stream it climbed to about 800 mb and for subsequent avcodec_send_packet and avcodec_receive_frame calls the memory usage doesn't significantly climb. If the resolution is 1080p it nets me about 300 megabytes of memory. This is a pretty high memory usage considering that one decoded 4k YUV420 frame is about 12 megabytes

    


        public Optional<boolean> decodeVideoFrame(AVPacket pkt,boolean readPacket,boolean keyFrames,boolean doProcessing) throws Exception {&#xA;        int ret;&#xA;        // Decode video frame&#xA;        if (readPacket) {&#xA;            ret = avcodec_send_packet(video_c, pkt);&#xA;            if (pkt.data() == null &amp;&amp; pkt.size() == 0) {&#xA;                pkt.stream_index(-1);&#xA;            }&#xA;            if (ret == AVERROR_EAGAIN() || ret == AVERROR_EOF()) {&#xA;                // The video codec may have buffered some frames&#xA;            } else if (ret &lt; 0) {&#xA;                // Ignore errors to emulate the behavior of the old API&#xA;                // throw new Exception("avcodec_send_packet() error " &#x2B; ret &#x2B; ": Error sending a video packet for decoding.");&#xA;            }&#xA;        }&#xA;&#xA;        // Did we get a video frame?&#xA;        while (true) {&#xA;            ret = avcodec_receive_frame(video_c, picture);&#xA;&#xA;            if (ret == AVERROR_EAGAIN() || ret == AVERROR_EOF()) {&#xA;                if (pkt.data() == null &amp;&amp; pkt.size() == 0) {&#xA;                    return Optional.empty();&#xA;                } else {&#xA;                    return Optional.of(true);&#xA;&#xA;                }&#xA;            } else if (ret &lt; 0) {&#xA;                // Ignore errors to emulate the behavior of the old API&#xA;                // throw new Exception("avcodec_receive_frame() error " &#x2B; ret &#x2B; ": Error during video decoding.");&#xA;                return Optional.of(true);&#xA;&#xA;            }&#xA;</boolean>

    &#xA;

    This is pretty much all the relevant code along with maybe the packet allocation :

    &#xA;

      AVPacket pkt = av_packet_alloc();&#xA;&#xA;            pkt.stream_index(-1);&#xA;            int ret;&#xA;            while(true){&#xA;                if((ret = av_read_frame(grabber.getFormatContext(),pkt))&lt;0){&#xA;&#xA;                    if (ret == AVERROR_EAGAIN()) {&#xA;                        try {&#xA;                            Thread.sleep(10);&#xA;                            continue;&#xA;                        } catch (InterruptedException ex) {&#xA;                            // reset interrupt&#xA;                            Thread.interrupted();&#xA;&#xA;                        }&#xA;                    }&#xA;                    av_packet_unref(pkt);&#xA;                    pkt.deallocate();&#xA;                    return null;&#xA;&#xA;                }&#xA;                break;&#xA;&#xA;            }&#xA;&#xA;&#xA;            return pkt;&#xA;

    &#xA;

    (this is in a separate method). Also another weird effect that comes out of this is when the video resolution is higher than 1080p the frames gets corrupted. I will attach two images that compare what the frame is supposed to look like and what it actually looks like.What its supposed to look like&#xA;What it looks like when given to the decoder&#xA;And in case the question is asked this isn't because of how I am displaying the frame. I can say that with 100% certainty as I have moved across 3 different ways of rendering video frames. The first one being CanvasFrame that comes with the wrapper library I am using for ffmpeg, then I switched to javafx ImageView and now I am using vulkan. Same exact result across all three methods. The decoder is pretty much in all cases vp9 and the frames are in yuv420p.

    &#xA;

    I tried looking through stackoverflow and some other places and I saw a somewhat similar post but unfortunately I couldn't really find an answer there.

    &#xA;

    Update : I decided to implement hardware acceleration in my program while this problem persists to see if its going to help. With hardware acceleration the memory usage is significantly lower but that's to be expected. The more bizarre thing I came across is this : The frames are still corrupted when resolution is above 1080p EXCEPT if I very specifically say

    &#xA;

    &#xA;avcodec_find_decoder_by_name("vp9_cuvid");&#xA;

    &#xA;

    . If I use this :

    &#xA;

    av_find_best_stream(oc, AVMEDIA_TYPE_VIDEO, -1, -1, vidCodec, 0); &#xA;

    &#xA;

    this also allocates the video codec and it uses vp9 but the frames get corrupted. no idea what's going on. I also tried doing

    &#xA;

    avcodec_find_decoder_by_name("vp9");&#xA;

    &#xA;

    but that also leaves me with corrupted frames. (it should be the same codec after all).

    &#xA;

  • Anomalie #3816 (Nouveau) : Compatiblité avec PHP 7.0.9 et 5.6.24 et les fonctions "expected to be ...

    10 août 2016

    Suite à http://forum.spip.net/fr_264848.html#forum264908

    Apparemment SPIP et PHP 7.0.9 génère une page blanche.

    D’après Tatu, il faudrait modifier le paramètre de la fonction f_queue() à la ligne 246 du fichier "spip/ecrire/inc/pipelines.php"

    Ainsi la fonction :
    function f_queue(&$texte)
    Devient :
    function f_queue($texte)

    D’après Luc, cela pourrait venir de https://bugs.php.net/bug.php?id=72698

    Si c’est le cas, il faudrait faire une revue du code et chercher les appels de type &$

  • Anomalie #3413 : Un script s’affiche lorsqu’on prévisualise un commentaire et que $filtrer_javascr...

    29 octobre 2015, par - Equipement

    Merci de ce retour. Je laisse le soin à la communauté de modifier le plugin forum.