Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (30)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • 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

Sur d’autres sites (5015)

  • Encoding video for real time streaming

    15 septembre 2019, par lilroo

    Miguel Grinberg’s article video streaming with flask, covers sending multiple JPG formatted images to a client through a multipart response to stream video to the browser.

    After doing some reading, I quickly realized that MJPEG is not a real video format, JPEGs are not optimized for video streaming and MJPEG cannot be streamed to a HTML5 video element.

    for my application (a screen sharing application written in python), I need to be able to encode and stream relatively smooth video (smoother than MJPEG anyway) in semi-realtime to the browser.

    I think what I need to do is encode a video stream using a tool like FFmpeg and then send chunks of that output to a browser using a multipart response - however it doesn’t look like there is a way to get FFmpeg (using python bindings) to write to an in-memory buffer.

    Is ffmpeg up to this task ?

    I appreciate that this question may sound nieve, but I would be thankful for being pointed in the right direction.

  • hls playlist where the #EXTINF tag doesnt match actual segment duration ? [closed]

    8 janvier, par tamirg

    "The EXTINF tag specifies the duration of a Media Segment."

    


    But what should happen if the actual file duration does not match that tag ?

    


    I tried to edit the m3u8 file of my playlist and change the EXTINF tags so it will be smaller than the actual file duration, and also sometimes changed it so it will be bigger than the duration. In both cases the result stayed the same and simply the actual segment duration was played, regardless of the EXTINF tag.

    


    So what is the actual need of this tag ? seems that simply the file is being played.

    


  • JavaFXFrameConverter consuming insane amounts of memory

    17 juillet 2023, par iexav

    The JavaFXFrameConverter (from the wrapper of the ffmpeg C library in java) convert() method is consuming an outrageous amount of memory. To elaborate a bit more, it does not happen usually. If I just make an instance of the class in my main method, grab a frame via FFMpegFrameGrabber and give it to the convert() method the memory usage is pretty much none. However, when I attempt to do pretty much the exact same in a class I made using an ExecutorService my memory usage jumps up to 8 gigabytes when convert is called. The converter and executor service are declared as member variables of my class. Namely :

    


        final JavaFXFrameConverter converter = new JavaFXFrameConverter();
    private  ExecutorService           videoExecutor;


    


    (the videoExecutor is instantiated in the constructor of the class :

    


    videoExecutor=Executors.newSingleThreadExecutor();


    


    Now, the method I am using for processing of the video frames is this :

    


        private void processVideo(){
        videoExecutor.submit(() -> {
            processingVideo.set(true);
            try{

                while(processingVideo.get() && (videoQueue.peek())!=null){

                    final Frame cloneFrame = videoQueue.poll();
                    final Image image = converter.convert(cloneFrame);
                    final long timeStampDeltaMicros = cloneFrame.timestamp - timer.elapsedMicros();
                    if (timeStampDeltaMicros > 0) {
                        final long delayMillis = timeStampDeltaMicros / 1000L;
                        try {
                            Thread.sleep(delayMillis);
                        } catch (InterruptedException e) {
                            Thread.currentThread().interrupt();
                        }
                    }

                    cloneFrame.close();
                    System.out.println("submitted image");
                videoListener.submitData(image);
                }
            }catch (NullPointerException e){
                NullPointerException ex = new NullPointerException("Error while processing video frames.");
            videoListener.notifyFailure(ex);
            }

            processingVideo.set(false);

        });
    }


    


    I sent the whole method for a bit more context but realistically speaking the only part that is of real significance is the converter.conver(cloneFrame) ; I used the intelliJ profiler and also the debugger and this is exactly where the problem occurs. When convert is called after doing some stuff it eventually ends up in this method :

    


            public <t extends="extends" buffer="buffer"> void getPixels(int x, int y, int w, int h, WritablePixelFormat<t> pixelformat, T buffer, int scanlineStride) {&#xA;            int fss = this.frame.imageStride;&#xA;            if (this.frame.imageChannels != 3) {&#xA;                throw new UnsupportedOperationException("We only support frames with imageChannels = 3 (BGR)");&#xA;            } else if (!(buffer instanceof ByteBuffer)) {&#xA;                throw new UnsupportedOperationException("We only support bytebuffers at the moment");&#xA;            } else {&#xA;                ByteBuffer bb = (ByteBuffer)buffer;&#xA;                ByteBuffer b = (ByteBuffer)this.frame.image[0];&#xA;&#xA;                for(int i = y; i &lt; y &#x2B; h; &#x2B;&#x2B;i) {&#xA;                    for(int j = x; j &lt; x &#x2B; w; &#x2B;&#x2B;j) {&#xA;                        int base = 3 * j;&#xA;                        bb.put(b.get(fss * i &#x2B; base));&#xA;                        bb.put(b.get(fss * i &#x2B; base &#x2B; 1));&#xA;                        bb.put(b.get(fss * i &#x2B; base &#x2B; 2));&#xA;                        bb.put((byte)-1);&#xA;                    }&#xA;                }&#xA;&#xA;            }&#xA;        }&#xA;</t></t>

    &#xA;

    Now, everything up until this point is fine. The memory usage is at around 130mb but alas, when execution enters in these 2 for loops that's where the downright stupid memory usage occurs. Every single one of these bb.put calls is netting me around 3 more megabytes of memory usage. By the end of it you can probably guess what happens. Also all of these memory allocations do happen on the stack so I'm assuming that's why my memory usage stops at around 8-8.5 gigabytes otherwise the program would crash (that has also happened, out of memory exception thrown, but it doesn't usually happen, it kind of just lingers at those 8 gigabytes.) Frankly speaking I'm at a bit of a loss. I haven't seen virtually anyone anywhere mention this ever and I ran out of things to try to fix this so I am making this post.

    &#xA;

    By the way another thing I tried is make the ExecutorService in the same class as the main method and when I submitted there I also didn't have these memory problems.

    &#xA;